Create an account


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 20,114
» Latest member: gfhfhfh
» Forum threads: 21,715
» Forum posts: 22,581

Full Statistics

Online Users
There are currently 503 online users.
» 0 Member(s) | 498 Guest(s)
Applebot, Baidu, Bing, Google, Yandex

 
  News - Michael Bay Accused Of Killing A Bird In Italy, Denies It
Posted by: xSicKxBot - 01-17-2023, 09:51 AM - Forum: Lounge - No Replies

Michael Bay Accused Of Killing A Bird In Italy, Denies It

Transformers director Michael Bay has been charged with killing a pigeon in Italy, but has denied the allegations.

According to a report from The Wrap, Bay is facing charges for killing a pigeon while filming his Netflix movie 6 Underground in Rome in 2018. The filmmaker has denied the allegations of killing the bird on the set of his movie and his legal team has made three attempts to clear the case with Italian authorities in the past year.

In a statement to The Wrap, Bay said, "I am a well-known animal lover and major animal activist. No animal involved in the production was injured or harmed. Or on any other production I've worked on in the past 30 years."

Continue Reading at GameSpot

https://www.gamespot.com/articles/michae...01-10abi2f

Print this item

  [Oracle Blog] GraalVM Enterprise 21.2—Productivity and Performance
Posted by: xSicKxBot - 01-16-2023, 01:46 PM - Forum: Java Language, JVM, and the JRE - No Replies

GraalVM Enterprise 21.2—Productivity and Performance

The latest GraalVM Enterprise 21.2 release delivers both new performance features, and improved developer experience—including enhancements to GraalVM Native Image to make it easier than ever to compile applications into native executables. Let’s take a look at some of the highlights of the GraalVM ...


https://blogs.oracle.com/java/post/graal...erformance

Print this item

  [Tut] How I Generate Invoices For My Clients Using Python
Posted by: xSicKxBot - 01-16-2023, 01:46 PM - Forum: Python - No Replies

How I Generate Invoices For My Clients Using Python

Rate this post


Project Description


Being self-employed personnel means I regularly need to generate Invoices for my clients to receive the payments. Now, this is a manual task that I have to perform using excel sheets and then convert them into PDFs. That is why I came up with a script that would automate the entire task for me.

Thus, in this mini project, I will demonstrate how I generate PDF invoices that I send to my clients using a simple Python script that uses the InvoiceGenerator API.

Step 1: Installing and Importing the InvoiceGenerator Library


InvoiceGenerator is a Python library that is specifically designed to generate simple invoices. Presently, it supports invoice generation in PDF and XML formats. The PDF invoice generation is based on ReportLab.

Installation

To install the InvoiceGenerator library, open your terminal and run the following command –

pip install InvoiceGenerator

In case you want to upgrade to a new version, then use the --upgrade flag.

pip install InvoiceGenerator – upgrade

Read more about this library and how to use the API here.

Once you have installed the library, go ahead and import it into your script. You also need to import the os module along with the necessary modules within the InvoiceGenerator library. Here’s a quick look at the necessary modules that we will need in our code –

import os
from InvoiceGenerator.api import Invoice, Item, Client, Provider, Creator
from InvoiceGenerator.pdf import SimpleInvoice
  • Import Invoice, Item, Client, Provider and Creator from InvoiceGenerator.API.
  • Also, import SimpleInvoice from InvoiceGenerator.PDF.
  • Finally, import os for performing OS-related activities.

Step 2: Create the Automated PDF Invoice


The next step is to create an automated PDF using the InvoiceGenerator API.

Code:

os.environ["INVOICE_LANG"] = "en"
client = Client('Finxter')
provider = Provider('Shubham Sayon Consultancy Services', bank_account='XXX-XXXX-XXXXX', bank_code='2021')
creator = Creator('Shubham Sayon')
invoice = Invoice(client, provider, creator)
number_of_items = int(input("Enter the number of Items: "))
for i in range(number_of_items): units = int(input(f"Enter the number of units for item no.{i+1}: ")) price_per_unit = int(input(f"Enter the price per unit of item no.{i+1}: ")) description = input("Enter the name of item/product: ") invoice.add_item(Item(units, price_per_unit, description=description)) invoice.currency = "$"
invoice.number = "10393069"
document = SimpleInvoice(invoice)
document.gen("invoice.pdf", generate_qr_code=True)

Explanation:

  • We will first set the document environment language. In my case, I have set it to “English”.
  • We then need to set the mandatory details like the client, provider and creator. The client details can be set using the Client object. Similarly, to set the provider, use the Provider object. I have set the provider name and the bank details within the Provider object.
  • Next, create the invoice object that will allow us to generate the numerous features within the bill.
  • I have then used an input() function to allow the user to enter the total number of items he/she wants to include in the bill.
  • Once the user enters the number of items, this can be used a range of create a for loop within which we can ask the user to enter further details like the number of units for each item, the price per unit of each item and the description of each item.
  • All these details can then be implemented within the invoice PDF using the item.add_item() method.
  • You can further specify
    • The currency of transaction using invoice.currency,
    • The invoice number using invoice.number
  • Finally, generate the invoice PDF with the help of the SimpleInvoice objects gen method. To generate a QR code within the PDF use the generate_qr_code object.

Putting it All Together


Let’s put it all together to visualize how the entire script works –

import os
from InvoiceGenerator.api import Invoice, Item, Client, Provider, Creator
from InvoiceGenerator.pdf import SimpleInvoice os.environ["INVOICE_LANG"] = "en"
client = Client('Finxter')
provider = Provider('Shubham Sayon Consultancy Services', bank_account='XXX-XXXX-XXXXX', bank_code='2021')
creator = Creator('Shubham Sayon')
invoice = Invoice(client, provider, creator)
number_of_items = int(input("Enter the number of Items: "))
for i in range(number_of_items): units = int(input(f"Enter the number of units for item no.{i+1}: ")) price_per_unit = int(input(f"Enter the price per unit of item no.{i+1}: ")) description = input("Enter the name of item/product: ") invoice.add_item(Item(units, price_per_unit, description=description)) invoice.currency = "$"
invoice.number = "10393069"
document = SimpleInvoice(invoice)
document.gen("invoice.pdf", generate_qr_code=True)

That’s it! As simple as that and when you execute the code it will generate the invoice PDF within your project folder conataining all the details mentioned by you.

Conclusion


Hurrah! We have successfully created an automation script that allows us to generate our customized PDF that also has a QR code embedded within it. Isn’t this extremely handy and useful!?

With that, we come to the end of this project.  I hope this project added some value and helped you in your coding quest. Stay tuned and subscribe for more interesting projects and tutorials.

Do you love automating tasks with Python? Well! I do. And if you are someone who likes automation, then here’s a list of a few mini projects that will get you going –





https://www.sickgaming.net/blog/2023/01/...ng-python/

Print this item

  (Indie Deal) FREE Alone on Mars & DBZ: KAKAROT Legendary Deal
Posted by: xSicKxBot - 01-16-2023, 01:45 PM - Forum: Deals or Specials - No Replies

FREE Alone on Mars & DBZ: KAKAROT Legendary Deal

Alone on Mars FREEbie
[freebies.indiegala.com]
https://www.youtube.com/watch?v=Bf85wwJuFBE
Plug In Digital Sale, up to 90% OFF
[www.indiegala.com]
Dear Villagers Sale, up to 85% OFF
[www.indiegala.com]
https://www.youtube.com/watch?v=HBKVO3gv4AU


https://steamcommunity.com/groups/indieg...2053400758

Print this item

  News - Get 10TB Of Cloud Storage For A Bargain Price
Posted by: xSicKxBot - 01-16-2023, 01:45 PM - Forum: Lounge - No Replies

Get 10TB Of Cloud Storage For A Bargain Price

Cloud storage lets you store and access your files on any device, which really does make it more desirable than local storage for some people. However, cloud storage can be pricey, especially if you go through the biggest names like Google or Microsoft. If you want to ditch the subscription plan storage options, you can get 10TB of Prism Drive cloud storage right now for only $89.

If 10TB sounds like way too much for you, you can get 5TB for $69 or 2TB for only $49.

Prism Drive works just like any other cloud storage solution. You’ll be able to upload any file from just about any device, then access or share them without any hassle. To keep your data safe, you can set up a password before sharing content with friends or family. And if you happen to accidentally delete something important, a 30-day trash history lets you easily restore the file.

Continue Reading at GameSpot

https://www.gamespot.com/articles/get-10...01-10abi2f

Print this item

  [Oracle Blog] Announcing Java Management Service
Posted by: xSicKxBot - 01-15-2023, 12:14 PM - Forum: Java Language, JVM, and the JRE - No Replies

Announcing Java Management Service

Today we are introducing a new Oracle Cloud Infrastructure (OCI) native service to help manage Java runtimes and applications on-premises or on any cloud. Java Management Service (JMS) is now generally available (GA).


https://blogs.oracle.com/java/post/annou...nt-service

Print this item

  [Tut] How I used Python to Automate my Daily Routine with Desktop Notifications
Posted by: xSicKxBot - 01-15-2023, 12:14 PM - Forum: Python - No Replies

How I used Python to Automate my Daily Routine with Desktop Notifications

Rate this post


Project Description


Today while working on my Python code, I suddenly realized that it’s been two hours since I have been trying to solve the bug. I was constantly looking at the screen for two hours without even realizing to take a break or drink a glass drink water. That is when I thought of creating a script that would automate my daily routine with desktop notifications. I thought of creating a script that will generate a notification after certain time intervals for the following:

  • Drink 1 glass of water ( notify after every 1 hr)
  • Take a break from work (after every 1 hr )
  • Restart work ( after 10 mins of 2nd notification)
  • Medicine Notification at 10 PM every day
  • Take backup and end work ( at 8 PM ) every day

Therefore, in this project, we will be learning how to automate the daily routine using desktop popup notifications. So, without further delay, let’s dive into the steps to complete our project.

Step 1: Install and Import the Necessary Libraries


The two important libraries we need in this project are win10toast and schedule. The win10toast module is used to create the desktop notifications. It notifies us when any event occurs. Since it is not a built-in Python library, therefore you need to install it using PIP. Open your terminal and type the following command –

pip install win10toast

Once you have installed the win10toast module, go ahead and install the schedule library as follows:

pip install schedule

Schedule Library helps us to schedule a task at a particular time every day or even on a particular day. It matches our system’s time to the scheduled time set and then calls the command function. You will also need the help of the time module while scheduling the tasks. So, make sure that you also import the time module in your script.

import win10toast
import schedule import time

Step 2: Creating Notifications


I used the ToastNotifier class from the win10toast module to create an object and the method show_toast to create a notification. The following code will generate a notification that will stay on the screen for 10 seconds.

noti = win10toast.ToastNotifier()
noti.show_toast("Demo", "You will get a notification", duration = 10)

Explanation: The first argument in the show_toast method is the header of the notification and the second argument is the message that you want to display within the notification window. The duration (mentioned in seconds) specifies how long the notification will remain on the desktop screen before disappearing. 

Step 3: Scheduling the Tasks


Code:

schedule.every().hour.do(water)
schedule.every().hour.do(take_break)
schedule.every(10).to(15).minutes.do(work)
schedule.every().day.at("22:00").do(medicine)
schedule.every().day.at("20:00").do(backup)
while True: schedule.run_pending() time.sleep(1)

Explanation: As we need to generate the notifications after certain time intervals we would use the schedule module that will schedule the tasks as per the given/required intervals. We will also use the sleep method from the time module, to let the next line of code execute after some time specified in seconds.

Step 4: Creating the Task Functions


Next, I created different functions that will perform different tasks when called. The function to remind me to:

  • Drink a glass of water every 1 hour is as follows:
def water(): noti.show_toast('Time to drink water!', duration= 10)
  • Take a break from work (after every 1 hr )
def take_break(): noti.show_toast('You have been working since one hour. Time to take a break', duration= 10)
  • Restart work ( after 10 mins of 2nd notification)
def work(): noti.show_toast('Restart your work', duration= 10)
  • Medicine Notification at 10 PM every day
def medicine(): noti.show_toast('Time to take the medicine', duration= 15)
  • Take backup and end work ( at 8 PM ) every day
def backup(): noti.show_toast('Take backup and end work', duration= 15)

Putting it All Together


Now let’s put it all together to visualize how the entire script works :

import win10toast
import schedule import time noti = win10toast.ToastNotifier() def water(): noti.show_toast('Time to drink water!', duration= 10) def take_break(): noti.show_toast('You have been working since one hour. Time to take a break', duration= 10) def work(): noti.show_toast('Restart your work', duration= 10) def medicine(): noti.show_toast('Time to take the medicine', duration= 15) def backup(): noti.show_toast('Take backup and end work', duration= 15) schedule.every().hour.do(water)
schedule.every().hour.do(take_break)
schedule.every(10).to(15).minutes.do(work)
schedule.every().day.at("22:00").do(medicine)
schedule.every().day.at("20:00").do(backup) while True: schedule.run_pending() time.sleep(1)

Conclusion


There we go! We have successfully created a wonderful automated script that will generate notifications for us, giving us prompts at certain intervals to organize our work and daily routine. I hope this project added some value and helped you in your coding quest. Stay tuned and subscribe for more interesting projects and tutorials.

Do you love automating tasks with Python? Well! I do. And if you are someone who likes automation then here’s a list of few mini projects that will get you going –




https://www.sickgaming.net/blog/2023/01/...fications/

Print this item

  (Indie Deal) GameMill & Games Operators Sales
Posted by: xSicKxBot - 01-15-2023, 12:13 PM - Forum: Deals or Specials - No Replies

GameMill & Games Operators Sales

Dear Villagers Giveaways
[www.indiegala.com]

https://www.youtube.com/watch?v=a9Loe-qYGck
GameMill Entertainment Sale, up to 90% OFF
[www.indiegala.com]
Games Operators Sale, up to 80% OFF Sale, up to 80% OFF
[www.indiegala.com]
https://youtu.be/Lm0cWNUUrjQ


https://steamcommunity.com/groups/indieg...2050509755

Print this item

  [Oracle Blog] Prepare for the Migration to JDK 9
Posted by: xSicKxBot - 01-14-2023, 07:35 AM - Forum: Java Language, JVM, and the JRE - No Replies

Prepare for the Migration to JDK 9 

The release date is proposed for September 21, 2017 and it’s time to make sure your code will work with JDK 9. As you probably know, you will still be able to use the classpath and code with any official Java SE APIs and supported JDK-specific APIs. You will run into problems if your code uses certa...


https://blogs.oracle.com/java/post/prepa...n-to-jdk-9

Print this item

  [Tut] Project – React dApp for Selling eBooks in a Decentralized Manner (1/4)
Posted by: xSicKxBot - 01-14-2023, 07:35 AM - Forum: Python - No Replies

Project – React dApp for Selling eBooks in a Decentralized Manner (1/4)

5/5 – (2 votes)

Welcome to another project of a decentralized dapp with React and ether.js.

YouTube Video

Project Scenario



We will build an ebook stall from which anyone can buy an ebook on a monthly subscription basis.

The buyer will submit his name, the book’s name, and the writer’s name at the time of buying the subscription. When he pays for the subscription, the subscription fee will be added to the bookstall owner’s account, and at the same time, the system will debit the transaction fee from the buyer’s account.

Apart from this, the details info of the buyer will be displayed on the user interface. The information includes the buyer’s name, wallet address, transaction time, book, and writer’s name.

Technology


We will use react.js and tailwind CSS in the frontend, Solidity for writing the smart contract, Ether.js for interacting with the smart contract, and the hardhat for smooth development.

Initiate Hardhat


Hardhat is arguably the best Ethereum development environment to compile your contracts and run them on a development network. To install the hardhat, open the vscode terminal and just type

npm install –save-dev hardhat

Hardhat will be installed on the directory. Now run hardhat.

npx hardhat

The command prompt will ask for creating a JavaScript project. Approve it. You need to install some dependencies to run the project. Copy this from the terminal and run. All the extra dependencies will be installed.

Create a new Solidity file inside the contract folder. “bookSell.sol“. We will be writing all the code here.

Build Solidity Smart Contract



I will create a simple and quick smart contract. This smart contract is basically for inputting the name, Book name, writer’s name, buyer address, the timing of issuing the order, etc.

pragma solidity >= 0.5.0 < 0.9.0;
contract BookSell{ address payable owner; constructor(){ owner = payable(msg.sender); } struct Receipt{ uint256 timestamp ; string name; address buyer; string book; string writer; } Receipt[] receipts; function buyBook(string memory name, string memory book, string memory writer) public payable{ require(msg.value>0,"Payment is not acceptable"); owner.transfer(msg.value); receipts.push(Receipt(block.timestamp, name, msg.sender,book, writer)); } function getReceipts() public view returns(Receipt[] memory) { return receipts; }
}

First, we need to confirm the address of the owner of the bookstall. This address will be payable cause it will receive the money of the buyers.

Create a constructor for the owner. “msg.sender” will be the owner in this case. msg.sender is normally the address that is used to deploy the contract. The person or the account that deploys the contract is normally the contract owner and will receive the transaction on his account.

Create a structReceipt” with three strings, that is,

  • name” for the buyer’s name,
  • book” for the book buyers want to buy, and
  • writer” for the writer of the book.

The timestamp would be an unsigned integer to note down the time and an address to collect the buyer’s account address.

To store the data of several buyers, I created a “receiptsarray. It is a dynamic array, which means whenever a new buyer inputs his information, the receipt will be added dynamically to the receipts array.

Create a function to buy the book. This buyBook function will take the information of the buyer as the parameters. The information includes the buyer’s name, book, and writer’s name. This function will also be payable cause we will use this to transfer money to the owner’s address.

Buyers must not pay zero eth as an amount. That’s why we added a condition with the “require” method. “msg.value” is the amount the buyer spends to buy the book.

owner.transfer(msg.value)” is used to transfer the fund to the stall owner’s account.

When the transaction is done, add the transaction receipt to the receipts array with the help of the push method. Since the receipts array is a struct type of array, you can input the required fields as the parameter of receipt.

To get the information from the receipts, we created a getReceipts() function. This returns the receipt of each buyer when we call the function.

Test the Smart Contract



Before deploying the contract, we need to check if all the functionalities of the smart contract are working properly or not. Hardhat has its own node and tools for checking the smart contract. We will first deploy our smart contract on the hardhat node to check its functionality and then deploy it to our testnet.

Move inside the deploy.js. We will create several functions here for different purposes.

We need to generate some accounts for the transaction. Inside the async main() function, generate account addresses with the help of the getSigners() method of ether.js. One account is for the contract owner, and the other three are for different buyers.

const [owner, buyer1, buyer2, buyer3] = await hre.ethers.getSigners();

Hardhat will generate four accounts with the help of ether modules. Each account will have 1000 eth by default. We can use that at the time of the transaction for testing purposes.

Create an addresses array to store all the addresses together.

const addresses = [ owner.address, buyer1.address, buyer2.address, buyer3.address, ];

Now to get the balances of those addresses, we will create obtainBalance() function outside the main function()

const obtainBalance = async (address) => { const balanceBigInt = await hre.ethers.provider.getBalance(address); return hre.ethers.utils.formatEther(balanceBigInt);
};

This obtainBalance() function will take an address from the addresses array, and it will use the getBalance() method of the ethers.provider to get the balance.

We will get the output as a Big Int object, and we need to convert it to get the actual number. The formatEther() method of the utils library converts the big int object into a readable format.

Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt


Now we will create another function to loop through the addresses, and it will also show the balances on the console.

const printBalances = async (addresses) => { let id = 0; for (const address of addresses) { console.log(`Account ${id} Balance:`, await obtainBalance(address)); id++; }
};

The “for” loop is used to loop through all the addresses of the array. While looping, the obtainBalance() function will get the balance from each account. An id variable is used to mark each account with a unique id.

Apart from that, we want to see the receipt for each buyer. Let’s create a printReceipt() function to get the receipt.

const printReceipts = async (receipts) => { for (const receipt of receipts) { const timestamp = receipt.timestamp; const name = receipt.name; const buyer = receipt.buyer; const book = receipt.book; const writer = receipt.writer; console.log( `Buyer Details: Name:${name},Book:${book},Writer:${writer},Address:${buyer},Time:${timestamp}` ); }
};

The printReceipts() function initiates a for loop that will loop through all the receipts of the receipts array. Then it will show all the buyer’s details from the receipt that will be called.

Now we need to call the receipts array from the smart contract. Otherwise, it won’t be possible to get data from the contract. Create an instance of the smart contract inside the main() function.

 const bookSell = await hre.ethers.getContractFactory("BookSell"); const contract = await bookSell.deploy(); //instance of the contract

With the first line of code, we called smart contract with the getContractFactory() method of the ethers library. Then we created an instance of the smart contract in the second line.

Now we can call the functions of the smart contract from here.


Let’s say we want to check the accounts’ balances first. Let’s console log the balance on the terminal with the help of printBalance() method that we created earlier.

 console.log("Initial Balance:"); printBalances(addresses);

Assume we want to send some balance to the owner’s address for buying books. Fix the amount we want to transfer

 const amount = { value: hre.ethers.utils.parseEther("1") }; await contract .connect(buyer1) .buyBook("Adam", "Miracle Morning", "Hal Elrod", amount); await contract .connect(buyer2) .buyBook("Mike", "The Slight Edge", "Jeff Olson", amount); await contract .connect(buyer3) .buyBook("Peter", "Loving what is", "Byron Katie", amount);

We fixed an amount, one eth, to transfer from all the buyer’s addresses. We used the parseEther() method of the utils library to fix the value.

In the next few lines, we called the contract and established a connection with the buyer’s address. We also called the buyBook method of the smart contract to buy the books.

Inside the buyBook function we passed the buyer address, the book name, the writer name, and the amount as the parameter. For simplicity, we are sending the same amount from all the buyer’s accounts.

To check the balances after buying the book, we will call the printBalance() method again. 

 console.log("Last Balance:"); await printBalances(addresses);

We forgot to call the receipts array from the smart contract. We will use the getReceipts() methods from the smart contract to get the receipts.

 const receipts = await contract.getReceipts(); printReceipts(receipts);
}

Now. Let’s deploy the contract on the hardhat and check how it works.

 await contract.deployed(); console.log("Contract Address:", contract.address);

I deployed the contract in the first line and then asked for the contract address.

Let’s move to the terminal and run the script.

npx hardhat run scripts/deploy.js

Don’t forget to mention the directory of the file on the code.


I got these results on my terminal after running the scripts. You can see from here that initially, the balances of all the accounts were 10000 eth. But after the transaction, more than one eth was deducted from each of the last three accounts.

It took more than one eth because of the transaction fee. At the same time, we can see the owner’s account (Account 0) is credited with exactly three eth.

In the last part, we also gathered all the info from the buyer’s receipt, including the time of the transaction and the address of the buyer.

Thanks for Reading ♥


That’s all for today. You have learned how to build and test a smart contract. In the next part, we will deploy the smart contract on a testnet.

GitHub: https://github.com/yassesh/bookSell



https://www.sickgaming.net/blog/2023/01/...anner-1-4/

Print this item

 
Latest Threads
Forza Horizon 5 Game Save...
Last Post: poxah56770
9 hours ago
(Xbox One) Vantage - Mod ...
Last Post: levihaxk
Today, 03:59 AM
News - Christopher Nolan’...
Last Post: xSicKxBot
Today, 03:31 AM
News - GameStop Is Not Hu...
Last Post: xSicKxBot
Yesterday, 11:06 AM
Lemfi Rebrand + World Cup...
Last Post: Sazzy01
Yesterday, 07:48 AM
World Cup 2026 Lemfi Foun...
Last Post: Sazzy01
Yesterday, 07:46 AM
World Cup 2026 Nigeria Le...
Last Post: Sazzy01
Yesterday, 07:45 AM
World Cup 2026 Canada Off...
Last Post: Sazzy01
Yesterday, 07:44 AM
World Cup 2026 Lemfi UK C...
Last Post: Sazzy01
Yesterday, 07:42 AM
Lemfi Wiki + World Cup 20...
Last Post: Sazzy01
Yesterday, 07:39 AM

Forum software by © MyBB Theme © iAndrew 2016