View profile

The Trojanโšก- Hello World!

The Trojanโšก- Hello World!
By Apoorv Tyagi • Issue #1 • View online
โ€œA journey of a thousand miles begins with a single step.โ€ โ€”Lao Tzu
Hello World! ๐Ÿ‘‹
Welcome to The Trojanโ€™s Wednesday Wisdom Newsletter. My name is Apoorv, Iโ€™m a recent Computer Science graduate working as a Software Engineer in a Health-tech startup in India.
I started writing online around 3 years ago and always wanted to start my own newsletter with it as well. But back then I was not very consistent with writing UNTIL the lockdown happened in 2020 after which I decided to bring in consistency to improve and grow my technical blog.
Now only thing left was launching this newsletter and finally today, here I am sharing my first issue of my first ever newsletter with y'all.

What will this be about? ๐Ÿ‘€
Every Wednesday I will send a list of some interesting articles or tips related to Software Engineering, Python, Spring Boot, Docker and more.
I will also make sure to share my latest tech articles here so that you wonโ€™t miss out on that too. Apart from that, some other exclusive content that might bring some more value to you.๐Ÿ˜‡
Oh BTW I have mentioned my blog a couple of times now - if you are wondering about it, hereโ€™s the link - The Trojan (Apoorv Tyagi)
So if it sounds interesting make sure you subscribe
Python Tip ๐Ÿ
Let us begin this week with some PYTHON -
Have you ever wondered what Python does under the hood when you run a program?
With โ€œdis()โ€ you can view the formatted bytecode operations happening for any function / Class / code object.
Bytecode is a internal version-specific implementation detail of the interpreter.
Python is often described as an interpreted language in which the source code is translated into CPU instructions as the program runs but this is only partially correct.
Python actually compiles source code to a set of instructions for a virtual machine and the Python interpreter is an implementation of that virtual machine.
Thoseย โ€œ.pycโ€ย (in case of python 2.x)ย files are the bytecode instructions that will be executed by Pythonโ€™s virtual machine as your program runs.
With python 3.x a โ€œ__pycache__ย "directory is created for the source and all compiledย Bytecode files are placed underneath.
In the CPython interpreter, Python code is first converted to an intermediate representation, theย bytecode, and then executed by the Python interpreter.
Theย disย module in Python standard library provides various functions useful for analysis of Python bytecode by disassembling it into a human-readable form
  • It prints one line per bytecode instruction
  • It also recursively disassembles nested code objects
This helps to perform optimizations. Look at an example below and things will become clear for you :
dis module in python
dis module in python
My Latest blog article ๐Ÿ“ฐ
What is Blockchain Technology? Learn by creating one
Yesterday, I published my new blog article. This time I have written on the Blockchain technologyย โ€” The million-dollar buzzword๐Ÿ˜‰ and demonstrated how you can build a simplified, high-level blockchain with functionalities such as adding blocks to the chain, validating transactions, and implementing encryption(Proof of Work).
Blockchain is essentially a shared digital ledger of transactions that is distributed across the entire network of member(computer systems) in a public or privateย peer-to-peer network.
All the members in a blockchain network can view those transactions that are relevant to them at any point of time
Blockchain is not just about Bitcoins. It is only the underlying technology that powers these cryptocurrencies.
In the article we have -
  • Defined a single block
  • Created a blockchain
  • Defined a proof-of-work system
  • Built a mining procedure
  • Built an interface(REST - APIs) through which we can interact with our Blockchain
The source code isย available on my Github. (Feel free to contribute as well)
I always enjoy learning by doing and if you do the same, at the end of this tutorial youโ€™ll have a functioning Blockchain with a solid grasp of how they work.
I am sure that this will inspire you to create something new & will assist you to understand the underlying technology that powers cryptocurrencies such as Bitcoin and Ethereum.
Do give it a read.๐Ÿ˜€
An exercise for you
Guess the correct output
Guess the correct output
Hereโ€™s a fun python code snippet. What I want you to do is think and reply to this email with what you think will get printed when we run this code snippet & Why.
HINT : Itโ€™s not [1, 8, 15]๐Ÿ˜‰
I will share the correct answer in the next issue that is on 17th Feb.
๐Ÿ‘‹ Until then, have a nice week and enjoy yourselves!
Thatโ€™s it for now. Let meย knowย what are your thoughts on this issue, what is it that I can improve in it, what is it that you like to see more, or any feedback you want to share.
If you liked this newsletter consider subscribingย (in case you havenโ€™t already) and share it with those you feel can get benefit out of it.
๐Ÿ‘€ See you next Wednesday.
Did you enjoy this issue?
Apoorv Tyagi

๐Ÿ“ฉ ๐—” ๐—ป๐—ฒ๐˜„๐˜€๐—น๐—ฒ๐˜๐˜๐—ฒ๐—ฟ ๐—ฎ๐˜ ๐˜๐—ต๐—ฒ ๐—ถ๐—ป๐˜๐—ฒ๐—ฟ๐˜€๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐—ผ๐—ณ ๐๐ฌ๐ฒ๐œ๐ก๐จ๐ฅ๐จ๐ ๐ฒ, ๐๐จ๐ง-๐…๐ข๐œ๐ญ๐ข๐จ๐ง ๐๐จ๐จ๐ค๐ฌ ๐—ฎ๐—ป๐—ฑ ๐’๐จ๐Ÿ๐ญ๐ฐ๐š๐ซ๐ž ๐„๐ง๐ ๐ข๐ง๐ž๐ž๐ซ๐ข๐ง๐ .

๐๐จ, ๐ฐ๐ž ๐๐จ๐ง'๐ญ ๐œ๐ฅ๐š๐ข๐ฆ ๐ญ๐จ ๐ฆ๐š๐ค๐ž ๐ฒ๐จ๐ฎ ๐ฌ๐ฆ๐š๐ซ๐ญ๐ž๐ซ ๐ž๐ฏ๐ž๐ซ๐ฒ ๐ฐ๐ž๐ž๐ค. ๐Ž๐ง๐ฅ๐ฒ ๐ฌ๐ฎ๐›๐ฌ๐œ๐ซ๐ข๐›๐ž ๐ข๐Ÿ ๐ฒ๐จ๐ฎ๐ซ ๐ข๐ง๐ญ๐ž๐ซ๐ž๐ฌ๐ญ๐ฌ ๐š๐ฅ๐ข๐ ๐ง ๐ฐ๐ข๐ญ๐ก ๐š๐ง๐ฒ ๐จ๐Ÿ ๐ญ๐ก๐ž ๐ญ๐ก๐ซ๐ž๐ž ๐ญ๐ก๐ข๐ง๐ ๐ฌ ๐ฆ๐ž๐ง๐ญ๐ข๐จ๐ง๐ž๐ ๐š๐›๐จ๐ฏ๐ž!

P.S. It is free (and probably fun)

Tweet ย ย ย  Share
In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Powered by Revue