# Ensure the value is one or more [value, 1].min # Ensure the value is 100 or less [value, 100].max
docker system prune
//example const double = (x) => x * 2; const square = (x) => x * x; var output1 = double(2); var output2 = square(output1); console.log(output2); var output_final = square(double(2)); console.log(output_final);
# Syntax lambda arguments: expression # Example of use add = lambda x, y: x + y # Defines a lambda function that adds two numbers result = add(5, 3) # Calls the lambda function with arguments 5 and 3 print(result) # Output: 8
class Example: def __init__(self): self.public_var = "public" self._protected_var = "protected" self.__private_var = "private" def public_method(self): print("This is a public method") def _protected_method(self): print("This is a protected method") def __private_method(self): print("This is a private method") # Creating an instance of the class example_instance = Example() # Accessing public method and variable example_instance.public_method() print(example_instance.public_var) # Accessing protected method and variable example_instance._protected_method() print(example_instance._protected_var) # Trying to access private method and variable (will raise AttributeError) # example_instance.__private_method() # print(example_instance.__private_var)
Example
has three types of methods and variables:_
prefix and are typically considered non-public, although Python does not enforce this.__
prefix and are only accessible within the class itself.public_var
, public_method()
, _protected_var
, and _protected_method()
are respectively public and protected variables and methods._protected_var
and _protected_method()
can be accessed from outside the class but are typically considered non-public.__private_var
and __private_method()
are private variables and methods and can only be accessed within the class itself. Trying to access them from outside the class will raise an AttributeError
.type()
to know the type of a variable for example:type(123) # <class 'int'>
123_145_877
view
s and which are table
s:SELECT * FROM information_schema.tables
{ "orderID":3, "productID":2, "quantity":4, "orderValue":16.60, "links":[ { "rel":"customer", "href":"https://adventure-works.com/customers/3", "action":"GET", "types":["text/xml","application/json"] }, { "rel":"customer", "href":"https://adventure-works.com/customers/3", "action":"PUT", "types":["application/x-www-form-urlencoded"] }, { "rel":"customer", "href":"https://adventure-works.com/customers/3", "action":"DELETE", "types":[] }, { "rel":"self", "href":"https://adventure-works.com/orders/3", "action":"GET", "types":["text/xml","application/json"] }, { "rel":"self", "href":"https://adventure-works.com/orders/3", "action":"PUT", "types":["application/x-www-form-urlencoded"] }, { "rel":"self", "href":"https://adventure-works.com/orders/3", "action":"DELETE", "types":[] }] }
pass
in Python functions as a placeholder for empty code.pass
prevents errors.pass
can be used to intentionally skip a block of code if a certain condition isn't met.%pip
and %conda
command that will run in the current kernel.%pip install geocoder
import sys
!{sys.executable} -m pip install geocoder
--progress
option: --progress string Set type of progress output (auto, plain, tty). Use plain to show container output
(default "auto")
--progress=plain
will show the output of the run commands that were not loaded from the cache. This can also be done by setting the BUILDKIT_PROGRESS
export BUILDKIT_PROGRESS=plain
--no-cache
to your build to rerun the steps and redisplay the output:docker build --progress=plain --no-cache ...
DOCKER_BUILDKIT=0
in your shell, e.g.:DOCKER_BUILDKIT=0 docker build ...
export DOCKER_BUILDKIT=0
docker build ...