All Questions

2
answers

What are the main differences between JSON and BSON formats?

I was reading an article on Internet , where it was commented on the format BSON ( Json BinĂ¡rio ), however I had some doubts about it: What is BSON ? For what reasons was it created? Is there a big difference in perfo...
asked on 29.12.2016 / 21:00
3
answers

Why static methods can be called through the "instance" class in Python 3?

Let's say I have the following class: class Person: @staticmethod def hello(): print('Hello!) When performing the Person().hello() operation, the method executes normally. But the hello method belongs to the Pe...
asked on 09.10.2017 / 19:08
1
answer

How to make a test fail if it takes too long?

I'm using MSTest which is the default unit testing platform in visual studio and I have this test here: [TestMethod] [ExpectedException(typeof(InvalidOperationException))] public void Board_nao_destroi_unidades_flutuantes() {...
asked on 12.04.2014 / 15:34
2
answers

Include within class and access to $ this, self or static

I found this little code inside the Composer/ClassLoader.php folder, in a project where I use composer . /** * Scope isolated include. * * Prevents access to $this/self from included files. */ function includeFile($file) {...
asked on 22.07.2015 / 15:06
1
answer

Algorithm for name generation

I researched a lot but did not find an algorithm that does something like banks do. For example, when you register for the first time in a 24-hour box, the machine generates a password. In general, 3 or 4 letter pairs are entered as a password....
asked on 11.09.2014 / 11:56
2
answers

What is the "Principle of Dependency Inversion" (DIP)?

I am now familiar with the SOLID principle: S Single Responsabilty Principle O Open / Closed L Liskov Substitution Principle I Interface Segregation D Dependency Inversion Principle However, I could not understand the...
asked on 02.12.2015 / 16:58
2
answers

Could current JavaScript engines optimize recursive "tail" calls?

In functional programming , it is very common to use functions recursive . Certain languages, such as Scheme, do not even have control structures for loops, depending on recursion to iterate over lists. JavaScript has functional features, s...
asked on 27.01.2014 / 17:29
1
answer

Galton Board - Central boundary theorem

The reason for this is study / learning. To know / apply programming techniques and concepts, transforming something "material" into "application". I received a video on WhatsApp, where mixed colored balls were separated by colors passing...
asked on 13.04.2018 / 19:47
4
answers

How to check events between 2 dates in MySQL?

Knowing that I have a table called eventos , and this table has the columns id , titulo , inicio and fim . The inicio and fim columns are of type timestamp , where the start and end date and time of...
asked on 04.02.2014 / 20:30
4
answers

How to call an external function, without sending the 'self'?

I am using a class attribute to save the View that I want to test in a Django application, like this: # TESTS.PY class OrderTests(TestCase, ShopTest): _VIEW = views.order def test_gateway_answer(self): url = 'whatever url'...
asked on 31.12.2013 / 15:16