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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 20,946
» Latest member: blackopsdlc
» Forum threads: 21,978
» Forum posts: 22,945

Full Statistics

Online Users
There are currently 1229 online users.
» 0 Member(s) | 1224 Guest(s)
Applebot, Baidu, Bing, Facebook, Google

Latest Threads
[WoW Retail News] Stat Sq...
Forum: World of Warcraft
Last Post: xSicKxBot

» Replies: 0
» Views: 6
BO6 & Warzone devs promis...
Forum: PC Discussion
Last Post: xSicKxBot

» Replies: 0
» Views: 9
I Thought Block Blast Was...
Forum: Lounge
Last Post: starfishmil

» Replies: 0
» Views: 11
[PS.Blog] Silent Hill: To...
Forum: Sony Discussion
Last Post: xSicKxBot

» Replies: 0
» Views: 7
[Steam Release] Good Comp...
Forum: New Game Releases
Last Post: xSicKxBot

» Replies: 0
» Views: 11
[DevBlog MS] Performance ...
Forum: C#, Visual Basic, & .Net Frameworks
Last Post: xSicKxBot

» Replies: 0
» Views: 18
[WoW Retail News] Over 20...
Forum: World of Warcraft
Last Post: xSicKxBot

» Replies: 0
» Views: 15
[WoW Retail News] Mythic ...
Forum: World of Warcraft
Last Post: xSicKxBot

» Replies: 0
» Views: 21
[Steam Release] Raft, 15%...
Forum: New Game Releases
Last Post: xSicKxBot

» Replies: 0
» Views: 17
Marvel Rivals Ace icon ex...
Forum: PC Discussion
Last Post: xSicKxBot

» Replies: 0
» Views: 21

 
  PC - Path of the Midnight Sun
Posted by: xSicKxBot - 01-27-2023, 04:48 AM - Forum: New Game Releases - No Replies

Path of the Midnight Sun



Protect a noblewoman reckoning with unholy powers as she wards off the soul of the Demon King sealed inside her. Doubt your own companions, survive against unforgiving hordes of monsters. But beware; every choice has consequences in this epic JRPG adventure of betrayal, romance & self-acceptance.

Communication and relationships are the key to success in this sprawling world, as your standing with them directly affects your companions' ability to battle. Put your skills to the ultimate test in Hardcore Mode, or immerse yourself in the world of Path of the Midnight Sun without any stress in Story Mode.

Publisher: Studio Daimon

Release Date: Jan 10, 2023




https://www.metacritic.com/game/pc/path-...dnight-sun

Print this item

  [Oracle Blog] Announcing Windows support for Java Management Service
Posted by: xSicKxBot - 01-26-2023, 06:39 AM - Forum: Java Language, JVM, and the JRE - No Replies

Announcing Windows support for Java Management Service

Blog announcing Window support for Java Management Service


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

Print this item

  [Tut] Basketball Statistics – Page Scraping Using Python and BeautifulSoup
Posted by: xSicKxBot - 01-26-2023, 06:39 AM - Forum: Python - No Replies

Basketball Statistics – Page Scraping Using Python and BeautifulSoup

5/5 – (1 vote)

In this blog series, powerful Python libraries are leveraged to help uncover some hidden statistical truths in basketball. The first step in any data-driven approach is to identify and collect the data needed.

Luckily for us, Basketball-Reference.com hosts pages of basketball data that can be easily scraped. The processes of this walkthrough can be easily applied to any number of their pages, but for this case, we plan on scraping seasonal statistics of multiple rookie classes.

Project Overview



The Objectives:

  1. Identify the Data Source
  2. Download the Page
  3. Identify Important Page Elements
  4. Pre-Clean and Extract
  5. Archive

The Tools:

  • Requests
  • Beautiful Soup
  • Pandas

Though we will inevitably be working with many specialized libraries throughout this project, the above packages will suffice for now.

Identifying the Data Source



Basketball-Reference.com hosts hundreds of curated pages on basketball statistics that range from seasonal averages of typical box score categories like points, rebounds, and shooting percentages, all the way down to the play-by-play action of each game played in the last 20 or so years. One can easily lose their way in this statistical tsunami if there isn’t a clear goal set on what exactly to look for.

The goal here in this post is simple: get rookie data that will help in assessing a young player’s true value and potential.

The following link is one such page. It lists all the relevant statistics of rookies in a particular season.

? Link: https://www.basketball-reference.com/leagues/NBA_1990_rookies-season-stats.html

In order to accumulate enough data to make solid statistical inferences on players, one year of data won’t cut it. There need to be dozens of years’ worth of data collected to help filter through the noise and come to a conclusion on a player’s future potential.

If an action can be manually repeated, it makes itself a great candidate for automation. In this case, the number in the URL above corresponds to the respective year of that rookie class. Powered by that knowledge, let’s start putting together our first lines of code.

import requests
import pandas as pd
from bs4 import BeautifulSoup years = list(range(1990, 2017)) url_base = "https://www.basketball-reference.com/leagues/NBA_{}_rookies-season-stats.html"

In creating the two variables referenced above, our thought process is as follows.

  1. The appropriate packages are imported
  2. url_base serves to store the pre-formatted string variable of the target URL
  3. The years list variable specifies the ranged of the desired years, 1990 up to 2017

Downloading the Page Data



In scraping web pages, it’s imperative to remove as much overhead as possible. Seeing as the site stores all their information on the HTML front end, the page can be easily downloaded and locally stored in its entirety.

# iterates through each year and downloads page into an HTML file
for year in years: url = url_base.format(year) data = requests.get(url) # page is save as an html and placed in Rookies folder with open("notebooks/Rookies/{}.html".format(year), "w+") as f: f.write(data.text)

The for loop iterates through the list variable years.

The curly braces found within the url’s string will serve to allow the format to substitute it with the currently iterated year.

For example, in its first iteration, the url value will be 'https://www.basketball-reference.com/leagues/NBA_1990_rookies-season-stats.html'.

On its second iteration, the subsequent year would be referenced instead (https://www.basketball-reference.com/leagues/NBA_1991_rookies-season-stats.html)

The data variable acts as a placeholder for the requests.get() function and references of the currently iterated url string value.

The requests method then uses the newly formatted URL string to retrieve the page in question.

The subsequent with open() reads and writes (w+) the page data from our requests.get (data.text), and locally stores the newly created HTML files.

Why download the page and store it locally?

To avoid a common growing pain in site scraping, we store these pages as local HTML files.

See, when making a visit to a page site, the server hosting said page has to honor your request and send back the appropriate data to your browser. But having one specific client asking for the same information over and over puts undue strain on the server.

The server admin is well within their rights to block these persistent requests for the sake of being able to optimally provide this service to others online.

By downloading these HTML files on your local machine, you avoid two things:

  1. Having to wait longer than usual to collect the same data
  2. Being blocked from visiting the page, halting data collection altogether

Identifying Important Page Elements



To scrape data elements of these recently downloaded pages using Python, there needs to be a means to understand what properties these HTML elements have. In order to identify these properties, we need to inspect the page itself.

How to Inspect


We’ll need to dive deeper into the inner workings of this document, but I promise I won’t make this an exercise on learning HTML.

If you know how to inspect HTML objects, feel free to jump ahead. Otherwise, please follow along on how to inspect page elements.

Option 1: Developer Tools


  1. Click on the three vertical dots on Chrome’s top menu bar
  2. Choose “More tools”
  3. Select Developer tools.

Option 2: Menu Select


  1. Right-click on the web page
  2. Choose “Inspect” to access the Developer tools panel

Inspecting the Page


Seeing that all of these pages are locally stored, we can choose to view them by either going into the file system to open them in our desired browser, or, we can continue to build our code by implementing the following snippet of code.

with open("notebooks/Rookies/2000.html") as f: page = f.read()

Below is the loaded page with Developer Tools docked to the right. Notice how hovering the mouse cursor on the HTML line containing the class ID rookies highlights the table element on the page?


All the desired data of this page is housed in that table element. Before hastily sucking up all of this data as is, now is the best time to consider whether everything on this table is worth collecting.

Pre-Clean



Pre-cleaning might not be a frequent word in your vocabulary, but for those of you seeing yourself scraping data regularly, it should be. If you want to avoid the frustration of wasted hours of progress on a data collection project, it’s best to first separate the chaff from the wheat.

For instance, take note of the three elements boxed in red.


One row serves as the “main” table header. The other two rows are duplicate instances of the same artifacts found at the top. This pattern repeats every 20th row.

Upon further inspection of these elements, it’s revealed that all of these rows have the same tr (table row) HTML tag. What distinguishes each of these elements from any others are their class names.


  1. Main Header Row
    a. Class = over_header
  2. Repeat Header Rows
    a. Class = over_header thead
  3. Statistics Category Row
    a. Class = thead
# array to house list of dataframes
dfs = [] # unnecessary table rows to be removed
classes = ["over_header", "over_header thead", "thead"]
  1. dfs will be used later on to house several data frames
  2. The classes array object will hold all the unwanted table row element’s class names.

Knowing that these elements provide no statistical value, rather than simply “skipping over” them in our parse, they should instead be completely omitted. That’s to say, permanently removed from any future considerations.

The decompose method serves to remove unwanted elements in a page. As per the official Beautiful Soup page.

decompose()

Tag.decompose() removes a tag from the tree, then completely destroys it and its contents.

Below is a snippet of code where the decompose method is optimized using multiple for loops.

# for loop to iterate through the years for year in years: with open("notebooks/Rookies/{}.html".format(year)) as f: page = f.read() soup = BeautifulSoup(page, "html.parser") # for loop cleans up unnecessary table # headers from reappearing in rows for i in classes: for tr in soup.find_all("tr", {"class":i}): tr.decompose()
  1. First for loop is used to iterate through the values of our years list object
  2. The with method provides our code the structure for the page variable to read locally stored HTML files when called on
  3. An HTML parser class is initialized by instantiating the BeautifulSoup class and passing in both the page string object and html.parser.
  4. Second for loop iterates through the values in the classes array
  5. Third for loop utilizes Beautiful Soup’s find_all method to identify elements that have both tr tags and class names matching those in classes
  6. tr.decompose serves to omit each of the identified table row elements from the page entirely

Let’s look to build on this by extracting the data we do want.

Extracting the Data



We can finally start working on the part of the code that actually extracts data from the table.

Remember that the table in with all of the relevant data has the HTML unique ID rookies. The following additions to our code will serve to parse the data of this table.

# the years we wish to parse for
years = list(range(1990, 2017)) # array to house list of dataframes
dfs = [] # unnecessary table headers to be removed
classes = ["over_header","over_header thead", "thead"] for year in years: with open("notebooks/Rookies/{}.html".format(year)) as f: page = f.read() soup = BeautifulSoup(page, "html.parser") #for loop cleans up unnecessary table headers from reappearing in rows for i in classes: for tr in soup.find_all("tr", {"class":i}): tr.decompose() ### Start Scraping Block ### #identifies, scrapes, and loads rookie tables into one dataframe rookie_table = soup.find(id="rookies") rookies = pd.read_html(str(rookie_table))[0] rookies["Year"] = year dfs.append(rookies) # new variable turns list of dataframes into single dataframe
all_rookies = pd.concat(dfs)

For what follows ### Start Scraping Block ###

  1. The rookie_table variable serves to help identify this, and only this table on the page
  2. Seeing that the Pandas package can read HTML tables, the rookie table is loaded into Pandas using the read_html method, passing the  rookie_table as a string
  3. Tacking on to end [0] to turn it from a list of dataframes into a single dataframe
  4. A “Year” column is added to the rookies dataframe
  5. dfs.append(rookies) serves to house all of tables of every rookie year in the order they were iterated into a list of dataframes
  6. The Pandas method concat is used to combine that list of dataframes into one single dataframe: all_rookies

Archiving


Our final step involves taking all of this useful, clean information and archiving it in easily readable CSV format. Tacking on this line to the end of our code (outside of any loops!) will serve to be useful when deciding to come back and reference the data collected.

# dataframe archived as local CSV
all_rookies.to_csv("archive/NBA_Rookies_1990-2016.csv")

Final Product



import requests
import pandas as pd
from bs4 import BeautifulSoup # the years we wish to parse for
years = list(range(1990, 2017)) # array to house list of dataframes
dfs = [] # unnecessary table headers to be removed
classes = ["over_header","over_header thead", "thead"] # loop iterates through years
for year in years: with open("notebooks/Rookies/{}.html".format(year)) as f: page = f.read() soup = BeautifulSoup(page, "html.parser") #second for loop clears unnecessary table headers for i in classes: for tr in soup.find_all("tr", {"class":i}): tr.decompose() # identifies, scrapes, and loads rookie tables into one dataframe table_rookies = soup.find(id="rookies") rookies = pd.read_html(str(table_rookies))[0] rookies["Year"] = year dfs.append(rookies) #new variable turns list of dataframes into single dataframe
all_rookies = pd.concat(dfs) #dataframe archived as local CSV
all_rookies.to_csv("archive/NBA_Rookies_1990-2016.csv")

Closing



Again, the process followed in this walkthrough will undoubtedly apply to most every other page on Basketball-Reference.com.

There are five simple steps worth taking in each instance.

  1. Identify the Page URL
  2. Download the Page
  3. Identify the Elements
  4. Pre-Clean and Extract
  5. Archive

Following these five steps will help guarantee a quick and successful scraping experience.

Next up in this series will be actually using this data to gain insight into future player potential. So be on the lookout for future installments!

We’ll share them here:



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

Print this item

  (Indie Deal) GameMill & Games Operators Sales
Posted by: xSicKxBot - 01-26-2023, 06:39 AM - 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

  PC - Colossal Cave
Posted by: xSicKxBot - 01-26-2023, 06:39 AM - Forum: New Game Releases - No Replies

Colossal Cave



Colossal Cave Reimagined by Roberta Williams, is an exciting new action-adventure game from the founders of Sierra On-Line, Ken and Roberta Williams.

Colossal Cave Reimagined by Roberta Williams is an exciting and thrilling adventure for a new generation to undertake. Immerse yourself in the world of Colossal Cave, explore its vast caverns and vistas, seek the diverse treasures within, and encounter both friends and foes in your quest to explore this mysterious and wonderful locale.

Publisher: Cygnus Entertainment

Release Date: Jan 19, 2023




https://www.metacritic.com/game/pc/colossal-cave

Print this item

  [Oracle Blog] Java SE 17 is live!
Posted by: xSicKxBot - 01-25-2023, 06:53 AM - Forum: Java Language, JVM, and the JRE - No Replies

Java SE 17 is live!

Java SE 17 is the latest Long-Term-Support (LTS) release.


https://blogs.oracle.com/java/post/java-se-17-is-live

Print this item

  [Tut] OpenAI API – or How I Made My Python Code Intelligent
Posted by: xSicKxBot - 01-25-2023, 06:53 AM - Forum: Python - No Replies

OpenAI API – or How I Made My Python Code Intelligent

5/5 – (1 vote)

In this quick tutorial, I’ll show you how I integrated ChatGPT intelligence into an app I’m currently working on. It’s really simple, so let’s get started!

Step 1: Create a Paid Account with OpenAI


I’m not affiliated with OpenAI in any way. However, to use it, you need to create a (paid) account to create an API key that you’ll need in order to connect ChatGPT with your code.

? Click here to create an account and connect it with your credit card

I use it a lot and pay only a couple of cents per day so it’s really inexpensive for now.

Step 2: Get Your API Key


Open the link https://beta.openai.com/playground and navigate to Personal > View API keys.


Now, click the + Create new secret key button to create a new API key:


Now copy the API key to your clipboard:


Step 3: Pip Install OpenAI


Use your version of pip to install the openai module by running a command similar to the following (depending on your local environment):

  • pip install openai
  • pip3 install openai
  • pip3.11 install openai

As I’ve installed Python 3.9 at the point of writing, I used pip3.9 install openai:


You can check your Python version here and learn how to install a module here.

Step 4: Python Code to Access OpenAI


Copy and paste the following code into a Python script (e.g., named code.py) and also paste your API key from Step 2 into the highlighted line (string):

import os
import openai openai.api_key = "<copy your secret API key here>" response = openai.Completion.create( model="text-davinci-003", prompt="What is the answer to all questions?", temperature=0.7, max_tokens=100, top_p=1, frequency_penalty=0, presence_penalty=0
) print(response)

You can modify the other highlighted line "What is the answer to all questions?" to customize your input prompt. The output after a few seconds will look like this:

{ "choices": [ { "finish_reason": "stop", "index": 0, "logprobs": null,
 "text": "\n\nThere is no one answer to all questions as each question has its own unique answer." } ], "created": 1674579571, "id": "cmpl-6cGvr0TM2PGsExeyG3NEx43CrNwSx", "model": "text-davinci-003", "object": "text_completion", "usage": { "completion_tokens": 19, "prompt_tokens": 8, "total_tokens": 27 }
}

Unfortunately, it couldn’t figure out the answer 42. ?



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

Print this item

  (Indie Deal) Sci-Fi Giveaways, DYNASTY WARRIORS 9, Disney Deals
Posted by: xSicKxBot - 01-25-2023, 06:53 AM - Forum: Deals or Specials - No Replies

Sci-Fi Giveaways, DYNASTY WARRIORS 9, Disney Deals

Team17 Sci-Fi Giveaways
[www.indiegala.com]

https://www.youtube.com/watch?v=Z0BMYSJL-gk
[www.indiegala.com]
Don't forget about the BONUS cashback!
https://youtu.be/7mQE-0x4yJk


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

Print this item

  PC - Warlander
Posted by: xSicKxBot - 01-25-2023, 06:53 AM - Forum: New Game Releases - No Replies

Warlander



Harness the almighty powers of god-like Warriors, Clerics, and Mages, with a unique style that mashes a Medieval-inspired setting, Fantastical items and abilities…and…EVEN POWERFUL ROBOTS! Master siege weapons and cataclysmic spells to control the battlefield and destroy the enemy's core!

Publisher: PLAION

Release Date: Jan 24, 2023




https://www.metacritic.com/game/pc/warlander

Print this item

  News - Forspoken - Best Skills To Unlock First
Posted by: xSicKxBot - 01-25-2023, 06:53 AM - Forum: Lounge - No Replies

Forspoken - Best Skills To Unlock First

In Forspoken, Frey Holland starts out with a single skill tree, but that number soon grows as the main storyline progresses. By the end of the game, Frey will have access to over 100 magic spells. Some are given to you after major story beats, but most need to be either bought using Mana or found through exploration, out in the world of Athia. We're here to provide some advice on which skills you should unlock first in Forspoken.

Forspoken Best Skills

Each skill tree in Forspoken is given a name but, in an attempt to avoid spoilers, we'll be referring to them by their designated color. There's Frey's Purple Magic tree, the Red Magic tree, the Blue Magic tree, and the Green Magic tree. These are our recommendations for the best skills to pick first for each of the skill trees once you unlock them. Don't go any further than the first skill tree if you want the others to be a surprise.

Frey's Purple Magic Skill Tree

Frey's Purple Magic skill tree
Frey's Purple Magic skill tree

Frey's Purple Magic skill tree is balanced between close-range, long-range, AoE, and defensive options. It's the first tree, so you'll be able to get a feel for the different styles of magic that'll be improved upon later on. These are the spells that you should pay attention to when expanding beyond the base set:

Continue Reading at GameSpot

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

Print this item