Skip to main content

Posts

Showing posts from October, 2020

What is Rust Variable Scope?

 What is Rust Variable Scope?    Introduction Rust could also be a programming language targeting performance and safety. It doesn't use garbage collection unlike other programming languages. Rust gives deterministic management of resources, with very low overhead.  It's prepared to be a language for highly coexisting and highly safe systems. Each variable features a scope in Rust that starts where the variable is initialized. We can have variable from the larger scope be visible to the scopes that are within that larger scope where the variable in initialized.   We'll assign variable with the results of a handout during one assignment So giving the variable from the scope of an if statement is perfectly valid. Variable Scope A scope is a which place where a block expression stores its variables. Scopes aren't directly represented within the ASCII document , but a scope begins when a block expression begins, with a `{` symbol, and ends when the bloc

What is Python List?

 What is Python List?    DESCRIPTION In Python, an inventory may be a mutable, means the values that it contain are often modified.   An inventory may be a variable which will have a sequence of values assigned there to during a list, these values are referred to as elements or members.   It's collection which is ordered, changeable and allows duplicate members. Defining an inventory We define an inventory this way: fruits = ["Mango", "Apple", "Orange”, “Banana", "Grapes"] In python lists are written with square brackets. We define an inventory by enclosing everything to the proper of the equal check in square brackets. Each element or member is separated by a comma and an area .   The primary element during a list always has an index of 0, the second element an index of 1, and so on.   An inventory element are often assigned any sort of value that we will assign to ordinary variables, for in

Smart Contract Misconceptions

 Smart Contract Misconceptions Smart Contract Misconceptions Whenever gentleman and smart people hear the term "smart contracts", their imaginations tend to run wild.   A sensible contract is simply a flowery name for code that runs on a blockchain , and interact thereupon block chain's state.   A sensible contract may be a piece of code that's stored on an block chain, triggered by blockchain transactions and which reads and writes data therein block chain's data base. Each language has its strengths and weaknesses --you'd be crazy to create an internet site in C or compress HD video in Ruby. But in theory a minimum of , you'll if you wanted to. You'd just pay an important price in terms of convenience, performance, and quite probably, you hair. Use Case-1 Contracting External Service The smart contract that replaces its behavior in response to some external event. First user case: An agricultural pol

What is Rust Ownership?

 What is Rust Ownership? Ownership concept   Memory and Allocation Data can be stored either in stack or heap memory in Rust. Memory Types Stack Memory Heap Memory Stack and Heap Stack and Heap are parts of memory to be used at runtime, but they are structured in different ways. Stack  It collects values in the order it get them and removes the values in the opposite order. Referred to as Last In, First Out (LIFO).   Stack: Think of a stack of plates When we put more plates,we add them on the top of the pile, and when we required a plate, we take one off the top. Putting or removing plates from the middle or bottom wouldn't work as well.   Adding data is called pushing onto the stack ,    Removing data is called popping off the stack .   Stack memory is an organized memory .   It is more faster than the heap memory due to the way it accesses the memory.   All data gathered on the stack must have a known, fixed size   Stack Push and Pop Example:       Stack: in action     S