All Questions

1
answer

What is the difference between mixins and inheritance?

Conceptually, is there a difference between a class that extends a module by mixin and a class that inherits another class (single inheritance)? I know that by mixins , a class can extend multiple modules, which is not allowed in most prog...
asked on 12.02.2018 / 17:23
2
answers

Selecting part of a data frame and saving in loop

I have a date frame of more than 1000 rows and two columns (col1 and col2). How do I select n date frames based on column 2 (just the same elements) through a loop and then save the n data.frames (df1, df2, ... dfn ) in a tb directory in the loo...
asked on 10.07.2017 / 07:46
3
answers

recursive function in python to calculate sum of the elements of a list

I'm having a hard time in an exercise where I should show the sum of all elements of a list recursively. The code that I just got has the basis of recursion, the recursion itself did not, because I did not understand how it could be applied t...
asked on 17.07.2017 / 18:58
1
answer

Replace space with comma and pipe interleaved

I have a certain string below, as you can see, they are coordinates separated by just one space. See:    -23.5209 -46.46466 -23.52008 -46.465952 -23.519253 -46.467239 -23.518808 -46.466901 -23.518738 -46.466848 -23.518411 -46.466597 -23.51834...
asked on 21.06.2017 / 22:45
1
answer

Content with code points (entity) or unicode characters

At w3schools has the reference of all the characters - special, symbols, alphanumeric. I did not understand the purpose of having this representation of the characters. In the example below the output is the same, it only changes the entity....
asked on 22.06.2017 / 04:17
1
answer

How to check if a file is an image?

I'm working on an application using ASP.NET MVC and AngularJS and need to ensure that the file upload will be just image files, even if someone sends an extension of another type of ".jpg" for example. I'm getting a MultipartFileData in the...
asked on 22.06.2017 / 15:37
1
answer

Redeem all nodes in a SQLite database tree

I have a serialized tree in my database in the arvore table. Like every good tree, every node can have at most one single parent node. Your data is in this format: id | id_pai | valor ---+--------+------ 1 | | 'pai de todos' 2...
asked on 22.06.2017 / 13:29
1
answer

Use IN or multiple ORs? Which one has the best performance?

I have the following queries in MySQL: 1st: Using multiple OR SELECT SUM(qtd) FROM produtos WHERE qtd > 10 and (status = '0' or status = '4' or status = '7') 2nd: Using IN SELECT SU...
asked on 06.07.2017 / 15:45
2
answers

interpret account in string C #

Hello, I needed to resolve a string with an account (eg 2 + 2) in C # and return an integer (eg 4) static void Main(string[] args) { string str = "2 + 2"; int resultado = Calcular(str); Console.WriteLine("Resultado => {0}",resul...
asked on 16.07.2017 / 18:56
2
answers

Sort items from a Collection from a predefined value

I have a Collection of Eloquent and would like to sort it by two fields at the same time being one of them a predefined value. Ex: this Collection has several objects of type Categoria and I want to sort it so that catego...
asked on 18.07.2017 / 16:42