Immerse yourself in the world of Season, a third-person atmospheric adventure bicycle road trip game.
Leave home for the first time to collect memories before a mysterious cataclysm washes everything away. Explore, record, meet people, and unravel the strange world around you.
Activision Blizzard To Pay $35 Million To Settle Workplace Misconduct Charges
Activision Blizzard has reached a settlement deal with the Securities and Exchange Commission that sees the Call of Duty company pay $35 million to settle workplace charges.
Per the SEC's press release, Activision Blizzard is paying the settlement fee, but not admitting or denying any wrongdoing, over claims that it "failed to maintain disclosure controls and procedures to ensure that the company could assess whether its disclosures pertaining to its workforce were adequate."
Additionally, the $35 million settlement pertains to charges that Activision Blizzard "violated an SEC whistleblower protection rule."
Advantages of DokuWiki Docker Container for Home Server Lab
I'm using DokuWiki to serve my text files mostly right now. Possibly some pdf files if I can find some relevant reasoning for it.
Below is an example of the accumulation of my backup text file folder. I've spent 5-10 years developing documentation on every program, OS, and hardware I've tested with. It's good to have notes to remind yourself how you did something exactly, and methods to reproduce it. Especially when you can go from python, to javascript, to html/php, to sql, to bash, okay, you should get the point. Working with so many languages, it's good to take notes, write down your objective, and follow through with written/typed examples. Any time I open a new application, I start a new text document. Got to keep track of locations, commands, plugins, and so on. I believe it's a good practice. Definitely pays off when errors in my setup arise. Hoping this site will help me be able to search my documentation better also. Since I go from 1 thing to the next so much. I'll have similar topics across multiple text files. Maybe even the same content if it relates.
Ways to link the dokuwiki pages directory to your local PC:
*So I have my local text file directory synced with another server/computer in home.
*You could use sync thing, or something similar. Forget what they are called, or personally,
*I host my "Documents" folder on the server and use samba to mount on my windows 10.
* From there you can symlink or just work out of those directories.
- I did find a way to symlink in windows that was very useful. Somewhere in this dokuwiki...
* Another good program for mounting remote folders to windows 10 SSHFS-win-manager. Works similar to samba.
* Aeome backupper can be used to backup that remote drive to your local computer in case you ever have a network outtage or something similar. Good to prepare for situations like that. Theres another backup program I like I may eventually come back and update here.
For Linux just sshfs mount the directory. Also have documentation about this in my wiki lol. I'll try to get around to updating this.
Posted by: xSicKxBot - 02-04-2023, 07:51 AM - Forum: Python
- No Replies
How to Flush Your Cache on Windows and Router
5/5 – (1 vote)
I work a lot with DNS settings for my websites and apps.
Today I added a few new DNS entries to set up a new server. I used DNS propagation checkers and confirmed that the DNS entries were already updated internationally. But unfortunately, I myself couldn’t access the website on my Windows machine behind my Wifi router. I could, however, access the website with my smartphone after switching off Wifi there.
This left only one conclusion: My browser, Windows OS, or router cached the stale DNS entries.
So the natural question arises:
Question: How to flush your browser cache, Windows cache, and router cache and reset the DNS entries so they’ll be loaded freshly from the name servers?
I’ll answer these three subproblems one by one in this short tutorial:
Step 1: Flush your browser DNS cache (Chrome, Edge, Firefox)
Step 2: Flush your Windows DNS cache
Step 3: Flush your router DNS cache
Let’s dive into each of them one by one!
Step 1: Reset Your Browser Cache
First, reset your browser cache because it may store some DNS entries. I’ll show you how to flush your browser cache for the three most popular browsers on Windows:
Chrome
Edge
Firefox
Here’s how!
Clear Cache In Chrome
Open Chrome
At the top right, click More with the three vertical dots
Click More tools > Clear browsing data
Choose a time range. To flush everything, select All time
Check boxes next to Cookies and other site data and Cached images and files
Go to Settings > Privacy, search, and services > scroll down > click Choose what to clear > Change the Time range and check boxes next to Cookies and other site data and Cached images and files. Then click Clear now.
Click the menu button (three horizontal bars) and select Settings > Privacy & Security. Scroll down to Cookies and Site Data section and click Clear Data.... Remove check mark in front of Cookies and Site Data so that only Cached Web Content is checked. Click the Clear button.
Now your browser has no stale DNS entries — but in my case, this didn’t fix the problem. After all, your operating system may have cached it first!
Step 2: Reset Your Windows OS Cache
There’s a long and a short answer to the question on how to flush the Windows operating system cache. In my case, it worked with the shorter answer but you may want to use the long answer instead if you absolutely need to make sure your Windows DNS cache is empty.
How to Flush Your Windows Cache (Short Answer)
Type cmd into the Windows search field and press Enter. Type “ipconfig /flushdns” and press Enter.
How to Flush Your Windows Cache (Long Answer)
Type cmd into the Windows search field and press Enter.
Type “ipconfig /flushdns” and press Enter.
Type “ipconfig /registerdns” and press Enter.
Type “ipconfig /release” and press Enter.
Type “ipconfig /renew” and press Enter.
Type “netsh winsock reset” and press Enter.
Restart the computer.
Step 3: Reset Your Router Cache
This one is simple (although a bit time-consuming): To reset your router DNS cache for sure, unplug your router and leave it unplugged for 30 seconds or more. This will reset its DNS cache for sure. Done!
Match3 Love Bundle & MechWarrior 5 Rise of Rasalhague is out
Match3 Love Bundle | 9 Steam Games | 95% OFF
[www.indiegala.com] Get ready early for St. Valentine! Forget flowers, chocolate or the traditional gifts. Get your significant other an indie bundle of Match3 games! Even if you don't have one, you too are also significant, you matter, that's why you deserve to get spoiled. Get Amanda's Magic Book 4: True Love, Rorys Restaurant: Winter Rush, Funny Pets, Academy of Magic - Lair of the Beast, Bunny Quest, Helga the Viking Warrior, Wildlife Match, The Chronicles of Hercules II - Wrath of Kronos & Suddenly Meow 2
Hello and welcome to Backfirewall_, a first-person tragicomic adventure set inside a smartphone.
You are the update assistant. Solve wacky puzzles to counter the update and save the previous operating system from deletion. The fate of the System is in your hands!
How I Built a House Price Prediction App Using Streamlit
5/5 – (1 vote)
In this tutorial, I will take you through a machine learning project on House Price prediction with Python. We have previously learned how to solve a classification problem.
Info: Streamlit is a popular choice for data scientists looking to deploy their apps quickly because it is easy to set up and is compatible with data science libraries. We are going to set up the dashboard so that when our users fill in some details, it will predict the price of a house.
But you may wonder:
Why Is House Price Prediction Important?
Well, house prices are an important reflection of the economy. The price of a property is important in real estate transactions as it provides information to stakeholders, including real estate agents, investors, and developers, to enable them to make informed decisions.
Governments also use such information to formulate appropriate regulatory policies. Overall, it helps all parties involved to determine the selling price of a house. With such information, they will then decide when to buy or sell a house.
We will use machine learning with Python to try to predict the price of a house. Having a background knowledge of Python and its usage in machine learning is a necessary prerequisite for this tutorial.
To keep things simple, we will not be dealing with data visualization.
The Datasets
We will be using California Housing Data of 1990 to make this prediction. You can get the dataset on Kaggle or you check my GitHub page. Let’s load it using the Pandas library and find the number of rows and columns.
import pandas as pd data = pd.read_csv('housing.csv')
print(data.shape)
# (20640, 10)
We can see the dataset has 20640 rows and 10 features.
Let’s get more information about the columns using the .info() method.
The longitude indicates how far west a house is while the latitude shows how far north the house is.
The housing_median_age indicates the median age of a building. A lower number tells us that the house is newly constructed.
The total_rooms and total_bedrooms indicate the total number of rooms and bedrooms within a block.
The population tells us the number of people within a block while the households tell us the number of people living within a home unit of a block.
The median_income is measured in tens of thousands of US Dollars. It shows the median income of households living within a block.
The median_house_value is also measured in US Dollars. It is the median house value for households living in one block.
The ocean_proximity tells us how close to the sea a house is located.
The dataset has the same number of columns except total_bedroom indicating the presence of missing values. They are all of float datatype except ocean_proximity which is categorical even though it is shown as object. Let us first confirm this.
data.ocean_proximity.value_counts()
Output:
<1H OCEAN 9136
INLAND 6551
NEAR OCEAN 2658
NEAR BAY 2290
ISLAND 5
Name: ocean_proximity, dtype: int64
It is categorical. So, we have to convert the ocean_proximity to int datatype using labelEncoder from the Scikit-learn library.
from sklearn.preprocessing import LabelEncoder label_encoder = LabelEncoder()
obj = (data.dtypes == 'object') for col in list(obj[obj].index): data[col] = label_encoder.fit_transform(data[col])
Take note of the way labelEncoder ordered the values. We will apply this when creating our Streamlit dashboard. We then fill in the missing values with the mean of their respective columns.
for col in data.columns: data[col] = data[col].fillna(data[col].mean()) print(data.isna().sum())
Having confirmed that there are no missing values, we can now proceed to the next step.
Standardizing the Data
If you take a glimpse of our data using the .head() method, you will observe that the data is of differing scales.
This will affect the model’s ability to perform accurate predictions.
Hence, we will have to standardize our data using StandardScaler from Scikit-learn. Also, to prevent data leakage, we will make use of pipelines.
The Models
We have no idea which algorithm or model will perform well in this regression problem.
A test will be carried out on different algorithms using default tuning parameters. Since this is a regression problem, we will be using 10-fold cross-validation to design our test harness and evaluate the models using R Squared metric.
Info: The R Squared metric is an indication of goodness of fit. It is between 0 and 1. The closer to 1 the better. When the value is 1, it means a perfect fit.
K-fold cross-validation works by splitting the datasets into several parts (10 folds in our case).
The algorithm is trained repeatedly on each fold with one held back for testing. We chose this approach over train_test_split method because it gives us a more accurate and reliable result as the model is trained and evaluated repeatedly on different data.
from sklearn.svm import SVR
from sklearn.neighbors import KNeighborsRegressor
from sklearn.tree import DecisionTreeRegressor
from sklearn.linear_model import LinearRegression, Lasso, ElasticNet
from sklearn.model_selection import KFold, cross_val_score, train_test_split
from sklearn.pipeline import Pipeline
import bz2 pipelines = []
pipelines.append(('ScaledLR', Pipeline([('Scaler', StandardScaler()), ('LR', LinearRegression())])))
pipelines.append(('ScaledLASSO', Pipeline([('Scaler', StandardScaler()), ('LASSO', Lasso())])))
pipelines.append(('ScaledEN', Pipeline([('Scaler', StandardScaler()), ('EN', ElasticNet())])))
pipelines.append(('ScaledKNN', Pipeline([('Scaler', StandardScaler()), ('KNN', KNeighborsRegressor())])))
pipelines.append(('ScaledCART', Pipeline([('Scaler', StandardScaler()), ('CART', DecisionTreeRegressor())])))
pipelines.append(('ScaledSVR', Pipeline([('Scaler', StandardScaler()), ('SVR', SVR())]))) x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=7) def modeling(models): for name, model in models: kfold = KFold(n_splits=10) results = cross_val_score(model, x_train, y_train, cv = kfold, scoring='r2') print(f'{name} = {results.mean()}')
Notice how we used Pipeline while standardizing our models. We then created a function that used 10-fold cross validation to repeatedly train our models. Then, the result is displayed using R Squared metric.
The results show that KNN benefited from scaling the data. Let’s see if we can improve the result by tuning KNN parameters.
Tuning the Parameters
The default number of neighbors of KNN is 7, and with it KNN achieved good results. We will conduct a grid search to identify which parameters will yield an even greater score.
Random Forest Regressor achieved the highest score, and it’s what we are aiming for. Therefore, we are selecting the Random Forest Regressor algorithm to train and predict the price of a building. But can it do better than this? Sure, given that we trained only on default tuning parameters.
Here is the full code. Save it as model.py.
import pandas as pd
from sklearn.preprocessing import LabelEncoder, StandardScaler
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split, KFold, cross_val_score
import pickle data = pd.read_csv('housing.csv')
# select only 1000 rows
data = data[:1000]
# converting categorical column to int datatype
label_encoder = LabelEncoder()
obj = (data.dtypes == 'object')
for col in list(obj[obj].index): data[col] = label_encoder.fit_transform(data[col]) # filling in missing values
for col in data.columns: data[col] = data[col].fillna(data[col].mean()) # making data a numpy array like
x = data.drop(['median_house_value'], axis=1)
y = data.median_house_value
x = x.values
y = y.values
# dividing data into train and test
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=7) # standardzing the data
stds = StandardScaler()
scaler = stds.fit(x_train)
rescaledx = scaler.transform(x_train) # selecting and fitting the model for training
model = RandomForestRegressor()
model.fit(rescaledx, y_train)
# saving the trained mode
pickle.dump(model, open('rf_model.pkl', 'wb'))
# saving StandardScaler
pickle.dump(stds, open('scaler.pkl', 'wb'))
We selected only 1000 rows to reduce pickled size.
Notice that we saved the StandardScaler() function to be used while creating the Streamlit dashboard. Since we scaled the dataset, we also expect to scale the input details from our users.
Streamlit Dashboard
It’s now time to design our Streamlit app. Once again, we will try to keep things simple and avoid complex designs. Save the following code as app.py.
import streamlit as st
import pickle def main(): style = """<div style='background-color:pink; padding:12px'> <h1 style='color:black'>House Price Prediction App</h1> </div>""" st.markdown(style, unsafe_allow_html=True) left, right = st.columns((2,2)) longitude = left.number_input('Enter the Longitude in negative number', step =1.0, format="%.2f", value=-21.34) latitude = right.number_input('Enter the Latitude in positive number', step=1.0, format='%.2f', value= 35.84) housing_median_age = left.number_input('Enter the median age of the building', step=1.0, format='%.1f', value=25.0) total_rooms = right.number_input('How many rooms are there in the house?', step=1.0, format='%.1f', value=56.0) total_bedrooms = left.number_input('How many bedrooms are there in the house?', step=1.0, format='%.1f', value=15.0) population = right.number_input('Population of people within a block', step=1.0, format='%.1f', value=250.0) households = left.number_input('Poplulation of a household', step=1.0, format='%.1f',value=43.0) median_income = right.number_input('Median_income of a household in Dollars', step=1.0, format='%.1f', value=3000.0) ocean_proximity = st.selectbox('How close to the sea is the house?', ('<1H OCEAN', 'INLAND', 'NEAR OCEAN', 'NEAR BAY', 'ISLAND')) button = st.button('Predict') # if button is pressed if button: # make prediction result = predict(longitude, latitude, housing_median_age, total_rooms,total_bedrooms, population, households, median_income, ocean_proximity) st.success(f'The value of the house is ${result}')
We imported Streamlit and other libraries. Then we defined our main function. We want it to be executed as soon as we open the app. So, we will call the function using the __name__ variable at the very last of our script.
The unsafe_allow_html makes it possible for the HTML tags to be executed by Python.
With st.columns, we were able to display our variables side by side. We formatted each variable to be the same datatype in our dataset. If the button is pressed, then a callback function, the predict() function, is executed.
# load the train model
with open('rf_model.pkl', 'rb') as rf: model = pickle.load(rf) # load the StandardScaler
with open('scaler.pkl', 'rb') as stds: scaler = pickle.load(stds) def predict(longitude, latitude, housing_median_age, total_rooms, total_bedrooms, population, households, median_income, ocean_pro): # processing user input ocean = 0 if ocean_pro == '<1H OCEAN' else 1 if ocean_pro == 'INLAND' else 2 if ocean_pro == 'ISLAND' else 3 if ocean_pro == 'NEAR BAY' else 4 med_income = median_income / 5 lists = [longitude, latitude, housing_median_age, total_rooms, total_bedrooms, population, households, med_income, ocean] df = pd.DataFrame(lists).transpose() # scaling the data scaler.transform(df) # making predictions using the train model prediction = model.predict(df) result = int(prediction) return result
We started by loading the train model and StandardScaler we saved earlier.
In the predict() function, we use a ternary operator to turn user input into a number. More info about this operator in the referenced blog tutorial or this video:
Notice that we made sure it corresponds with the number assigned by LabelEncoder. If you are ever in doubt, use the .value_counts() method on the categorical column to confirm.
We divided the median_income by 5 since the corresponding column in our dataset is said to be in tens of thousands of Dollars. However, this may not be necessary given that StandardScaler finally scaled the data. We did it just to be on the safe side.
The double parentheses are our way of instructing Python to turn the given inputs into a DataFrame. We also made sure the order of the parameters in the predict() function corresponds accordingly.
If the function seems to predict the same amount despite changes to the input details, then you may check the correlation the target variable has over the features by typing data.corr().
If we were to apply Recursive Feature Elimination (RFE) to select the best features capable of predicting the target variable, it would select just 4: longitude, latitude, median_income, and ocean_proximity. Let me show you what I mean.
Only 4 features are capable of predicting the target variable. If you kept getting the same amount, that may be the reason.
The purpose of this tutorial is purely educational, to demonstrate how to use Python to solve machine learning problems. I tried to keep things simple by not going through data visualization and feature engineering. Since the data is old, it should not be relied on when making important decisions.
We finally came to the end of the tutorial. Be sure to check my GitHub page to see the full project code.
To deploy on Streamlit Cloud, I assume you have already created a repository and added the required files. Then, you create an account on Streamlit Cloud, and input your repository URL. Streamlit will do the rest.
Installing phpMyAdmin on a Windows computer will vary based on the existing environment. This article will tell the step-by-step process of installing phpMyAdmin using the following methods.
Manual installation on top of the existing Apache server.
Installation via WAMP package.
Method 2 is an easier one, which will automatically install as part of the WAMP package. Not only WAMP but all packages like XAMPP and LAMP also have the advantage of reducing the effort.
In a previous tutorial, we have seen how to install XAMPP. It helped to set up an Apache, PHP, and MySQL database server environment on a server.
Manual installation on top of the existing Apache server
We have seen the advantages of phpMyAdmin managing databases through a web interface.
Prerequisites
Make sure that you have installed the following before start installing phpMyAdmin.
Apache server
MySQL server
PHP
Then, follow the below steps.
Step 1: Download the phpMyAdmin project from its official website. Download the zip file to your browser by clicking the required downloadable.
Step 2: Unzip the downloaded zip and copy the phpMyAdmin project.
Step 3: Move the phpMyAdmin extracted folder to the Apache web root, the htdocs directory.
Step 4: Open the php.ini file found in the PHP config root. Make sure that the file has administrator permission to edit the config.
Step 5: Uncomment the following extensions to enable them.
php_mbstring.dll
php_mysqli.dll
Step 6: Restart Apache and MySQL servers.
Step 7: Run the phpMyAdmin application as same as you run other PHP applications on the Apache web root.
An example web address is http://localhost/phpmyadmin/. It will show the PHPMyAdmin home by listing all the databases.
Installation via WAMP package
We have seen a seven-step process of installing phpMyAdmin manually. Now, let’s see how the WAMP package provides an easy way of achieving this.
Step 2: Double-click the downloaded WAMP installer and proceed with the wizards asking the following.
Choose language.
Accept the agreement.
Accept or configure the default browser.
Accept or Configure the default editor.
Step 3: Click “Finish” when the wizard prompts.
Step 4: Open the WAMP tool and choose phpMyAdmin from the menu.
Thus, the phpMyAdmin is installed simply by this method.
Conclusion
Once installed, the phpMyAdmin will help manage the database easily via a web application interface. Previously, we saw steps to use the frequently used tools of this application. E.g., How to create a database using phpMyAdmin?
This application helps connect a local or remote database by logging in via the landing login panel.
Share this page