I searched for mkl_intel_thread.dll and could see them in the correct env folder. Many in StackOverflow advised moving the dll one folder up. Since this was an office laptop, I did not have the option of moving Dll. So I was stuck.
After a few more google searches and trial and error, I Solved the problem by just doing this.
conda install cython
After the cython install all dll’s were in the proper place.
I have seen this dll problem come up so often, that its worth knowing this solution.
My daughter’s English teacher has a habit of sending moral stories to her students.
I have heard most of them, some I have shared here in this blog.
Her latest story which I have not heard before is about snake and a saw. Liked it enough to post it here.
One night a snake, looking for food, entered a carpenter’s workshop. The carpenter, who was a rather untidy man, had left several of his tools lying on the floor. One of them was a saw.
As the snake went round and round the shop, it climbed over the saw, which gave it a little cut. At once, thinking that the saw was attacking it, the snake turned around and bit it so hard that its mouth started to bleed. This made the snake very angry. So the snake decided to roll around the saw as if wanting to suffocate it with his whole body. As the snake squeezed the saw the snake got hurt even more. Because of that, the snake thought it had to attack harder so it squeezed even more. This went on until one of them lost the battle.
Moral of the story:
Sometimes in life, it is better to ignore certain situations that arise, the insults and wrongdoings people say and do to you. Because fighting every “battle” you are provoked with will not help you live a successful and happy life. Some battles will take much more from you than you will get from them if you win them.
“If you love to read, or learn to love reading, you will have an amazing life. Period. Life will always have hardships, pressure, and incredibly annoying people, but books will make it all worthwhile. In books, you will find your North Star, and you will find you, which is why you are here.
Books are paper ships, to all the worlds, to ancient Egypt, outer space, eternity, into the childhood of your favorite musician, and — the most precious stunning journey of all — into your own heart, your own family, your own history and future and body.
Out of these flat almost two-dimensional boxes of paper will spring mountains, lions, concerts, galaxies, heroes. You will meet people who have been all but destroyed, who have risen up and will bring you with them. Books and stories are medicine, plaster casts for broken lives and hearts, slings for weakened spirits. And in reading, you will laugh harder than you ever imagined laughing, and this will be magic, heaven, and salvation. I promise.”
Source: A Velocity of Being: Letters to A Young Reader by Anne Lamott
Every 2 hours it launches the default browser with the big fonts telling me to take a break. Much more intuitive and useful than anything I have tried earlier.
Another beauty of the system is that if this doesn’t get me started, I can configure this to lock my screen at that moment. A slight inconvenience but something that I will try if this big pop up doesn’t work.
“Another thing I think should be avoided is extremely intense ideology because it cabbages up one’s mind. … When you’re young it’s easy to drift into loyalties and when you announce that you’re a loyal member and you start shouting the orthodox ideology out, what you’re doing is pounding it in, pounding it in, and you’re gradually ruining your mind.”
Charlie Munger – USC Law Commencement Speech, May 2007
This constant pounding leads the stories you are telling yourself.
Recently wanted to deploy a learning app I have developed for my kids on the web. The main reason behind this was to make the app accessible from anywhere and from any device.
This was necessitated by the our travel back to kids grandparents, where the laptop was not always online and on.
After research ( few google searches and blog reads…:) ) heroku and pythonanywhere.com were the two method that I settled on.
I have previous use heroku to deploy one of my previous app, so this time turned to pythonanywhere.com Heroku has ton of tutorials on how to deploy a python django app on heroku, but there were not many for pythonanywehere.com, so here’s a pictorial demo of the process I took.
Here’s an overview of the steps involved.
Create an pythonanywhere account
Upload your code to PythonAnywhere
Set up a virtualenv and install Django and any other requirements
Set up your web app using the manual config option
Add any other setup (static files, environment variables etc)
In enginnering software development or other software developement projects, most programmers are solving a problem and this always starts by writing a naive implementation and then optimizing it in various ways.
Many a times, instead of focusing on timing, we are also interested in memory usage so we can explore those tradeoffs of caching a table or re-computing as needed.
Fortunately python, with its batteries included philosophy has just the module that is needed to memory profile your code.
# Function to profile memory
snapshot = tracemalloc.take_snapshot()
And later this trace_dump can be queried as bellow
Some of the things I think I think, I find don’t make any sense when I start trying to write them down. You ought to be able to explain why you’re taking the job you’re taking, why you’re making the investment you’re making, or whatever it may be. And if it can’t stand applying pencil to paper, you’d better think it through some more
Writing crystallises thinking than any thing else.
Recently while working on a side project in python and web, needed to find if a string is a url or not?
Here’s a solution using python standard library
from from urllib.parse import urlparse
parsed = urlparse(text)
if (parsed.scheme) and (parsed.netloc):
if __name__ == "__main__":
Love this simple small snippets using the standard library. Do you know of such a hidden gem?
When the Black Death plague entered England in 1348, the Scots up north laughed at their good fortune. With the English crippled by disease, now was a perfect time for Scotland to stage an attack on its neighbor.
The Scots huddled together thousands of troops in preparation for battle. Which, of course, is the worst possible move during a pandemic.
“Before they could move, the savage mortality fell upon them too, scattering some in death and the rest in panic,” historian Barbara Tuchman writes in her book A Distant Mirror.
There’s a powerful urge to think risk is something that happens to other people. Other people get unlucky, other people make dumb decisions, other people get swayed by the seduction of greed and fear. But you? Me? No, never us. False confidence makes the eventual reality all the more shocking.
Some are more susceptible to risk than others, but no one is exempt from being humbled.
Last summer, while in home quarantine, received an update from the housing society committee on the general group, that nominations are invited for new managing committee. I ignored it. Come September, learnt that many ignored the same and now by way of a lottery system I was one of the chosen few to take up a role in the managing committee.
This is how I landed the job of the Treasurer of the housing society. The responsibilities sounded simple when it was explained but in practice it proved too much work.
Ad-hoc expenses, regular expenses. It was hard to manage. The only advise I received from the leaving Treasurer was, record the expense as soon as you incur it.
I bought a diary and started doing this but it became evident that recording expenses in diary and then transferring it to an excel sheet will be time consuming. The volume and variety of expenses from various sources overwhelmed my paper based system.
This is the problem that was beckoning to be solved and I turned to python.
Here’s the result of the solution.
Developed a Django webapp that can be accessed from anywhere, on any of my devices. The web app allows not only allows adding expenses but also shows and consolidate the expenses.
It was fun experience building this. The site is solely used by me now and has made logging of expenses straight forward. Solving this, turned my attention to another problem that had bigger time-toll in my duties as treasurer, but that’s a topic for another post.
The hardest financial skill is getting the goalpost to stop moving.
If expectations rise with results there is no logic in striving for more because you’ll feel the same after putting in extra effort. It gets dangerous when the taste of having more—more money, more power, more prestige—increases ambition faster than satisfaction
Modern capitalism is a pro at two things: generating wealth and generating envy. Perhaps they go hand in hand; wanting to surpass your peers can be the fuel of hard work. But life isn’t any fun without a sense of enough.
Happiness, as it’s said, is just results minus expectations.