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 fun!) :)

Tweet ย ย ย  Share
If you don't want these updates anymore, please unsubscribe here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Powered by Revue