tag:blogger.com,1999:blog-83617735981504146182024-03-19T01:47:01.447-07:00Vaibhav Maheshwariwhere will your curiosity lead you?Vaibhavhttp://www.blogger.com/profile/04065991764103917042noreply@blogger.comBlogger129125tag:blogger.com,1999:blog-8361773598150414618.post-38789360624922029672024-03-10T04:03:00.000-07:002024-03-10T04:03:42.607-07:00How to regulate cryptocurrencies? Nuanced viewpoint. <p>Cryptocurrency regulation remains a focal point of debate among financial institutions, governments, and users. The crux of the issue is balancing the innovation and freedom of cryptocurrencies with the need to prevent their misuse. The image you shared illustrates the problems faced by public institutions in monitoring and controlling illicit activities involving cryptocurrencies, and also suggests potential solutions to these challenges.</p><p><br /></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl_gGf7tn0pP5iqCRrTPC47kij-ptcsveabnUICXMemeC6Ik3aR3EHu_VhlE6JW9QpRoxzmbwhY8H5ut_ta41w7pzyr8MAK-PrtAB6Wtwk2G-P91RL4zi-kU5gC71HGcDCrtJUDvlZP21WTM618ig8wkhkNDs5oDESIDdzKbPEHbgVdJYke4PbD8FszKv9/s2094/regulation.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1060" data-original-width="2094" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl_gGf7tn0pP5iqCRrTPC47kij-ptcsveabnUICXMemeC6Ik3aR3EHu_VhlE6JW9QpRoxzmbwhY8H5ut_ta41w7pzyr8MAK-PrtAB6Wtwk2G-P91RL4zi-kU5gC71HGcDCrtJUDvlZP21WTM618ig8wkhkNDs5oDESIDdzKbPEHbgVdJYke4PbD8FszKv9/w640-h324/regulation.jpeg" width="640" /></a></div><br /><p><br /></p><p><br /></p><p>The flowchart in the image outlines the difficulties in tracking the movement of cryptocurrencies from legitimate to illegal usage and vice versa. It points out that once cryptocurrency is purchased, it cannot be frozen by government authorities, making it a potential tool for illegal activities. Even though fiat purchasers are vetted by governments, the conversion of illegal fiat currency into cryptocurrency remains an issue due to anonymity. Subsequently, these funds can be mixed and transferred multiple times to obscure their origin, ultimately being exchanged back into legal fiat currency.</p><p><br /></p><p>The process raises concerns about the genuine use cases of cryptocurrencies, given that they can empower users through smart contracts and democratization of power. However, it's challenging to distinguish between legitimate and illicit transactions, as the decentralized nature of cryptocurrencies can be exploited by bad actors.</p><p><br /></p><p>The image also outlines a series of solutions to address these bottlenecks, focusing on the off-ramp and on-ramp stages of crypto transactions. The proposed solutions are:</p><p><br /></p><p>1. Having registered crypto users state the purpose of transactions to regulatory authorities, which can later be monitored by AI tracing mechanisms.</p><p>2. Maintaining the transparency of crypto transactions to ensure they can be traced by government entities.</p><p>3. Creating a portal for users to prove the legitimacy of their use cases and transaction flows.</p><p><br /></p><p>For crypto-to-crypto issues, the suggestions include:</p><p><br /></p><p>1. Regulating contract addresses based on liquidity and number of users and establishing a global database of contract classifications.</p><p>2. Ensuring that the purpose of the transaction is stated in such a way that the identity of the parties is not revealed, yet the parties cannot lie about the transaction's purpose.</p><p><br /></p><p>This image reveals a nuanced view of cryptocurrency regulation, recognizing both its potential risks and its innovative benefits. It underscores the necessity for intelligent regulation that doesn't stifle technological advancement while ensuring that the financial system is not compromised. As the dialogue around cryptocurrency regulation evolves, the balancing act between innovation and security becomes increasingly vital for the future of digital finance.</p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-27986617825520493492024-01-30T16:04:00.000-08:002024-01-31T10:59:02.456-08:00VIsion 2025<p>Hey, I think I am probably overreaching it but here is what I think the entire crypto-web3-AI dream will take us tomorrow. I wrote the article - <a href="https://vaibhavgeek.blogspot.com/2012/04/vision-electronic-cloud.html" rel="nofollow" target="_blank">Vision Electronic Cloud</a> in 2012, it has been 12 years since I wrote that and we are nowhere near the Vision Electronic Cloud today. It seems that solving a problem is more important as compared to giving people vision. There are homes today which are like Electronic Cloud but there have not been massive transformations in energy, and the repair and maintenance cost of IOT devices ultimately acted as a negative proponent of Electronic Cloud. </p><p><br /></p><p>I don't think anyone is sitting on the realization here of how intelligent LLMs and GPT actually are. They can act as wonderful brains. However, there is still the problem of how to use them by providing the right context? How would the privacy of a user work if they are not given the right context? What if a third-party organization requests access to some of the results computed on such data? Who will own their personal data? </p><p>Here is what the vision encapsulates - everyone will have their personal LLM which will be trained on their own data. This data will be stored in vectors and can be anything digital under the sun. - Images, Videos, Audios, Texts. There will be a schema along with each item which will tell how this data was captured and other statistics about the information. Each person will have cameras embedded into their glasses which will upload everything that they see to the cloud, and it will upload everything they hear to the cloud, this data composed with artificial intelligence will be revolutionary. Everything they read, hear or write will be recorded. </p><p>The personal LLM and </p><p>How would privacy work?</p><p>This could potentially lead to privacy violations on an unimaginable scale. No entity should have entire control over this user's data, this could lead to changing privacy policy or being under government pressure to vilify someone's data. The request to access this data would be made using a smart contract transaction, </p><p><br /></p><p><br /></p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-69386305276327853992023-11-26T11:24:00.000-08:002023-11-26T11:24:54.987-08:00For Fun: Reading an old story. <p>This blog post holds a sense of nostalgia for me. </p><p>In our 12th grade English class, we studied a story about a father telling a bedtime tale to his daughter. You can find that story here: [https://ncert.nic.in/ncerts/l/levt105.pdf](https://ncert.nic.in/ncerts/l/levt105.pdf).</p><p><br /></p><p>Everyone in our English class got a chance to read stories aloud before we discussed them. I was chosen for the narration of this story and hence it is nostalgic for me personally. Unfortunately, we didn't take our English literature teacher very seriously, probably because she was the nicest person in the school. During discussions, some jokes and sarcasm were thrown around, which she never appreciated. For some reason, this story is deeply seeded in my memory.</p><p><br /></p><p>Now, let's review the story from the perspective of 27-year-old Vaibhav.</p><p><br /></p><p>**Q: What is the moral issue that the story raises?**</p><p><br /></p><p>My favorite lines from the book 'Prince' go something like this: "It ought to be remembered that there is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success than to take the lead in the introduction of a new order of things. Because the innovator has for enemies all those who have done well under the old conditions and lukewarm defenders in those who may do well under the new. This coolness arises partly from fear of the opponents, who have the laws on their side, and partly from the incredulity of men, who do not readily believe in new things until they have had a long experience of them."</p><p><br /></p><p>I think the dad was defending the actions of his own mother. The truth is, there are no absolutely right or wrong decisions, just familiar and unfamiliar ones. Our parents and caregivers, with the best intentions, always choose decisions that are familiar to them. Accepting unfamiliarity is hard, and it's even more difficult for those who are advocating for it. Technology breakthroughs, whether they are decentralization or artificial intelligence, are tools that represent hard-to-accept breakthroughs, even for the developers themselves. If you are not concerned about the moral implications and the potential disruptions caused by your innovation, then it's not truly innovation.</p><p><br /></p><p>The daughter here wants Roger Skunk to smell like roses again, but her father says that he went back to smelling like a stinky skunk. To many, this may sound odd because the rational mind would always lean towards Roger smelling like roses rather than a skunk. However, being identified with a bad smell is part of the skunk's identity, and letting go of that narrative is extremely hard. We have seen this play out in different conflicts and settings. People often value their identity more than rational thought. Those who oppose such identities are often punished and demoralized by society. This occurs in every setting where communication is present, ex. on the Internet.</p><p>Kleo Network aims to bring communities closer and experience a richer version of people's life by data ownership, social networks on existing data, and creating a 10x communication layer for the people to give and receive help. Communications will be decentralized and communities can do commerce with the speed of thought. </p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-35750757086110912232022-09-29T14:16:00.006-07:002022-09-29T14:33:59.926-07:00The nomad, the future and what we are today. <p>Somehow we today are interconnected and deeply rooted with our belief systems. The reach of these connections extend our abilities to be someone with a lot of validation (perhaps as difficult creating a tomb). <br />I spend my time thinking a lot about what makes these Decentralised Autonomous Organisations so successful and valuable. Sure they create impact (so did private limited organisations) but it's not just that. This is not about expanding internet to become a better version of itself by allowing expanse of it swallow through the metaverse, it is actually about going back right to tight knit communities taking care of each other. Given how easy it has become to move from place to place (unless you require US Visa, xD), our growing individualistic lifestyle and transience nature of economic volatility required us to create instruments which can move faster with much easier and public reputation systems. This need for transparency and trust is a growing consumer concern, too often than not we have seen products on shelves with harmful ingredients, medicines/products that want to upsell with disregard for potential sideeffects. Some believe that we are in the worst phase of human evolution with a disregard for nature and a know-it-all human attitude. Others believe that this is the most prosperous time for humanity and we would transcend to solve the issues that are plaguing us without the need of uprooting our daily lives. This dichotomy may be a dividing factor amongst many in future. </p><p>When we look at last 50 years of humanity the changes that are paraded as wildly successful such as providing cheap electricity, better mobility of goods, better healthcare and medicines, faster pace of living has led to consequences so devastating that we are yet to suffer through the actual outcomes of it. This ignorance of things will move as it did because of inertia or humans inability to comprehend situations until they actually take place would probably leave us wondering how could we miss such obvious signs which are both a result of society's lack of tight knit communities and growing disbalance of natural resources. This may look like a bleak future but I am sure of witnessing some aspect of it in my lifetime. </p><p>When we looked earlier times, sure the changes took time to come into effect but information also travelled slower, this allowed adoption in a non cult manner to masser audience. The idea of belief systems had little or no importance but soon that might change on the internet with growing community and community oriented online presence. Allowing impact and mission driven communities to work on issues that they struggle with collectively is a great cause to be focused and can solve lot of issues if allowed to collaborate a manner which reveals information best suited to the member (anonymous as well)!</p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-33272636190625519342022-09-28T00:43:00.007-07:002022-09-28T05:12:14.021-07:00The Polygon Fellowship Experience<p>Imagine a bunch of highly passionate and brightest folks in one room and solving the most difficult problems of web3 ecosystem! You might say that "hey, hackathons exist, right!!", well that's true but what if the experience was 2 months of building something! That's what polygon fellowship exactly was! </p><p><br /></p><h3 style="text-align: left;">The people</h3><div style="text-align: left;">Clearly what stood out for me was the people I got to interact with, I had discussions on 'Cosmos Ecosystem vs other Layer 1s" for quite a long time and was able to have insights that I did not have before. Everyone were nice and did not make one feel left out during a conversation, but had a great ordeal of patience to explain and often at times argue in order to make a point. This collaborative nature and perhaps the passion for the ecosystem was what made the fellowship stood out. It's crazy how easily we bonded together and became friends. I still feel nothing beats in person communication. Digital is great as ease of communication but it does not replaces the in person interactions that one can pull through. </div><div style="text-align: left;"><br /></div><div style="text-align: left;"><h3>The Workshops</h3><div>The second biggest takeway for the fellows during the fellowship was the sessions we had. Some of the things that they said infused so much passion and inspiration in us as a team. We truly had a great time of learning from some of the highly technical CXOs which gave the talk themselves. We also had an opportunity to interact with the OG "Sandeep Nailwal" and ask him questions which was the icing on a cake, especially to people who are very new to the ecosystem. </div><div><br /></div><div>// Add links to Videos?</div><div><br /></div></div><h3 style="text-align: left;">The Retreat</h3><div>All the fellows stayed at "The Paul" Bangalore which had amazing facilities provided to all the fellows. The food was finger licking delicious and stay was really comfortable with all the amenities. The rooms were suites and left the fellows wondering if it can get better than this, and it did with the actual workshops and the ideas / discussions that happened about how as an ecosystem we can grow. The entire atmosphere was filled with a lot of optimism and positivity as compared to how web3/crypto gets looked upon by some of more traditional and orthodox institutions. </div><div><br /></div><div>// Add pics to the retreat. </div><div><h3>The Online and Mentors</h3></div><div>The mentors we connected with, we had long discussions on how we can take our solutions forward from business perspective and do more with our work. We learnt more on how the current ecosystem works and the rational of ideas from not just tech perspective but marketing and business as well. I cam to know of other avenues notably 'Polygon Grants', and different DAOs. This further motivated me to be part of such an exclusive group. </div><div><br /></div><div>Overall the event was extremely well organised by Devfolio and I have said so multiple times to my friends that nothing of this sort has been done not just in Indian blockchain scene but Indian tech scene altogether. I am extremely grateful to the devfolio team for selecting me as candidature and further enabling my belief. </div><div><br /></div><div><br /></div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-46522411814128793772022-08-26T03:54:00.006-07:002022-09-24T04:00:03.947-07:00Detailed Post on Modular Blockchains<p></p><ul style="text-align: left;"><li><span id="docs-internal-guid-6eb969ea-7fff-b0d8-bfb1-8f4a1f0fd412"><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; white-space: pre-wrap;">A blockchain is a decentralized ledger which you can use to communicate without a need of central authority. You don’t need postman, you don’t need bank, you don’t need the government and you definitely don’t need these companies running AWS servers. </span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">These Blockchains fundamentally have 4 different elements, </span></p><ol style="margin-bottom: 0px; margin-top: 0px; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Consensys</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Execution</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Data Availability and</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Settlement</span></p></li></ol><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Consensus is related to the mechanism whereby validators/miners can come to agreement on the order of transactions (also known as messages) for a specific block. The idea is that all the nodes of this decentralized ledger need to agree on a certain state of the chain. </span></p><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Next we have execution, execution refers to the computation required to make state changes from the set of transactions in a new block. It basically means that once there is agreement on order of transactions we need to ensure the execution of those transactions takes place and these transactions are added to those decentralized ledger. </span></p><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Third is Data Availability, </span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">These transactions need to be communicated with applications or end users for that matter, now there should be a way for that data to be available from these nodes to the user, which is what data availability is </span></p><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Settlement </span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">There would be a need to verify and confirm these blocks which happens in settlement layer, it’s about ensuring that no bad actors push the wrong blocks on chain. </span></p><br /><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">In a monolithic blockchain all of these are handled by the chain itself, whereas modular chains tend to outsource each of these functions to a separate workgroup. So let’s understand the pros and cons of modular and monolithic chains in depth, </span></p><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Monolithic chains allow developers to easily integrate, they really do not have think of all the parameters while they are building and can focus just on business logic of things although the downside is that there are high chances congestion as we have seen previously. Now chains like solana have solved these issues by increasing validator requirements and increasing number of transaction in a single block, this may have solved congestion but it comes at the cost of decentralization. </span></p><br /><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Now let’s see how different modular chains handle this, </span></p><ol style="margin-bottom: 0px; margin-top: 0px; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Polkadot </span></p></li></ol><ol style="margin-bottom: 0px; margin-top: 0px; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; margin-left: 36pt; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Collators are responsible for ordering and executing transactions on a specific parachain</span></p></li></ol><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">These transactions are then posted as proofs on the main relay chain for Polkadot</span></p><ol start="2" style="margin-bottom: 0px; margin-top: 0px; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; margin-left: 36pt; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Settlement takes place on this relay chain. </span></p></li></ol><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Over here execution / ordering is separate from the settlement layer. This is similar to chains optimistic rollups chains like optimism. </span></p><br /><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> b. Celestia</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Celestia aims to build a layer-1 proof-of-stake blockchain that provides data availability and consensus so the developer needs to take care of execution and settlement. Celestia allows developers to build their own plug and play roll-ups to order and execute transactions on top of Celestia’s data availability and consensus layer, here the basic idea is to give applications more control over how they want the architecture of decentralization looks like. </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> C. Cosmos </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Validators of an app-chain are responsible for execution, consensus, data availability and settlement, but the app chain’s settlement layer is not shared which is in the case of monolithic chains. Cosmos basically allows the app chain to easily integrate with all the elements of the public blockchain in the way they seem fit. Using IBC these chains can communicate with each other so that token / value transfer can take place. The major negative aspect for this is that the community building is required for each app chain and they cannot utilize the already existing community for validation and quick prototyping which is the case for other monolithic chains. </span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">So why cosmos has been gaining popularity? </span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">A great case for cosmos is the self sovereignty it allows for app chains, take example of LUNA. LUNA was built on top of cosmos an on April 5th, 2022, LUNA reached a market-cap of over $40 billion. By Friday, May 13th the LUNA market-cap catered to less than $10 million, and nearly all on-chain value was completely destroyed.The rest of the Cosmos ecosystem — Cosmos Hub, Osmosis, Akash, Regen, etc. — kept steadily producing blocks during the UST collapse and after Terra halted. Before I jump to saga, I want to draw your attention to Astroport and Crescent. Astroport relied on terra for security while Crescent on staking and validator set. Both of these chains tokens lost 80-90% of their token value post Terra crash. </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Saga is part of Cosmos ecosystem it provides economic security and validator set for other developers to build on. </span></p><ol style="margin-bottom: 0px; margin-top: 0px; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Permissionless deployment of code</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Customization of self-sovereign blockchain </span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">No upfront cost to launching a chainlet</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Predictable developer pricing for gas fees </span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Dedicated blockspace for a developer’s applications, ensuring high throughput, easy upgradability and congestion relief. </span></p></li></ol><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">In other words, applications deployed on Saga reserve their own dedicated blockspace, which is a feature that is not possible in monolithic blockchains. Applications deployed on Saga enjoy independence, meaning that block production on one chainlet is independent of the block production on other chainlets, a feature not shared in modular frameworks like Polkadot. Saga chainlets are self-sovereign and do not rely on a shared settlement, which is the case in Ethereum. In other words, Saga chainlets are as much a part of the Cosmos multi-chain ecosystem as any other application-based chain.</span></p></span></li></ul><div><span style="font-family: Arial;"><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></span></div><div><span> </span><span> </span><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/0jjRmAyk7qk" title="YouTube video player" width="560"></iframe></div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-86932995041907328882022-05-16T13:14:00.003-07:002022-05-16T13:14:28.765-07:00When blockchain can be used in a project?<p> </p><p>When is blockchain actually required and when can a web2 startup can replace blockhain based projects.</p>
<ul>
<li>Data integrity - When there is a need to make sure that the data itself has some integrity associated with itself. This means that data cannot be corrupted or incorrect data manipulation should not take place in order to suit any specific party’s demands.<br /><br /></li>
<li>Provable Time Linearisation.
Time linearisation in mathematical terms means anything means that increases / decreases with respect to the time, say <code>f(t) = at + b</code> so the idea that anything needs to have consistence provable time linearisation say applications like Dollar Cost Averaging or anything that changes with respect to the time then we need the function the <code>f(t)</code> that needs to be verified by a consensus algorithm. Now in a blockchain, this happens by deterministically increasing the block number with a given time stamp and provably linked timestamps (and made sure that they are verified by consensus algorithm with high economic incentive)<br /><br /></li>
<li>Censorship resistance,
Now, every piece of information on chain is a new block while it can be creation, updation or deletion so it is ensured that no data gets lost ever. The idea that blockchain data is censorship resistance means that the data can never be corrupted and manipulated in a way to suit the needs of certain entities. Everything is a new block which is verified by consensus algorithm with high economic incentive.<br /><br /></li>
<li>Double Spend Protection,
The idea that one can spend twice on chain but it would be recorded so on chain data. The idea is that when you make an transaction there are multiple fields that are required and of them is nonce, the idea is that if two transactions are broadcasted with exact same parameters then based on number of confirmations (probably dependent on time of broadcast and gas fees), the one having more number of confirmations will be accepted while the other will be rejected.<br /><br /></li>
<li>Inherit Layer 1 security
Layer 1 can provide consensus and security, so if there is an asset that is deemed to super valuable for the community then then layer 2 can add scalibility where as layer 1 gives the necessary security.</li>
</ul><div>There is no point of needlessly integrating blockchain in a project it is not meant to. </div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-75747553041125708262022-05-15T16:01:00.000-07:002022-05-15T16:01:10.785-07:00How can we keep our cities cool during summer?<h3 style="text-align: left;">- My daily Power Usage</h3><p>Electricity is not plenty. Even though with the infrastructure that we have today, the truth why homes need to exist and are so prevalent when jobs have become mobile, internet data is mobile and luxurious cars that are same as tiny homes, we need power. </p><p>Estimating my Power Usage, </p><p></p><ul style="text-align: left;"><li>4 hours of Light [43 Watts * 4 ] </li><li>12 hours of fan [ 55 Watts * 12 ]</li><li>10 hours of laptop / computing device [70 Watts * 10]</li><li>1.5 hours of cooking (induction) [1500 Wattage]</li><li>4 hours of mobile [4 wattage * 4]</li></ul><div>The total comes out to be roughly 3.5 Kwh per day approximately. Post engine efficiency, one litre of petrol can generate upto 2-4Kwh of energy, so 2 litres of petrol is sufficient enough for a day of electricity usage. [approx 5-6Kwh]</div><div><br /></div><div><br /></div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-24326651253992590712021-11-13T21:31:00.005-08:002021-11-14T01:33:35.262-08:00Solo Trip Adventures - Dalhousie<p>Traveling solo is a different ball game altogether and it's an adventure because you rarely can plan it and just have to make it up as you go along. When I thought of the idea of doing a solo trip I imagined I would have plenty of time to work and get mostly bored. I was googling what people do while they are solo travelling whilst my experience was completely opposite from that. I had to find some quiet time for myself to relax. </p><p>Most Google searches would result in activities such as observing people, observing nature and trekking to an destination but here is what my answer to this question is - You listen, because listening to others is much more theraipautic than any other thing out there. There are just so many stories that are waiting to be heard, so many lives that you can touch just by listening to what other people have to say. Before this banter continues further ahead, let's meet the people on this journey. </p><p><br /></p><p>Krunal aka Youtuber</p><p>I wish I had half the tenacity of this guy. Why is it still easier to say to everyone that you are an UPSC aspirant than to become a youtuber in India? Clearly the stigma is very alive and very hard to get rid of. After walking 5 million miles he had the energy to speak 5 million words as well, time and again. </p><p><br /></p><p>Traveling with him was astoundingly simple - I had very little to take care of. He made sure I got the best deals, best knowledge, best experience and best behind the scenes bloopers. May God grant you a youtuber to travel with. </p><p><br /></p><p>Even when God knocks on his door for gateway to heaven, I am sure he would just ask the other God for better discount while the rest of us pay extra. </p><p><br /></p><p>Jokes apart, I didn't agree with creative side of his work (obviously that's very little to complaint but as a friend I feel like I have every right to do so). More often than not when we are treading on an off beat path, we try and look for safety and security. Or maybe there is an entire population of India that uses YouTube that I am unaware of, but if I had an YouTube channel it would be entertainment rather than information. </p><p><br /></p><p>Nevertheless, it's just making that choice, the first step is the hardest to take and as we go along the journey with resolve it gets easier with time. </p><p><br /></p><p>Ustaad Bhai</p><p>It's always the local that leave a hole in my heart and ears bleeding. If you are going on a solo trip, make it a point to talk to the security guard , the cook , the driver because it would leave you little astounded and shocked at the same time. Every time I do, I just feel bad to be privileged and growing up with that basic logic of not channeling everything down by my emotional controller. Yes, capitalism is open for all, yes the opportunities do exist for everyone if they are willing to work but for that you need to believe in yourself and have an appetite for taking risks. He was a truck driver previously and had an accident which made his left side pretty much not usable. He became a chef to take care for his family. </p><p><br /></p><p> The "Five Girls" </p><p> I think there was no arrow when God planned the cupid for me :P </p><p> I can say that I am omitting the names to protect their privacy but the truth is I don't remember their names. They were staying in the dorm with us and were final year med students or more like final year fed up students. What's interesting was that they were Kota coaching friends. Even I can plan a trip like that. Let's see what those fuckers are upto - asshole, bigger asshole , abroad, abroad, too irritating , too cool to reply to my text. Maybe my friendships were way more real and complex than them :P. Okay, maybe I can't but it was fun bunch of folks and the hangover of their interaction stayed with me even though I didn't sip a single drop of alcohol. Making politically incorrect statements to offend a lot of people is always a lot of fun. </p><p><br /></p><p>Arun and Nithin </p><p>I think Arun bhai was the most knowledgeable person in that camp, It was a refreshing experience to understand the policies of Mughals, British India and Indian government over Dalhousie and how has that shaped the culture. His passion for adventure and building a backpacker house was unmatched. On the other hand was Nithin bhai who was a walking example of Netflix and chill and let's just say no more. </p><p><br /></p><p>Vishal </p><p>He was the first person I met in the hostel and gave me the boss vibe from day one. He was like that senior in college who has had done everything that is to be done and now just wants to be shining light for other people from his tribe to follow. </p><p><br /></p><p>Everyone Else </p><p>There were just lot of nuggets and emotional outbursts not only from other tourists but locals as well. People mostly have plenty of time as they go around visiting places and are open to talking as compared to cities where everything and everyone is a rush (including me). </p><p><br /></p><p>Nature </p><p>If you haven't tried to listen to nature then there is no point of making the trip. You need to close your eyes and listen to the rhythmic beat of your pumping heart, the water trickling down from a crib, the gargantuan calm forest looking down for and at us while we crib in vain on our petty issues. </p><p><br /></p><p>Also, I did zip line, paragliding, multiple long treks and visits to waterfall. Posting some of the pics. </p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com1tag:blogger.com,1999:blog-8361773598150414618.post-44660268345933008412021-09-09T11:38:00.001-07:002021-09-09T11:38:05.441-07:00How should government tax crypto?<p> Governments serve a basic purpose - To help the community grow and prosper. They have a singular function of serving the needs of the community. Now taxing cryptocurrencies is very hard but there is also an understanding by the Blockchain community that funds for public good is required. The most simple way to tax cryptocurrency traders and developers is to make taxation voluntary and on chain. </p><p>Once you know that the transaction is on chain you can go ahead and track the end beneficiary of your money and there should be an option to choose your money to be given to local / national cause along with certain restrictions. </p><p>I think taxation can be DAO in totality and this has been the major idea behind DAOs. </p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-15920609402125298862021-06-12T05:12:00.004-07:002021-06-12T05:12:55.719-07:00Jabra Fan : A NFT powered fan based marketplace <h2 id="about-jabra">About Jabra</h2>
<p>This is an early support based NFT marketplace, mostly aimed at content creators. Imagine getting supported for your initiatives by strangers on the internet who
believe in you because of your past track record? </p>
<p>What's in it for these supporters you ask? Well they can sell these NFTs when you become a public sensation. This serves as a dual edged sword as the people
who believe in you will also be the advocate of your success and help you reach there faster.</p>
<hr />
<h3 id="use-case-1">Use Case 1</h3>
<p>Imagine you create educational videos on machine learning. You have made 4 videos and now you need some money to create more/new videos. You can mint a NFT
on our platform and sell it to your supporters. This NFT would guarentee one-on-one time and certain exclusive features by the creator. Now, when and as
channel grows these NFT (and thus the exclusivity) associated with it can be sold to new members of the community. </p>
<h3 id="use-case-2">Use Case 2</h3>
<p>Imagine you are a TV actor who is out of work at the moment (as we saw during the pandemic) , now you need some money in order to sustain a
certain lifestyle. So you can reach out and mint NFTs and the exclusivity could be the videos of incorrect takes that took place, inside gossips,
artworks from sets that you have, behind the scenes footage, reaction of your own memes. Your fans will buy it for certain premium and then as you grow
to become a bigger star, these exclusivity can be sold out to the potentially highest bidder. </p><hr />
<h2 id="technical-architechture">Technical Architechture</h2>
<p>It uses </p>
<ul>
<li>Zilliqa BlockChain </li>
<li>Scilla Smart Contracts</li>
<li>ZilPay Wallet Chrome Extension is Required </li>
<li>ReactJS for frontend</li>
<li>Rails Backend for storing some centralized data</li>
<li>AWS Amplify and AWS EC2 for hosting frontend and backend respectively. </li>
</ul>
<hr />
<h2 id="screenshots">Screenshots</h2>
<p>
<img src="https://i.imgur.com/0lkCeg9.png" width="40%" />
<img src="https://i.imgur.com/1TUsq8Z.png" width="40%" />
<img src="https://i.imgur.com/AHnpEFF.png" width="40%" />
<img src="https://i.imgur.com/tfyv1jI.png" width="40%" />
<img src="https://i.imgur.com/uW9ixZ1.png" width="40%" />
<img src="https://i.imgur.com/Lr7Wdcz.png" width="40%" />
<img src="https://i.imgur.com/WyYCMVN.png" width="40%" />
<img src="https://i.imgur.com/Dh4uM3l.png" width="40%" />
</p>
<hr/>
<h2 id="demo-video">Demo Video</h2>
<p><a href="https://www.youtube.com/watch?v=JqDsqNygJdg">https://www.youtube.com/watch?v=JqDsqNygJdg</a> </p>
<p>(Apologies for the low audio) </p>
Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-9894695424417625782021-06-08T05:48:00.006-07:002022-09-24T04:07:50.971-07:00Machine Learning Components<p> 1. <span style="font-family: Arial; font-size: 11pt; white-space: pre-wrap;">Introduction </span></p><p><span style="font-family: Arial; font-size: 11pt; white-space: pre-wrap;">Basic Mathematics behind traditional data algorithms, Only topics would be explored for theoretical understanding and no code would be written for the same. </span></p><span id="docs-internal-guid-7e0c2c4c-7fff-ca52-cd39-f54add268c84"><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><ol style="margin-bottom: 0; margin-top: 0; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Naive Bayes Classifier</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Term Frequency - Inverse Term Frequency </span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Cosine Similarity </span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Linear Regression </span></p></li></ol><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2. Applications and breakdown,</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></p><ul style="margin-bottom: 0; margin-top: 0; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Tabular Data</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Images </span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Audio</span></p></li><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Video</span></p></li></ul><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This breakdown along with the detailed analysis on each component would help you figure out how to work on Machine Learning Models. </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Most of the research papers whether in computer vision, speech and text need a very good understanding of four things. All of these require thorough understanding along with the code. The idea is to first process them in 3 line definition format and then experiment with the TensorFlow. </span></p><ul style="margin-bottom: 0; margin-top: 0; padding-inline-start: 48px;"><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Components</span></p></li><ul style="margin-bottom: 0; margin-top: 0; padding-inline-start: 48px;"><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Recurrent Neural Networks</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Convolutional Neural Networks </span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Long Short Term Memory Cells</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Gated Recurrent Units</span></p></li></ul><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Topology Used </span></p></li><ul style="margin-bottom: 0; margin-top: 0; padding-inline-start: 48px;"><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Encoder/Decoder</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Bidirectional </span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Grid LSTM</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Tree LSTM</span></p></li></ul><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Additional factors</span></p></li><ul style="margin-bottom: 0; margin-top: 0; padding-inline-start: 48px;"><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Attention</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Normalization</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Regularization </span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Share/Unshare Something</span></p></li></ul><li aria-level="1" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Activation Function</span></p></li><ul style="margin-bottom: 0; margin-top: 0; padding-inline-start: 48px;"><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">TanH</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Rectified Linear Unit</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Parametric Rectified Linear Unit </span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Exponential Linear Unit </span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Sigmoid</span></p></li><li aria-level="2" dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: circle; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Softplus
</span></p></li></ul></ul>3. Conclusions and Rules of Thumb for practical purposes. </span>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-13025539411910481502021-06-05T18:29:00.008-07:002021-06-05T18:42:39.461-07:00"Real Value" Of CryptoCurrency<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvwTpDvURHijpl1h5YsQMW7XNjx0tc9bS1x3MHkH3GuuKbYzwnm4bkuccI4gw1d6-WplCBeYGOuqd7XEw3gqxynaTpkq7ZeWuetZpJR5Rg4qNtdt0E5L1GP9g6oiI09q_VgfP8gjC6qHBC/s1279/MUE-Crypto-Flubit-Nov.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="637" data-original-width="1279" height="318" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvwTpDvURHijpl1h5YsQMW7XNjx0tc9bS1x3MHkH3GuuKbYzwnm4bkuccI4gw1d6-WplCBeYGOuqd7XEw3gqxynaTpkq7ZeWuetZpJR5Rg4qNtdt0E5L1GP9g6oiI09q_VgfP8gjC6qHBC/w640-h318/MUE-Crypto-Flubit-Nov.jpg" width="640" /></a></div><br /><p>I think most people reading this would know about BitCoin and would have some vague ideas about trading in cryptocurrency (apps like WazirX and CoinDCX). This article is meant for people who would want to start trading in cryptocurrency but have no idea where to start. It should obviously not be taken as investment advice.</p><p>The volatility in crypto markets is very high and there are macro trends and micro trends. The micro trends are very hard to predict for any cryptocurrency and for new currencies with less number of coins out there, the percentage change with these micro-trends can be massive in terms of numbers and thus it's advisable to tread carefully. These trends are often because of trading bots and hypes perpetuated on internal groups. Although, that's something not to worry about if you understand the "real" value of that cryptocurrency. Any currency has value based on the number of people adopting it. So, the more projects are built using cryptocurrency, the more people get attracted to it, the more people use it. This adoption often shows compounded effect given a sensible leadership is heading the project with genuine social good in mind. Often at times the leadership gets' greedy and wants to manipulate the projects to benefit their own greed hurting the community at large that supported them in their endeavor. The current stage of a lot of adoption of this tech is based on the hope of growth and it has shown massive promises. </p><p>As of now the sovereign funds, pension funds have not invested in these currencies and thus acts as an early investment. If any of these big cheque funds decide to pick up any cryptocurrency then it would totally change the shape of it. (Few million dollars is small number for them).</p><p><b>Real Projects are not replicas. </b></p><p>As I said above the value of any currency is based on projects that use it. If your neighbourhood e-commerce store starts using a coin then you can buy stuff from them without getting into the national currency loop, thus making the currency more valuable. Obviously, every project helps but to truly have massive adoption of any cryptocurrency, the projects built on top of it cannot be "Replica of X in Crypto", the value lies in building something truly innovative and engaging for the community while leveraging the currency. </p><p>If you are just looking for trends to understand so that you can invest, the first and foremost thing to realize it is that do not have a tunnel vision but a long term thought, here are some pointers that you can use. </p><p></p><ul style="text-align: left;"><li>Wallet address growth</li><li>The blockchain's transaction volume and growth </li><li>Real Projects and adoption </li><li>dApp creation and usage growth </li><li>Community Address and Resolution of Technical Problems associated with scaling up</li><li>GitHub work contributed to a blockchain </li><li>Developers adding to the blockchain. Are developers growing, stagnant or decreasing over time?</li><li>Key partnerships that are adding value. Not just announcing the name of someone to put on your website but what the partnership is actually doing to drive adoption and value creation. (Partnerships with bigger currencies)</li><li>Celebrity Endorsements and Influencer marketing </li><li>Reddit / Closed Groups Sentiment </li></ul><div>There are often Red Flags associated, which can be tracked down if you are watching very closely, these are, </div><div><ul style="text-align: left;"><li>How many ICOs are happening? Are we seeing an increase of more and more ICOs raising tens of millions of dollars with no working product?</li><li>Is the growth euphoric or optimistic? </li><li>People will increase their risk appetite to try and get more return as higher returns become harder in the top 50 cryptos because most of that price action will have been exhausted. So investing in big players is indeed very stupid. They are fluctuating with micro-trends and have very little to offer in terms of growth and adoption. </li><li>What is the economic outlook in the traditional world? Negative sentiment among the community is to be feared as it spreads like wildfire. </li></ul></div><div>The biggest and most indicative is obviously Wallet Address Growth closely followed by transaction volume and growth. Comparing this with other currencies and comparing it with it's own trends over the spectrum of months would give you a good long term measure of the currency's future. </div><div><br /></div><div>Is it advisable to invest your life savings in crypto? <br /><b>Obviously No. </b></div><div><b>My advice would be to make bets to small unheard currencies in a way that losing that money would not affect you a bit. 5% - 7% of your savings at max. </b></div><div><br /></div><div>Also Worth Reading : <a href="https://vaibhavgeek.blogspot.com/2017/06/blockchain-and-its-end-user-applications.html">https://vaibhavgeek.blogspot.com/2017/06/blockchain-and-its-end-user-applications.html</a></div><div><br /></div><p></p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com5tag:blogger.com,1999:blog-8361773598150414618.post-58964654024928198022021-02-08T06:58:00.002-08:002021-02-08T06:59:07.549-08:00Building Get Go Scalable Products with AWS - Webinar<p><br /></p><p></p><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="363" src="https://www.youtube.com/embed/WObRtu1AkxI" width="436" youtube-src-id="WObRtu1AkxI"></iframe></div><br /><p></p><p><br />
<iframe src="https://docs.google.com/presentation/d/e/2PACX-1vS9TpI8gw7-f-6nTo4IUQK97tHyXkYBcX8ExtgreAc-eL2dQ0SOb5iwvW_oDEgiOpASuh0Sc-0rt2Ns/embed?start=false&loop=false&delayms=3000" frameborder="0" width="100%" height="569" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
</p><p><br /></p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-75817226841269077392021-01-19T08:59:00.006-08:002022-09-25T05:41:55.075-07:00Sheety Chatbots! <h3 style="text-align: left;">Sheety Chatbot!</h3><div><br /></div><div>In this tutorial we are going to learn how to build a notification chatbot which sends you notifications at specific time intervals and talks to you if you want to receive them or not.</div><div><br /></div><div>For the purpose of this tutorial we are going to build a bot which checks every 5 minutes on a google sheet if the person has marked his work or not and notifies specific **subscriber** on their telegram/slack/skype account if they have. Instead of a google sheet you can ping a website for changes.</div><div><br /></div><div>> subscriber - the user who has subscribed to the project via Telegram/Slack/Skype</div><div><br /></div><div>We are going to use following stack for this purpose,</div><div><br /></div><div>- DynamoDB - subscribers and habits</div><div>- AWS Lambda -</div><div> - serverless functions which is invoked when chatbot gets a message.</div><div> - a cron job which notifies the user for an update</div><div>- Claudia.js - Wrapper to write chatbot for slack, telegram and skype</div><div>- Cloudwatch Rules - To trigger lambda function every 5 minutes</div><div> </div><h3 style="text-align: left;">Architecture.</h3><div><br /></div><div>In our database, we are going to have two tables - subscribers , sheetcells</div><div><br /></div><div>Subscribers is going to have following columns, </div><div>- id </div><div>- slackToken </div><div>- slackId </div><div>- telegramId </div><div>- skypeId </div><div>- sheetId</div><div><br /></div><div>Sheetcells is going to have following columns, </div><div>- cell </div><div>- value </div><div>- last checked </div><div>- type : enum [ “habit”, “goal”, “day” ] </div><div>- subscriberId</div><div><br /></div><div>For our main infrastructure, we will have cloudwatch event calling our notification lambda function (called as notifyLambda), which will send the message to our user. The conversations would be handled by separate lambda function which is called (</div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-65755951855098181022020-09-28T23:24:00.003-07:002020-09-28T23:24:41.961-07:00Time Management and Productivity<p>As someone who is data and productivity fanatic, this post is going to be about breaking the schedule, tracking the data while there is a schedule and there is not a schedule and how to measure more accurate metrics. </p><p><br /></p><p><br /></p>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com1tag:blogger.com,1999:blog-8361773598150414618.post-28881345919272556422020-07-31T01:04:00.002-07:002020-07-31T01:04:22.179-07:00(College Education - 2) What if you get 100K USD job after a 200$ course. Will you pay for college then? If you have not read my previous article on college education, you can find the link over <a href="#" id="https://vaibhavgeek.blogspot.com/2018/12/college-education-1-data-analytics-for.html" name="https://vaibhavgeek.blogspot.com/2018/12/college-education-1-data-analytics-for.html">here</a>. Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-35818900344696843732020-07-08T01:34:00.000-07:002020-07-08T09:49:17.862-07:00Why this pandemic is an ultimate test.<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm5A8UE3yakJWISf2wjBIiW1JZ82pA1lZ5P6LykA0KiN9i0yZOazuKAE09j2nUQOsRH4CadmEUOE5OwUNTUyVyxbikJQ_1Qxo3B7PrpkS8hPSOr59s0r8mHPccdcRjW8OEduz4NrFYPTtu/s800/2e94c86c9ad23a3e1abcd206f14d984c.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="720" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm5A8UE3yakJWISf2wjBIiW1JZ82pA1lZ5P6LykA0KiN9i0yZOazuKAE09j2nUQOsRH4CadmEUOE5OwUNTUyVyxbikJQ_1Qxo3B7PrpkS8hPSOr59s0r8mHPccdcRjW8OEduz4NrFYPTtu/w576-h640/2e94c86c9ad23a3e1abcd206f14d984c.jpg" width="576" /></a></div>
</div>
<div>
<div>
<br /></div>
<div>
Humans have survived on the hope of a better future. The now is pretty irrelevant as long as there is the promise of a better future. We have led ourselves to narrate a sippy dream filled with brighter future of neon lights and disposable human connections. Nobody expected to be in a home lockdown, irrespective of the fact that's what we would have been doing anyway, the imposition of such comes as a big blow. Something more precious than the present has been taken away from us, the promise of a better future. </div>
<div>
<br /></div>
<div>
The psychological impact of it is insanely high. We have to deal with someone, we have to live with someone we rarely have an honest conversation with, ourselves. This pandemic is also a long coming for so many issues that plagued society, we are looking at improved conversations on the division of labour between genders, mental health, social media addiction, unimpactful education system and so on. It is indeed an extraordinary situation where everyone seems to be stuck together (and yet alone) in an elevator that sometimes goes up, sometimes down, but the doors don’t open and the help button is broken.</div>
<div>
<br /></div>
<div>
And that is why this pandemic is an ultimate test for homo sapiens. </div>
<div>
We need to create reasons to find hope, because I am pretty sure this won't go on more than 3-4 months from now on. The vaccine would be prepared and when it does we should be ready to do what we always dreamt of. </div>
<div>
<br /></div>
</div>
</div>
Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-2128451337976927992020-06-29T07:38:00.000-07:002020-06-29T07:38:45.125-07:00A study of shock induced air cavity in liquid nitromethane<br />
<iframe src="//www.slideshare.net/slideshow/embed_code/key/DOXFOcipd93m5P" width="668" height="714" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/vaibhavmah/a-study-if-shock-induced-cavity-collapse-in-liquid-nitromethan" title="A study if shock induced cavity collapse in liquid nitromethan" target="_blank">A study if shock induced cavity collapse in liquid nitromethan</a> </strong> from <strong><a href="https://www.slideshare.net/vaibhavmah" target="_blank">Vaibhav Maheshwari</a></strong> </div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-77794179287524873222020-06-18T04:43:00.001-07:002020-06-18T04:43:52.735-07:00JRE with Bret Weinstein & Heather Heying<iframe width="560" height="315" src="https://www.youtube.com/embed/HYJFgyqs0sM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-84442449550613437142020-06-09T00:01:00.001-07:002020-06-09T00:01:09.767-07:00GraphQL , ReactJS and Apollo Client<p>We will build a client-sided GraphQL application which will combine React with GraphQL. The application would allow us to gather facebook profile information</p>
<p>The following tutorial will be split into four sections.</p>
<ul>
<li>What is GraphQL and how is it different from REST API.</li>
<li>What is Reactjs and Why should you use it?</li>
<li>Creating a GraphQL backend in nodejs and express.</li>
<li>Connecting Apollo Client to a react application</li>
</ul>
<h2 id="what-is-graphql-and-how-is-it-different-from-rest-api">What is GraphQL and how is it different from REST API?</h2>
<p>One might ask themselves that they already understand the REST APIs very well and if there is a true need of GraphQL at all. GraphQL is based on objects instead of strings (comparing to SQL) and thus reduces complexity of the application.</p>
<p>All the requests in GraphQL are handled by a single a end-point <code>/graphql</code>. Let that sink in for a while.</p>
<p>Why does this matter? The actual transmission of requests and data is abstracted away. We no longer have to worry about things like response codes and planning out our urls like<br>
<code>/articles/id/comments/user_id/comment_id/delete</code>.<br>
In the HTTP API structure, we had to create 4 API to interact with our single object in model which were largely,</p>
<ul>
<li>post</li>
<li>get</li>
<li>delete</li>
<li>put</li>
</ul>
<p>whereas GraphQL would have handler functions which would handle things for us.</p>
<p>To summarize it we have following advantages of GraphQL.<br>
<strong>GraphQL is declarative</strong>: Query responses are decided by the client rather than the server. A GraphQL query returns exactly what a client asks for and no more.</p>
<p><strong>GraphQL is compositional</strong>: A GraphQL query itself is a hierarchical set of fields. The query is shaped just like the data it returns. It is a natural way for product engineers to describe data requirements.</p>
<p><strong>GraphQL is strongly-typed</strong>: A GraphQL query can be ensured to be valid within a GraphQL type system at development time allowing the server to make guarantees about the response. This makes it easier to build high-quality client tools</p>
<p>GraphQL fits in very well with abstraction based concept on which facebook devoloper tools function. The idea that abstraction reduces complexity is common across React, GraphQL and other devoloper tools that facebook has created and thus it workds seamlessly with ReactJS.</p>
<h2 id="what-is-reactjs-and-why-should-you-use-it-with-graphql">What is Reactjs and Why should you use it with GraphQL?</h2>
<p>The number of front-end libraries built on top javascript has clearly surpassed a guessable number. This has led it to be the butt of many jokes. There is a popular drinking joke amongst developers where a person names a noun and if there exists a js library with such a name, you are supposed to drink</p>
<p>A new library called ReactJS somehow has emerged as the uncrowned champion amidst this bubble. It has gained massive popularity amongst management and developers alike. The best part about react js is that to get started you only need a basic understanding of HTML and Javascript. Not only is it easy to learn but also easy to migrate as it is not a framework but a library with small compatibility layers In this article, we will talk about why you should migrate to ReactJS and list few of the tech companies that have done the same.</p>
<ol>
<li>
<p>SuperSonic Load<br>
ReactJs uses Virtual Dynamic Object Model (V-DOM) which is built with a diff <a href="https://reactjs.org/docs/reconciliation.html">algorithm</a> (A tree of elements hierarchy is created, it is then calculated as to what is the fastest way to change the tree in order to get desired results). The basic idea behind V-DOM is that the changes are made in virtual DOM with pure javascript as compared to live DOM. Only the minimal changes that are needed to be made to page happen. So both the data bindings and changes to page content is minimalistic.</p>
</li>
<li>
<p>Easy to Build<br>
As mentioned in the first paragraph, developers are already familiar with Javascript so it is easy for them to get hands-on coding with ReactJS. This combined with the fact that the complete ReactJS framework is built on components thus making it easier to do A/B testing. For example, we can have an A/B test that compares 9 different design variations in the UI, which could mean maintaining code for 10 views for the duration of the test. This modular aspect makes it easy to test and reuse the same components in multiple places across devices.</p>
</li>
<li>
<p>Security<br>
With technologies coming and going so haphazardly, the need for a stable technology is what organizations are looking for. And, ReactJS is just that, since it is backed by big names like Facebook, Instagram and millions of developers globally. Even, with peer competition increasing, ReactJS has been able to sustain its popularity level and in fact, has been soaring high still. Hence, developers find security and stability in opting for React.</p>
</li>
<li>
<p>Great Runtime Performance<br>
To build the best visually-rich user experience for the webapp, efficient UI rendering is critical. While there are fewer hardware constraints on desktops/laptops (compared to other devices), expensive operations can still compromise UI responsiveness. In particular, DOM manipulations that result in reflows and repaints are especially detrimental to user experience. ReactJS comes with great runtime experience for the user.</p>
</li>
<li>
<p>Isomorphic Javascript<br>
React enables developers to build JavaScript UI code that can be executed in both server (e.g. Node.js) and client contexts. React allows the basic back-end to load whereas the client context can be loaded over time without the live DOM, thus reducing the loading time by a huge margin. Furthermore, the UI code written using the React library that is responsible for generating the markup could be shared with the client to handle cases where re-rendering was necessary.</p>
</li>
</ol>
<h2 id="creating-a-graphql-backend-in-nodejs-and-express.">Creating a GraphQL backend in nodejs and express.</h2>
<p>We will first create a node directory that contains our backend. We will initialize using the command <code>$ npm init</code> in our terminal and initialize the npm repository. Furthermore create a new server.js file in the project directory. That will be the file where the code required to implement the Node.js GraphQL server will be inserted in the next section:</p>
<p><code>$ touch server.js</code></p>
<p>Finally make sure that NPM packages <em>graphql</em>, <em>express</em> and <em>express-graphql</em> are added to the project:</p>
<p><code>$ npm install graphql express express-graphql --save</code></p>
<p>Having installed these packages successfully we’re now ready to implement a first GraphQL server.</p>
<p>Then we will create our server.js file and copy the following code.</p>
<pre><code>var express = require('express');
var express_graphql = require('express-graphql');
var {buildSchema} = require('graphql');
// we require all dependencies
// GraphQL Schema
// We are passing the GraphQL Interface Definition Language which is used to define the schema
// It defines how the schema of our object is going to look like.
var schema = buildSchema(`
type Query {
message: String
}
`);
// Root resolver
// Root resolver has mapping to actions to functions. This is also called as handler functions.
var root = {
message: () => 'Hello Wold!'
};
// Create an expres server and a GraphQL endpoint, notice that there is only one end point as we stated before
var app = express();
app.use('/graphql', express_graphql({
schema: schema,
rootValue: root,
graphiql: true
}));
app.listen(4000, () => console.log('Express GraphQL Server Now Running On localhost:4000/graphql'));
</code></pre>
<p>The code has been heavily commented so that you can easily understand what each and every line means. There are two main components here to focus on</p>
<ul>
<li>GraphQL Schema</li>
<li>Root Resolver</li>
</ul>
<p><strong>GraphQL schema</strong><br>
It is used to describe the complete APIs type system. It includes the complete set of data and defines how a client can access that data. Each time the client makes an API call, the call is validated against the schema. Only if the validation is successful the action is executed. Otherwise an error is returned.</p>
<p><strong>Root Resolver</strong><br>
Resolver contains the mapping of actions to functions. In our example from above the root resolver contains only one action: message. To keep things easy the assigned functions just returns the string <em>Hello World!</em>. Later on you’ll learn how to include multiple actions and assign different resolver functions.</p>
<p>At the end of code we create and express end-point where these queries can be consumed.</p>
<p>Next we will move on to our actual code and a more sophisticated example. You can create a new file and and copy paste the following code in it.</p>
<pre><code>var express = require('express');
var express_graphql = require('express-graphql');
var {buildSchema} = require('graphql');
// GraphQL Schema
var schema = buildSchema(`
type Query {
course(id: Int!): Course
courses(topic: String): [Course]
}
type Mutation {
updateCourseTopic(id: Int!, topic: String!): Course
}
type Course {
id: Int
title: String
author: String
description: String
topic: String
url: String
}
`);
var coursesData = [
{
id: 1,
title: 'The Complete Node.js Developer Course',
author: 'Andrew Mead, Rob Percival',
description: 'Learn Node.js by building real-world applications with Node, Express, MongoDB, Mocha, and more!',
topic: 'Node.js',
url: 'https://codingthesmartway.com/courses/nodejs/'
},
{
id: 2,
title: 'Node.js, Express & MongoDB Dev to Deployment',
author: 'Brad Traversy',
description: 'Learn by example building & deploying real-world Node.js applications from absolute scratch',
topic: 'Node.js',
url: 'https://codingthesmartway.com/courses/nodejs-express-mongodb/'
},
{
id: 3,
title: 'JavaScript: Understanding The Weird Parts',
author: 'Anthony Alicea',
description: 'An advanced JavaScript course for everyone! Scope, closures, prototypes, this, build your own framework, and more.',
topic: 'JavaScript',
url: 'https://codingthesmartway.com/courses/understand-javascript/'
}
]
var getCourse = function(args) {
var id = args.id;
return coursesData.filter(course => {
return course.id == id;
})[0];
}
var getCourses = function(args) {
if (args.topic) {
var topic = args.topic;
return coursesData.filter(course => course.topic === topic);
} else {
return coursesData;
}
}
var updateCourseTopic = function({id, topic}) {
coursesData.map(course => {
if (course.id === id) {
course.topic = topic;
return course;
}
});
return coursesData.filter(course => course.id === id)[0];
}
// Root resolver
var root = {
course: getCourse,
courses: getCourses,
updateCourseTopic: updateCourseTopic
};
// Create an expres server and a GraphQL endpoint
var app = express();
app.use('/graphql', express_graphql({
schema: schema,
rootValue: root,
graphiql: true
}));
app.listen(4000, () => console.log('Express GraphQL Server Now Running On localhost:4000/graphql'));
</code></pre>
<p>We write GraphQL query to fetch us the required results. You can explore this using the <code>http://localhost:4000/graphql</code> server. This code helps you to get a course, get courses and update a course Topic.</p>
<h2 id="connecting-apollo-client-to-a-react-application">Connecting Apollo Client to a react application</h2>
<p>We use the create-react-app to get us started with our project.</p>
<pre><code>$ npx create-react-app react-graphql-frontend
$ cd react-graphql
$ npm start
</code></pre>
<p>The following packages needs to be installed:</p>
<ul>
<li><em>apollo-boost</em>: Package containing everything you need to set up Apollo Client</li>
<li><em>react-apollo</em>: View layer integration for React</li>
<li><em>graphql-tag</em>: Necessary for parsing your GraphQL queries</li>
<li><em>graphql</em>: Also parses your GraphQL queries</li>
</ul>
<p>The installation of these dependencies can be done by using the following NPM command:</p>
<p><code>$ npm install apollo-boost react-apollo graphql-tag graphql</code></p>
<p>The main entry point of the React application can be found in <em>index.js</em>. The code contained in this file is making sure that <em>App</em> component is rendered out to the DOM element with ID root.Here is how the file should look.</p>
<h3 id="index.js">index.js</h3>
<pre><code>import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));
</code></pre>
<h3 id="app.js">App.js</h3>
<p>The main logic of our code is present in App.js. We need to do the following tasks.</p>
<ul>
<li>Creating An Instance Of ApolloClient</li>
<li>Connecting ApolloClient To Your React App</li>
</ul>
<p><strong>Creating An Instance of ApolloClient</strong><br>
First <em>ApolloClient</em> is imported from the <em>apollo-boost</em> library. A new instance of <em>ApolloClient</em> is created and stored in <em>client</em>. To create a new instance of <em>ApolloClient</em> you need to pass a configuration object to the constructor. This object must contain the <em>uri</em> property. The value of this property must be replaced which the URI of the GraphQL endpoint which should be accessed.</p>
<pre><code>import ApolloClient from "apollo-boost";
const client = new ApolloClient({
uri: "[Insert URI of GraphQL endpoint]"
});
</code></pre>
<p><strong>Connecting ApolloClient To your react App</strong><br>
Having established a connection to the GraphQL endpoint by using <em>ApolloClient</em> we now need to connect the instance of <em>ApolloClient</em> to the React app. To do so, please make sure to add the following lines of code in <em>App.js</em>:</p>
<pre><code>import { ApolloProvider } from "react-apollo";...const App = () => (
<ApolloProvider client={client}>
<div className="container">
<nav className="navbar navbar-dark bg-primary">
<a className="navbar-brand" href="#">React and GraphQL - Sample Application</a>
</nav>
<div>
<Courses />
</div>
</div>
</ApolloProvider>
);
</code></pre>
<p>Fist <em>ApolloProvide</em> is imported from the <em>react-apollo</em> library. The <code><ApolloProvider></code> element is then used in the component’s JSX code and is containing the template code which is used to render the component. This is what the final version of App.js would look like.</p>
<p>App.js</p>
<pre><code>import React, { Component } from 'react';
import './App.css';
import Courses from './Courses';
import ApolloClient from "apollo-boost";
import { ApolloProvider } from "react-apollo";
const client = new ApolloClient({
uri: "http://localhost:4000/graphql"
});
const App = () => (
<ApolloProvider client={client}>
<div className="container">
<nav className="navbar navbar-dark bg-primary">
<a className="navbar-brand" href="#">React and GraphQL - Sample Application</a>
</nav>
<div>
<Courses />
</div>
</div>
</ApolloProvider>
);
export default App;
</code></pre>
<h3 id="course.js">Course.js</h3>
<p>So far the output of courses is done within the <em>Courses</em> component. In the next step we’re going to introduce a new component to our project: <em>Course</em>. This component should then contain the code which is needed to output a single course. Once this component is available in can be used in <em>Courses</em> component.</p>
<p>First let’s add a new file <em>Course.js</em> to the project and insert the following lines of code:.</p>
<pre><code>import React from 'react';
const Course = (props) => (
<div className="card" style={{'width': '100%', 'marginTop': '10px'}}>
<div className="card-body">
<h5 className="card-title">{props.course.title}</h5>
<h6 className="card-subtitle mb-2 text-muted">by {props.course.author}</h6>
<p className="card-text">{props.course.description}</p>
<a href={props.course.url} className="card-link">Go to course ...</a>
</div>
</div>
);
export default Course;
</code></pre>
<p>The implementation of this component is quite simple. The current course is handed over to <em>Course</em> component as a property and is available via <em>props.course</em>.</p>
<h3 id="courses.js">courses.js</h3>
<p>Next we create a new courses component and copy paste the following in it.<br>
courses.js</p>
<pre><code>import React from 'react';
import { Query } from "react-apollo";
import Course from './Course';
import gql from "graphql-tag";
// The Query component makes it extremely easy to embed the GraphQL query directly in the JSX code of the component.
// Furthermore the Query component contains a callback method which is invoked once the GraphQL query is executed.
const Courses = () => (
<Query
query={gql`
{
allCourses {
id
title
author
description
topic
url
}
}
`}
>
{({ loading, error, data }) => {
if (loading) return <p>Loading...</p>;
if (error) return <p>Error :(</p>;
return data.allCourses.map((currentCourse) => (
<Course course={currentCourse} />
));
}}
</Query>
);
export default Courses;
</code></pre>
<p>This is the implementation of the Courses component. To retrieve data from the GraphQL endpoint this component makes use of another component from the React Apollo library: <em>Query</em>. The <em>Query</em> component makes it extremely easy to embed the GraphQL query directly in the JSX code of the component. Furthermore the <em>Query</em> component contains a callback method which is invoked once the GraphQL query is executed.</p>
<p>Here we’re using the JavaScript map method to generate the HTML output for every single course record which is available in <em>data.allCourse</em>.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Hey! All this is cool but how does one decide which tech stack to use. The question has been answered several times and by several ingenious folks and there is no correct answer. It truly depends on use-case, complexity and scalability requirements for the application. Often at time you would have to evolve and change multiple things for your application. It is important to note that these stacks work perfectly well in tandem with each other. So, you can very well have Rails backend serving you a GraphQL along with React front-end. We know Rails is very good at handling back-end logic and we also know the React’s ability to handle front-end which gives us an amazing combination.</p>
Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-77491137154559291892020-05-21T04:33:00.001-07:002020-05-21T04:33:24.880-07:00Your First SPA in ReactJS, NodeJS<h1 id="your-first-spa-in-reactjs-nodejs">Your First SPA in ReactJs, NodeJS</h1>
<p>Today we are going to build a simple blog application that will help you get started with ReactJS with back-end built over NodeJS The complete tutorial has been split into SIX IMPORTANT steps.</p>
<ol>
<li>
<p>Installing the required tools</p>
</li>
<li>
<p>Understanding NodeJS structure (Back-end of your application)</p>
</li>
<li>
<p>Coding Your APIs</p>
</li>
<li>
<p>Understanding ReactJS structure (Front-end of your application)</p>
</li>
<li>
<p>Designing and Coding your Front-end</p>
</li>
<li>
<p>Grab a good drink and pat yourself on the back for doing an excellent job.</p>
</li>
</ol>
<h2 id="installing-the-required-tools">Installing the required tools</h2>
<p><img src="https://lh3.googleusercontent.com/ms8rpAlP2RFG8MV-2Vo2XVxCPU_bxCdQCXXP63Da8c4LEdmSixPp_zZj4NfZQKYQAl9HbGA40Hv0oIF7xl_VkT5SV2TiAgfYFmBOlsMmLBMBNF4Ea6BT0cUqiODTPJHY8aVeCoyY" alt=""><br>
Let’s get our tools installed and start the fire going to get us started with building our Blog Application. We will use ReactJS, NodeJS, Express and MongoDB.</p>
<ul>
<li>
<p>Node.js: Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js brings JavaScript to the server</p>
</li>
<li>
<p>MongoDB: A document-based open source database</p>
</li>
<li>
<p>Express: A Fast, unopinionated, minimalist web framework for Node.js</p>
</li>
<li>
<p>React: A JavaScript front-end library for building user interfaces</p>
</li>
</ul>
<p>Let’s install them on a Debian based system. You can ignore this section if you already have them installed. Fire up the terminal by hitting the keys Cltr+Altr+T and do the following.</p>
<p>Installing NodeJs and NPM</p>
<pre><code>$ wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.gz
# tar -xf node-v6.9.2-linux-x64.tar.gz --directory /usr/local --strip-components 1
</code></pre>
<p>Next, we will install express, react, cors and mongoose.</p>
<pre><code>
$ npm install express body-parser cors mongoose react nodemon
</code></pre>
<p>A long-form version of the same is to use npm install express/react --save but the shorthand version comes in handy very often.</p>
<p>Now, we install MongoDB. You can also cloud solution called as <a href="http://mlab.com">mlab.com</a> but for this tutorial, we will use the one on your system instead.</p>
<pre><code>
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
$ sudo bash -c 'echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" > /etc/apt/sources.list.d/mongodb-org-4.0.list'
$ sudo apt-get update
$ sudo apt-get install -y mongodb-org
</code></pre>
<p>If you have some issues with mongodb installation<a href="https://www.howtoforge.com/tutorial/install-mongodb-on-ubuntu-16.04/">,check this out</a>. It has very succinct guide on how to setup your MongoDB environment.</p>
<h2 id="understanding-nodejs-structure-back-end-of-your-application">Understanding NodeJS structure (Back-end of your application)</h2>
<p>In this section we will deal with only two files. One that defines our model and other that helps us with setting up our HTTP API endpoints.</p>
<ul>
<li>models/modelname.js<br>
This would have the schema of the database. In our case we are going using mongoose database adapter to connect with our MongoDB</li>
<li>/server.js<br>
This would alllow back-end to function.</li>
</ul>
<p>The back-end will comprise HTTP endpoints to cover the following use cases:</p>
<ul>
<li>
<p>Retrieve the complete list of available blog articles by sending an HTTP GET request</p>
</li>
<li>
<p>Retrieve a specific blog article by sending HTTP GET request and provide the specific blogID in addition</p>
</li>
<li>
<p>Create a new blog article in the database by sending an HTTP POST request</p>
</li>
<li>
<p>Update an article in the database by sending an HTTP POST request</p>
</li>
</ul>
<p>Let’s understand how NodeJS along with express communicates to the database (mongoose). We will setup the app.js in our project directory and copy-paste the following code. The code is commented on various sections to help you understand with each and every line of it. Make sure you have setup MongoDB database correctly while implementing this code. You would need to change database URL in order to make this function correctly.</p>
<pre><code>const express = require('express');
// using express library
const app = express();
// this creates an instance of express module, enabling the feature
// module.exports.
const bodyParser = require('body-parser');
// this enables us to parse JSON
const cors = require('cors');
//Cross Origin Resource Sharing, it allows/denies/sets rules for cross domain requests in the application.
const mongoose = require('mongoose');
// MongoDB adapter for NodeJS
const PORT = 4000;
// Where the application would run on Mongoose.
app.use(cors());
app.use(bodyParser.json());
mongoose.connect('mongodb://127.0.0.1:27017/', { useNewUrlParser: true });
// you need to specify database URL. Make sure this is correctly set up with
// database you are using.
const connection = mongoose.connection;connection.once('open', function() {
console.log("MongoDB database connection established successfully");
})
app.listen(PORT, function() {
console.log("Server is running on Port: " + PORT);
});
</code></pre>
<p>Next we will run nodemon server inside the directory to make sure if the code is functional. The express server would be live on <a href="http://localhost:4000">http://localhost:4000</a>.</p>
<h2 id="coding-our-apis">Coding our APIs</h2>
<p><strong><img src="https://lh3.googleusercontent.com/y6k3ElVdVfVMErWtmFeUZw2sbcC-P5rIi9YpL26uJ__CQQcO_AMFU2Rafz2NX2-HLUmo2iy-6vpo1sVhZ91RAz79JAgGKKUPs4q0ctn7fPvJy7Et_TjN_pandUGpcGIkk8owjCho" alt=""></strong><br>
As we have already mentioned before the APIs that we are going to use. Now let us build the API logic around our application. This would allow the API call made to make changes to our database.</p>
<p>Our database would only have a single doucment that will allow us to store the blog article. We would need to create the Mongoose Schema for that document.</p>
<p class="file-desc"><span>models/article.js</span></p>
<pre><code>const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let Article = new Schema({
content: {
type: String
},
author: {
type: String
}
});
module.exports = mongoose.model('Article', Article);
</code></pre>
<p>Next we will make endpoints in order to update the document in the schema. In order to do so we <em><strong>need a express router</strong></em>. The router will be added as a middleware and will take control of request starting with path /articles:</p>
<pre><code>const articleRoutes = express.Router();
</code></pre>
<p><strong>Now we will make an end-point that delivers us all the articles from our database.</strong></p>
<pre><code>articleRoutes.route('/articles').get(function(req, res) {
Article.find(function(err, articles) {
if (err) {
console.log(err);
}
else
{
res.json(articles);
}
});
});
</code></pre>
<p>The function which is passed into the call of the method <em>get</em> is used to handle incoming HTTP GET request on the <em>/articles/</em> URL path. In this case we’re calling Article.find to retrieve a list of all articles from the MongoDB database. Again the call of the find methods takes one argument: a callback function which is executed once the result is available. Here we’re making sure that the results (available in todos) are added in JSON format to the response body by calling <code>res.json(articles)</code>.</p>
<p><strong>Now we will create an API which will allow us to get a specific article based on id passed on to it</strong>.<br>
The url would look something like this /article/:id_. Here :id the path extension is used to retrieve a article item from our database. The implementation logic is straight forward:</p>
<pre><code>articleRoutes.route('/article/:id').get(function(req, res) {
let id = req.params.id;
Article.findById(id, function(err, art) {
res.json(art);
});
});
</code></pre>
<p><strong>Next, let’s add the route which is needed to be able to add new articles by sending a HTTP post request (/article/new):</strong></p>
<pre><code>articleRoutes.route('/article/new').post(function(req, res) {
let art = new Article(req.body);
art.save()
.then(art => {
res.status(200).json({'art': 'article created successfully'});
})
.catch(err => {
res.status(400).send('creating a new article failed');
});
});
</code></pre>
<p>The new article is part the the HTTP POST request body, so that we’re able to access it via <em>req.body</em> and therewith create a new instance of <em>Article</em> in our Mongoose Database. This new item is then saved to the database by calling the <em>save</em> method.</p>
<p><strong>Now we come to our final API which would allow us to update the blog article.</strong></p>
<pre><code>articleRoutes.route('/article/update/:id').post(function(req, res) {
Article.findById(req.params.id, function(err, art) {
if (!art)
res.status(404).send("data is not found");
else
art.content = req.body.content;
art.author = req.body.author;
art.save().then(todo => {
res.json('Article updated!');
})
.catch(err => {
res.status(400).send("Update not possible");
});
});
});
</code></pre>
<p>Here is the complete <a href="https://gist.github.com/vaibhavgeek/a2fd9535c3a4f98bf07a4dc4a8e1f3fb#file-server-js">source code for the nodejs backend file server.js</a> and you can also check out the <a href="https://gist.github.com/vaibhavgeek/a2fd9535c3a4f98bf07a4dc4a8e1f3fb#file-article-model">mongoose schema mentioned above over here</a>.</p>
<h2 id="understanding-reactjs-structure">Understanding ReactJS structure</h2>
<p>Before we start exploring the structure let’s setup our application by creating the react app. You can do this in multiple ways but I suggest you use the trustworthy module ‘create-react-app’. It will help you get up running quickly.</p>
<pre><code>$ npm i -g create-react-app
$ create-react-app blog_spa
$ cd blog_spa
</code></pre>
<p>We would also setup react-router-dom. This would allow us to change the URL without sending a request to the server. Axios would allow us to send and recieve HTTP requests.</p>
<pre><code>$ npm i react-router-dom axios --save
</code></pre>
<p>There are two main folders that we are largely going to interact with while our development of reactjs SPA.</p>
<ul>
<li>src</li>
<li>public</li>
</ul>
<p>Now we will delete everything that’s present in src and pulic folder. You can do it from GUI or from terminal, it doesn’t make a whole lot of difference.</p>
<p>Now we will create the main page which will work as the skeleton of your application. [aka MasterPage if you are migrating from <a href="http://ASP.NET">ASP.NET</a>] React allows us to choose which components to show and which to hide on the basis of url. This is done with the help of <code>HashRouter , NavLink and Route</code> from <code>react-router-dom</code> library. We also import the content pages from different components that we want.</p>
<p class="file-desc"><span>src/main.js</span></p>
<pre><code>import React, { Component } from "react";
import {
Route,
NavLink,
HashRouter
} from "react-router-dom";
import allPosts from "./allPosts";
import newArticle from "./newArticle";
import article from "./article";
class Main extends Component {
render() {
return (
<HashRouter>
<div>
<h1>Blog SPA</h1>
<ul className="header">
<li><NavLink to="/">All Articles</NavLink></li>
<li><NavLink to="/new">New Article</NavLink></li>
</ul>
<div className="content">
<Route exact path="/" component={allPosts}/>
<Route path="/new" component={newArticle}/>
<Route path="/article/:id" component={article}/>
/* the last route is added so that we can display indivdual article on load. We are not consuming any api over here */
</div>
</div>
</HashRouter>
);
}
}
export default Main;
</code></pre>
<p class="file-desc"><span>src/index.js</span></p>
<p>We need to load the main file on every page of our application, so we add this basic code.</p>
<pre><code>import React from "react";
import ReactDOM from "react-dom";
import Main from "./main";
ReactDOM.render(
<Main/>,
document.getElementById("root")
);
</code></pre>
<h2 id="coding-our-front-end">Coding our Front-End</h2>
<p><strong><img src="https://lh4.googleusercontent.com/-YsQeg1SkgT76cgygxcXac9gaZugFx0nEq-9_FcWnMwgeiW0qHWV2cAtocELVIrh-aPPhZJJa_JEkdf5mDx4smxeJ2Cg2HxRXRqvNCsF5ovGcow5csZOO8qrDRKrVbESLUFWQ1r4" alt=""></strong><br>
Now we come towards the final stage of our tutorial. We need create three pages that will allow us to connect with our node.js backend application. We will use axios, so that will allow us to communicate with our backend APIs. Notice how we pass variables across the render section and our function <code>componentDidMount()</code>. We are using a GET request to retrieve all the articles from our back-end.</p>
<p class="file-desc"><span>src/allPosts.js</span></p>
<pre><code>import React, { Component } from "react";
import {
Route,
NavLink,
HashRouter
} from "react-router-dom";import axios from 'axios';
class allPosts extends Component {
state = {
articles: []
}
componentDidMount() {
axios.get(`http://localhost:4000/articles`)
.then(res => {
const a = res.data;
console.log(a);
this.setState({ articles: a });
})
}
render() {
return (
<HashRouter>
<div>
{this.state.articles.map(art => <div> <h2> <NavLink to={`article/${art._id}`}>Blog Post by {art.author}</NavLink> </h2> {art.content}</div>)}
<div className="content">
</div>
</div>
</HashRouter>
);
}
}
export default allPosts;
</code></pre>
<p class="file-desc"><span>src/newArticle.js</span></p>
<p>Now we need to send a post-request which will allow creating of a new article. To make it easier, we are passing the author as string instead of user input.</p>
<pre><code>import React, { Component } from "react";
import axios from 'axios';
class newArticle extends Component {
state = {
content: '',
}
handleChange = event => {
// console.log(event.target.value)
this.setState({ content: event.target.value });
}
handleSubmit = event => {
event.preventDefault();
const article = {
content: this.state.content,
author: 'vaibhavgeek'
};
axios.post(`http://localhost:4000/article/new`, article )
.then(res => {
//console.log(res);
console.log(res.data);
console.log(event);
this.setState({ content: "" });
})
}
render() {
return (
<div>
<h2>Create New Article</h2>
<form onSubmit={this.handleSubmit}>
<textarea placeholder="create article" name="content" value={this.state.content} onChange={this.handleChange}>
</textarea>
<button type="submit">create</button>
</form>
</div>
);
}
}
export default newArticle;
</code></pre>
<p class="file-desc"><span>src/article.js</span></p>
Now I would like the fact, that once I click on certain article, I am redirected to a page that contains only that specific article. This file allows us to do exactly that. We are making a call to our back-end API to get specific file.
<pre><code>import React, { Component } from "react";
import {
Route,
NavLink,
HashRouter
} from "react-router-dom";
import axios from 'axios';
class article extends Component {
state = {
article: String,
author: String,
id: String
}
componentDidMount() {
const { id } = this.props.match.params
axios.get(`http://localhost:4000/article/${id}`)
.then(res => {
const a = res.data;
console.log(a);
this.setState({ article: a.content , author: a.author , id: a.id });
})
}
render() {
return (
<div>
{ this.state.article }
</div>
);
}
}
export default article;
</code></pre>
<p>We are done with our application. You can go to terminal to power them up and chec it out. It would look something like this.<br>
<strong><img src="https://lh4.googleusercontent.com/JcHvEADRIK2Er9o13kH4_Rv641ZvbOI9sjdeNYb7DU-14Y66s4-OvOHCsGW67mFJDxsuv7uWR1y3gFGzNTJ7IELHOPSpucNH3YHh-XZRTXuRkpZA1GeKhQPCZAk3obzo31IRc97_" alt=""></strong><br>
<strong><img src="https://lh6.googleusercontent.com/30rmNUxOV-b9pVX3uwib0JC47mrc5CPb5PUyjNobYrsfb2U9tk1gdv9OV6CoFrEgG3CWl-KBOCxPYgf3FUSst8CMm62AFnJIzyXdKowOqzg4jdlmGnmoeGHWJdSmdF7Z1cDP8dwd" alt=""></strong></p>
Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-26202609048863245182020-04-28T04:26:00.004-07:002020-04-28T04:26:59.286-07:00EduBhogi Video Demo <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/n9fcNExUPW0/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/n9fcNExUPW0?feature=player_embedded" width="320"></iframe></div>
<br /></div>
Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-73495953526124521832020-04-24T00:41:00.034-07:002023-09-15T05:48:48.392-07:00Stolen"Three minutes to the train," thought Rakesh. It had been a tiring day for him. His job at the dockyard, which was initially hard on him, had gotten easier with time. Earlier, it was a strange caricature of decay and resurrection, but after his first salary was credited a few days ago, the same structure turned into the sweaty smell of hope. Somehow, he had found a home in the blood-metal sound of machines and the ocean's blue water and skies. He did not particularly enjoy coming to the railway station, though. The railway station always made him envious of the lives other people had—families saying affectionate goodbyes, girlfriends holding hands with their boyfriends, and a group of young men cackling with laughter and merriment. It was this envy that made him buy an expensive new smartphone with his first salary. He wanted to feel more confident among the crowd around him. He had already imagined himself standing beside the pole of the Mumbai local train, earphones in his ears, and the wind blowing through his hair. The fact that he owned such an expensive piece of technology made him beam with happiness and joy. He had touched his front pocket jeans countless times, partly because he wanted to be sure that he had one and partly just to enjoy its feel in his pocket. <div><br /></div><div>"Pooooo..." whistled the train. Rakesh looked up toward the arriving train. Finally, he was going home. He raised his suitcase over his head so that he could fight his way into the general coach of the train. It's amazing to see how quickly people coalesce to get into the general coach of the train. Rakesh nudged around with his elbows as he tried to get on board. In the midst of elbow-kicking and chest foreplay, he saw the familiar face of Mr. Patloo. Mr. Patloo was a 40-year-old man with five strands of hair on his head. He wore a colorful T-shirt and tight-fitted jeans. You did not have to look closely to understand that he was a textbook example of midlife crisis. Oblivious to his bizarre sense of fashion, Mr. Patloo greeted Rakesh with a wide, affectionate smile as both of them fought their way through the crowd. Somehow, they were lucky enough to be inside the train. The general coach of the bogie is a different type of caricature in itself. As you pass, you can smell the different body odors mixed on the bogie.</div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0tag:blogger.com,1999:blog-8361773598150414618.post-31037337095763786322020-04-09T06:04:00.004-07:002021-03-19T23:35:12.324-07:00Dynamic Programming <div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
In this blog post we will discuss various dynamic programming questions. The idea is to have a same template to understand all the dynamic programming problems. All the problems that we discuss will be divided into four parts:-</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li>What is the question? (<i>read * 2 times</i>) </li>
<li>Why this problem can be solved with the help of Dynamic Programming? (<i>read once</i>)</li>
<li>What does dp[i][j] or dp[i] mean with respect to the question? (<i>read once</i>)</li>
<li>What is the solution if the assumed dp array is to be constructed? (<i>read once</i>)</li>
<li>How the dp[i] or dp[i][j] will be formulated? Along with the help of an example. (<i>read twice</i>)</li>
<li>Variations to the questions </li>
</ul>
<div>
Once these algorithms are done, we will observe that even the new problems can be solved with the help of this template. I have used same terminology to make the questions easier. </div>
<h3 id="longest-common-subsequnce">
1. Longest Common Subsequnce</h3>
<b><u>QUESTION</u></b> : Given two sequences, find the length of longest subsequence present in both of them. In the code given below we assume X,Y to be strings.<br />
<br />
<u style="font-weight: bold;">WHY DP:</u> Notice that given problem can be broken down as smaller chunk problem. Let us just take the first character of both the strings and compare them. Then we take the next character of string 1 and compare it with string 2 and so on.<br />
<br />
<u style="font-weight: bold;">DP[i][j]: </u><br />
for the string s1[0..i] and string s2[0..j] what is the length of longest common subsequence with those specific substrings. Example let string 1 be "abcdefg" anf string 2 be "abcdgk"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1WxxIiuLb6gv0_HgTSPWz7IJoyXhua2Dq-i5rQtVwzzenQq-RAkaUkfq3iLuGa5FcmQnrX3QK8akk_P60-ktsc-QrhyyjATmiOtKd4a0IWMjG6c5kIhG5f900NjSZiBRFJqTLdfuPP2Lu/s1600/2016-01-04-longest-common-subsequence2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="241" data-original-width="413" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1WxxIiuLb6gv0_HgTSPWz7IJoyXhua2Dq-i5rQtVwzzenQq-RAkaUkfq3iLuGa5FcmQnrX3QK8akk_P60-ktsc-QrhyyjATmiOtKd4a0IWMjG6c5kIhG5f900NjSZiBRFJqTLdfuPP2Lu/s320/2016-01-04-longest-common-subsequence2.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<u style="font-weight: bold;">SOLUTION: </u> dp[n][m] (initialized as dp[n+1][m+1]<br />
<br />
<b><u>CODE:</u></b><br />
<a href="https://github.com/vaibhavgeek/tompetitive/blob/master/dynamicProgramming/lcs.cpp">https://github.com/vaibhavgeek/tompetitive/blob/master/dynamicProgramming/lcs.cpp</a><br />
<br />
<br />
<pre><code> if (i == <span class="hljs-number">0</span> || j == <span class="hljs-number">0</span>)
dp<span class="hljs-string">[i]</span><span class="hljs-string">[j]</span> = <span class="hljs-number">0</span>;
else if (X<span class="hljs-string">[i - 1]</span> == Y<span class="hljs-string">[j - 1]</span>)
dp<span class="hljs-string">[i]</span><span class="hljs-string">[j]</span> = dp<span class="hljs-string">[i - 1]</span><span class="hljs-string">[j - 1]</span> + <span class="hljs-number">1</span>;
else
dp<span class="hljs-string">[i]</span><span class="hljs-string">[j]</span> = max(dp<span class="hljs-string">[i - 1]</span><span class="hljs-string">[j]</span>, dp<span class="hljs-string">[i]</span><span class="hljs-string">[j - 1]</span>);</code></pre>
<h3 id="maximum-sum-subarray">
</h3>
<div style="text-align: left;">
<u>Variations:-</u><span style="font-weight: normal;"> </span></div>
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li><span style="font-weight: normal;">Printing Longest Common Subsequence</span></li>
<li><span style="font-weight: 400;">Longest Common Subsequence with at most k changes allowed</span></li>
</ul>
<br />
<h3>
2. Maximum Sum Subarray </h3></div>
Tha maximum sum subarray is the task of finding the largest possible sum of a contagious subarray, within a given one-dimensional array A[1..n]. (No length specified)<br />
<pre><code> dp<span class="hljs-string">[i]</span> = max(dp<span class="hljs-string">[i-1]</span> + a<span class="hljs-string">[i]</span> , a<span class="hljs-string">[i]</span>)
</code></pre>
The maximum subarray problem is the task of finding the largest possible sum of a contiguous subarray, within a given one-dimensional array A[1…n] of numbers with k length.<br />
<pre><code> dp<span class="hljs-string">[i]</span> = dp<span class="hljs-string">[i-1]</span> + a<span class="hljs-string">[i]</span> - a<span class="hljs-string">[i-k-1]</span>
</code></pre>
<h3 id="longest-increasing-subsequence">
</h3>
<h3 id="longest-increasing-subsequence">
3. Longest Increasing Subsequence</h3>
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order.<br />
<br />
<h3 id="coinchange-problem">
</h3>
<br />
<pre style="-webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;"><code> if(arr<span class="hljs-string">[j]</span> < arr<span class="hljs-string">[i]</span>)
dp<span class="hljs-string">[i]</span> = max(dp<span class="hljs-string">[i]</span>, dp<span class="hljs-string">[j]</span> + <span class="hljs-number">1</span>)
</code></pre>
<h3 id="dynamic-programming-notes-br-">
4. KnapSack Problem</h3>
<br />
Given weights and values of n items, put these items in a knapsack of
capacity W to get the maximum total value in the knapsack.
In other words, given two integer arrays val[0..n-1] and wt[0..n-1]
which represent values and weights associated with n items respectively.
Also given an integer W which represents knapsack capacity, find out the
maximum value subset of val[] such that sum of the weights of this
subset is smaller than or equal to W. You cannot break an item,
either pick the complete item, or don’t pick it (0-1 property)<br />
In this problem we define dp[i][j] as i value and for j knapsack capacity. That is for j capacity how much maximum value it can store. <br />
<pre><code>if( j < wt<span class="hljs-comment">[i]</span>)
dp<span class="hljs-comment">[i]</span><span class="hljs-comment">[j]</span> = dp<span class="hljs-comment">[i-1]</span><span class="hljs-comment">[j]</span>;
else
dp<span class="hljs-comment">[i]</span><span class="hljs-comment">[j]</span> = max(dp<span class="hljs-comment">[i-1]</span><span class="hljs-comment">[j - wt<span class="hljs-comment">[i]</span>]</span> + val<span class="hljs-comment">[i]</span> , dp<span class="hljs-comment">[i-1]</span><span class="hljs-comment">[j]</span>);
</code></pre>
<h3 id="longest-common-subsequnce">
</h3>
<h3 id="longest-common-subsequnce">
5. Coinchange Problem</h3>
Given a value N, if we want to make change for N cents, and we have infinite supply of each of S = { S1, S2, .. , Sm} valued coins, how many ways can we make the change? The order of coins doesn’t matter.<br />
<pre><code> if(j >= coin<span class="hljs-comment">[i]</span>)
{
dp<span class="hljs-comment">[i]</span><span class="hljs-comment">[j]</span> = min(1 + dp<span class="hljs-comment">[i]</span><span class="hljs-comment">[j-coin<span class="hljs-comment">[i]</span>]</span> , dp<span class="hljs-comment">[i-1]</span><span class="hljs-comment">[j]</span>);
}
else
{
dp<span class="hljs-comment">[i]</span><span class="hljs-comment">[j]</span> = dp<span class="hljs-comment">[i-1]</span><span class="hljs-comment">[j]</span>;
}</code></pre>
<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 id="longest-common-subsequnce">5. Wordbreak Problem</h3>
</div>
<pre><code> </code></pre>
</div>Vaibhav Maheshwarihttp://www.blogger.com/profile/11099612924006247687noreply@blogger.com0