And you wouldn't even know - such a breeze to install. And, when you launch, you can use the regular browser - like Chrome..
But, why are terminals unavailable?
Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Saturday, February 29, 2020
Wednesday, February 26, 2020
Shame on Google - Can't Even Get Factorial Right..
It just gets worse..
And worser.. WT*? What are they trying to prove? A one liner has been made a freaking paragraph!
Problem : The pretty_address function separates out parts of the address string into new strings: house_number and street_name, and returns: "house number X on street named Y". The format of the input string is: numeric house number, followed by the street name which may contain numbers, but never by themselves, and could be several words long. For example, "123 Philly Ave", "1001 3rd St", or "55 North Ferst Blvd". Fill in the gaps to complete this function.
def pretty_address(address):
# Declare variables
# Separate the address string into parts
words = address.split()
# Traverse through the address parts
# for __:
# Determine if the address part is the
# house number or part of the street name
# Does anything else need to be done
# before returning the result?
# Return the formatted string
return "house number {} on street named {}".format(" ".join(<censored>) , words[duh!] )
print(pretty_address("456 Castler Street"))
# Should print: "house number 456 on street named Castler Street"
asdf. Another one that got my temperature up. Problem? A failure to address or play to the student's curiosity. Think about how ridiculous this is - you have two classes of clothing - shirts and pants and they're both inheriting from Clothing - so far so good. Clothing keeps track of the entire population - hence assigning to CNAME.varName rather than self.varName. Good.
But then, when you want information about the entire population - in this case, the total stock of Cotton, you go through a particular class of clothing - how ridiculous is that? Or sick?
For the current_stock = , you can use either polo or sweatpants - which shows up another QA fail - why is one singular and the other plural?
class Clothing:
stock={ 'name': [],'material' :[], 'amount':[]}
def __init__(self,name):
material = ""
self.name = name
def add_item(self, name, material, amount):
Clothing.stock['name'].append(self.name)
Clothing.stock['material'].append(self.material)
Clothing.stock['amount'].append(amount)
def Stock_by_Material(self, material):
count=0
n=0
for item in Clothing.stock['material']:
if item == material:
count += Clothing.stock['amount'][n]
n+=1
return count
class shirt(Clothing):
material="Cotton"
class pants(Clothing):
material="Cotton"
polo = shirt("Polo")
sweatpants = pants("Sweatpants")
polo.add_item(polo.name, polo.material, 4)
sweatpants.add_item(sweatpants.name, sweatpants.material, 6)
current_stock = sweatpants.Stock_by_Material("Cotton")
print(current_stock)
That's not enough.. More evidence that either Google's or Coursera's QA dept is asleep (highlighted) :
class Zoo:
def __init__(self):
self.current_animals = {}
def add_animal(self, animal):
self.current_animals[animal.name] = animal.category
def total_of_category(self, category):
result = 0
for animal in self.___.values():
if self.____ == category:
result += 1
return result
zoo = Zoo()
And worser.. WT*? What are they trying to prove? A one liner has been made a freaking paragraph!
Problem : The pretty_address function separates out parts of the address string into new strings: house_number and street_name, and returns: "house number X on street named Y". The format of the input string is: numeric house number, followed by the street name which may contain numbers, but never by themselves, and could be several words long. For example, "123 Philly Ave", "1001 3rd St", or "55 North Ferst Blvd". Fill in the gaps to complete this function.
def pretty_address(address):
# Declare variables
# Separate the address string into parts
words = address.split()
# Traverse through the address parts
# for __:
# Determine if the address part is the
# house number or part of the street name
# Does anything else need to be done
# before returning the result?
# Return the formatted string
return "house number {} on street named {}".format(" ".join(<censored>) , words[duh!] )
print(pretty_address("456 Castler Street"))
# Should print: "house number 456 on street named Castler Street"
asdf. Another one that got my temperature up. Problem? A failure to address or play to the student's curiosity. Think about how ridiculous this is - you have two classes of clothing - shirts and pants and they're both inheriting from Clothing - so far so good. Clothing keeps track of the entire population - hence assigning to CNAME.varName rather than self.varName. Good.
But then, when you want information about the entire population - in this case, the total stock of Cotton, you go through a particular class of clothing - how ridiculous is that? Or sick?
For the current_stock = , you can use either polo or sweatpants - which shows up another QA fail - why is one singular and the other plural?
class Clothing:
stock={ 'name': [],'material' :[], 'amount':[]}
def __init__(self,name):
material = ""
self.name = name
def add_item(self, name, material, amount):
Clothing.stock['name'].append(self.name)
Clothing.stock['material'].append(self.material)
Clothing.stock['amount'].append(amount)
def Stock_by_Material(self, material):
count=0
n=0
for item in Clothing.stock['material']:
if item == material:
count += Clothing.stock['amount'][n]
n+=1
return count
class shirt(Clothing):
material="Cotton"
class pants(Clothing):
material="Cotton"
polo = shirt("Polo")
sweatpants = pants("Sweatpants")
polo.add_item(polo.name, polo.material, 4)
sweatpants.add_item(sweatpants.name, sweatpants.material, 6)
current_stock = sweatpants.Stock_by_Material("Cotton")
print(current_stock)
That's not enough.. More evidence that either Google's or Coursera's QA dept is asleep (highlighted) :
class Zoo:
def __init__(self):
self.current_animals = {}
def add_animal(self, animal):
self.current_animals[animal.name] = animal.category
def total_of_category(self, category):
result = 0
for animal in self.___.values():
if self.____ == category:
result += 1
return result
zoo = Zoo()
Tuesday, February 25, 2020
Did You K? PDF is an Open Standard! Manipulate PDFs with python - tutorial
https://realpython.com/courses/pdf-python/
pyPDF2 - that's hot stuff!
pyPDF2 - that's hot stuff!
- Introduction
- pyPDF2 History, an Alternative and Installation
- Metadata Extraction and Rotating Pages
- Merging and Splitting PDFs
- Adding Watermarks and Encrypting PDFs
- Conclusion and Further Reading
Alternatives to pyPDF2 (Phasit) - pdfrw by Patrick Maupin (good with ReportLab, but no encryption).
Actually, this tutorial is members only :(
How would you add links in a PDF : https://stackoverflow.com/questions/28796832/add-links-in-pdf
But, Al Sweigart, on the advice of Alan Dershowitz, has made his Udemy companion (to the book) is free in March - just log out of Udemy, go to his website and then click on the link, and you'll see it's free.. click on buy and checkout, it's $0.
But, Al Sweigart, on the advice of Alan Dershowitz, has made his Udemy companion (to the book) is free in March - just log out of Udemy, go to his website and then click on the link, and you'll see it's free.. click on buy and checkout, it's $0.
Wednesday, February 19, 2020
Python Resources - Online Interpreters and More
Who else but GOOG would know about this?
- https://www.python.org/shell/
- https://www.onlinegdb.com/online_python_interpreter
- https://repl.it/languages/python3
- https://www.tutorialspoint.com/execute_python3_online.php
- https://rextester.com/l/python3_online_compiler
- https://trinket.io/python3
Additional Python resources
While this course will give you information about how Python works and how to write scripts in Python, you’ll likely want to find out more about specific parts of the language. Here are some great ways to help you find additional info:
- Read the official Python documentation.
- Search for answers or ask a question on Stack Overflow.
- Subscribe to the Python tutor mailing list, where you can ask questions and collaborate with other Python learners.
Strings :
String operations
- len(string) Returns the length of the string
- for character in string Iterates over each character in the string
- if substring in string Checks whether the substring is part of the string
- string[i] Accesses the character at index i of the string, starting at zero
- string[i:j] Accesses the substring starting at index i, ending at index j-1. If i is omitted, it's 0 by default. If j is omitted, it's len(string) by default.
String methods
- string.lower() / string.upper() Returns a copy of the string with all lower / upper case characters
- string.lstrip() / string.rstrip() / string.strip() Returns a copy of the string without left / right / left or right whitespace
- string.count(substring) Returns the number of times substring is present in the string
- string.isnumeric() Returns True if there are only numeric characters in the string. If not, returns False.
- string.isalpha() Returns True if there are only alphabetic characters in the string. If not, returns False.
- string.split() / string.split(delimiter) Returns a list of substrings that were separated by whitespace / delimiter
- string.replace(old, new) Returns a new string where all occurrences of old have been replaced by new.
- delimiter.join(list of strings) Returns a new string with all the strings joined by the delimiter
Check out the official documentation for all available String methods.
Formatting expressions
| Expr | Meaning | Example |
|---|---|---|
| {:d} | integer value | '{:d}'.format(10.5) → '10' |
| {:.2f} | floating point with that many decimals | '{:.2f}'.format(0.5) → '0.50' |
| {:.2s} | string with that many characters | '{:.2s}'.format('Python') → 'Py' |
| {:<6s} | string aligned to the left that many spaces | '{:<6s}'.format('Py') → 'Py ' |
| {:>6s} | string aligned to the right that many spaces | '{:<6s}'.format('Py') → ' Py' |
| {:^6s} | string centered in that many spaces | '{:<6s}'.format('Py') → ' Py ' |
Check out the official documentation for all available expressions.
Sunday, February 02, 2020
Cubicle in ON Semi Bangalore
Makes you wonder why anyone would ever want to work there.. Wonder what a *real* sweatshop like Broadcom has..
Saturday, February 01, 2020
Pushing Your Stuff to Github
You have files on your computer you want to send to GitHub.
If you said you have files in your directory you want to send to GitHub, I'd say... not so fast. If you don't know what you're doing, you might lose *all* of them!
What *should* you do?
Start with an empty directory.
Then
git init
git remote add origin https://github.com/username/repoName (yes, I assume you created it on GH :)
git pull origin master // this is the magic that now tells your local system that you're hooked up
cp /from/path/file1 . // may be overcautious..
git add file1
git commit -m "initial"
git push origin master
If you try the git remote add origin thing without the git init..
fatal: not a git repository (or any parent up to mount point /cygdrive)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
If you do the git init and the git remote add origin and then try pushing..
To https://github....
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/...
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/...
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
CowPhImB : Avoid Death by Powerpoint
C : Use contrast to draw attention to the important parts of the slide
O : One message per slide!
W : White does not delight! Use the appropriate background for the setting - if you're outdoors, maybe white is okay :)
PhIm : Have an Image and Phrases. Don't have full sentences because people will lose cognitive bandwidth processing them - and you won't get your verbal message across.
B : The most important part of the slide should be the biggest - not necessarily the title!
https://youtu.be/Iwpi1Lm6dFo
O : One message per slide!
W : White does not delight! Use the appropriate background for the setting - if you're outdoors, maybe white is okay :)
PhIm : Have an Image and Phrases. Don't have full sentences because people will lose cognitive bandwidth processing them - and you won't get your verbal message across.
B : The most important part of the slide should be the biggest - not necessarily the title!
https://youtu.be/Iwpi1Lm6dFo
Oh Really? How, If Drones are Supposed to Be Illegal in India?
https://yourstory.com/socialstory/2019/12/drone-scientist-karnataka-mandya-600-drones
Nitakal Marimadiah Pratap started tinkering with drones when he was only 14 years old, and two years later at 16, he had managed to develop a fully functioning drone. Even though it could fly and capture only a few images, it was no less than an achievement for the young boy, who was inspired by the might of the eagle soaring in the sky and Dr APJ Abdul Kalam, India’s top scientist and former president.
Over the course of the next few years, Pratap built 600 drones all by himself. He has so far completed six major projects that includes Telegraphy in Border Security, Drones in Traffic Management, UAVs in rescuing humans and Auto piloted drones and Cryptography in Drone Networking. Pratap’s drones are saving the lives of tribals in Africa by helping deliver medical support in a short period of time.
Invited to 87 countries.. wow.. and just a B.Sc. from JSS College of Arts, Science and Commerce, Mysore.
Nitakal Marimadiah Pratap started tinkering with drones when he was only 14 years old, and two years later at 16, he had managed to develop a fully functioning drone. Even though it could fly and capture only a few images, it was no less than an achievement for the young boy, who was inspired by the might of the eagle soaring in the sky and Dr APJ Abdul Kalam, India’s top scientist and former president.
Over the course of the next few years, Pratap built 600 drones all by himself. He has so far completed six major projects that includes Telegraphy in Border Security, Drones in Traffic Management, UAVs in rescuing humans and Auto piloted drones and Cryptography in Drone Networking. Pratap’s drones are saving the lives of tribals in Africa by helping deliver medical support in a short period of time.
Invited to 87 countries.. wow.. and just a B.Sc. from JSS College of Arts, Science and Commerce, Mysore.
Wednesday, January 29, 2020
Nothing New : Israel Best the US at Arms Since the 70's
Consider the case of the Sidewinder (Bill MacLean's baby) :
(from Ron Westrum's underwhelming book)
Israel had its first missile kill on 28 November 1966, when an Israeli Mirage IIIC fired a Matra 530 missile successfully at an Egyptian MiG-19, downing it. Yet, missiles were hardly used at all in the Six-Day War of 1967, whose many Israeli victories were all accomplished with guns. After 1967 there was a rapid climb in the number of missiles Israel used in combat. The Israelis soon got access to Sidewinders and used the AIM-9B and AIM-9D in the early years. Bu the Lebanon conflict (1982), Israeli planes were also carrying the AIM-9L, "super-Sidewinder." Diplomacy got Israel its early missiles, but soon it was designing its own, first the Shafrir and then its successor, the Python. The Rafael Design Bureau carried out the design of these Sidewinder variants. Israel has excellent technical capabilities, and these missiles are generally considered superior to the American Sidewinder versions.
(from Ron Westrum's underwhelming book)
Israel had its first missile kill on 28 November 1966, when an Israeli Mirage IIIC fired a Matra 530 missile successfully at an Egyptian MiG-19, downing it. Yet, missiles were hardly used at all in the Six-Day War of 1967, whose many Israeli victories were all accomplished with guns. After 1967 there was a rapid climb in the number of missiles Israel used in combat. The Israelis soon got access to Sidewinders and used the AIM-9B and AIM-9D in the early years. Bu the Lebanon conflict (1982), Israeli planes were also carrying the AIM-9L, "super-Sidewinder." Diplomacy got Israel its early missiles, but soon it was designing its own, first the Shafrir and then its successor, the Python. The Rafael Design Bureau carried out the design of these Sidewinder variants. Israel has excellent technical capabilities, and these missiles are generally considered superior to the American Sidewinder versions.
Monday, January 27, 2020
Survive Like a Spy (In Prison) with (Jason Hanson) and John Kiriakou
"
What are the rules? Use : The ARAB WEDGE goes from SC to FL in a Hired Michigan TRuCK
| No | Rule | Mn |
| 1 | Adapt to your environment : blend in - don't stand out and become a target | A |
| 2 | Recruit spies to get access to secrets (info not publicly available). Use GERI : Greed, Excitement, Revenge, Ideology on the part of your target | R |
| 3 | Ande Mac : Admit Nothing, Deny Everything, Make Counteraccusations | A |
| 4 | Use cover to blend in - sense your surroundings and avoid trouble | B |
| 5 | Everyone is working for someone. Everyone is potentially working for the other side! (Remember the Moscow rules!) | W |
| 6 | The human body can endure much more than the mind thinks it can. Keep your body healthy and your mind will stay healthy. A punch in the face ain't so bad. If your assessment is that you need help, there's nothing wrong with seeking it and using antidepressants to recover | E |
| 7 | Solve potential problems before they arise using dirty tricks | D |
| 8 | Don't underestimate the power of another's greed | G |
| 9 | Don't be afraid to beat a strategic retreat | S |
| 10 | If stability is not to your benefit, then chaos is your friend | C |
| 11 | Be the power behind the throne - don't be an overt challenge to the king. Remember Nicolas Fouquet? He really fouqued up and died in prison. Don’t! | F |
| 12 | Listening is a better strategy than talking. Use the FEND : flattery, ego, naivete and deliberate misspeaking (remember David Lieberman's "Now You Can Read Anyone"? | L |
| 13 | Hide in Plain Sight - Don't draw attention and become a target (Yah? How the hell is this different from #2 or #4?) | H |
| 14 | Use the subtle art of misdirection to throw people off the scent (How?) | MI |
| 15 | Trust no one - everyone is potentially working for the opposition | T |
| 16 | Use the power of rumour | Ru |
| 17 | Always maintain a plausible cover for action - have your story ready! | C |
| 18 | Know your enemy - knowledge is power! | K |
Subscribe to:
Posts (Atom)