“It is by logic that we prove, but by intuition that we discover. To know how to criticize is good, to know how to create is better.”
— #Henri_Poincaré
— #Henri_Poincaré
An IDE...
must consists of:
• source code editor
• build automation tools
• a debugger
can consists of:
• intelligent code completion
• a compiler, or an interpreter, or both
• version control system
• various tools to simplify the construction of a graphical user interface
• a class browser
• an object browser
• a class hierarchy diagram
• code can be continuously parsed while it is being edited, providing instant feedback when syntax errors are introduced. That can speed learning a new programming language and its associated libraries.
should not:
• take longer to learn than it takes to manually integrate individual tools
• fence in the developer's creativity.
must consists of:
• source code editor
• build automation tools
• a debugger
can consists of:
• intelligent code completion
• a compiler, or an interpreter, or both
• version control system
• various tools to simplify the construction of a graphical user interface
• a class browser
• an object browser
• a class hierarchy diagram
• code can be continuously parsed while it is being edited, providing instant feedback when syntax errors are introduced. That can speed learning a new programming language and its associated libraries.
should not:
• take longer to learn than it takes to manually integrate individual tools
• fence in the developer's creativity.
ComputerScientist
Separate concerns.
#Nile
Guidelines
Each adjective must treat (deal with, handle) exactly one concern.
Do not fear the over-abundance of adjectives; most adjectives of two very similar classes might be the same, but the ones that are not draw the line between them and demonstrate how they are different and separate.
Guidelines
Each adjective must treat (deal with, handle) exactly one concern.
Do not fear the over-abundance of adjectives; most adjectives of two very similar classes might be the same, but the ones that are not draw the line between them and demonstrate how they are different and separate.
#characters #ASCII
Whitespace
*line endings
MS Windows files use CR+LF as line ending.
Whitespace
9 character tabulation10 line feed*11 line tabulation12 form feed13 carriage return*32 space*line endings
MS Windows files use CR+LF as line ending.
#Nile
Terminology
Cloudnile, the cloud:
The website where authors hang out.
NILEPATH:
The directory that stores files downloaded from the cloud for offline use.
Author:
Any developer from beginner to expert.
Authors have XP levels.
App:
A bundle with a i.txt, a version history, and corresponding modules and resources mentioned in them.
Bundle:
Folders that include some modules and resources like databases, documentation, screenshots, etc.
Module:
.nile files, comprised of Nile code.
Terminology
Cloudnile, the cloud:
The website where authors hang out.
NILEPATH:
The directory that stores files downloaded from the cloud for offline use.
Author:
Any developer from beginner to expert.
Authors have XP levels.
App:
A bundle with a i.txt, a version history, and corresponding modules and resources mentioned in them.
Bundle:
Folders that include some modules and resources like databases, documentation, screenshots, etc.
Module:
.nile files, comprised of Nile code.
#Python
How to install a module
Normally, if a suitable module is already installed, attempting to install it again will have no effect. Upgrading existing modules must be requested explicitly:
How to install a module
python -m pip install SomePackageNormally, if a suitable module is already installed, attempting to install it again will have no effect. Upgrading existing modules must be requested explicitly:
python -m pip install --upgrade SomePackage#toRead
📚 Controlling the Keyboard and Mouse with GUI Automation
#Python
https://automatetheboringstuff.com/chapter18/
📚 Controlling the Keyboard and Mouse with GUI Automation
#Python
https://automatetheboringstuff.com/chapter18/
#Python
The 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!
The 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!
#Python
Syntax
Definition:
Conditional
⚠️ Use
Iteration:
Inside a function definition, use the following syntax to include the global variables in its scope:
Syntax
Definition:
def f(args):Conditional
if expression:⚠️ Use
== to check for equality, not is.Iteration:
for i in iterable:Inside a function definition, use the following syntax to include the global variables in its scope:
def f(args):
global names
stuff
#Python
How to send GET or POST requests
How to send GET or POST requests
import requests
r = requests.get(url)
r = requests.post(url, data=data)
r = r.json()
Exceptions
Events that occur during the execution of a program and disrupt the normal flow. An exception is an object that represents an error.
When raised, exceptions must be handled immediately, otherwise they would terminate the execution. If you have some suspicious code that may raise an exception, you can defend your program by placing it in a try block, followed by a except block which handles the problem as elegantly as possible.
The list of all #Python exceptions:
https://docs.python.org/3/library/exceptions.html
Events that occur during the execution of a program and disrupt the normal flow. An exception is an object that represents an error.
When raised, exceptions must be handled immediately, otherwise they would terminate the execution. If you have some suspicious code that may raise an exception, you can defend your program by placing it in a try block, followed by a except block which handles the problem as elegantly as possible.
try:
You do your operations here;
......................
except ExceptionI:
If there is ExceptionI, then execute this block.
except ExceptionII:
If there is ExceptionII, then execute this block.
......................
else:
If there is no exception then execute this block.
The list of all #Python exceptions:
https://docs.python.org/3/library/exceptions.html
“Desktop environment is something you normally don't think much about, once it's setup anyway, but finding an old screenshot while trying to clean up the drive can be oddly nostalgic.”
— #Daniil_Baturin
— #Daniil_Baturin
“A language that makes it hard to write elegant code makes it hard to write good code.”
— #Eric_Raymond, Why Python?
— #Eric_Raymond, Why Python?
“All OO languages show some tendency to suck programmers into the trap of excessive layering. Object frameworks and object browsers are not a substitute for good design or documentation, but they often get treated as one. Too many layers destroy transparency: It becomes too difficult to see down through them and mentally model what the code is actually doing. The Rules of Simplicity, Clarity, and Transparency get violated wholesale, and the result is code full of obscure bugs and continuing maintenance problems.”
— #Eric_Raymond, The Art of Unix Programming: Unix and Object-Oriented Languages
— #Eric_Raymond, The Art of Unix Programming: Unix and Object-Oriented Languages
