<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shamanta Sristy</title>
    <description>The latest articles on DEV Community by Shamanta Sristy (@shamantasristy).</description>
    <link>https://dev.to/shamantasristy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F602371%2Fe14a29be-030c-4e57-92af-b94175177f19.jpeg</url>
      <title>DEV Community: Shamanta Sristy</title>
      <link>https://dev.to/shamantasristy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shamantasristy"/>
    <language>en</language>
    <item>
      <title>🛳️ Titanic Survival Prediction: A Gentle Introduction to Data Science for Beginners📊</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Tue, 13 May 2025 16:38:25 +0000</pubDate>
      <link>https://dev.to/shamantasristy/titanic-survival-prediction-a-gentle-introduction-to-data-science-for-beginners-9l9</link>
      <guid>https://dev.to/shamantasristy/titanic-survival-prediction-a-gentle-introduction-to-data-science-for-beginners-9l9</guid>
      <description>&lt;p&gt;Hey there, curious minds! 👋&lt;br&gt;
If you're new to data science and machine learning like me, this post is just for you. In this blog, I’ll walk you through one of the most classic beginner projects — predicting survival on the Titanic 🚢 — in a way that’s super beginner-friendly. We’ll explore the steps I took, the code I wrote, and the lessons I learned, all while keeping things simple and clear.&lt;/p&gt;




&lt;h2&gt;
  
  
  📚 What's the Titanic Project?
&lt;/h2&gt;

&lt;p&gt;The Titanic dataset is one of the most popular datasets used to learn data science. The goal is to predict whether a passenger survived or not based on information like their age, gender, ticket class, etc.&lt;/p&gt;

&lt;p&gt;This project is perfect for learning how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explore data 📊&lt;/li&gt;
&lt;li&gt;Clean and prepare it 🧹&lt;/li&gt;
&lt;li&gt;Visualize patterns 🎨&lt;/li&gt;
&lt;li&gt;Apply machine learning 🤖&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📚 Project Overview
&lt;/h2&gt;

&lt;p&gt;This project uses the &lt;a href="https://www.kaggle.com/competitions/titanic/data" rel="noopener noreferrer"&gt;Titanic dataset&lt;/a&gt; to predict whether a passenger survived based on their features like age, sex, class, etc. It’s perfect for learning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data analysis and visualization&lt;/li&gt;
&lt;li&gt;Handling missing data&lt;/li&gt;
&lt;li&gt;Feature engineering&lt;/li&gt;
&lt;li&gt;Training a basic machine learning model (Logistic Regression)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧰 Tools &amp;amp; Technologies Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Language&lt;/strong&gt;: Python&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Libraries&lt;/strong&gt;: Pandas, NumPy, Matplotlib, Seaborn, Scikit-learn&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IDE&lt;/strong&gt;: Jupyter Notebook&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔍 Step-by-Step Walkthrough
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Importing Libraries
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;seaborn&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;sns&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.model_selection&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;train_test_split&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.linear_model&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;LogisticRegression&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.metrics&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;accuracy_score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;classification_report&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Loading the Data
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df = pd.read_csv("titanic.csv")
df.head()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Checking for Missing Values
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df.isnull().sum()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Age: 177 missing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cabin: 687 missing → dropped&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embarked: 2 missing → filled with mode&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Handling Missing Data
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df['Age'].fillna(df['Age'].median(), inplace=True)
df['Embarked'].fillna(df['Embarked'].mode()[0], inplace=True)
df.drop(columns='Cabin', inplace=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. Visualizing the Data
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Survival by Gender
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.countplot(x='Survived', hue='Sex', data=df)
plt.title("Survival Count by Gender")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Survival by Passenger Class
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.countplot(x='Survived', hue='Pclass', data=df)
plt.title("Survival Count by Class")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. Correlation Heatmap
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plt.figure(figsize=(10, 6))
sns.heatmap(df.corr(), annot=True, cmap='coolwarm')
plt.title("Correlation Heatmap")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  7. Feature Encoding
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df['Sex_encoded'] = df['Sex'].map({'male': 0, 'female': 1})
df = pd.get_dummies(df, columns=['Embarked'], drop_first=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  8. Model Preparation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X = df[['Pclass', 'Sex_encoded', 'Age', 'Fare', 'Embarked_Q', 'Embarked_S']]
y = df['Survived']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  9. Logistic Regression Model
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model = LogisticRegression()
model.fit(X_train, y_train)

y_pred = model.predict(X_test)
print("Accuracy:", accuracy_score(y_test, y_pred))
print(classification_report(y_test, y_pred))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🧠 Key Learnings
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;✅ How to explore and clean a real-world dataset&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✅ Understanding visual patterns in data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✅ Feature encoding and selection&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✅ Building a logistic regression model&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✅ Evaluating model accuracy and performance&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💭 Reflections
&lt;/h2&gt;

&lt;p&gt;This project was more than just code — it helped me gain confidence in using ML tools and understand the real process behind building predictive models. I'm now more excited than ever to keep exploring!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thanks for reading! If you're also starting out in machine learning or have suggestions for improvement, I’d love to connect and hear your thoughts 💬&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>machinelearning</category>
      <category>datasciencebeginner</category>
      <category>titanicproject</category>
      <category>pythonprojects</category>
    </item>
    <item>
      <title>🎯 How I Built My First Machine Learning Project (A Beginner-Friendly Guide)</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Sun, 27 Apr 2025 17:32:29 +0000</pubDate>
      <link>https://dev.to/shamantasristy/how-i-built-my-first-machine-learning-project-a-beginner-friendly-guide-3hpg</link>
      <guid>https://dev.to/shamantasristy/how-i-built-my-first-machine-learning-project-a-beginner-friendly-guide-3hpg</guid>
      <description>&lt;p&gt;Today, I’m sharing how I built my &lt;strong&gt;first machine learning project&lt;/strong&gt; after restarting my tech journey — and I’ll walk you through it &lt;strong&gt;step-by-step&lt;/strong&gt; so even beginners can follow along!&lt;/p&gt;

&lt;p&gt;We’ll build a simple &lt;strong&gt;Iris Flower Classification&lt;/strong&gt; project using Python.&lt;br&gt;&lt;br&gt;
Let’s dive in! 🚀&lt;/p&gt;


&lt;h2&gt;
  
  
  Step 1: Setting Up the Project
&lt;/h2&gt;

&lt;p&gt;First, I created a clean folder structure like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iris-classification/
│
├── data/
├── notebooks/
├── src/
├── README.md
├── requirements.txt
└── .gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;code&gt;data/&lt;/code&gt; for datasets&lt;br&gt;&lt;br&gt;
✅ &lt;code&gt;notebooks/&lt;/code&gt; for Jupyter notebooks&lt;br&gt;&lt;br&gt;
✅ &lt;code&gt;src/&lt;/code&gt; for Python scripts&lt;br&gt;&lt;br&gt;
✅ &lt;code&gt;README.md&lt;/code&gt; to explain the project&lt;br&gt;&lt;br&gt;
✅ &lt;code&gt;requirements.txt&lt;/code&gt; to list all needed Python packages&lt;/p&gt;

&lt;p&gt;I highly recommend starting with good organization — it makes everything easier later!&lt;/p&gt;


&lt;h2&gt;
  
  
  Step 2: Loading and Exploring the Data
&lt;/h2&gt;

&lt;p&gt;I used the famous &lt;strong&gt;Iris Dataset&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;data/iris.csv&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;head&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, I checked basic information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df.info()
df.describe()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Tip: Always look at your data first before modeling!&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Visualizing the Data
&lt;/h2&gt;

&lt;p&gt;I made some simple visualizations to understand the features better.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import seaborn as sns
import matplotlib.pyplot as plt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Correlation heatmap
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plt.figure(figsize=(10,8))
sns.heatmap(df.corr(), annot=True, cmap='coolwarm')
plt.title('Feature Correlation Heatmap')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpytwp6f551oytnqismcr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpytwp6f551oytnqismcr.png" alt="Image description" width="795" height="604"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Pairplot
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import seaborn as sns
import matplotlib.pyplot as plt

# Create a smaller pairplot using the correct label
g = sns.pairplot(df, hue='target', height=2.3)

# Add a title
g.fig.suptitle('Pairplot of Iris Features', y=1.03)

# Clean layout
plt.tight_layout()

# Save if needed
plt.savefig('pairplot.png', dpi=300, bbox_inches='tight')

plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8v706yit0z34ll2n2a8d.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8v706yit0z34ll2n2a8d.jpeg" alt="Image description" width="800" height="676"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✅ Tip: Visualization helps you see patterns that numbers alone can't show!&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Preparing the Data
&lt;/h2&gt;

&lt;p&gt;I separated features (X) and labels (y).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X = df.drop('species', axis=1)
y = df['species']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I split the data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Tip: Always split your data — training and testing on the same data gives fake results.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Organizing and Pushing to GitHub
&lt;/h2&gt;

&lt;p&gt;Finally, I learned to push my project properly to GitHub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
git add .
git commit -m "First ML project: Iris Classification"
git branch -M main
git remote add origin https://github.com/ShamantaSristy/iris-classification.git
git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Tip: Save your work online — GitHub shows your growth and makes you look professional!&lt;/p&gt;

&lt;p&gt;🎉 What I Learned&lt;br&gt;
💡How to structure and organize a machine learning project&lt;/p&gt;

&lt;p&gt;💡How to analyze, visualize, and prepare data&lt;/p&gt;

&lt;p&gt;💡How to push and maintain a clean GitHub repository&lt;/p&gt;

&lt;p&gt;👉 My full project is here:&lt;br&gt;
🔗 &lt;a href="https://github.com/ShamantaSristy/iris-classification" rel="noopener noreferrer"&gt;Iris Flower Classification GitHub Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're also starting your journey, trust me — you can do this! 🌱&lt;br&gt;
One small project at a time, and you’ll get better every day.&lt;/p&gt;

&lt;p&gt;See you in the next post, where I'll tackle my next project: the Titanic Survival Prediction 🚢❓&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🎉 I'm Back — And Here's Why I Left (And Why I'm Writing Again)</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Tue, 15 Apr 2025 10:02:06 +0000</pubDate>
      <link>https://dev.to/shamantasristy/im-back-and-heres-why-i-left-and-why-im-writing-again-5bhf</link>
      <guid>https://dev.to/shamantasristy/im-back-and-heres-why-i-left-and-why-im-writing-again-5bhf</guid>
      <description>&lt;p&gt;Hey there, lovely people of Dev! 👋&lt;br&gt;&lt;br&gt;
It's been a while. Maybe even &lt;em&gt;too&lt;/em&gt; long.&lt;/p&gt;

&lt;p&gt;I used to write here — sharing my tech experiments, beginner experiences, and whatever curious thing caught my eye. But then... life happened. Academic pressure, burnout, shifting interests — I paused my writing, not because I didn’t love it, but because I forgot how much I did.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After a long break, I'm returning to share my journey in ML, Computer Vision, and creative tech. Here's why I stopped writing — and what’s next.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But here I am again, with a heart full of ideas and a mind that refuses to stop learning.&lt;br&gt;&lt;br&gt;
And this time? I want to write consistently, creatively, and courageously.&lt;/p&gt;




&lt;h2&gt;
  
  
  👩‍💻 What I’ve Been Up To
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I finished my BSc in Electrical and Electronic Engineering (EEE).&lt;/li&gt;
&lt;li&gt;I dove head-first into &lt;strong&gt;Machine Learning&lt;/strong&gt;, &lt;strong&gt;Smart Grids&lt;/strong&gt;, and recently... &lt;strong&gt;Computer Vision&lt;/strong&gt; (and I &lt;em&gt;love&lt;/em&gt; it!).&lt;/li&gt;
&lt;li&gt;I led the IEEE WIE Affinity Group at my university, starting initiatives from &lt;em&gt;zero funding&lt;/em&gt; and turning them into &lt;em&gt;community-building&lt;/em&gt; successes.&lt;/li&gt;
&lt;li&gt;I’ve been building skills, preparing for higher studies, and rediscovering my passion for writing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💭 What I’ll Be Writing About
&lt;/h2&gt;

&lt;p&gt;You can expect posts on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My learning journey in &lt;strong&gt;Machine Learning&lt;/strong&gt; and &lt;strong&gt;Computer Vision&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Beginner-friendly guides and tutorials&lt;/li&gt;
&lt;li&gt;Reflections from my leadership, academic, and tech experiences&lt;/li&gt;
&lt;li&gt;Tips and tools for staying curious, creative, and kind in the tech world&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤝 Let's Connect!
&lt;/h2&gt;

&lt;p&gt;If you're also learning ML, experimenting with CV, or just figuring things out — I’d &lt;em&gt;love&lt;/em&gt; to connect with you.&lt;br&gt;&lt;br&gt;
Let’s support, grow, and geek out together 💻❤️&lt;/p&gt;




&lt;p&gt;Thanks for sticking around. I'm excited for this new chapter, and I hope you’ll be part of it.&lt;/p&gt;

&lt;p&gt;Stay curious, stay kind,&lt;br&gt;&lt;br&gt;
&lt;strong&gt;— Sristy&lt;/strong&gt; 🌻&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>career</category>
      <category>beginners</category>
      <category>writing</category>
    </item>
    <item>
      <title>What is Event loop in JavaScript?</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Mon, 30 Aug 2021 12:55:30 +0000</pubDate>
      <link>https://dev.to/shamantasristy/what-is-event-loop-in-javascript-34a5</link>
      <guid>https://dev.to/shamantasristy/what-is-event-loop-in-javascript-34a5</guid>
      <description>&lt;p&gt;Let's look into JavaScript Event loop from a different angle. Sounds interesting, right? It is! So, sit tight and let's dive into it!&lt;br&gt;
The concept of event loop is very simple. But in order to understand that,  first we need to be clear about some concepts related to event loop. &lt;/p&gt;

&lt;p&gt;Inside &lt;strong&gt;Browser&lt;/strong&gt;, there is a Javascript engine (we are considering &lt;strong&gt;V8&lt;/strong&gt; for chrome.) and an environment to run javascript properly. Javascript engine has two parts, &lt;strong&gt;Heap&lt;/strong&gt; and &lt;strong&gt;Call Stack&lt;/strong&gt;. And the engine has some assistant named &lt;strong&gt;Web APIs&lt;/strong&gt; and &lt;strong&gt;Callback Queue&lt;/strong&gt;. &lt;/p&gt;
&lt;h2&gt;
  
  
  Heaps
&lt;/h2&gt;

&lt;p&gt;It's an unstructured memory block. Our code's memory allocation happens here. As a programmer we don't have to worry much about heaps.&lt;/p&gt;
&lt;h2&gt;
  
  
  Call Stack
&lt;/h2&gt;

&lt;p&gt;We can consider Call Stack as a kitchen where all our code executed or cooked. Whenever we  try to run a piece of code, it goes to call stack first and then executed. It works in &lt;strong&gt;LIFO&lt;/strong&gt; style. That is &lt;strong&gt;L&lt;/strong&gt;ast  &lt;strong&gt;I&lt;/strong&gt;n &lt;strong&gt;F&lt;/strong&gt;irst &lt;strong&gt;O&lt;/strong&gt;ut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const lunch = () =&amp;gt; console.log("It's time for lunch!");

const dinner = () =&amp;gt; console.log("It's time for dinner!");

const breakfast = () =&amp;gt; {
  console.log("Time to breakfast!");
  setTimeout(lunch, 3000);
  dinner();
};

breakfast();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we run the code above, The global execution context &lt;em&gt;main()&lt;/em&gt; runs on the browser, and JS engine will start to read the code from the first line and will search for tasks. On the last line, one function is called. So, this function will go to the Call Stack and will execute the tasks. First it will print &lt;em&gt;Time to breakfast!&lt;/em&gt; , then goes to the next line, where we have an asynchronous block of code.&lt;br&gt;
 As we know, JavaScript is synchronous and single-threaded language, this asynchronous block of code goes to the call stack and suddenly pops out. Here JS engine takes help from it's assistant, &lt;strong&gt;Web API&lt;/strong&gt;. The setTimeout() waits on the Web API and after it's timer runs out (In this case,  3 seconds), After 3 seconds the callback function goes to the &lt;strong&gt;Callback Queue&lt;/strong&gt; and waits for Call stack to be free. By this time, Call stack runs the other piece of codes. Prints&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;It's time for dinner!&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Web APIs
&lt;/h2&gt;

&lt;p&gt;Web API works as JS engines assistant. When JS engine have to deal with asynchronous code, it takes the help of Web API. Web API handles the blocking behavior of JavaScript code. &lt;br&gt;
In this case, from our code above, we can say Web API will take the callback function&lt;br&gt;
&lt;br&gt;
  &lt;code&gt;setTimeout(lunch, 3000);&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
  , run it's timer,  and pass it to Callback Queue after 3 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Callback Queue
&lt;/h2&gt;

&lt;p&gt;It's a guard who monitors the stack of asynchronous callback functions who just completed the task of waiting and passed the gate of Web API. Callback Queue works using &lt;strong&gt;FIFO&lt;/strong&gt; (&lt;strong&gt;F&lt;/strong&gt;irst  &lt;strong&gt;I&lt;/strong&gt;n &lt;strong&gt;F&lt;/strong&gt;irst &lt;strong&gt;O&lt;/strong&gt;ut ) method. And now, they waits here to go back to Call Stack. But how will Call Stack know that there's some callback functions waiting in Callback Queue? &lt;br&gt;
Here comes the star, &lt;strong&gt;Event Loop&lt;/strong&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Event Loop
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Event loop&lt;/em&gt; is just a guardian who keeps a good &lt;strong&gt;communication&lt;/strong&gt; with &lt;strong&gt;Call Stack&lt;/strong&gt; and &lt;strong&gt;Callback Queue&lt;/strong&gt;. It checks if the call stack is free, then lets know the callback queue. Then Callback queue passes the callback function to Call stack to be executed. When all the callback functions are executed, the call stack is out and global execution context is free. &lt;/p&gt;

&lt;p&gt;See! it was not complex at all! 😄&lt;br&gt;
Thanks for reading.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>eventloop</category>
    </item>
    <item>
      <title>10 Important JavaScript Concepts for Interview</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Sat, 08 May 2021 14:51:16 +0000</pubDate>
      <link>https://dev.to/shamantasristy/10-important-javascript-concepts-for-interview-25ia</link>
      <guid>https://dev.to/shamantasristy/10-important-javascript-concepts-for-interview-25ia</guid>
      <description>&lt;h2&gt;
  
  
  Truthy and Falsy values
&lt;/h2&gt;

&lt;p&gt;By default, javascript considers some values as true and the others false. Almost all values other than &lt;strong&gt;0&lt;/strong&gt; and &lt;strong&gt;''&lt;/strong&gt;(empty string) are considered true in Javascript. &lt;br&gt;
Some specific cases are there when Javascript will show true or false. Now we will discuss them.&lt;/p&gt;
&lt;h3&gt;
  
  
  True values:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;''&lt;/code&gt;, &lt;code&gt;'0'&lt;/code&gt;, &lt;code&gt;{}&lt;/code&gt; , &lt;code&gt;[]&lt;/code&gt;  All these will give true value &lt;/p&gt;
&lt;h3&gt;
  
  
  False values:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;false&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;null&lt;/code&gt; , &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;NaN&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Null vs Undefined
&lt;/h2&gt;

&lt;p&gt;Null is a value that was defined but empty or null, whereas undefined is a value that was declared but no value assigned.&lt;br&gt;
Undefined is a type where null is an object.&lt;/p&gt;
&lt;h2&gt;
  
  
  Double Equal ( == ) vs Triple equal ( === )
&lt;/h2&gt;

&lt;p&gt;Double equals just check values and while triple equals check values with the type of the values. Double equals convert the type of the value and then check the value.&lt;/p&gt;
&lt;h2&gt;
  
  
  Scope
&lt;/h2&gt;

&lt;p&gt;Scope means the accessibility of variables. Javascript has two types of scope: &lt;strong&gt;Local scope&lt;/strong&gt; and &lt;strong&gt;Global scope&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Variables declared within a function are the local scope and these variables are accessible within only that function.&lt;/p&gt;

&lt;p&gt;A global scope is a variable declared outside of a function and accessible from any function, scripts, and  webpage, &lt;/p&gt;
&lt;h2&gt;
  
  
  Block scope
&lt;/h2&gt;

&lt;p&gt;A block scope in Javascript is the area within any loop or condition like &lt;strong&gt;for&lt;/strong&gt;,  &lt;strong&gt;while&lt;/strong&gt;, &lt;strong&gt;if&lt;/strong&gt;, &lt;strong&gt;switch&lt;/strong&gt; etc. To make it more clear, any javascript code within curly braces &lt;code&gt;{}&lt;/code&gt; are block. ES6 made things easy for developers. &lt;strong&gt;let&lt;/strong&gt; and &lt;strong&gt;const&lt;/strong&gt;  keywords are used in specific cases to declare variables that are accessible only within the block.&lt;/p&gt;
&lt;h2&gt;
  
  
  Closuer
&lt;/h2&gt;

&lt;p&gt;Closure in javascript is when there's a function declared within a function. Or a function returns a function. The second function which is declared within the first one has variables that are not accessible from the parent function or first function (&lt;strong&gt;private variable&lt;/strong&gt;). But the children function can access the value of the parent function.&lt;/p&gt;
&lt;h2&gt;
  
  
  Bind
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;bind()&lt;/strong&gt; method creates a new function that, when called, has its &lt;code&gt;this&lt;/code&gt; keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.&lt;/p&gt;
&lt;h2&gt;
  
  
  Call
&lt;/h2&gt;

&lt;p&gt;Call returns function where parameters are separated by a comma.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function.call(firstParam, secondParam, thirdParam);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Apply
&lt;/h2&gt;

&lt;p&gt;Apply returns an array&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function.apply(1st param, [secParam, thirdParam]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Window
&lt;/h2&gt;

&lt;p&gt;The  &lt;code&gt;window&lt;/code&gt;  object is supported by all browsers. It represents the browser's window. All global JavaScript objects, functions, and variables automatically become members of the window object. Global variables are properties of the window object.&lt;br&gt;
Global functions are methods of the window object.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>interview</category>
    </item>
    <item>
      <title>A Deep Dive in JSX</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Fri, 07 May 2021 15:02:37 +0000</pubDate>
      <link>https://dev.to/shamantasristy/a-deep-dive-in-jsx-44pj</link>
      <guid>https://dev.to/shamantasristy/a-deep-dive-in-jsx-44pj</guid>
      <description>&lt;p&gt;To know JSX in-depth, we should have a clear idea of what is JSX and is used? The full form of JSX is &lt;strong&gt;Javascript XML&lt;/strong&gt;. To clear the whole JSX concept first, we will discuss what is JSX?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is JSX?
&lt;/h2&gt;

&lt;p&gt;JSX is an XML/HTML-like syntax used by React.js which extend Javascript so that XML/HTML-like text can co-exist with JavaScript/React code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why JSX?
&lt;/h2&gt;

&lt;p&gt;JSX allows us to write HTML elements in JavaScript and place them in the DOM without any createElement() and/or appendChild() methods.JSX converts HTML tags into react elements.&lt;br&gt;
For example, &lt;strong&gt;with JSX&lt;/strong&gt; , we can write code like below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const firstElement = &amp;lt;h1&amp;gt;My first JSX&amp;lt;/h1&amp;gt;;

ReactDOM.render(firstElement, document.getElementById('root'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And &lt;strong&gt;without JSX&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const firstElement= React.createElement('h1', {}, 'I do not use JSX!');

ReactDOM.render(firstElement, document.getElementById('root'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From above, we can see that, with JSX writing code for React application is quite easy. &lt;/p&gt;

&lt;h2&gt;
  
  
  Expressions in JSX
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Inserting a Single Line HTML
&lt;/h4&gt;

&lt;p&gt;In JSX we can write expressions inside curly braces &lt;code&gt;{ }&lt;/code&gt; . &lt;br&gt;
The expression can be a React variable, or property, or any other valid JavaScript expression. JSX will execute the expression and return the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const text = &amp;lt;h1&amp;gt; This is an expression in JSX &amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Inserting  A Block of HTML
&lt;/h4&gt;

&lt;p&gt;To insert a block of HTML expression on multiple lines, we need to put the HTML block inside parentheses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list= (
  &amp;lt;ul&amp;gt;
    &amp;lt;li&amp;gt;Apples&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;Bananas&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;Cherries&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Specifying The React Element Type
&lt;/h2&gt;

&lt;p&gt;The first part of a JSX tag determines the type of the React element.&lt;/p&gt;

&lt;p&gt;Capitalized types indicate that the JSX tag is referring to a &lt;strong&gt;React component&lt;/strong&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  React Must Be in Scope
&lt;/h3&gt;

&lt;p&gt;Since JSX compiles into calls to  &lt;code&gt;React.createElement&lt;/code&gt;, the  &lt;code&gt;React&lt;/code&gt;  library must also always be in scope from JSX code.&lt;/p&gt;

&lt;p&gt;For example, both of the imports are necessary in this code, even though  &lt;code&gt;React&lt;/code&gt;  and  &lt;code&gt;CustomButton&lt;/code&gt;  are not directly referenced from JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import CustomButton from './CustomButton';

function WarningButton() {
  // return 
React.createElement(CustomButton, {color: 'red'}, null);  return &amp;lt;CustomButton color="red" /&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  User-Defined Components Must Be Capitalized
&lt;/h3&gt;

&lt;p&gt;React recommend naming components with a capital letter. If a component is declared that starts with a lowercase letter, we need to assign it to a capitalized variable before using it in JSX.&lt;/p&gt;

&lt;p&gt;For example, this code will not run as expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

// This is a component and should be capitalized:function Hello(props) { This use of &amp;lt;div&amp;gt; is legitimate because div is a valid HTML tag:
  return &amp;lt;div&amp;gt;Hello {props.toWhat}&amp;lt;/div&amp;gt;;
}

function HelloWorld() {
  // React knows &amp;lt;Hello /&amp;gt; is a component because it's capitalized. 
   return &amp;lt;Hello toWhat="World" /&amp;gt;;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Choosing the Type at Runtime
&lt;/h3&gt;

&lt;p&gt;We cannot use a general expression as the React element type. If we do want to use a general expression to indicate the type of the element, we have to just assign it to a capitalized variable first. &lt;br&gt;
For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import { PhotoStory, VideoStory } from './stories';

const components = {
  photo: PhotoStory,
  video: VideoStory
};

function Story(props) {
  // JSX type can be a capitalized variable. 
  const SpecificStory = components[props.storyType];
  return &amp;lt;SpecificStory story={props.story} /&amp;gt;;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Props in JSX
&lt;/h2&gt;

&lt;p&gt;There are several different ways to specify props in JSX&lt;/p&gt;

&lt;h3&gt;
  
  
  JavaScript Expressions as Props
&lt;/h3&gt;

&lt;p&gt;Any JavaScript expression can be passed as a prop, by surrounding it with  &lt;code&gt;{}&lt;/code&gt;. For example, in this JSX:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyComponent foo={1 + 2 + 3 + 4} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  String Literals
&lt;/h3&gt;

&lt;p&gt;String literals  can be passed as a prop. These two JSX expressions are equivalent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyComponent message="hello world" /&amp;gt;
&amp;lt;MyComponent message={'hello world'} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Spread Attributes
&lt;/h3&gt;

&lt;p&gt;If we already have  &lt;code&gt;props&lt;/code&gt;  as an object, and we want to pass it in JSX, we can use  &lt;code&gt;...&lt;/code&gt;  as a “spread” operator to pass the whole props object. These two components are equivalent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function App1() {
  return &amp;lt;Greeting firstName="Ben" lastName="Hector" /&amp;gt;;
}

function App2() {
  const props = {firstName: 'Ben', lastName: 'Hector'};
  return &amp;lt;Greeting {...props} /&amp;gt;;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Children in JSX
&lt;/h2&gt;

&lt;p&gt;There are several different ways to pass children:&lt;/p&gt;

&lt;h3&gt;
  
  
  String Literals
&lt;/h3&gt;

&lt;p&gt;We can put a string between the opening and closing tags and  &lt;code&gt;props. children&lt;/code&gt;  will just be that string. This is useful for many of the built-in HTML elements. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyComponent&amp;gt;Hello world!&amp;lt;/MyComponent&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  JSX Children
&lt;/h3&gt;

&lt;p&gt;We can provide more JSX elements as the children. This is useful for displaying nested components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyContainer&amp;gt;
  &amp;lt;MyFirstComponent /&amp;gt;
  &amp;lt;MySecondComponent /&amp;gt;
&amp;lt;/MyContainer&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  JavaScript Expressions as Children
&lt;/h3&gt;

&lt;p&gt;Passing any JavaScript expression as children in JSX is allowed, by enclosing it within  &lt;code&gt;{}&lt;/code&gt;. For example, these expressions are equivalent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyComponent&amp;gt;foo&amp;lt;/MyComponent&amp;gt;

&amp;lt;MyComponent&amp;gt;{'foo'}&amp;lt;/MyComponent&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Functions as Children
&lt;/h3&gt;

&lt;p&gt;Normally, JavaScript expressions inserted in JSX will evaluate to a string, a React element, or a list of those things.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Repeat(props) {
  let items = [];
  for (let i = 0; i &amp;lt; props.numTimes; i++) {    items.push(props.children(i));
  }
  return &amp;lt;div&amp;gt;{items}&amp;lt;/div&amp;gt;;
}

function ListOfTenThings() {
  return (
    &amp;lt;Repeat numTimes={10}&amp;gt;
      {(index) =&amp;gt; &amp;lt;div key={index}&amp;gt;This is item {index} in the list&amp;lt;/div&amp;gt;}    &amp;lt;/Repeat&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Children passed to a custom component can be anything, as long as that component transforms them into something React can understand before rendering. This usage is &lt;strong&gt;not common&lt;/strong&gt;, but it works if you want to stretch what JSX is capable of.&lt;/p&gt;

&lt;h3&gt;
  
  
  Booleans, Null, and Undefined Are Ignored
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;false&lt;/code&gt;,  &lt;code&gt;null&lt;/code&gt;,  &lt;code&gt;undefined&lt;/code&gt;, and  &lt;code&gt;true&lt;/code&gt;  are valid children. They simply don’t render. These JSX expressions will all render to the same thing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div /&amp;gt;

&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;div&amp;gt;{false}&amp;lt;/div&amp;gt;

&amp;lt;div&amp;gt;{null}&amp;lt;/div&amp;gt;

&amp;lt;div&amp;gt;{undefined}&amp;lt;/div&amp;gt;

&amp;lt;div&amp;gt;{true}&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If You are new to the JSX concept more's &lt;a href="https://reactjs.org/docs/introducing-jsx.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>jsx</category>
    </item>
    <item>
      <title>10 Interesting hacks about JS (ES6) Block Bindings</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Thu, 06 May 2021 15:45:19 +0000</pubDate>
      <link>https://dev.to/shamantasristy/10-interesting-hacks-about-js-es6-block-bindings-pfp</link>
      <guid>https://dev.to/shamantasristy/10-interesting-hacks-about-js-es6-block-bindings-pfp</guid>
      <description>&lt;p&gt;Today we are going to discuss an interesting topic of EcmaScript6(ES6), Block Bindings. This discussion is going to be about bindings variables to scope.&lt;/p&gt;

&lt;h2&gt;
  
  
  Binding?
&lt;/h2&gt;

&lt;p&gt;Binding is the formal name of &lt;strong&gt;variables&lt;/strong&gt;. When we declare and/or initialize a variable, &lt;strong&gt;we actually bind a value to a name inside a scope&lt;/strong&gt;. And scope means to a specific part of a program.&lt;br&gt;
So we &lt;strong&gt;bind&lt;/strong&gt; a variable whenever we declare and/or initialize a variable using one of these keywords: &lt;strong&gt;var&lt;/strong&gt;, &lt;strong&gt;let&lt;/strong&gt; and &lt;strong&gt;const&lt;/strong&gt; in JavaScript.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a
let b
const last = c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hoisting
&lt;/h2&gt;

&lt;p&gt;In short, hoisting is a mechanism that handles execution contexts in JavaScript. This means &lt;strong&gt;the variable and function declarations&lt;/strong&gt; (not initializations)  are put into the memory during the compile phases before going for any execution.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getName(condition) {

var name

if (condition) {
name = 'Sherlock'
console.log(name)
}
else {
console.log(name)
}
console.log(name)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the above example, we can see, the declaration is hoisted to the top but the initialization is staying exactly where we type the &lt;strong&gt;name&lt;/strong&gt; variable. This means that we can access the &lt;strong&gt;name&lt;/strong&gt; variable from everywhere in the &lt;strong&gt;enclosing&lt;/strong&gt; block in case of &lt;strong&gt;var&lt;/strong&gt; binding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block Level Declarations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Inside a function&lt;/strong&gt; (function block)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Inside a block&lt;/strong&gt;  (wrapped with two curly &lt;strong&gt;{ }&lt;/strong&gt; braces)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Let Declarations
&lt;/h3&gt;

&lt;p&gt;We have already seen these block-level scopes in the example above. Now we will use the previous function again but this time using either &lt;strong&gt;let&lt;/strong&gt; or &lt;strong&gt;const&lt;/strong&gt;. So, we are using &lt;strong&gt;let&lt;/strong&gt; :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getName (condition) {

if (condition) {
let name = 'Nicholas'
console.log(name)
}
else {
// 'name' does not exists here
return null
}
// 'name' does not exists here
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the &lt;strong&gt;let&lt;/strong&gt; binding, we can see, &lt;strong&gt;name&lt;/strong&gt; only exists inside the &lt;strong&gt;if&lt;/strong&gt; block. It is not available outside the &lt;strong&gt;if&lt;/strong&gt; block. &lt;strong&gt;Because JavaScript engine does not hoist let and const declarations.&lt;/strong&gt; So the &lt;strong&gt;name&lt;/strong&gt; is not accessible in &lt;strong&gt;else&lt;/strong&gt; and &lt;strong&gt;enclosing&lt;/strong&gt; blocks.&lt;/p&gt;

&lt;h3&gt;
  
  
  No Redeclaration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = "x"
//syntax error
let name = "y"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;name&lt;/code&gt; is declared twice: once with &lt;code&gt;var&lt;/code&gt; and once with &lt;code&gt;let&lt;/code&gt;.Because &lt;code&gt;let&lt;/code&gt; will not redefine an identifier that already exists in the same scope, the &lt;code&gt;let&lt;/code&gt; declaration will throw an error. On the other hand, no error is thrown if a &lt;code&gt;let&lt;/code&gt; declaration creates a new variable with the same name as a variable in its containing scope, as demonstrated in the following code:&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var count = 30;

// Does not throw an error
if (condition) {

    let count = 40;

    // more code
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Constant Declarations
&lt;/h3&gt;

&lt;p&gt;You can also define variables in ES6 with the &lt;code&gt;const&lt;/code&gt; declaration syntax. Variables declared using &lt;code&gt;const&lt;/code&gt; are considered &lt;em&gt;constants&lt;/em&gt;, meaning their values cannot be changed once set.&lt;/p&gt;

&lt;h3&gt;
  
  
  Constants vs Let Declarations
&lt;/h3&gt;

&lt;p&gt;Constants, like &lt;code&gt;let&lt;/code&gt; declarations, are block-level declarations. That means constants are destroyed once execution flows out of the block in which they were declared, and declarations are not hoisted, as demonstrated in this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition) {
    const maxItems = 5;

    // more code
}

// maxItems isn't accessible here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Block Binding in Loops
&lt;/h3&gt;

&lt;p&gt;Perhaps one area where developers most want block-level scoping of variables is within &lt;code&gt;for&lt;/code&gt; loops, where the throwaway counter variable is meant to be used only inside the loop. For instance, it's not uncommon to see code like this in JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (var i=0; i &amp;lt; 10; i++) {
    process(items[i]);
}

// i is still accessible here
console.log(i); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Functions in Loops
&lt;/h3&gt;

&lt;p&gt;The characteristics of &lt;code&gt;var&lt;/code&gt; have long made creating functions inside of loops problematic because the loop variables are accessible from outside the scope of the loop. Consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var funcs = [];

for (var i=0; i &amp;lt; 10; i++) {
    funcs.push(function() { console.log(i); });
}

funcs.forEach(function(func) {
    func();     // outputs the number "10" ten times
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Let Declarations in Loops
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;let&lt;/code&gt; declaration simplifies loops by effectively mimicking what the IIFE does in the previous example. On each iteration, the loop creates a new variable and initializes it to the value of the variable with the same name from the previous iteration. That means you can omit the IIFE altogether and get the results you expect, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var funcs = [];

for (let i=0; i &amp;lt; 10; i++) {
    funcs.push(function() {
        console.log(i);
    });
}

funcs.forEach(function(func) {
    func();     // outputs 0, then 1, then 2, up to 9
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Constant Declarations in Loops
&lt;/h3&gt;

&lt;p&gt;The ECMAScript 6 specification doesn't explicitly disallow &lt;code&gt;const&lt;/code&gt; declarations in loops; however, there are different behaviors based on the type of loop you're using. For a normal &lt;code&gt;for&lt;/code&gt; loop, you can use &lt;code&gt;const&lt;/code&gt; in the initializer, but the loop will throw a warning if you attempt to change the value. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var funcs = [];

// throws an error after one iteration
for (const i=0; i &amp;lt; 10; i++) {
    funcs.push(function() {
        console.log(i);
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Global Block Bindings
&lt;/h3&gt;

&lt;p&gt;Another way in which &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; are different from &lt;code&gt;var&lt;/code&gt; is in their global scope behavior. When &lt;code&gt;var&lt;/code&gt; is used in the global scope, it creates a new global variable, which is a property on the global object (&lt;code&gt;window&lt;/code&gt; in browsers). That means you can accidentally overwrite an existing global using &lt;code&gt;var&lt;/code&gt;, such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// in a browser
var RegExp = "Hello!";
console.log(window.RegExp);     // "Hello!"

var ncz = "Hi!";
console.log(window.ncz);        // "Hi!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Emerging Best Practices for Block Bindings
&lt;/h3&gt;

&lt;p&gt;While ES6 was released, developers thought &lt;code&gt;let&lt;/code&gt; should behave exactly as &lt;code&gt;var&lt;/code&gt; did. So, the direct replacement makes logical sense. In this case, you would use &lt;code&gt;const&lt;/code&gt; for variables that needed modification protection&lt;br&gt;
However, as more developers migrated to ECMAScript 6, an alternate approach gained popularity: use &lt;code&gt;const&lt;/code&gt; by default and only use &lt;code&gt;let&lt;/code&gt; when you know a variable's value needs to change.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>10 Mostly used Javascript string prototypes you need to know as a beginner</title>
      <dc:creator>Shamanta Sristy</dc:creator>
      <pubDate>Wed, 05 May 2021 15:47:55 +0000</pubDate>
      <link>https://dev.to/shamantasristy/10-mostly-used-javascript-string-prototypes-you-need-to-know-as-a-beginner-4god</link>
      <guid>https://dev.to/shamantasristy/10-mostly-used-javascript-string-prototypes-you-need-to-know-as-a-beginner-4god</guid>
      <description>&lt;p&gt;A string in javascript stores a series of characters, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Harry Potter"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A sting can be anything inside a single or double quote.&lt;br&gt;
Today we will discuss some commonly used string prototypes of javascript.&lt;/p&gt;
&lt;h2&gt;
  
  
  concat()
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;concat()&lt;/strong&gt; method of string contacts or add one string to the other and returns a new string. This addition or concatenation of string is like the second string that sits after the first one and makes a &lt;strong&gt;chain-like structure&lt;/strong&gt;.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const str1 = “Hello”
const str2 = “Albus”
console.log(str1.concat(',  ', str2));

Output: “Hello, Albus” 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  indexOf()
&lt;/h2&gt;

&lt;p&gt;The indexOf() method returns exactly where the string belongs. By default, the indexing or identity of the position of a string starts from [0] and then moves on [1,2,3, ….]. So, if we want to know the exact position of a word in a string, we need to use the indexOf() method. One important thing here to note that, if we ask for any invalid index or a string or word that does not exist in particular that string, it will return the value -1.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const  paragraph = “I am reading about javascript”;
const  searchString = “about”;
const index = paragraph.indexOf(searchString );
console.log(index)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output: 13&lt;/p&gt;

&lt;h2&gt;
  
  
  replace()
&lt;/h2&gt;

&lt;p&gt;replace() method returns a string. If we have a string with series of words of multiple characters, we can change or replace a string or character of the mother string using the replace() method.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const  paragraph = “I am reading about javascript”;
console.log(paragraph.replace('reading', ‘writing’));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output: I am writing about javascript&lt;/p&gt;

&lt;h2&gt;
  
  
  toLowerCase()
&lt;/h2&gt;

&lt;p&gt;If we want to make a string all lowercase, we will use the toLowerCase() method.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const dotted = "Bangladesh";
console.log(dotted.toLowerCase());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
bangladesh&lt;/p&gt;
&lt;h2&gt;
  
  
  toUpperCase()
&lt;/h2&gt;

&lt;p&gt;The toUpperCase() method returns a string that all the characters are converted to uppercase. This is exactly the opposite of the toLowerCase() method.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const lower = "hello";
console.log(lower.toUpperCase());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
HELLO&lt;/p&gt;
&lt;h2&gt;
  
  
  charAt()
&lt;/h2&gt;

&lt;p&gt;Previously we have discussed finding words inside of a string using their index. Now we will discuss something that closely matches that. We will try to find a character in a string using the charAt() method.&lt;br&gt;
Example :&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```const text = "Hello World";&lt;br&gt;
const index = 4;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Output:
o
## includes()
The includes() method performs a case-sensitive search.It finds whether one string may be found within another string. And returns true or false as output.
Example:


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;const isThere = "hello world";&lt;br&gt;
const word = "word";&lt;br&gt;
console.log(isThere.includes(word));&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Output:
false
## slice()
The slice() method extracts a section of a string and returns it as a new string, without modifying the original string.

Example:


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;const text = 'The quick brown fox jumps over the lazy dog.';&lt;/p&gt;

&lt;p&gt;console.log(str.slice(31));&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


 Output: "the lazy dog."

If we want to slice from one index and end another,we have to write that.



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;const text = 'The quick brown fox jumps over the lazy dog.';&lt;br&gt;
console.log(str.slice(4, 19));&lt;br&gt;
Output: "quick brown fox"&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


We can determine inverse index too.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;const text = 'The quick brown fox jumps over the lazy dog.';&lt;br&gt;
console.log(str.slice(-4));&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Output: "dog."

## split() 
The split() method divides a String into an ordered list of substrings, puts these substrings into an array, and returns the array.



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;const str = 'The quick brown fox jumps over the lazy dog.';&lt;/p&gt;

&lt;p&gt;const words = str.split(' ');&lt;br&gt;
console.log(words[3]);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Output: "fox"
## startsWith() 
The startsWith() method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.

Example :


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;const str1 = 'Saturday night plans';&lt;/p&gt;

&lt;p&gt;console.log(str1.startsWith('Sat');&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Output: true


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
  </channel>
</rss>
