Edited, memorised or added to reading list

on 17-May-2018 (Thu)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

#quantecon

OOP is about producing well organized code — an important determinant of productivity

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

Object Oriented Programming – Quantitative Economics
ramming, and nicely supported in Python OOP has become an important concept in modern software engineering because It can help facilitate clean, efficient code (if used well) The OOP design pattern fits well with many computing problems <span>OOP is about producing well organized code — an important determinant of productivity Moreover, OOP is a part of Python, and to progress further it’s necessary to understand the basics About OOP¶ OOP is supported in many languages: JAVA and Ruby are relativel




Flashcard 1731011939596

Tags
#quantecon
Question

OOP is about producing [...] — an important determinant of productivity

Answer
well organized code


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
OOP is about producing well organized code — an important determinant of productivity

Original toplevel document

Object Oriented Programming – Quantitative Economics
ramming, and nicely supported in Python OOP has become an important concept in modern software engineering because It can help facilitate clean, efficient code (if used well) The OOP design pattern fits well with many computing problems <span>OOP is about producing well organized code — an important determinant of productivity Moreover, OOP is a part of Python, and to progress further it’s necessary to understand the basics About OOP¶ OOP is supported in many languages: JAVA and Ruby are relativel







Flashcard 1752719035660

Tags
#banach-space
Question
A [...] has a metric that allows the computation of vector length and distance between vectors
Answer
normed space

An inner product space defines an inner product, which produces a metric; so inner product space is a normed space. But a norm doesn't have to be defined by an inner product. So here the right answer is a normed space.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
A normed space has a metric that allows the computation of vector length and distance between vectors

Original toplevel document

Banach space - Wikipedia
Banach space - Wikipedia Banach space From Wikipedia, the free encyclopedia Jump to: navigation, search In mathematics, more specifically in functional analysis, a Banach space (pronounced [ˈbanax]) is a complete normed vector space. Thus, a Banach space is a vector space with a metric that allows the computation of vector length and distance between vectors and is complete in the sense that a Cauchy sequence of vectors always converges to a well defined limit that is within the space. Banach spaces are named after the Polish mathematician Stefan Banach, who introduced this concept and studied it systematically in 1920–1922 along with Hans Hahn and Eduard Helly. [1]







Flashcard 2961980394764

Tags
#best-practice #pystan
Question

The second phase of Hamiltonian Monte Carlo resample the auxiliary momenta to allow the next trajectory to [...] .

Answer
explore another slice of the target parameter space


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Hamiltonian Monte Carlo proceeds in two phases -- the algorithm first simulates a Hamiltonian trajectory that rapidly explores a slice of the target parameter space before resampling the auxiliary momenta to allow the next trajectory to explore another slice of the target parameter space. Unfortunately, the jumps between these slices induced by the momenta resamplings can be short, which

Original toplevel document

pystan_workflow
.sampling(data=data, seed=194838, control=dict(max_treedepth=15)) and then check if still saturated this larger threshold with stan_utility.check_treedepth(fit, 15) Checking the E-BFMI¶ <span>Hamiltonian Monte Carlo proceeds in two phases -- the algorithm first simulates a Hamiltonian trajectory that rapidly explores a slice of the target parameter space before resampling the auxiliary momenta to allow the next trajectory to explore another slice of the target parameter space. Unfortunately, the jumps between these slices induced by the momenta resamplings can be short, which often leads to slow exploration. We can identify this problem by consulting the energy Bayesian Fraction of Missing Information, In [18]: stan_utility.check_energy(fit) Chain 2: E-BFMI = 0.177681346951 E-BFMI below 0.2 indicates you may need to reparameterize your mod







Flashcard 2965737180428

[unknown IMAGE 2965735083276]
Tags
#has-images #mapping
Question
a bijective function is a [...] mapping of a set X to a set Y.
Answer


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
a bijective function a one-to-one and onto (surjective) mapping of a set X to a set Y.

Original toplevel document

Bijection - Wikipedia
nction between the elements of two sets, where each element of one set is paired with exactly one element of the other set, and each element of the other set is paired with exactly one element of the first set. There are no unpaired elements. <span>In mathematical terms, a bijective function f: X → Y is a one-to-one (injective) and onto (surjective) mapping of a set X to a set Y. A bijection from the set X to the set Y has an inverse function from Y to X. If X and Y are finite sets, then the existence of a bijection means they have the same number of elements.







#oop

n the OOP paradigm

  • data and functions are “bundled together” into “objects”

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

OOP I: Introduction to Object Oriented Programming – Quantitative Economics
an, C, MATLAB, etc.) is called procedural It works as follows The program has a state corresponding to the values of its variables Functions are called to act on these data Data are passed back and forth via function calls In contrast, i<span>n the OOP paradigm data and functions are “bundled together” into “objects” (Functions in this context are referred to as methods ) Python and OOP¶ Python is pragmatic language that blends object oriented and procedural styles, rather than taking a pur




#oop
in Python, everything is an object

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

OOP I: Introduction to Object Oriented Programming – Quantitative Economics
eferred to as methods ) Python and OOP¶ Python is pragmatic language that blends object oriented and procedural styles, rather than taking a purist approach However, at a foundational level, Python is object oriented In particular, <span>in Python, everything is an object In this lecture we explain what that statement means and why it matters Objects¶ In Python, an object is a collection of data and instructions held in computer memory that c




Flashcard 2971450346764

Tags
#oop
Question

In Python, an object is a collection of data and instructions held in computer memory that consists of [1...2...3...4...]

Answer
type, identity, data, methods

tidy mommy


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
OOP I: Introduction to Object Oriented Programming – Quantitative Economics
ather than taking a purist approach However, at a foundational level, Python is object oriented In particular, in Python, everything is an object In this lecture we explain what that statement means and why it matters Objects¶ <span>In Python, an object is a collection of data and instructions held in computer memory that consists of a type a unique identity data (i.e., content) methods These concepts are defined and discussed sequentially below Type¶ Python provides for different types of objects, to accommodate different categories of data For example s =







#zen-of-python
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

PEP 20 (The Zen of Python) by example · GitHub
ravallo said to me.'" - Carlo Emilio Gadda, *That Awful Mess on the Via Merulana* """ ################################# text ################################# """ The Zen of Python, by Tim Peters <span>Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! """ ################################### 1 ################################## """ Give me a function that takes a list of numbers and returns only the e




Flashcard 2971456376076

Tags
#zen-of-python
Question
[...]
Explicit is better than implicit.
Answer
Beautiful is better than ugly.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense.&#1

Original toplevel document

PEP 20 (The Zen of Python) by example · GitHub
ravallo said to me.'" - Carlo Emilio Gadda, *That Awful Mess on the Via Merulana* """ ################################# text ################################# """ The Zen of Python, by Tim Peters <span>Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! """ ################################### 1 ################################## """ Give me a function that takes a list of numbers and returns only the e







Flashcard 2971457948940

Tags
#zen-of-python
Question
Beautiful is better than ugly.
[...]
Simple is better than complex.
Answer
Explicit is better than implicit.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cas

Original toplevel document

PEP 20 (The Zen of Python) by example · GitHub
ravallo said to me.'" - Carlo Emilio Gadda, *That Awful Mess on the Via Merulana* """ ################################# text ################################# """ The Zen of Python, by Tim Peters <span>Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! """ ################################### 1 ################################## """ Give me a function that takes a list of numbers and returns only the e







Flashcard 2971460308236

Tags
#zen-of-python
Question
Explicit is better than implicit.
[...]
Complex is better than complicated.
Answer
Simple is better than complex.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break th

Original toplevel document

PEP 20 (The Zen of Python) by example · GitHub
ravallo said to me.'" - Carlo Emilio Gadda, *That Awful Mess on the Via Merulana* """ ################################# text ################################# """ The Zen of Python, by Tim Peters <span>Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! """ ################################### 1 ################################## """ Give me a function that takes a list of numbers and returns only the e







Flashcard 2971462667532

Tags
#zen-of-python
Question

Simple is better than complex.
[...]
Flat is better than nested.
Answer
Complex is better than complicated.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats

Original toplevel document

PEP 20 (The Zen of Python) by example · GitHub
ravallo said to me.'" - Carlo Emilio Gadda, *That Awful Mess on the Via Merulana* """ ################################# text ################################# """ The Zen of Python, by Tim Peters <span>Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! """ ################################### 1 ################################## """ Give me a function that takes a list of numbers and returns only the e







Flashcard 2971470531852

Tags
#quantecon
Question

Joblib is a popular Python library for [...]

Answer
caching and parallelization


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
Other Scientific Libraries – Quantitative Economics
cult it is to beat the speed improvements provided by Numba Nonetheless, Cython is a very mature, stable and widely used tool Cython can be more useful than Numba when working with larger, more sophisticated applications Joblib¶ <span>Joblib is a popular Python library for caching and parallelization To install it, start Jupyter and type !pip install joblib from within a notebook Here we review just the basics Caching¶ Perhaps, like us, you sometimes run a long comp







#oop #quantecon

If you want to provide a return value for the len function when applied to your user-defined object, use the __len__ special method

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

OOP II: Building Classes – Quantitative Economics
¶ Python provides special methods with which some neat tricks can be performed For example, recall that lists and tuples have a notion of length, and that this length can be queried via the len function x = (10, 20) len(x) 2 <span>If you want to provide a return value for the len function when applied to your user-defined object, use the __len__ special method class Foo: def __len__(self): return 42 Now we get f = Foo() len(f) 42 A special method we will use regularly is the __call__ method This method can




#oop #quantecon

A special method we will use regularly is the __call__ method

This method can be used to make your instances callable, just like functions

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

OOP II: Building Classes – Quantitative Economics
If you want to provide a return value for the len function when applied to your user-defined object, use the __len__ special method class Foo: def __len__(self): return 42 Now we get f = Foo() len(f) 42 <span>A special method we will use regularly is the __call__ method This method can be used to make your instances callable, just like functions class Foo: def __call__(self, x): return x + 42 After running we get f = Foo() f(8) # Exactly equivalent to f.__call__(8) 50 Exercise 1 provides a more




Flashcard 2971476823308

Tags
#oop #quantecon
Question

the [...] method makes your instances callable, just like functions

Answer
__call__


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
A special method we will use regularly is the __call__ method This method can be used to make your instances callable, just like functions

Original toplevel document

OOP II: Building Classes – Quantitative Economics
If you want to provide a return value for the len function when applied to your user-defined object, use the __len__ special method class Foo: def __len__(self): return 42 Now we get f = Foo() len(f) 42 <span>A special method we will use regularly is the __call__ method This method can be used to make your instances callable, just like functions class Foo: def __call__(self, x): return x + 42 After running we get f = Foo() f(8) # Exactly equivalent to f.__call__(8) 50 Exercise 1 provides a more







Flashcard 2971479182604

Tags
#oop #quantecon
Question

If you want to provide a return value for the len function when applied to your user-defined object, use the [...] special method

Answer
__len__


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
If you want to provide a return value for the len function when applied to your user-defined object, use the __len__ special method

Original toplevel document

OOP II: Building Classes – Quantitative Economics
¶ Python provides special methods with which some neat tricks can be performed For example, recall that lists and tuples have a notion of length, and that this length can be queried via the len function x = (10, 20) len(x) 2 <span>If you want to provide a return value for the len function when applied to your user-defined object, use the __len__ special method class Foo: def __len__(self): return 42 Now we get f = Foo() len(f) 42 A special method we will use regularly is the __call__ method This method can







#python

When your script is run by passing it as a command to the Python interpreter,

 python myscript . py 

all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level.

In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__". Thus, you can test whether your script is being run directly or being imported by something else by testing

 if __name__ == "__main__" : ... 

If your script is being imported into another module, its various function and class definitions will be imported and its top-level code will be executed, but the code in the then-body of the if clause above won't get run as the condition is not met. As a basic example, consider the following two scripts:

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

python - What does if __name__ == &quot;__main__&quot;: do? - Stack Overflow
add a comment | up vote 1313 down vote <span>When your script is run by passing it as a command to the Python interpreter, python myscript.py all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is being run directly or being imported by something else by testing if __name__ == "__main__": ... If your script is being imported into another module, its various function and class definitions will be imported and its top-level code will be executed, but the code in the then-body of the if clause above won't get run as the condition is not met. As a basic example, consider the following two scripts: # file one.py def func(): print("func() in one.py") print("top-level in one.py") if __name__ == "__main__": print("one.py is being run di




Flashcard 2971486260492

Tags
#python
Question

When your script is run by passing it as a command to the Python interpreter,

 python myscript.py 

[...] gets executed.

Answer
all level 0 indented code


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
When your script is run by passing it as a command to the Python interpreter, python myscript . py all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatical

Original toplevel document

python - What does if __name__ == &quot;__main__&quot;: do? - Stack Overflow
add a comment | up vote 1313 down vote <span>When your script is run by passing it as a command to the Python interpreter, python myscript.py all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is being run directly or being imported by something else by testing if __name__ == "__main__": ... If your script is being imported into another module, its various function and class definitions will be imported and its top-level code will be executed, but the code in the then-body of the if clause above won't get run as the condition is not met. As a basic example, consider the following two scripts: # file one.py def func(): print("func() in one.py") print("top-level in one.py") if __name__ == "__main__": print("one.py is being run di







#python
__name__ is a built-in variable which evaluates to the name of the current module.

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on


Parent (intermediate) annotation

Open it
ined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. <span>__name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is be

Original toplevel document

python - What does if __name__ == &quot;__main__&quot;: do? - Stack Overflow
add a comment | up vote 1313 down vote <span>When your script is run by passing it as a command to the Python interpreter, python myscript.py all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is being run directly or being imported by something else by testing if __name__ == "__main__": ... If your script is being imported into another module, its various function and class definitions will be imported and its top-level code will be executed, but the code in the then-body of the if clause above won't get run as the condition is not met. As a basic example, consider the following two scripts: # file one.py def func(): print("func() in one.py") print("top-level in one.py") if __name__ == "__main__": print("one.py is being run di




#python
if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__".

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on


Parent (intermediate) annotation

Open it
hat gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, <span>if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is being run directly or being imported by something else by testing if __name__ == "__main__" : ... If your script is being impor

Original toplevel document

python - What does if __name__ == &quot;__main__&quot;: do? - Stack Overflow
add a comment | up vote 1313 down vote <span>When your script is run by passing it as a command to the Python interpreter, python myscript.py all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is being run directly or being imported by something else by testing if __name__ == "__main__": ... If your script is being imported into another module, its various function and class definitions will be imported and its top-level code will be executed, but the code in the then-body of the if clause above won't get run as the condition is not met. As a basic example, consider the following two scripts: # file one.py def func(): print("func() in one.py") print("top-level in one.py") if __name__ == "__main__": print("one.py is being run di




Flashcard 2971491765516

Tags
#python
Question
[...] is a built-in variable which evaluates to the name of the current module.
Answer
__name__


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
__name__ is a built-in variable which evaluates to the name of the current module.

Original toplevel document

python - What does if __name__ == &quot;__main__&quot;: do? - Stack Overflow
add a comment | up vote 1313 down vote <span>When your script is run by passing it as a command to the Python interpreter, python myscript.py all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is being run directly or being imported by something else by testing if __name__ == "__main__": ... If your script is being imported into another module, its various function and class definitions will be imported and its top-level code will be executed, but the code in the then-body of the if clause above won't get run as the condition is not met. As a basic example, consider the following two scripts: # file one.py def func(): print("func() in one.py") print("top-level in one.py") if __name__ == "__main__": print("one.py is being run di







Flashcard 2971493338380

Tags
#python
Question
if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string [...].
Answer
"__main__"


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" .

Original toplevel document

python - What does if __name__ == &quot;__main__&quot;: do? - Stack Overflow
add a comment | up vote 1313 down vote <span>When your script is run by passing it as a command to the Python interpreter, python myscript.py all of the code that is at indentation level 0 gets executed. Functions and classes that are defined are, well, defined, but none of their code gets run. Unlike other languages, there's no main() function that gets run automatically - the main() function is implicitly all the code at the top level. In this case, the top-level code is an if block. __name__ is a built-in variable which evaluates to the name of the current module. However, if a module is being run directly (as in myscript.py above), then __name__ instead is set to the string "__main__" . Thus, you can test whether your script is being run directly or being imported by something else by testing if __name__ == "__main__": ... If your script is being imported into another module, its various function and class definitions will be imported and its top-level code will be executed, but the code in the then-body of the if clause above won't get run as the condition is not met. As a basic example, consider the following two scripts: # file one.py def func(): print("func() in one.py") print("top-level in one.py") if __name__ == "__main__": print("one.py is being run di







#incêndio

Em sistemas de detecção de alarme e incêndio:

Sistemas endereçáveis Classe A
são todos circuitos que possuem uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto não implique em paralisação parcial ou total de seu funcionamento.

Sistemas endereçáveis Classe B todo circuito onde não existe uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto deste circuito implique na paralisação parcial ou total de seu funcionamento, utilizando protocolo de comunicação unidirecional. Redução de cabos, informando a localização exata do dispositivo em alarme.

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

Unknown title
tilizam protocolos proprietários, ou seja, os dispositivos instalados nas centrais devem possuir o mesmo tipo de comunicação. Os sistemas endereçáveis são subdivididos em duas classes: A e B. Sistemas endereçáveis: classe A e classe B <span>Sistemas endereçáveis do tipo Classe A são todos circuitos que possuem uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto não implique em paralisação parcial ou total de seu funcionamento. Sistemas endereçáveis do tipo Classe B trata-se de todo circuito onde não existe uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto deste circuito implique na paralisação parcial ou total de seu funcionamento, utilizando protocolo de comunicação unidirecional. Essa topologia de instalação tem como principal diferencial a redução de cabos, gerando uma maior economia, informando a localização exata do dispositivo em alarme. Vamos relembrar as principais características de cada sistema: Sistema convencional Não permite a localização exata do ponto em sinistro; Indicado para ambiente menores; Neces




Flashcard 2975254842636

Tags
#incêndio
Question

Em sistemas de detecção de alarme e incêndio:

Sistemas endereçáveis Classe A
são todos circuitos que possuem uma fiação de [...], de forma que uma eventual interrupção em qualquer ponto não implique em [...] .

Sistemas endereçáveis Classe B todo circuito onde não existe uma fiação de [...] , de forma que uma eventual interrupção em qualquer ponto deste circuito implique na [...] , utilizando protocolo de comunicação unidirecional. Redução de cabos, informando a localização exata do dispositivo em alarme.

Answer
retorno à central
paralisação parcial ou total


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Em sistemas de detecção de alarme e incêndio: Sistemas endereçáveis Classe A são todos circuitos que possuem uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto não implique em paralisação parcial ou total de seu funcionamento. Sistemas endereçáveis Classe B todo circuito on

Original toplevel document

Unknown title
tilizam protocolos proprietários, ou seja, os dispositivos instalados nas centrais devem possuir o mesmo tipo de comunicação. Os sistemas endereçáveis são subdivididos em duas classes: A e B. Sistemas endereçáveis: classe A e classe B <span>Sistemas endereçáveis do tipo Classe A são todos circuitos que possuem uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto não implique em paralisação parcial ou total de seu funcionamento. Sistemas endereçáveis do tipo Classe B trata-se de todo circuito onde não existe uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto deste circuito implique na paralisação parcial ou total de seu funcionamento, utilizando protocolo de comunicação unidirecional. Essa topologia de instalação tem como principal diferencial a redução de cabos, gerando uma maior economia, informando a localização exata do dispositivo em alarme. Vamos relembrar as principais características de cada sistema: Sistema convencional Não permite a localização exata do ponto em sinistro; Indicado para ambiente menores; Neces







Flashcard 2975257201932

Tags
#incêndio
Question
Vantagem de sistemas de incêndio endereçáveis Classe B sobre o A?
Answer
Redução de cabos, informando a localização exata do dispositivo em alarme


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
circuito onde não existe uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto deste circuito implique na paralisação parcial ou total de seu funcionamento, utilizando protocolo de comunicação unidirecional. <span>Redução de cabos, informando a localização exata do dispositivo em alarme. <span><body><html>

Original toplevel document

Unknown title
tilizam protocolos proprietários, ou seja, os dispositivos instalados nas centrais devem possuir o mesmo tipo de comunicação. Os sistemas endereçáveis são subdivididos em duas classes: A e B. Sistemas endereçáveis: classe A e classe B <span>Sistemas endereçáveis do tipo Classe A são todos circuitos que possuem uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto não implique em paralisação parcial ou total de seu funcionamento. Sistemas endereçáveis do tipo Classe B trata-se de todo circuito onde não existe uma fiação de retorno à central, de forma que uma eventual interrupção em qualquer ponto deste circuito implique na paralisação parcial ou total de seu funcionamento, utilizando protocolo de comunicação unidirecional. Essa topologia de instalação tem como principal diferencial a redução de cabos, gerando uma maior economia, informando a localização exata do dispositivo em alarme. Vamos relembrar as principais características de cada sistema: Sistema convencional Não permite a localização exata do ponto em sinistro; Indicado para ambiente menores; Neces







Flashcard 2975261134092

Tags
#economia #mises
Question
O que diz a lei da utilidade marginal?
Answer
O consumidor tem satisfação com um bem, mas a unidade seguinte já não lhe proporciona tanto prazer como a anterior.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
a utilização que um indivíduo faz de uma unidade de um conjunto homogêneo de bens, se dispõe de n unidades, e que não faria se só dispusessem de n-1 unidades, man- tidas iguais às demais circunstâncias, constitui a utilização menos urgente, ou seja, a sua utilização marginal. Por isso,

Original toplevel document (pdf)

cannot see any pdfs







"Fair process profoundly influences attitudes and behaviors..."

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

pdf

cannot see any pdfs




#platão #timeu
Segundo Platão/Sócrates, todo o ato intelectual só pode ter lugar na alma

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

pdf

cannot see any pdfs




Flashcard 2976165530892

Tags
#platão #timeu
Question
Segundo Platão/Sócrates, todo o ato intelectual só pode ter lugar na [local]
Answer
alma


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Segundo Platão/Sócrates, todo o ato intelectual só pode ter lugar na alma

Original toplevel document (pdf)

cannot see any pdfs







Tendo construído os corpos de cada um deles – sete ao todo –, o deus estabeleceu-os nas órbitas que o percurso do Outro seguia, em número de sete delas: na primeira a Lua, à volta da Terra; na segunda o Sol, por cima da Terra 125 ; a Estrela da Manhã 126 e o astro que dizem ser consagrado a Hermes 127 na rota circular 128 que tem a mesma velocidade que o Sol, ainda que lhes tenha cabido em sorte um ímpeto contrário ao dele

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

pdf

cannot see any pdfs




Quanto à Terra, o nosso sustento, a qual roda 136 em torno do eixo que atravessa o universo, foi estabelecida como guardiã e produtora da noite e do dia; ela que é a primeira e a mais velha das divindades geradas dentro do céu

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

pdf

cannot see any pdfs




De Geia e Urano foram gerados Oceano e Tétis, seus filhos, e destes foram gerados Fórcis, Cronos e Reia, e todos aqueles que os seguiram; de Cronos e de Reia foram gerados Zeus e Hera e todos aqueles que, segundo a tradição, sabemos serem seus irmãos, e ainda outros descendentes destes foram gerados.

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

pdf

cannot see any pdfs




formai e engendrai seres-vivos, fazei-os crescer, providenciando- lhes o alimento, e, quando perecerem, recebei-os outra vez.

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

pdf

cannot see any pdfs




Uma vez acalmados, gera-se o sossego, e, uma vez gerado um sossego profundo, abate-se um sono com poucos sonhos; mas quando restam alguns movimentos fortes, conforme a sua natureza e os locais onde ficam, produzem no interior simulacros que se assemelham, quanto à natureza e ao número, ao exterior e que serão recordados ao acordar.

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

pdf

cannot see any pdfs