<?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>Forem: Gökhan ERGEN</title>
    <description>The latest articles on Forem by Gökhan ERGEN (@gokhanergentech).</description>
    <link>https://forem.com/gokhanergentech</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%2F1133248%2F8ca0dfae-3183-4eb5-ae8e-2d9bcd5306aa.jpeg</url>
      <title>Forem: Gökhan ERGEN</title>
      <link>https://forem.com/gokhanergentech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gokhanergentech"/>
    <language>en</language>
    <item>
      <title>Clean code, programming</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Thu, 17 Apr 2025 00:00:36 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/clean-code-programming-4bpo</link>
      <guid>https://forem.com/gokhanergentech/clean-code-programming-4bpo</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/gokhanergentech" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F1133248%2F8ca0dfae-3183-4eb5-ae8e-2d9bcd5306aa.jpeg" alt="gokhanergentech"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/gokhanergentech/getting-to-know-syntactic-sugar-in-programming-1fm3" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Getting to Know Syntactic Sugar in Programming&lt;/h2&gt;
      &lt;h3&gt;Gökhan ERGEN ・ Apr 16&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#software&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#coding&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cleancode&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#engineer&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>software</category>
      <category>programming</category>
      <category>javascript</category>
      <category>coding</category>
    </item>
    <item>
      <title>How to Check if a Value is a Number in JavaScript</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Mon, 14 Apr 2025 19:51:35 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/how-to-check-if-a-value-is-a-number-in-javascript-2n83</link>
      <guid>https://forem.com/gokhanergentech/how-to-check-if-a-value-is-a-number-in-javascript-2n83</guid>
      <description>&lt;p&gt;In JavaScript, determining whether a value is truly a number can be trickier than it first appears. Especially when dealing with user input — where values like "123" may look like numbers but are actually strings — choosing the right approach is crucial. &lt;/p&gt;

&lt;p&gt;😅 The NaN Dilemma&lt;br&gt;
When coding, we often encounter numbers that are formatted or manipulated without proper validation, leading to unexpected results like NaN. This is one of those moments where you stare at your screen and wonder, "How did this happen?" Understanding how to properly check for valid numbers is essential to avoid these frustrating situations.&lt;/p&gt;

&lt;p&gt;In this post, we’ll explore the most common ways to check if a value is numeric in JavaScript and compare their behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Using typeof for Type Checking&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;typeof x === 'number'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the most basic method to check whether a value is of type "number". However, it has some caveats:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;typeof 123       // "number"
typeof NaN       // "number"
typeof Infinity  // "number"
typeof '123'     // "string"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❗ Both NaN and Infinity are considered numbers — which may not always be what you want.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Using Number.isFinite() — The Safest Method&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;Number.isFinite(x)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method checks whether the value is:&lt;br&gt;
A number, and A finite value (i.e., not NaN, Infinity, or -Infinity)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Number.isFinite(123)        // true
Number.isFinite('123')      // false
Number.isFinite(NaN)        // false
Number.isFinite(Infinity)   // false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ If you want to make sure the value is a real, usable number, this is your best choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Using !isNaN(Number(x)) — Allowing Coercion&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;!isNaN(Number(x))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method is useful if you want to accept numeric strings (e.g., "123"), and convert them before checking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;!isNaN(Number("123"))     // true
!isNaN(Number("abc"))     // false
!isNaN(Number(""))        // true (empty string becomes 0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❗ Be cautious: an empty string ("") is converted to 0, which means this will return true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4 - Detecting Integer Numbers&lt;/strong&gt;&lt;br&gt;
To determine whether a value is an integer, JavaScript provides the Number.isInteger() method. It returns true if the value is of type number and has no decimal part.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Value&lt;/th&gt;
      &lt;th&gt;&lt;code&gt;typeof x === 'number'&lt;/code&gt;&lt;/th&gt;
      &lt;th&gt;&lt;code&gt;Number.isFinite(x)&lt;/code&gt;&lt;/th&gt;
      &lt;th&gt;&lt;code&gt;!isNaN(Number(x))&lt;/code&gt;&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
&lt;td&gt;&lt;code&gt;123&lt;/code&gt;&lt;/td&gt;      &lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
&lt;td&gt;&lt;code&gt;'123'&lt;/code&gt;&lt;/td&gt;    &lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
&lt;td&gt;&lt;code&gt;'abc'&lt;/code&gt;&lt;/td&gt;    &lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
&lt;td&gt;&lt;code&gt;NaN&lt;/code&gt;&lt;/td&gt;      &lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
&lt;td&gt;&lt;code&gt;Infinity&lt;/code&gt;&lt;/td&gt; &lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
&lt;td&gt;&lt;code&gt;''&lt;/code&gt;&lt;/td&gt;       &lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;🧠 When to Use Which?&lt;br&gt;
✅ Use Number.isFinite(x) when you only want real numeric values (excluding NaN and Infinity)&lt;br&gt;
✅ Use !isNaN(Number(x)) if you also want to accept strings like "123"&lt;br&gt;
⚠️ Use typeof x === 'number' only for quick type checks, but not for strict validation&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>software</category>
    </item>
    <item>
      <title>Optimizing the Knapsack Problem Using Stochastic Hill Climbing Algorithm</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Sat, 12 Apr 2025 18:46:53 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/optimizing-the-knapsack-problem-using-stochastic-hill-climbing-algorithm-3d1k</link>
      <guid>https://forem.com/gokhanergentech/optimizing-the-knapsack-problem-using-stochastic-hill-climbing-algorithm-3d1k</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this blog, we will explore how to solve the well-known Knapsack Problem using the Stochastic Hill Climbing algorithm. The Knapsack Problem is a classic optimization problem where the goal is to maximize the value of selected items, subject to weight constraints. Specifically, we'll use the stochastic version of the hill climbing algorithm, which is a local search method that helps in finding the optimal or near-optimal solution for such combinatorial optimization problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## The Knapsack Problem&lt;/strong&gt;&lt;br&gt;
In the 0/1 Knapsack Problem, you are given a set of items, each with a weight and a value. The goal is to select a subset of these items such that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The total weight of the selected items does not exceed the maximum weight limit of the knapsack.&lt;/li&gt;
&lt;li&gt;The total value of the selected items is as large as possible.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In our case, the problem consists of 10 items, each with a specified price and weight. The objective is to select the items that maximize the total price without exceeding a weight of 10 kg.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm Selection: Stochastic Hill Climbing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will use the Stochastic Hill Climbing algorithm to solve this optimization problem. This variant of the Hill Climbing algorithm adds randomness to the local search process, which allows it to explore the solution space more effectively by not always choosing the best immediate neighbor. This randomness can help avoid local optima and increase the chances of finding the global optimum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are given two arrays:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;prices:&lt;/em&gt; Contains the values of the items.&lt;br&gt;
&lt;em&gt;weights:&lt;/em&gt; Contains the weights of the items.&lt;/p&gt;

&lt;p&gt;We also have a maximum weight limit (max_kg) and a certain number of iterations (epochs) to run the algorithm. Our goal is to find a solution where the total weight is less than or equal to 10 kg, and the total price is maximized.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import numpy as np
from local_search import LocalSearch
import numpy as np
import matplotlib.pyplot as plt

local_search = LocalSearch()


prices = np.array([60, 50, 70, 30, 80, 90, 100, 40, 110, 120])
weights = np.array([0.5, 1.2, 2, 3, 0.7, 0.9, 1.5, 0.2, 0.6, 2.5])
max_kg = 10
epochs = 1000
problem_dimension = 10

def objective_function(solution):
    total_price = np.sum(np.multiply(prices, solution))
    if total_price == 0:
        return 10000
    return 1 / total_price


def extra_condition_fn(solution):
    return np.sum(np.multiply(solution, weights)) &amp;lt;= max_kg


def custom_generate_neighbours_fn(neighborhood_count, dim, best_solution):
    neighborhoods = []

    for _ in range(neighborhood_count):
        probs = np.random.uniform(0, 1, dim)
        copied_solution = np.array(best_solution, copy=True)
        inversible_indices = np.where(probs &amp;gt;= 0.5)
        for i in inversible_indices[0]:
            copied_solution[i] = 1- copied_solution[i]
        neighborhoods.append(copied_solution)


    return np.array(neighborhoods)

def calculate_initial_solution_fn(dim):
    return np.zeros(dim)



epoch_results = local_search.fit(objective_function, epochs, 
                                 problem_dimension,
                                 extra_condition_fn=extra_condition_fn,
                                 calculate_initial_solution_fn = calculate_initial_solution_fn,
                                 custom_generate_neighbours_fn=custom_generate_neighbours_fn ,
                                 algorithm_type="stochastic_hill_climbing")

np.set_printoptions(precision=3, suppress=True)

plt.plot(range(0,1000), 1 / np.array(epoch_results).ravel())
plt.title(f"Best Price: {1 / local_search.best_solution_value} KG: {np.sum(np.multiply(local_search.best_solution, weights))}")
plt.xlabel("Iteration")
plt.ylabel("Price")
plt.show()


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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;&lt;/p&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%2F5r4a6mam8olctiq1lyn1.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%2F5r4a6mam8olctiq1lyn1.png" alt="Image description" width="760" height="575"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Solution Found&lt;/strong&gt; -&amp;gt; [1 1 1 0 1 1 1 0 1 1]&lt;br&gt;
&lt;strong&gt;prices&lt;/strong&gt; = np.array([60, 50, 70, 30, 80, 90, 100, 40, 110, 120])&lt;br&gt;
&lt;strong&gt;weights&lt;/strong&gt; = np.array([0.5, 1.2, 2, 3, 0.7, 0.9, 1.5, 0.2, 0.6, 2.5])&lt;/p&gt;

&lt;p&gt;This means that &lt;br&gt;
&lt;strong&gt;The best price&lt;/strong&gt; found is calculated as follows: 1*60 + 50*1 + 70*1 + 30*0 + 80*1 + 90*1 + 100*1 + 40*0 + 110*1 + 120*1 = &lt;strong&gt;680&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;The best weight&lt;/strong&gt; found is calculated as follows: 1*0.5 + 1.2*1 + 2*1 + 3*0 + 0.7*1 + 0.9*1 + 1.5*1 + 0.2*0 + 0.6*1 + 2.5*1 = &lt;strong&gt;9.9&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Steps in the Code:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Objective Function: The goal is to maximize the total price. We define an objective function that takes a solution (a binary array representing selected items) and returns the inverse of the total price. A high penalty is applied when no items are selected.&lt;/li&gt;
&lt;li&gt;Extra Condition: We add a constraint to ensure that the total weight of the selected items does not exceed the given weight limit.&lt;/li&gt;
&lt;li&gt;Neighbor Generation: The custom_generate_neighbours_fn function generates neighboring solutions by randomly flipping the selection of items based on probabilities. This randomness helps the algorithm avoid getting stuck in local optima.&lt;/li&gt;
&lt;li&gt;Initial Solution: The initial solution is defined as selecting no items (all zeros).&lt;/li&gt;
&lt;li&gt;Stochastic Hill Climbing: The fit() method of LocalSearch runs the algorithm, iterating through epochs and refining the solution until the best solution is found or the maximum number of iterations is reached.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>python</category>
    </item>
    <item>
      <title>Pomodoro Technique: The Easiest Way to Boost Your Productivity</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Mon, 31 Mar 2025 08:14:37 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/pomodoro-technique-the-easiest-way-to-boost-your-productivity-143e</link>
      <guid>https://forem.com/gokhanergentech/pomodoro-technique-the-easiest-way-to-boost-your-productivity-143e</guid>
      <description>&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%2Fnhvfew6508j3flvtytnq.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%2Fnhvfew6508j3flvtytnq.png" alt="Image description" width="500" height="603"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Ref: &lt;a href="https://pixabay.com/vectors/egg-timer-egg-timer-timer-kitchen-154763/" rel="noopener noreferrer"&gt;https://pixabay.com/vectors/egg-timer-egg-timer-timer-kitchen-154763/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Nowadays, many people struggle with time management. If you feel distracted while studying, working, or handling projects, the Pomodoro Technique might be just what you need!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Pomodoro Technique?
&lt;/h2&gt;

&lt;p&gt;The Pomodoro Technique is a simple yet effective time management method developed by Francesco Cirillo in the 1980s. This technique aims to enhance focus by breaking work into short intervals.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Apply the Pomodoro Technique?
&lt;/h2&gt;

&lt;p&gt;The key steps of the Pomodoro Technique are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Choose Your Task&lt;/strong&gt;: Decide what you will work on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set a Timer for 25 Minutes&lt;/strong&gt;: Start a focused work session for 25 minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start Working&lt;/strong&gt;: Avoid distractions and concentrate on your task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Take a 5-Minute Break When Time's Up&lt;/strong&gt;: After 25 minutes of work, take a short break.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Take a Longer Break After Four Pomodoros&lt;/strong&gt;: Once you complete four Pomodoros, take a longer break of 15–30 minutes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Advantages of the Pomodoro Technique
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Better Focus&lt;/strong&gt;: Short work intervals prevent distractions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Time Management&lt;/strong&gt;: You complete tasks in a planned manner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Increased Motivation&lt;/strong&gt;: Small achievements boost your motivation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prevention of Burnout&lt;/strong&gt;: Regular breaks help maintain long-term productivity.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some Pomodoro Apps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pomodone (An app integrated into workflow systems)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Focus Booster (A tool offering detailed analytics for professional users)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;PomoBoost (&lt;a href="https://play.google.com/store/apps/details?id=com.aesthetic.pomodoro" rel="noopener noreferrer"&gt;Available on Google Play&lt;/a&gt;)&lt;/strong&gt;- A simple app we have been being developed.&lt;/p&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%2Fkp0t32l3iub0sge67881.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%2Fkp0t32l3iub0sge67881.png" alt="Image description" width="500" height="889"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;PomoBoost Example Screen&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Pomodoro Technique is a fantastic solution, especially for those struggling with focus and productivity. If you have difficulty managing your time, try this technique to boost your work efficiency. Start with small steps and experience the difference!&lt;br&gt;
Do you use the Pomodoro Technique? Share your experiences in the comments!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Pomodoro_Technique" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Pomodoro_Technique&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>softwaredevelopment</category>
      <category>software</category>
      <category>programming</category>
    </item>
    <item>
      <title>Local Search vs Stochastic Hill Climbing: Python Implementation, Testing, and Comparative Analysis</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Mon, 31 Mar 2025 08:10:43 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/local-search-vs-stochastic-hill-climbing-python-implementation-testing-and-comparative-analysis-2lie</link>
      <guid>https://forem.com/gokhanergentech/local-search-vs-stochastic-hill-climbing-python-implementation-testing-and-comparative-analysis-2lie</guid>
      <description>&lt;p&gt;Optimization of Benchmark Functions Using Local Search and Stochastic Hill Climbing&lt;/p&gt;

&lt;p&gt;The optimization of five benchmark functions using the Local Search and Stochastic Hill Climbing algorithm.&lt;/p&gt;

&lt;p&gt;In Local Search, neighborhoods was generated by radius size and selected the best neighborhood.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local Search (LS):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1- Generate an initial solution&lt;/p&gt;

&lt;p&gt;2- In each iteration,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate a set of neighboring solutions based on the current solution using a predefined radius size.&lt;/li&gt;
&lt;li&gt;Select the best solution from the generated neighbors.&lt;/li&gt;
&lt;li&gt;Compare the selected neighbor with the current best solution.&lt;/li&gt;
&lt;li&gt;If the selected neighbor is superior to the current solution, update the current solution and proceed to the next iteration; otherwise, terminate the algorithm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stochastic Hill Climbing (SHC):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1- Generate an initial solution.&lt;/p&gt;

&lt;p&gt;2- In each iteration,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate a set of neighboring solutions based on the current solution using a predefined radius size.&lt;/li&gt;
&lt;li&gt;Randomly select one of the neighboring solutions.&lt;/li&gt;
&lt;li&gt;Compare the selected neighbor with the current best solution.&lt;/li&gt;
&lt;li&gt;If the selected neighbor is superior to the current solution, update the current solution and continue to the next iteration until the maximum number of iterations is reached.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neighborhood count: 1000&lt;/p&gt;

&lt;p&gt;Radius scale size: 0.1&lt;/p&gt;

&lt;p&gt;Domain: (-5.12, 5.12)&lt;/p&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%2Ff1gvtx1gpy9acug94q4v.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%2Ff1gvtx1gpy9acug94q4v.png" alt="Table 1 - Functions and Global Minimum Values" width="746" height="293"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Table 1 - Functions and Global Minimum Values&lt;/em&gt;&lt;/p&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%2F891xjja49cazdjn82mam.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%2F891xjja49cazdjn82mam.png" alt="De Jong 1st Function" width="143" height="102"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;De Jong 1st Function&lt;/em&gt;&lt;/p&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%2F2b43c9skvg81uuiegwlz.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%2F2b43c9skvg81uuiegwlz.png" alt="2nd De Jong Rosenbrock’s Saddle Function" width="403" height="113"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;2nd De Jong Rosenbrock’s Saddle Function&lt;/em&gt;&lt;/p&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%2Fte36j6s0mlmt0sb56adz.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%2Fte36j6s0mlmt0sb56adz.png" alt="4th De Jong Function" width="187" height="106"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;4th De Jong Function&lt;/em&gt;&lt;/p&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%2F2zdvsxyng295icouiwov.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%2F2zdvsxyng295icouiwov.png" alt="Rastrigin’s Function" width="445" height="142"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Rastrigin’s Function&lt;/em&gt;&lt;/p&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%2Ffcjbzxrmgq0vjafsz63h.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%2Ffcjbzxrmgq0vjafsz63h.png" alt="Griewangk’s Function" width="392" height="121"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Griewangk’s Function&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local Search Results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- De Jong 1st Function&lt;/strong&gt;&lt;/p&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%2Fjrsshmb0t000fxs09rjt.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%2Fjrsshmb0t000fxs09rjt.png" alt="Image description" width="640" height="364"&gt;&lt;/a&gt;&lt;/p&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%2Fkqe1t2gw1104xmd6acm8.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%2Fkqe1t2gw1104xmd6acm8.png" alt="Image description" width="640" height="347"&gt;&lt;/a&gt;&lt;/p&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%2Fcdjx4xj5pm4gqz7kfddq.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%2Fcdjx4xj5pm4gqz7kfddq.png" alt="Image description" width="640" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2nd De Jong Rosenbrock’s Saddle Function&lt;/li&gt;
&lt;/ul&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%2Fbkulpjzngc7njz3k7sb2.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%2Fbkulpjzngc7njz3k7sb2.png" alt="Image description" width="640" height="335"&gt;&lt;/a&gt;&lt;/p&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%2Fbbvhir2y17bvnzod9vqk.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%2Fbbvhir2y17bvnzod9vqk.png" alt="Image description" width="640" height="334"&gt;&lt;/a&gt;&lt;/p&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%2Fli69rccqqugsujicgjym.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%2Fli69rccqqugsujicgjym.png" alt="Image description" width="640" height="379"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;- 4th De Jong Function&lt;/strong&gt;&lt;/p&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%2F25wjp3ng3l4sgs730yq3.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%2F25wjp3ng3l4sgs730yq3.png" alt="Image description" width="640" height="356"&gt;&lt;/a&gt;&lt;/p&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%2Fkq48eqk47717btlyn7tw.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%2Fkq48eqk47717btlyn7tw.png" alt="Image description" width="640" height="341"&gt;&lt;/a&gt;&lt;/p&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%2Fhvf4xhm57zlbg8kzoms1.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%2Fhvf4xhm57zlbg8kzoms1.png" alt="Image description" width="640" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rastrigin’s Function&lt;/li&gt;
&lt;/ul&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%2F0q1o1jpku5ifz36xcnl4.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%2F0q1o1jpku5ifz36xcnl4.png" alt="Image description" width="640" height="393"&gt;&lt;/a&gt;&lt;/p&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%2Fb0em7tur6e6df9iughm8.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%2Fb0em7tur6e6df9iughm8.png" alt="Image description" width="640" height="341"&gt;&lt;/a&gt;&lt;/p&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%2Fiebk6d2uxgdbcmjbv1wz.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%2Fiebk6d2uxgdbcmjbv1wz.png" alt="Image description" width="640" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Griewangk’s Function&lt;/strong&gt;&lt;/p&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%2Fzu14eyl157ikhmk6qy5d.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%2Fzu14eyl157ikhmk6qy5d.png" alt="Image description" width="640" height="362"&gt;&lt;/a&gt;&lt;/p&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%2Fmhuq49b60ap9oubqmfw6.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%2Fmhuq49b60ap9oubqmfw6.png" alt="Image description" width="640" height="355"&gt;&lt;/a&gt;&lt;/p&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%2Fg0episv57m51w8ew7pj6.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%2Fg0episv57m51w8ew7pj6.png" alt="Image description" width="640" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stochastic Hill Climbing Results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;- De Jong 1st Function&lt;br&gt;
*&lt;/em&gt;&lt;br&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%2Fqj8lilqfrtefxrdd3hi4.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%2Fqj8lilqfrtefxrdd3hi4.png" alt="Image description" width="640" height="372"&gt;&lt;/a&gt;&lt;/p&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%2F6fxuzn4f4awdgnrlfxkp.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%2F6fxuzn4f4awdgnrlfxkp.png" alt="Image description" width="640" height="341"&gt;&lt;/a&gt;&lt;/p&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%2F8d78pqa1t9k4z7ty7l44.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%2F8d78pqa1t9k4z7ty7l44.png" alt="Image description" width="640" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- 2nd De Jong Rosenbrock’s Saddle Function&lt;/strong&gt;&lt;/p&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%2Fqtn5t1m4natfciwli22o.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%2Fqtn5t1m4natfciwli22o.png" alt="Image description" width="640" height="361"&gt;&lt;/a&gt;&lt;/p&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%2Frr858uo611t504jxgx0v.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%2Frr858uo611t504jxgx0v.png" alt="Image description" width="640" height="324"&gt;&lt;/a&gt;&lt;/p&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%2Fceqzi8oy7dpujfbw0xtl.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%2Fceqzi8oy7dpujfbw0xtl.png" alt="Image description" width="640" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- 4th De Jong Function&lt;/strong&gt;&lt;/p&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%2Fux80ln1j6shqdsbimilp.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%2Fux80ln1j6shqdsbimilp.png" alt="Image description" width="640" height="353"&gt;&lt;/a&gt;&lt;/p&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%2Fj4mevr7bc1ke34ubnkho.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%2Fj4mevr7bc1ke34ubnkho.png" alt="Image description" width="640" height="331"&gt;&lt;/a&gt;&lt;/p&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%2Fka33fnsfasw28x2wyslo.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%2Fka33fnsfasw28x2wyslo.png" alt="Image description" width="640" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Rastrigin’s Function&lt;/strong&gt;&lt;/p&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%2Fgdu7fjf0tmpr9u7b6xb1.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%2Fgdu7fjf0tmpr9u7b6xb1.png" alt="Image description" width="640" height="357"&gt;&lt;/a&gt;&lt;/p&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%2Ff6yquka01ynf2k25uuq4.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%2Ff6yquka01ynf2k25uuq4.png" alt="Image description" width="640" height="347"&gt;&lt;/a&gt;&lt;/p&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%2Fpkmlrfphi3j4638xp2lk.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%2Fpkmlrfphi3j4638xp2lk.png" alt="Image description" width="640" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-  Griewangk’s Function&lt;/strong&gt;&lt;/p&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%2Fuh6qydi3fj1o3pjys1e9.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%2Fuh6qydi3fj1o3pjys1e9.png" alt="Image description" width="640" height="341"&gt;&lt;/a&gt;&lt;/p&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%2F4pz7gpdr9rzlanbewp6j.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%2F4pz7gpdr9rzlanbewp6j.png" alt="Image description" width="640" height="349"&gt;&lt;/a&gt;&lt;/p&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%2Fauyltdvttrnu2jlr3rrm.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%2Fauyltdvttrnu2jlr3rrm.png" alt="Image description" width="640" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparison Tables&lt;/strong&gt;&lt;/p&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%2Fezi89pjhm9v51chuvgrg.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%2Fezi89pjhm9v51chuvgrg.png" alt="Image description" width="640" height="351"&gt;&lt;/a&gt;&lt;/p&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%2Ffc3x72lh3049oaaa0a8d.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%2Ffc3x72lh3049oaaa0a8d.png" alt="Image description" width="640" height="338"&gt;&lt;/a&gt;&lt;/p&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%2Fb6gqwel4eenw2r49ymp5.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%2Fb6gqwel4eenw2r49ymp5.png" alt="Image description" width="588" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Local Search (LS) demonstrated high computational efficiency, whereas Stochastic Hill Climbing (SHC) generally yielded better results. Both methods are variants of local search; however, their neighborhood selection strategies differ. SHC selects a neighboring solution randomly, while LS always chooses the best available option. Additionally, LS terminates if no improvement is found, whereas SHC continues until the maximum number of iterations is reached.&lt;/p&gt;

&lt;p&gt;Local search (LS) also employs a greedy approach in this context, as it aims to improve the current solution at each step by selecting the best neighboring solution. This approach often leads the algorithm to become stuck in a local optimum, as it consistently chooses the most favorable option available without considering alternative paths.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link for codes: &lt;a href="https://github.com/gokhanergen-tech/python-local-search-stochastic-hill-climbing" rel="noopener noreferrer"&gt;https://github.com/gokhanergen-tech/python-local-search-stochastic-hill-climbing&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.sfu.ca/%7Essurjano/rastr.html" rel="noopener noreferrer"&gt;https://www.sfu.ca/~ssurjano/rastr.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.sfu.ca/%7Essurjano/griewank.html" rel="noopener noreferrer"&gt;https://www.sfu.ca/~ssurjano/griewank.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://algorithmafternoon.com/stochastic/stochastic_hill_climbing/" rel="noopener noreferrer"&gt;https://algorithmafternoon.com/stochastic/stochastic_hill_climbing/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://machinelearningmastery.com/stochastic-hill-climbing-in-python-from-scratch/" rel="noopener noreferrer"&gt;https://machinelearningmastery.com/stochastic-hill-climbing-in-python-from-scratch/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/introduction-hill-climbing-artificial-intelligence/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/introduction-hill-climbing-artificial-intelligence/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>datascience</category>
      <category>algorithms</category>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>Signal Visualization in Discrete-Time Domain</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Wed, 05 Mar 2025 13:26:35 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/signal-visualization-in-discrete-time-domain-479d</link>
      <guid>https://forem.com/gokhanergentech/signal-visualization-in-discrete-time-domain-479d</guid>
      <description>&lt;p&gt;In this application, we analyze and visualize the discrete-time signal represented by the following function:&lt;/p&gt;

&lt;p&gt;y(k)=5cos(2πf1​kTs​)−2sin(2πf2​kTs​)&lt;/p&gt;

&lt;p&gt;where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;f1 and f2​ are the signal frequencies,&lt;/li&gt;
&lt;li&gt;k represents the discrete-time index,&lt;/li&gt;
&lt;li&gt;Ts​ is the sampling period.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The signal values were computed and visualized using both stem and line plots to illustrate its discrete and continuous representations. These graphs help in understanding the periodic behavior and frequency components of the signal in the time domain.&lt;br&gt;
A dropdown menu labeled "Examples" has been added, allowing users to switch between different examples seamlessly. This feature enhances usability by providing quick access to various signal processing demonstrations.&lt;/p&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%2Fv8p67s9vdajr0dr9450y.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%2Fv8p67s9vdajr0dr9450y.png" alt="Examples Dropdown" width="454" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can change the function parameters.&lt;/p&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%2F5bd8t3bdukx4pu6ugt9t.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%2F5bd8t3bdukx4pu6ugt9t.png" alt="Image description" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will encounter an interface where you can configure settings and view the signal graphs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calculation Used In The App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ts = 1/Fs&lt;br&gt;
x = [0, 1, 2, … N]&lt;br&gt;
y = [(5*np.cos(2*pi*f1s*k*Ts)-2*sin(2*pi*f2s*k*Ts)) foreach k in x]&lt;br&gt;
power = np.power(y,2)&lt;br&gt;
energy = np.sum(power)&lt;br&gt;
rmse = np.sqrt(energy/self.N)&lt;br&gt;
average = np.mean(y)&lt;br&gt;
variance = (1/self.N)&lt;em&gt;np.sum(np.power((y-average),2))&lt;br&gt;
std = np.sqrt(variance)&lt;br&gt;
median = np.median(y)&lt;br&gt;
own_mean = mean_own(y)&lt;br&gt;
own_rmse = rmse_own(y)&lt;br&gt;
own_variance = variance_own(y, own_mean)&lt;br&gt;
own_std = math.sqrt(own_variance)&lt;br&gt;
own_median = median_own(y)&lt;br&gt;
own_average_power = own_rmse&lt;/em&gt;*2&lt;br&gt;
own_energy = own_average_power*len(y)&lt;br&gt;
To show as time&lt;br&gt;
x = [i/fs foreach i in x]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Increasing N&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If N increases, the signal sample time will also increase, resulting in a wider range of signals observed in the graph.&lt;/p&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%2F5s19aiumditpg2w56k2d.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%2F5s19aiumditpg2w56k2d.png" alt="Image description" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If fs increases, Ts will reduce. In this case, the signals we will be able to see in the graph will be limited.&lt;/p&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%2Fwn3kb4kbiwcibp2lapb9.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%2Fwn3kb4kbiwcibp2lapb9.png" alt="Image description" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&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%2Fc7c9razv643vy5oxqdef.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%2Fc7c9razv643vy5oxqdef.png" alt="Image description" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When fs = 500 and N = 250 are the same, the graph appears identical to the case where fs = 200 and N = 100.&lt;br&gt;
We can observe signal analyses in the table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Github Link:&lt;/strong&gt; &lt;a href="https://github.com/gokhanergen-tech/dearpygui-signal-waveforms" rel="noopener noreferrer"&gt;https://github.com/gokhanergen-tech/dearpygui-signal-waveforms&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>coding</category>
      <category>data</category>
    </item>
    <item>
      <title>A GUI App Which You Can Visulise Signal Waveforms With Python</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Sun, 16 Feb 2025 20:56:02 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/a-gui-app-which-you-visulise-signal-waveforms-with-python-2ben</link>
      <guid>https://forem.com/gokhanergentech/a-gui-app-which-you-visulise-signal-waveforms-with-python-2ben</guid>
      <description>&lt;p&gt;In this App, you can visulise three signal waveforms such as Sinusoidal, Square, and saw-toothed. Also, these signals has some params which you can setting them. The application was developed with dearpygui providing UI components for desktop apps. If you want to write a detailed blog about dearpygui, please comment :).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A: Ampitute&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can setting the ampitute of the waves.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DC&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A constant value which offsets veritcally&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FI0: Initial Phase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Phase shift&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fs: Sampling Frequency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a sampling frequency showing how many samples is collected per a second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fsig: Frequency Signal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can use this to take the cycle count of signals. A cycle takes 1/Fsig seconds.&lt;/p&gt;

&lt;p&gt;If Fsig is 0.2hz then the cycle count will be 5 seconds.&lt;/p&gt;

&lt;p&gt;you can visulise sinusoidal sampled signal, squared sampled signal, and saw-toothed sampled signal by using above the params. The time range of signals is splitted (max_time-min_time)*Fs because Fs is sampling frequence per a second.&lt;/p&gt;

&lt;p&gt;The program, which you change the params has a basic interface.&lt;/p&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%2Fnk5x8e8tag1igbz7yvv8.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%2Fnk5x8e8tag1igbz7yvv8.png" alt="Image description" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sinusoidal Wave&lt;/strong&gt;&lt;br&gt;
As a default, selected waveform is sinusoidal.&lt;br&gt;
Signal time range is between 0 and 10 and uses A*sin(2*π*Fsig*t+fi0)+dc as a formula to be drawn.&lt;br&gt;
In case A = 4,&lt;/p&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%2Fwucycobstaupzmfq3fv3.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%2Fwucycobstaupzmfq3fv3.png" alt="Image description" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can use that positive side is about max 5 and negative side is min -3, because DC is 1 so signal shifts verticaly to up 1 step.&lt;br&gt;
&lt;strong&gt;Square Wave&lt;/strong&gt;&lt;/p&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%2Fr2jr2mymqavi497zjrsw.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%2Fr2jr2mymqavi497zjrsw.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see a squared sampled signal.&lt;br&gt;
signal_wave = sin(2*π&lt;em&gt;Fsig*t)&lt;br&gt;
if signal_wave &amp;gt;=0, 1&lt;br&gt;
otherwise, -1&lt;br&gt;
**Saw-toothed Wave&lt;/em&gt;*&lt;/p&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%2Fjsowfph7s4pfo2wphry9.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%2Fjsowfph7s4pfo2wphry9.png" alt="Image description" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use scipy library to draw saw-toothed wave form.&lt;br&gt;
All of these signal waveforms use the same params.&lt;br&gt;
Lets change the time range as -100 to 100. We will see this graph sinusoidal waveforms.&lt;/p&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%2Fmw4u8kqour0sybrhvrqp.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%2Fmw4u8kqour0sybrhvrqp.png" alt="Image description" width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I changed Fsig to 0.5. This means T = 1/0.5 = 2s cycle time.&lt;/p&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%2Fafr51sywv2ky8e6d8cx7.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%2Fafr51sywv2ky8e6d8cx7.png" alt="Image description" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&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%2F6p22ah1x0jw4qw86durm.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%2F6p22ah1x0jw4qw86durm.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&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%2F0msy84zicvh51m6fmzo4.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%2F0msy84zicvh51m6fmzo4.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python Version:&lt;/strong&gt; 3.11.5&lt;br&gt;
&lt;strong&gt;Scipy:&lt;/strong&gt; 1.11.3&lt;br&gt;
&lt;strong&gt;Numpy:&lt;/strong&gt; 1.26.0&lt;br&gt;
&lt;strong&gt;Dearpygui:&lt;/strong&gt; 1.9.0&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Github Link:&lt;/strong&gt; &lt;a href="https://github.com/gokhanergen-tech/dearpygui-signal-waveforms" rel="noopener noreferrer"&gt;https://github.com/gokhanergen-tech/dearpygui-signal-waveforms&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>signal</category>
      <category>programming</category>
      <category>application</category>
    </item>
    <item>
      <title>Installing A Linux Distribution Using WSL</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Thu, 13 Feb 2025 13:57:39 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/installing-a-linux-distribution-using-wsl-28oc</link>
      <guid>https://forem.com/gokhanergentech/installing-a-linux-distribution-using-wsl-28oc</guid>
      <description>&lt;p&gt;WSL means Windows Subsystem For Linux. You can use linux on Windows and execute its commands. In this blog, we will see wsl commands and Ubuntu Installation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check Before Installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You need to have Windows 10 (version 2004 and later) and Windows 11&lt;br&gt;
WSL Installation&lt;/p&gt;

&lt;p&gt;It is easy to do this via one command&lt;br&gt;
&lt;code&gt;wsl --install&lt;/code&gt;&lt;br&gt;
By using this command, you can install wsl features and Ubuntu.&lt;/p&gt;

&lt;p&gt;Maybe, you want to install a specific distribution of Ubuntu.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wsl --install -d &amp;lt;any-ubuntu-distribution&amp;gt;&lt;/code&gt;&lt;br&gt;
If you want to download the list of linux distributions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wsl --list --online&lt;br&gt;
wsl -l -o&lt;/code&gt;&lt;br&gt;
You can also see whether the distributions you installed are working or not.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wsl --list --verbose&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Updating WSL and Checking Its Version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wsl --version&lt;br&gt;
wsl --update&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;More Options About WSL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can check options by using below the command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wsl --help&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Removing a Distribution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can delete your distribution, but you should be careful because most things related to the distribution you want to delete will be removed.&lt;/p&gt;

&lt;p&gt;Please check the reference: Removing a Distribution&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wsl --unregister &amp;lt;installed-distribution&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Limiting WSL’s Resource Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First of all, you need to create a wslconfig file as below, but this is available in wsl 2 distributions.&lt;/p&gt;

&lt;p&gt;C:\Users\UserName.wslconfig&lt;/p&gt;

&lt;p&gt;If you want check the versions of your distributions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wsl -l -v&lt;/code&gt;&lt;br&gt;
Finally, your linux distribution is ready. You can install vscode, dockerize your app and write code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can look these:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1 - Basic Info About WSL&lt;/p&gt;

&lt;p&gt;2- Advance Settings Configuration&lt;/p&gt;

</description>
      <category>linux</category>
      <category>software</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Raspberry PI Apache Web Server, Pigpio and Ultrasonic Sensor With Java By Using PI4J Library</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Sat, 02 Mar 2024 13:16:52 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/raspberry-pi-apache-web-server-pigpio-and-ultrasonic-sensor-with-java-by-using-pi4j-library-hpg</link>
      <guid>https://forem.com/gokhanergentech/raspberry-pi-apache-web-server-pigpio-and-ultrasonic-sensor-with-java-by-using-pi4j-library-hpg</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Raspberry PI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Raspberry PI was developed for low cost and to teach students about computers. But today, it can also be used for personal and daily use. You can create circuits and projects on it. It is an embedded Linux system that becomes more powerful with new versions.&lt;/p&gt;

&lt;p&gt;You can build your own circuits on it, create servers and work on image processing. Raspberry takes its name from the name of the fruit and PI comes from Python, which belongs to RPI and also refers to the number PI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fay3xee6d7wk6tizdc9kt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fay3xee6d7wk6tizdc9kt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As seen in Figure 1, Raspberry PI model 4b has 4 USB ports, 1 Gigabit internet port and 2 HDMI converter ports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Raspberry PI as an Embedded System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Embedded systems can be defined as a combination of hardware and software such as memory, IO and CPU. Raspberry PI is a mini computer that can fit in our hands and we can think of it as an embedded system. A system can be obtained by combining hardware, and software is required for this system to perform certain functions. The software contains the commands for the hardware to perform its function, and the commands are converted into the language that the machine understands, that is, 0s and 1s. Instructions are executed on the processor. This logic also works in embedded systems, and we can write software containing commands and manage hardware on Raspberry PI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Apache Server on Raspberry PI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fkmoh6h485gnp39749cna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fkmoh6h485gnp39749cna.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The application was made on a 4GB version of the Raspberry PI 4B model. There is an SD card slot on it. A 32GB SD card was used as storage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fhz3terv1bnsthspf1t50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fhz3terv1bnsthspf1t50.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to make any development, a Linux system must be installed. First of all, we make the SD card bootable. Operating system is a system software. Thanks to this software, we can manage the hardware. In addition, the operating system is a software and we can produce and run software through this software.&lt;/p&gt;

&lt;p&gt;Linux-based Raspberry PI OS was installed on this computer. This operating system offers us GUI and you can also use the terminal so you can benefit from the services of the operating system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fc4fi8clfyt2m0ss28741.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fc4fi8clfyt2m0ss28741.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After downloading the software here, it can be used with a laptop or another computer with SD card reader feature. With this program, you can easily install the operating system by choosing an operating system on your SD card. To get information about installation and more, you can visit their website [9].&lt;/p&gt;

&lt;p&gt;You can use Raspberry PI on a display that supports HDMI. For this, you can connect your HDMI converter cable to the micro HDMI port to the monitor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F319l2v44ismguiewj7c5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F319l2v44ismguiewj7c5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the picture in Figure 5, 2 USBs were used for the keyboard and mouse and were powered by a power adapter. Raspberry PI is ready for use with a bootable SD card.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fv8a9ewhecd90vyc4oip6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fv8a9ewhecd90vyc4oip6.png" alt="Figure 6 Raspberry PI OS"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 6 Raspberry PI OS



&lt;p&gt;In Figure 6, you can go to the configuration settings and make keyboard settings and activate the SSH option. You can also access your computer’s command line remotely via SSH.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fus9ashuiyffle6538qdo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fus9ashuiyffle6538qdo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 7 Raspberry PI OS Configuration Settings



&lt;p&gt;&lt;a href="https://media.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%2Fcq2kghkdhn891ninow0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcq2kghkdhn891ninow0w.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 8 Terminal Screen



&lt;p&gt;In Figure 8, we opened the terminal software and will operate on the command line. First of all, we can get the current version of our packages and new versions with update, and we can move the packages we have to the latest version with upgrade. If yes or no questions come up during the process and you want the default to be yes, you can add the -y argument.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fmhbpwhlhwuom5sozrc8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmhbpwhlhwuom5sozrc8x.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 9 Apache Installation



&lt;p&gt;You can easily install the Apache web server by entering the sudo apt-get install apache2 command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fsmi7096uo855n5occ1b2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsmi7096uo855n5occ1b2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 10 Learning Apache Server Status



&lt;p&gt;You can find out whether the web server is active or not with sudo systemctl status apache2 command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fyxvu56xrvelncopsc0e9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fyxvu56xrvelncopsc0e9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 11 Accessing the Address on the Local Network



&lt;p&gt;You can access your 32-bit address assigned to you on the local network with the hostname -I command. The web page was served by Apache via this address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fhttxmdszcbw6u2fs9xr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fhttxmdszcbw6u2fs9xr3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 12 Apache Default Page Location



&lt;p&gt;Apache http server is served at /var/www/html by default. For detailed information, you can visit [18][19]. It will contain an index.html file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fhr01ypsvbwaow5iu94t1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fhr01ypsvbwaow5iu94t1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 13 /var/www/html Folder Content



&lt;p&gt;&lt;a href="https://media.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%2Fwcwywffq9m3hh8jvaeb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fwcwywffq9m3hh8jvaeb7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 14 Changing Html File Content



&lt;p&gt;You can use the file content using nano or vim, whichever you prefer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fafh5la8eswntxoau4oeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fafh5la8eswntxoau4oeg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

Figure 15 Accessing the Web Page



&lt;p&gt;You can access the web page by typing the address you obtained with the hostname -I command into the URL section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Raspberry PI Pigpio Usage and Java PI4J Distance Sensor Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can say that Pigpio is a tool that allows us to operate the pins on the Raspbery PI.&lt;/p&gt;

&lt;p&gt;There is also a library that you can use with Java language. PI4J is an I/O library that allows us to develop with Raspberry PI. You can do various projects with this library.&lt;/p&gt;

&lt;p&gt;Java is a powerful language that has a lot of support and you will not have any difficulty in searching for resources, and if you already have experience in this language, you will not have any difficulty. First of all, let’s give information about writing and reading values on some small pins with pigpio.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F0t0czrsiec13honmr5cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F0t0czrsiec13honmr5cg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 16 Pigpio Installation



&lt;p&gt;If the package is not installed, you can quickly install it with sudo apt-get pigpio command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1dz5i7ndq1hcecdlkp55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1dz5i7ndq1hcecdlkp55.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 17 Pigpiod Status



&lt;p&gt;You can see the status of the package with sudo systemctl status pigpiod command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Frovgve1ig58t19dhhuu7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Frovgve1ig58t19dhhuu7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 18 Basic Pigpio Commands



&lt;p&gt;pigs modes ‘pin code’ ‘mode (w)write or (r)read’&lt;/p&gt;

&lt;p&gt;pigs modes 17 w&lt;/p&gt;

&lt;p&gt;pigs modes 17 r&lt;/p&gt;

&lt;p&gt;Pin 17 is set to read or write mode.&lt;/p&gt;

&lt;p&gt;pigs w 17 1 with this command, high, i.e. 3.3v, was transmitted to pin 17.&lt;/p&gt;

&lt;p&gt;At this stage, if an LED circuit is installed on the relevant pin, the LED will turn on. In this case, pigs w 17 0 will switch to the off state, that is, low. pigs r 17 checks whether there is voltage on pin 17 or not. If it exists, it returns 1, otherwise it returns 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Distance Sensor with Java PI4J Library&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s look at an example distance sensor application with the Java pi4j library. Pi4j library uses the pigpio package and you can check out the sources for detailed information [20].&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F2vuhcb3agia5evfsqzyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2vuhcb3agia5evfsqzyr.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 19 Distance Sensor Circuit



&lt;p&gt;&lt;a href="https://media.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%2Fsesdonf6s8aa4kac7vpt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsesdonf6s8aa4kac7vpt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 20 https://www.researchgate.net/figure/Raspberry-Pi-4-pin-details_fig4_352212777



&lt;p&gt;In the application, 1 HC-SR04 distance sensor, 1 LED and 2 resistors were used. The red LED turns on when the distance between the sensor and the object is less than 10cm. GPIO 2 was connected to echo on the sensor and GPIO 3 was connected to trigg. 3.3v was used as voltage. GPIO 17 pin was used for the LED.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fsvpfwm9dcsl118kmgmjd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsvpfwm9dcsl118kmgmjd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 21 Distance Sensor Application Command Line



&lt;p&gt;&lt;a href="https://media.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%2Fdyxi69awesq7v2qabype.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fdyxi69awesq7v2qabype.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 22 Example Distance Less than 10cm



&lt;p&gt;&lt;a href="https://media.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%2F9kbrlxfhofc57m8x3mzd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9kbrlxfhofc57m8x3mzd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
Figure 23 Distance More Than 10cm



&lt;p&gt;Github: &lt;a href="https://github.com/gokhanergen-tech/pi4j-java-distance-sensor-and-vcore-raspberry-pi" rel="noopener noreferrer"&gt;https://github.com/gokhanergen-tech/pi4j-java-distance-sensor-and-vcore-raspberry-pi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a result, Raspberry PI is a popular educational computer today. You can install a web server such as Apache on it or use it in your daily work. You can design circuits and make projects using sensors. You may not limit yourself to the programming language and you can choose other programming languages as needed. Within the scope of this article, examples of a library developed in Java language were shown.&lt;/p&gt;

&lt;p&gt;Sources&lt;/p&gt;

&lt;p&gt;1-&lt;a href="https://www.researchgate.net/figure/The-structure-of-the-Raspberry-Pi-4B_fig1_370357718" rel="noopener noreferrer"&gt;https://www.researchgate.net/figure/The-structure-of-the-Raspberry-Pi-4B_fig1_370357718&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2-&lt;a href="https://www.deviceplus.com/raspberry-pi/the-history-of-raspberry-pi/" rel="noopener noreferrer"&gt;https://www.deviceplus.com/raspberry-pi/the-history-of-raspberry-pi/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3-&lt;a href="https://electronicguidebook.com/is-raspberry-pi-an-embedded-system%EF%BF%BC/" rel="noopener noreferrer"&gt;https://electronicguidebook.com/is-raspberry-pi-an-embedded-system%EF%BF%BC/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4-&lt;a href="https://www.raspberrypi.com/software/" rel="noopener noreferrer"&gt;https://www.raspberrypi.com/software/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5-&lt;a href="https://mediatrend.mediamarkt.com.tr/windows-10-bootable-usb-nasil-yapilir/" rel="noopener noreferrer"&gt;https://mediatrend.mediamarkt.com.tr/windows-10-bootable-usb-nasil-yapilir/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6-&lt;a href="https://edu.gcfglobal.org/en/computerbasics/understanding-operating-systems/1/" rel="noopener noreferrer"&gt;https://edu.gcfglobal.org/en/computerbasics/understanding-operating-systems/1/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7-&lt;a href="https://www.freecodecamp.org/news/command-line-for-beginners/" rel="noopener noreferrer"&gt;https://www.freecodecamp.org/news/command-line-for-beginners/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;8-&lt;a href="https://www.prepbytes.com/blog/operating-system/operating-system-services" rel="noopener noreferrer"&gt;https://www.prepbytes.com/blog/operating-system/operating-system-services&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;9- Raspberry Pi Documentation — Getting started&lt;/p&gt;

&lt;p&gt;10-&lt;a href="https://pimylifeup.com/raspberry-pi-apache/" rel="noopener noreferrer"&gt;https://pimylifeup.com/raspberry-pi-apache/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;11-&lt;a href="https://linuxize.com/post/how-to-create-groups-in-linux/" rel="noopener noreferrer"&gt;https://linuxize.com/post/how-to-create-groups-in-linux/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;12-&lt;a href="https://www.freecodecamp.org/news/file-permissions-in-linux-chmod-command-explained/" rel="noopener noreferrer"&gt;https://www.freecodecamp.org/news/file-permissions-in-linux-chmod-command-explained/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;13-&lt;a href="https://devconnected.com/how-to-list-users-and-groups-on-linux/" rel="noopener noreferrer"&gt;https://devconnected.com/how-to-list-users-and-groups-on-linux/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;14-&lt;a href="https://www.geeksforgeeks.org/permissions-in-linux/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/permissions-in-linux/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;15-&lt;a href="https://stackoverflow.com/questions/29475138/what-is-the-difference-between-update-and-upgrade" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/29475138/what-is-the-difference-between-update-and-upgrade&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;16-&lt;a href="https://www.ihs.com.tr/blog/apache-nedir/" rel="noopener noreferrer"&gt;https://www.ihs.com.tr/blog/apache-nedir/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;17-&lt;a href="https://ubuntu.com/tutorials/install-and-configure-apache#3-creating-your-own-website" rel="noopener noreferrer"&gt;https://ubuntu.com/tutorials/install-and-configure-apache#3-creating-your-own-website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;18-&lt;a href="https://ubuntu.com/server/docs/how-to-configure-apache2-settings#:%7E:text=The%20default%20value%20is%20%2Fvar,create%20that%20directory%20if%20necessary" rel="noopener noreferrer"&gt;https://ubuntu.com/server/docs/how-to-configure-apache2-settings#:~:text=The%20default%20value%20is%20%2Fvar,create%20that%20directory%20if%20necessary&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;19-&lt;a href="https://operavps.com/blog/vim-vs-nano/#:%7E:text=Nano%20can%20be%20suitable%20for,capabilities%20to%20improve%20your%20productivity" rel="noopener noreferrer"&gt;https://operavps.com/blog/vim-vs-nano/#:~:text=Nano%20can%20be%20suitable%20for,capabilities%20to%20improve%20your%20productivity&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;20- &lt;a href="https://pi4j.com/about/" rel="noopener noreferrer"&gt;https://pi4j.com/about/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;21-&lt;a href="https://www.researchgate.net/figure/Raspberry-Pi-4-pin-details_fig4_352212777" rel="noopener noreferrer"&gt;https://www.researchgate.net/figure/Raspberry-Pi-4-pin-details_fig4_352212777&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;22-&lt;a href="https://kalitut.com/control-gpio-pigpiod-commands/" rel="noopener noreferrer"&gt;https://kalitut.com/control-gpio-pigpiod-commands/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;23-&lt;a href="https://raspberrypi.stackexchange.com/questions/17121/ultrasonic-sensor-get-distance-with-java" rel="noopener noreferrer"&gt;https://raspberrypi.stackexchange.com/questions/17121/ultrasonic-sensor-get-distance-with-java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;24-&lt;a href="https://github.com/gokhanergen-tech/pi4j-java-distance-sensor-and-vcore-raspberry-pi" rel="noopener noreferrer"&gt;https://github.com/gokhanergen-tech/pi4j-java-distance-sensor-and-vcore-raspberry-pi&lt;/a&gt;&lt;br&gt;
^&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>java</category>
      <category>programming</category>
      <category>sensor</category>
    </item>
    <item>
      <title>Graph Library graphjs-react updated to 1.0.3</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Wed, 15 Nov 2023 21:12:20 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/graph-library-graphjs-react-updated-to-103-159a</link>
      <guid>https://forem.com/gokhanergentech/graph-library-graphjs-react-updated-to-103-159a</guid>
      <description>&lt;p&gt;GraphJS React is a graph library to view or visualize your data which you collect or find. &lt;/p&gt;

&lt;p&gt;We wrote a blog about this library. If you do not read it, you should go to this link: &lt;a href="https://dev.to/gokhanergentech/new-react-chart-library-for-basic-charts-graphjs-react-16ed"&gt;https://dev.to/gokhanergentech/new-react-chart-library-for-basic-charts-graphjs-react-16ed&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets talk about this version. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Added LineChart labelled or number&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NSpky76B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6pqjbp187k5363jg8nfx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NSpky76B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6pqjbp187k5363jg8nfx.jpg" alt="Image description" width="672" height="537"&gt;&lt;/a&gt;&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;LineChart
  data={[
    [
      {
        color: 'rgb(197,104,176)',
        x: '2005',
        y: 66357782
      },
      {
        color: 'rgb(231,205,242)',
        x: '2006',
        y: 28585057
      },
      {
        color: 'rgb(104,222,112)',
        x: '2007',
        y: 83097927
      },
      {
        color: 'rgb(174,227,215)',
        x: '2008',
        y: 40312901
      },
      {
        color: 'rgb(225,116,228)',
        x: '2009',
        y: 64665550
      },
      {
        color: 'rgb(197,206,222)',
        x: '2010',
        y: 83476844
      }
    ],
    [
      {
        color: 'rgb(174,183,141)',
        x: '2005',
        y: 16388224
      },
      {
        color: 'rgb(103,131,243)',
        x: '2006',
        y: 72801715
      },
      {
        color: 'rgb(187,144,151)',
        x: '2007',
        y: 17787543
      },
      {
        color: 'rgb(135,199,171)',
        x: '2008',
        y: 31304136
      },
      {
        color: 'rgb(177,186,201)',
        x: '2009',
        y: 34091381
      },
      {
        color: 'rgb(211,119,199)',
        x: '2010',
        y: 11001680
      }
    ]
  ]}
  height={400}
  labels={[
    {
      color: 'blue',
      name: 'A'
    },
    {
      color: 'red',
      name: 'B'
    }
  ]}
  onPointClick={() =&amp;gt; {}}
  onPointOver={() =&amp;gt; {}}
  title={{
    label: 'Countries\' Populations'
  }}
  titles={{
    x: 'Year',
    y: 'Population'
  }}
  width={400}
  xAxisLabels={[
    '2005',
    '2002',
    '2006',
    '2007',
    '2008',
    '2009',
    '2010'
  ]}
/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c3KmMInx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/10k8s3qeelxcjsvut5yn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c3KmMInx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/10k8s3qeelxcjsvut5yn.jpg" alt="Image description" width="746" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the usage of the chart.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Added wheel scaling for bar and line charts&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also help to develop this library. We use example project to use the charts and also storybook.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gokhanergen-tech/graphjs-react"&gt;https://github.com/gokhanergen-tech/graphjs-react&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>New React Chart Library For Basic Charts - graphjs-react</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Mon, 30 Oct 2023 10:55:00 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/new-react-chart-library-for-basic-charts-graphjs-react-16ed</link>
      <guid>https://forem.com/gokhanergentech/new-react-chart-library-for-basic-charts-graphjs-react-16ed</guid>
      <description>&lt;p&gt;Charts are very important for data visualization. You can use it on Data Science. There are a lot of chart types such as pie, tunnel, line charts, etc. By using these, the predicting of future data situation is probably and you can also understand and analysis data. In this blog, I will show the chart library named graphjs-core which I have still developed. You can also join us to develop the library.&lt;/p&gt;

&lt;p&gt;Note: The library has been being developed and currently there are bar, tunnel and bar charts.&lt;/p&gt;

&lt;p&gt;Installation&lt;br&gt;
Follow the instructions to install GraphJS-React&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install graphjs-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage&lt;br&gt;
Add GraphJS-React CSS file to your index.js.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'graphjs-react/index.css'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bar Chart&lt;/strong&gt;&lt;br&gt;
You can create basic bar chart by using this library.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bFqT6AgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0n12yiu7g2jbk6s4xuc5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bFqT6AgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0n12yiu7g2jbk6s4xuc5.jpg" alt="Image description" width="800" height="511"&gt;&lt;/a&gt;&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;BarChart
height={400}
onBarClick={() =&amp;gt; {}}
data={[
  {
    color: 'rgb(110,221,234)',
    x: 'Ocak',
    y: -68
  },
  {
    color: 'rgb(106,226,126)',
    x: 'Şubat',
    y: -54
  },
  {
    color: 'rgb(154,222,111)',
    x: 'Mart',
    y: -37
  },
  {
    color: 'rgb(126,187,225)',
    x: 'Nisan',
    y: 56
  },
  {
    color: 'rgb(156,206,128)',
    x: 'Mayıs',
    y: 83
  },
  {
    color: 'rgb(116,245,247)',
    x: 'Haziran',
    y: -78
  },
  {
    color: 'rgb(235,196,136)',
    x: 'Temmuz',
    y: 30
  },
  {
    color: 'rgb(186,117,243)',
    x: 'Ağustos',
    y: 75
  },
  {
    color: 'rgb(221,157,208)',
    x: 'Eylül',
    y: -63
  },
  {
    color: 'rgb(252,122,106)',
    x: 'Ekim',
    y: 10
  },
  {
    color: 'rgb(193,139,193)',
    x: 'Kasım',
    y: 27
  },
  {
    color: 'rgb(254,173,150)',
    x: 'Aralık',
    y: -52
  }
]}
width={400}
  /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tunnel Chart&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Da1GnmQc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fl8chdv9x2wzpk2npreo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Da1GnmQc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fl8chdv9x2wzpk2npreo.jpg" alt="Image description" width="800" height="671"&gt;&lt;/a&gt;&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;FunnelChart
  data={[
    {
      backgroundColor: 'lightgreen',
      name: 'K',
      value: 999
    },
    {
      backgroundColor: 'green',
      name: 'B',
      value: 168
    },
    {
      backgroundColor: 'yellow',
      name: 'E',
      value: 114
    },
    {
      backgroundColor: 'red',
      name: 'C',
      value: 93
    },
    {
      backgroundColor: 'black',
      name: 'D',
      value: 32
    }
  ]}
  height={500}
  width={500}
/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above an example code for Tunnel Chart&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pie Chart&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8h94lFRK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mdeqft1zz92399wwdli.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8h94lFRK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mdeqft1zz92399wwdli.jpg" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&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;Pie
  data={[
    {
      backgroundColor: 'lightgreen',
      name: 'K',
      textColor: 'white',
      value: 136
    },
    {
      backgroundColor: 'green',
      name: 'B',
      textColor: 'yellow',
      value: 85
    },
    {
      backgroundColor: 'red',
      name: 'C',
      textColor: 'white',
      value: 53
    },
    {
      backgroundColor: 'black',
      name: 'D',
      textColor: 'white',
      value: 22
    },
    {
      backgroundColor: 'yellow',
      name: 'E',
      textColor: 'black',
      value: 30
    }
  ]}
  legend
  onMouseClickPiece={() =&amp;gt; {}}
/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pie Chart is generally used for showing data with percent. You can see that how to view data comprehensively.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Line Chart&lt;/em&gt; is coming soon :)&lt;/p&gt;

&lt;p&gt;visit here for more details,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/graphjs-react?activeTab=readme"&gt;https://www.npmjs.com/package/graphjs-react?activeTab=readme&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you learn about charts theoretically&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.computerhope.com/jargon/b/barchart.htm"&gt;https://www.computerhope.com/jargon/b/barchart.htm&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>chart</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>ToastJS and Fetching with React apps</title>
      <dc:creator>Gökhan ERGEN</dc:creator>
      <pubDate>Tue, 08 Aug 2023 19:05:23 +0000</pubDate>
      <link>https://forem.com/gokhanergentech/toastjs-with-react-apps-26pe</link>
      <guid>https://forem.com/gokhanergentech/toastjs-with-react-apps-26pe</guid>
      <description>&lt;p&gt;You can add your react app and make fetching&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Follow the instructions to install ToastJS-React&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install toastjs-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add ToastJS-React CSS file to your index.js.&lt;/p&gt;

&lt;p&gt;You must add your app components or elements between&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { ToastContainer } from 'toastjs-react'
import 'toastjs-react/index.css'
return (
 &amp;lt;ToastContainer maxMessageCount={5} position="center"&amp;gt;
  &amp;lt;App /&amp;gt;
 &amp;lt;/ToastContainer&amp;gt;);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can limit your max toasts in your projects using below.&lt;/p&gt;

&lt;p&gt;Change Your Maximum Toast&lt;/p&gt;

&lt;p&gt;maxMessageCount={5} // Optional, default = 10&lt;/p&gt;

&lt;p&gt;Change Your Toast Position&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;position={"left"|"right"|"center
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You could have many toasts in your screen. ToastJS-React is going to add them to a queue. It will show them in order.&lt;/p&gt;

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

&lt;p&gt;You have 8 toasts. And you set your max toast = 5 then firstly you are going to see 5 toasts until they become to fade out. Next,&lt;/p&gt;

&lt;p&gt;you are going to see other 3 toasts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import useGlobalMessage Hook
 import { useGlobalMessage } from 'toastjs-react';

 // Call It In Your Component
 const toast = useGlobalMessage();

 // And Show It!
 toast.show({
    type: "success",
    message: "You have been added your item succesfully.",
    autoCloseWithTimeout: true,
    timeout: 2000,
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QRQt3OHP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npkylo55lgb6ov4u7h88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QRQt3OHP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npkylo55lgb6ov4u7h88.png" alt="Image description" width="331" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, you can make fetching&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetchingOptions?:{
           promise: Promise&amp;lt;any&amp;gt;
           errorComponent: (response?:any)=&amp;gt;React.ReactElement
           successComponent: (response?:any)=&amp;gt;React.ReactElement
           response: (response: object, hasError: boolean) =&amp;gt; void
   }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to learn a lot, visit to &lt;a href="https://www.npmjs.com/package/toastjs-react?activeTab=readme"&gt;https://www.npmjs.com/package/toastjs-react?activeTab=readme&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
