teleren/devto huggingface dataset:
State of Ruby : What version manager to use
Tags: ruby, discuss
Published: 2023-10-11 18:42:31

I have asked on Twitter what was your favorite version manager for Ruby. 

The clear leader was Rbenv, ASDF, which was most of the comment for the last response; then we have RVM, but I will not consider it for the rest of this post because it is pretty obscure how it works :).

Let's understand the critical difference between those and help you make some choices for your Ruby Version manager.

{% twitter 1692472247372378362 %}

## Community 

Leaderboard : 
```
	1.Rbenv
	2.ASDF
	3.Chruby
```
First, the Tweet shows that Rbenv is a great winner for the Ruby community. But it seems mainly because it is the goto solution.

Nevertheless, this is a great thing because if you have an issue. It is more likely that you are one of many to have it. 

## Versatility

In terms of versatility, here is the leaderboard : 

```
	1. ASDF
	2. Rbenv 
	3. ChRuby
```

Indeed, ASDF enables you to manage your ruby version and supports many other languages and tools like nodejs. Moreover, you can add a plugin to it. 

Rbenv is also versatile, and you can add plugins; nevertheless, as its name suggests, you can only manage the ruby version. Rbenv and ASDF both use the same underlying gem, which is ruby-build. 

ChRuby is not extensible, and you can only manage Ruby with it. But it comes with ruby-mac, an excellent tool for installing ruby quickly on Mac.
	
## Speed
```
1. ChRuby
2. Rbenv
3. ASDF
```
Why? 

Rbenv and Asdf are Shim. They act like a proxy for every call to Ruby. Inevitably, they are slower. 
Chruby does not provide that, and you need to use chruby-exec if you want to use the version managed by chruby.

## Misc 

Moreover, both Rbenv and ASDF use ruby-build to compile and install ruby. Whereas chruby can use both ruby-build and ruby-install for new rubies installation.

In addition, chruby is really simple to install if you are on Mac thanks to ruby-mac utility tool.

## And the winner is ? 

There is no such thing as a better version manager. It all depends on what you want to do.

If you want a lightweight and quick version manager, use chruby. 

You have several choices if you want something with more extensibility and do not care about speed : 

- ASDF if you want to manage several other language than Ruby.

- Rbenv if you need a versatile version manager that manages only ruby

There is this [good resource](https://github.com/rbenv/rbenv/wiki/Comparison-of-version-managers) that also talk about different ruby version manager from the Rbenv repository. With some links to benchmarks of ASDF and Rbenv.
When should you go for tech startups?
Published: 2023-10-11 18:42:24

If you are the only resource or you have a friend or some partner and you are interested in starting a startup then you must have one thing otherwise the startup is not the best idea *yet!*
That one thing is a skill. And you must be extremely good at it. That's the condition. 
Even if one person in your circle is extremely good at what you are going to build a startup about then don't wait and start *planning* about the execution otherwise wait and learn the skill, make yourself valuable, and then find people to work alongside with.
Hair Wig Shop in Patna
Published: 2023-09-27 18:57:41

Gagan Hair Studio is a well known hair wig shop in Patna. They provide a wide type of hair wigs for ladies and men, together with full lace wigs, frontal lace wigs, artificial wigs, human hair wigs, and more. the shop has a crew of professional and skilled professionals who offer personalised consultation and assistance to help clients pick out the right wig that matches their possibilities, fashion, and price range.

Gagan Hair Studio additionally presents customized wig making services, in which clients can get their wigs made in keeping with their unique desires and necessities. They use excessive fine hair extensions and other materials to ensure that their wigs are at ease, natural-searching, and long-lasting.

In addition to hair wigs, Gagan Hair Studio additionally gives other hair care services, which includes hair extensions, hair weaving, hair bonding, and hair alternative. the store is located in Patna, and customers can visit their store or location orders on-line. They offer home shipping and delivery services across India.

Website : [https://www.hairwigshop.in/patna/index.html](https://www.hairwigshop.in/patna/index.html)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kqvir8iff12njd7tub7i.jpg)
Health Portal
Tags: webdev, typescript, react
Published: 2023-10-11 18:20:09

I'm in the very early stages of designing this web application. 

First, I've decided on my Minimum Viable Product (MVP). The four primary features of this site will be:

1. Patient (user) accounts/profiles
2. Appointment scheduling
3. Medical records
4. Billing

I have also decided on the technologies I will utilize:

Frontend:
TypeScript
React
Node

Backend:
Python server
Google Firestore DBMS

Hosting:
Google Cloud Platform (GCP)

I'm using GCP since I already have experience hosting multiple web applications on it.

My next step is to start designing it visually on Figma
Demonstrating K means Clustering on Iris Dataset
Published: 2023-10-11 18:14:09

K-means clustering was performed to evaluate the possible clusters can be derived from the features of the given dataset hence giving the unsupervised model. The following explanatory variables were included as possible contributors to a K-means Clustering model (output) includes the petal length & petal width.


**Python Code**

```
iris = load_iris(as_frame=True)
iris.data
iris.feature_names

['sepal length (cm)',
 'sepal width (cm)',
 'petal length (cm)',
 'petal width (cm)']

X = iris.data
X_act = iris.data 
X = X.drop(['sepal length (cm)','sepal width (cm)'],axis=1)

from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
scaler.fit(X[['petal length (cm)']])
X['Scaled_PL'] = scaler.transform(X[['petal length (cm)']])
scaler.fit(X[['petal width (cm)']])
X['Scaled_PW'] = scaler.transform(X[['petal width (cm)']])

X = X.drop(['petal length (cm)','petal width (cm)'],axis=1)

plt.scatter(X['Scaled_PL'],X['Scaled_PW'])
```

![Scatter Plot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/le0idcw6dsaybe0yabcz.png)
_Scatter Plot Showing the possible cluster between petal length and petal width_

---

**Output**

```
from sklearn.cluster import KMeans
model = KMeans(n_clusters = 2)
model.fit(X)

predictions = model.predict(X)
X['clusters'] = predictions
X
```

![list](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gepwmo7havrnuxpxkk4n.png)
_Prediction shows cluster number (Here we have 2)_

---


```
cluster0 = X[['Scaled_PL','Scaled_PW']][X.clusters == 0]
cluster1 = X[['Scaled_PL','Scaled_PW']][X.clusters == 1]
centroids = model.cluster_centers_
plt.scatter(cluster0['Scaled_PL'],cluster0['Scaled_PW'],color="yellow",label="Cluster1")
plt.scatter(cluster1['Scaled_PL'],cluster1['Scaled_PW'],color="orange",label="Cluster2")
plt.scatter(centroids[:,0],centroids[:,1],marker="*",color="purple",label="centroid")
plt.xlabel("petal length")
plt.ylabel("petal width")
plt.legend()
```

![predicted plot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fmaxw3eyhpk0i7mzsyo4.png)
_Scatter Plot representing the 2 predicted cluster along with it's centroids_

---
**Finding Elbow**
```
SSE = []

for i in range(1,11):
    test_model = KMeans(n_clusters=i)
    test_model.fit(X[['Scaled_PL','Scaled_PW']])
    SSE.append(test_model.inertia_)

plt.plot(SSE)
plt.xlabel("K")
plt.ylabel("SSE")
```

![elbow plot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yq0jjk8wl60t136mvjkh.png)
_Possible elbow found for the predicted Kmeans model_

---

Here We get the elbow curve at nearly 1 to 5 range (No.of clusters). To get accurate predictions we should put the K value between 1 to 5
Connect 4 Terminal Game in Python
Tags: python, codecademy
Published: 2023-10-11 18:00:32

Connect 4 is a classic game played for generations. As part of the Codecademy Computer Science career path, I have decided to create a simple implementation of it in the Python Terminal. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hrngwf52nv433huzxk4s.png)

The program first creates a blank board as a two-dimensional list, using list comprehensions. It then asks for the names of both players. Once both players are named, the program asks each player to drop their token into one of the seven columns. While loops are utilized to validate input, and to prevent a user from dropping a token into a column that is full. To check for the winner of the game, for loops and if-else statements are used to check for every possible win condition. This is clearly un-ideal, but I believe this is simply another avenue for improvement.

The program functions well as is, although another improvement would be to create a system to validate for integers.

The code is linked [here.](https://github.com/TBSveryfunny/connect4)
647. Palindromic Substrings
Tags: leetcode, medium
Published: 2023-10-11 17:59:30

Problem: [647. Palindromic Substrings](https://leetcode.com/problems/palindromic-substrings/description/)

<strong>Approaches</strong>
1. Simplest approach will be checking all possible combinations of the substrings and check which one is palindromic

    O(n ^ 2) with each string to be around n / 2
    => O(n ^ 3) => more than 10 ^ 9
    and working with string is not so good


2. Can we apply DP here to keep track of the palindrom that is already checked
dp[][]

dp[i][j] will be either 0, 1, or 2
with 0 is unknown
with 1 is false
and 2 is true

dp[i][j] = 1 means that is not palindromic
dp[i][j] = 2 means palindromic checked 

if the string has length 1 => true for sure 

else: 
    check dp first
    check the first and last string then check recurse(left + 1, right - 1);

This will require to start with each substring starting with a specific index and check the length of it 

At most, a substring can have a length of n 
check from length 1 to length n 
with that, 

with length l, check from index 0 till index i as long as i + l < n; i++ 


<strong>Solution</strong>
```java
class Solution {
    int[][] dp;
    String string;
    
    public int recurse(int start, int end) {
        if (dp[start][end] != 0) {
            return dp[start][end];
        } else {
            int isPalindromic = 0;

            if (start == end) {
                isPalindromic = 2;
            } else if (string.charAt(start) != string.charAt(end)) {
                isPalindromic = 1;
            } else { // char at start and end are equal
                if (start + 1 == end) { 
                    isPalindromic = 2;
                } else {
                    isPalindromic = recurse(start + 1, end - 1);
                }
            } 

            dp[start][end] = isPalindromic;
            return dp[start][end];
        }
    }

    public int countSubstrings(String s) {
        string = s;
        dp = new int[string.length()][string.length()];

        for (int r = 0; r < dp.length; r ++) {
            for (int c = 0; c < dp.length; c++) {
                dp[r][c] = 0; // fill with unknown
            }
        }

        for (int length = 1; length <= s.length(); length ++) {
            for (int idx = 0; idx + length - 1 < s.length(); idx ++) {
                // StringBuilder sb = new StringBuilder();
                // for (int i = idx; i < idx + length; i++) {
                //     sb.append(s.charAt(i));
                // }
                // System.out.println(sb.toString());

                recurse(idx, idx + length - 1);
            }
        }    

        int result = 0;
        for (int r = 0; r < dp.length; r ++) {
            for (int c = 0; c < dp.length; c++) {
                if (dp[r][c] == 2) result ++;
            }
        }
        return result;
    }
}
```
Optimizing Ubuntu Linux: Controlling Desktop Animations for a Smooth Experience
Tags: linux
Published: 2023-10-11 17:53:16

Ubuntu Linux, a beloved operating system among many, comes packed with a bouquet of visual effects, including those mesmerizing animations and fading transitions that add an extra layer of charm to your desktop experience.

However, these captivating features can be a double-edged sword, as they might be the catalyst for slowdowns on less powerful hardware.

In this guide, we will navigate the realm of Ubuntu Linux to empower you with the knowledge of how to wield the magic wand that is animation control.

Whether you seek to unleash the full potential of animations on your powerhouse machine or need to reign them in to boost performance on an aging computer, we've got you covered.

## Enabling or Disabling Animations

As previously hinted, the visually stimulating animations in Ubuntu Linux can transform your [desktop](https://www.laiyoh.com) into a captivating wonderland when unleashed on more capable systems. However, on the flip side, their charm can become a performance bottleneck on slower hardware.

Here's how to take control:

**Accessing the Heart of Ubuntu Linux**

In Ubuntu Linux, all roads lead to the System Settings - a centralized hub for a multitude of configurations, from system-wide settings to user management. Getting there is a breeze:

1. Begin by opening the Activities overview, or simply start typing 'Settings' to search for it.
2. Alternatively, you can opt for the more traditional route by clicking on the System menu located at the top-right corner of your desktop.

**Toggling the Animation Switch**

Once you find yourself within the System Settings realm, your journey toward animation control continues:

1. Inside the Settings application, navigate to the left-hand menu and select 'Accessibility.'
2. In the Accessibility settings panel, situated under the 'Seeing' section, you'll encounter the key to your animation kingdom: the 'Enable Animations' toggle.
3. To bask in the glory of desktop animations, simply switch it to the 'On' position.
4. Conversely, if you wish to liberate your system from their allure for improved performance, slide the toggle back to the 'Off' position.

Your chosen path to animation mastery will be applied seamlessly to your desktop, ensuring a tailored user experience.

In conclusion, you've embarked on a journey to seize the reins of desktop animations in Ubuntu Linux. As you gain more control, remember that knowledge is power, and with great power comes great responsibility.

Use this newfound wisdom to craft a desktop experience that suits your needs, and please don't hesitate to share your thoughts or insights in the comments section below. Your input matters!
🚀 Best alternative to contribute to Hacktoberfest (+ brand new leaderboards)📈
Tags: webdev, javascript, programming, hacktoberfest
Published: 2023-10-11 17:48:32


Hey friends 👋

We’re halfway through the second week of Hacktoberfest! 

To make your contributor journey even more rewarding and to supercharge your developer experience, we have, at Quira, released a few Hacktoberfest treats 🍭.

---

## 🍬 Treat 1: Hacktoberfest Leaderboards.

This year celebrates the 10th anniversary of Hacktoberfest and we want to honour and recognise the repos, contributors, and orgs that have contributed to the success of this year's Hacktoberfest.

We are releasing a set of (never seen before) leaderboards that track activity across repos labelled hacktoberfest. 🎃

Check them out [here.](https://quira.sh/hacktoberfest/?utm_source=devto&utm_campaign=hacktoberfest_product_leaderboard_release) 



[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzuing4o2is2sfod5ofk.gif)](https://quira.sh/hacktoberfest/?utm_source=devto&utm_campaign=hacktoberfest_product_leaderboard_release) 




---


##🍭  Treat 2: Hacktoberfest filter on Contribute

To help you achieve those four PR contributions, we are also giving "[Contribute](https://quira.sh/contribute/?utm_source=devto&utm_campaign=hacktoberfest_product_leaderboard_release))" a cool Hacktoberfest twist. 

Simply enable the new shiny filter and find high-quality and Hacktoberfest-ready repositories with just a click (just in case you are wondering, this is completely free 🙂). 

Now there's no excuse not to make those 4 PRs (and not win prizes)! 

Check them out [here.](https://quira.sh/contribute/?utm_source=devto&utm_campaign=hacktoberfest_product_leaderboard_release)


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9oyef5yshbtuprjgg0vw.gif)](https://quira.sh/contribute/?utm_source=devto&utm_campaign=hacktoberfest_product_leaderboard_release)


---

##🍫Treat 3: A Quira+Hacktoberfest swag giveaway

Hacktoberfest wouldn't be complete without caps and T-shirts, right? To make this month even more exciting, we’ll be launching a special competition for Quira users, where you’ll have a chance to win real, physical, Quira swag. And yes, we'll ship it to (almost) anywhere in the world 🌍.

We’ll drop the deets very soon - stay tuned and keep an eye out for further updates. 👀


Are you participating in Hacktoberfest? Let us know what would make your experience more enjoyable by commenting below 👇

Your Dev.to buddy, 

Bap

---


If you haven't yet, you should join our [discord server](https://discord.com/invite/ChAuP3SC5H/?utm_source=devto&utm_campaign=hacktoberfest_product_leaderboard_release) if you want to join the self-proclaimed "coolest" server in open source (😝). We are also here to help you in your journey with open source. 🫶


{% embed [https://dev.to/quira](https://dev.to/quira) %}
Password encryption while login
Tags: springboot, spring, encryption, java
Published: 2023-10-11 17:45:29

We have a centralized application where the are some clients to it where their data will be stored in our application db. Now, I have to encrypt the password while logging in to avoid security issues. But our clients also need to send their password-encrypted and I can't share static secret key with them through which they can encrypt. Any better suggestions are appreciated.
HOW TO DO Password encryption while login?
Tags: springboot, spring, encryption, java
Published: 2023-10-11 17:45:26

We have a centralized application where the are some clients to it where their data will be stored in our application db. Now, I have to encrypt the password while logging in to avoid security issues. But our clients also need to send their password-encrypted and I can't share static secret key with them through which they can encrypt. Any better suggestions are appreciated.
Incident Response For Common Attack Types
Published: 2023-10-11 17:43:42

Incident Response For Common Attack Types

1. Brute Forcing

Details:
Attacker trying to guess a password by attempting several different passwords
Threat Indicators:
Multiple login failures in a short period of time
Where To Investigate:
• Active directory logs
• Application logs
• Operational system logs
• Contact user
Possible Actions:
If not legit action, disable the account and investigate/block attacker

2. Botnets

Details:
Attackers are using the victim server to perform DDoS attacks or other malicious activities
Threat Indicators:
• Connection to suspicious IPs
• Abnormal high volume of network traffic
Where To Investigate:
• Network traffic
• OS logs (new processes)
• Contact server owner
• Contact support team
Possible Actions:
If confirmed:
• Isolate the server
• Remove malicious processes
• Patch the vulnerability utilized for infection

3. Ransomware

Details:
A type of malware that encrypts files and requests a ransom (money payment) from the user to decrypt the files
Threat Indicators:
• Anti-Virus alerts
• Connection to suspicious Ips
Where To Investigate:
• AV logs
• OS logs
• Account logs
• Network traffic
Possible Actions:
• Request AV checks
• Isolate the machine

4. Data Exfiltration
Details:
The attacker (or rogue employee) exfiltrates data to external sources
Threat Indicators:
• Abnormal high network traffic
• Connection to cloud -storage solutions (Dropbox, Google Cloud)
• Unusual USB Sticks
Where To Investigate:
• Network traffic
• Proxy logs
• OS logs
Possible Actions:
• If employee: Contact manager, perform full forensics
• If external threat: Isolate the machine, disconnect from network

5. Compromised Account

Details:
Attackers get access to one account (via social engineering or any other method)
Threat Indicators:
• Off-hours account logins
• Account group changes
• Abnormal high network traffic
Where To Investigate:
• Active directory logs
• OS logs
• Network traffic
• Contact user for clarifications
Possible Actions:
If confirmed:
• Disable account
• Password changes
• Forensic investigations

6. Denial Of Service (Dos/DDoS)

Details:
When attacker can cause interference in a system by exploiting DoS vulnerabilities or by generating a high volume of traffic
Threat Indicators:
Abnormal high network traffic in public facing servers
Where To Investigate:
• Network traffic
• Firewall logs
• OS logs
Possible Actions:
• If DoS due to vulnerabilities: Contact the patching team for remediation
• If DDoS due to network traffic: Contact network Support or ISP
A Guide For Online Dating Coach
Published: 2023-10-11 17:36:10

Relationship therapist Susan Edelman helps single women reclaim their power & transform their love lives. She is an online dating expert & board-certified psychiatrist. By use of our [website](https://beyourownbrandofsexy.com/), you can make the best dating coaching for women over 40 and relationship Decisions. Women used to adhere to a strict, restrictive script in order to succeed in dating.
Error 45 initializing SQL*Plus Internal Error while running an SQL using SQLPlus
Tags: sqlplus, oracle, errors, programming
Published: 2023-10-11 17:32:52


I am trying to execute a shell script that has below code, on Linux server with Oracle 19c installed. I am getting error “Error 45 initializing SQL*Plus Internal Error”.

____________________________________________________________________________

sqlplus uname/'<password>'@DB <<EOF

SELECT 'Refreshed successfully' STATUS FROM DUAL;

exit

EOF

exit 0

____________________________________________________________________________

It establishes the connection and connects to oracle database with credentials, but the next SELECT statement is throwing the error. The error screenshot is attached.


But, When I try to execute in command line the SQL plus statement to connect to the database and run the same SELECT statement manually (Not via Shell Script), It runs without any issues.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7foa34o0rnwbstn3f9e5.png)


Please suggest what has to be checked/modified to resolve this issue.

Need this issue fixed as soon as possible. Any suggestions are welcome.
My Restart
Published: 2023-10-11 17:24:03

>Hello, erveryone, I'm a erlang programmer from china. The reason that i come here is to study technology and english. It's obvious that my english is vary bad. I'm studying CSAPP recently, however it's diffcult for me because my major of university is Biological Sciences. All knowledge of computer sciences is studied on web by myself.So, It's very appreciate if someone would like to have a conversation with me. Recently, I found a hobby of learning calligraphy. I think i should clock everyday. Today is first day.
I will speed up my frequency of updating blog with improvement of my english skills.
![Day1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zg8t15pkh8wy5ojfebt5.jpg)
![Day2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1yveapnwyxqkweqo8wc.jpg)
![Day2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mq663vm8gd12m83j44r2.jpg)