Python & Virtual Environments

When starting a Python 3 project in Linux, it’s essential to follow best practices to ensure a clean and isolated development environment. One of the recommended approaches is to utilize virtual environments. Virtual environments allow you to create an isolated environment for each project, preventing conflicts between different packages and dependencies. In this guide, we’ll walk you through the steps to set up and activate a virtual environment for your Python 3 project....

2023-03-15

HelloWorld Solidity

This’s my Hello World on Solidity: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.6 < 0.9.0; contract TaskContract { uint nextId; struct Task { uint id; string name; string description; } Task[] tasks; function createTask (string memory _name, string memory _description) public { tasks.push(Task(nextId, _name, _description)); nextId++; } function findIndex(uint _id) internal view returns (uint) { for (uint i=0;i < tasks.length; i++){ if (tasks[i].id == _id){ return i; } } revert('Task not found'); } function readTask(uint _id) public view returns (uint, string memory, string memory) { // _id ---> variable local uint index = findIndex(_id); return (tasks[index]....

2022-01-14