All Questions

2
answers

python: compare list that contains multiple lists with a different unique list

I am solving a question where I have to do a program that corrects evidence. The program receives a feedback and "n" students responses and compares with the template provided. The answers of all students are put on a single list. My problem is,...
asked on 12.09.2016 / 15:31
1
answer

Thread Safe (TS) and Non Thread Safe (NTS) - What are they, what's the difference?

When someone is going to download PHP, you have these 2 options: ts and nts , as well as language extensions. My doubts are as follows: What are Thread Safe and Non Thread Safe (NTS) ? Are there any differences between them...
asked on 27.05.2016 / 20:24
1
answer

___ ___ erkimt Is there a difference between using "return" or "exit ()" to end the "main ()"? ______ qstntxt ___

%code% terminates running the application immediately. The %code% command exits the function, but when it is inside the %code% it will exit the application, including the value used in it will be returned to the one who called the application as an error code (zero is ok), as well as the function output.

Of course there is a difference in other functions, where %code% terminates application immediately and the command will return the execution stream to the calling function.

If both do the same thing in the described situation, does either use one or the other?

    
______ azszpr174313 ___

There is an important semantic difference in C ++. The %code% will close the scope and call all pending destructors. If the application is closed, rarely will the call of the destructors produce a different result, but technically it is possible for one of them to do something that is important to the end of the application, or to print relevant information for the user. >

Even though the action looks the same, the %code% function causes a premature exiting of the application. Then execution is terminated almost immediately. %code% finalizes static objects, but not destructors. The %code% and %code% neither does this and it closes on time.

There's a difference even in C if you have functions registered with %code% . These functions will always run no matter how the application is shutting down. But there will be undefined behavior if one of the linked functions in %code% has reference to some data in stack . Something like %code% and %code% . This is especially important in C. documentation

Note that the %code% function is not special and can be called within the application. In this case there will be an important difference since a %code% will not terminate the application, although in the context of the question this would not happen. But understand that if what you wrote will not be called in the operating system and this %code% is part of a module that will be loaded and used in another application, your module will terminate the application and not only your code if you use %code% , %code% will then be the most appropriate in most situations.

A call to %code% can be recursive, although it should not. Of course there is difference in this case, but it falls into what I said in the previous paragraph.

That's why you always have to choose the most semantically correct way . If you want to terminate the application immediately use %code% , otherwise use %code% . Many people say that if %code% is terminating the application, %code% is the most appropriate. Not everyone agrees, especially in C ++. That's why it's good to understand the workings, the implications of each and do not blindly follow rules.

I do not know if it counts as a difference, because it is a function, to use it, you need to use a %code% so that it is available, and if the code unit it contains would not enter the application, the executable will be a bit bigger. The command is always available.

    
___

exit() terminates running the application immediately. The return command exits the function, but when it is inside the main() it will exit the application, including the value used in it will be returned to the one who ca...
asked on 30.12.2016 / 13:15
1
answer

Import, analyze and extract data from a CSV with PHP [closed]

How can I do to import a csv file with PHP and grab the data from a specific column and write that data to the database? Can you do this analysis and save only specific data (type a column, or row)?     
asked on 17.03.2016 / 14:48
1
answer

Methods "__" or "Dunder" in Python, which are the most used?

In Python there are "Magic" methods, such as __len__ , which allows the use of len (object), in addition to that in specific, which are the others most used that can facilitate the use of the structure? >     
asked on 10.01.2017 / 15:57
1
answer

Difference in the application of Dijkstra and Prim algorithms

What is the basic difference in the field of application of the Dijsktra and Prim algorithms? What problems does one of them solve that the others can not solve? Having, for example, the following situation: it is necessary to find the smallest...
asked on 15.04.2016 / 04:37
2
answers

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 the following directory structure is automatically generated, see the image below: Being in total eight directories. Question I would like...
asked on 28.10.2016 / 03:49
2
answers

Concatenate fields in a more performative way

I am concatenating the description lines of a record so that instead of having N records for a description it has only one. I can make it happen, but I wanted a more performative way, because I'll do it with a table with some 900,000 records....
asked on 12.03.2016 / 01:03
2
answers

How important is Integrity and CrossOrigin attributes?

I've been giving it a look, but I still have that doubt. Currently some frameworks, their link and script are coming with attributes integrity and crossorigin . Ex: <link rel="stylesheet" href="https://maxcdn.b...
asked on 21.01.2016 / 18:22
1
answer

Roundup of 5 in 5 cents

In a PHP system I'm developing, I need to update a column of the price table. The price field is in float format and the administrator informs the percentage of increase. Example: Reports that it will have a 10% increase. $valor_anti...
asked on 27.02.2016 / 16:17