teleren/devto huggingface dataset:
مدیریت زمان در کسب و کار خانگی
Tags: time
Published: 2023-07-24 18:30:43

مدیریت زمان یکی از اصولی‌ترین عوامل موفقیت در [کسب و کار خانگی](https://hozhabriyan.ir/%d9%85%d8%b4%d8%a7%d9%88%d8%b1%d9%87-%d8%b1%d8%a7%d9%87-%d8%a7%d9%86%d8%af%d8%a7%d8%b2%db%8c-%da%a9%d8%b3%d8%a8-%d9%88-%da%a9%d8%a7%d8%b1-%d8%ae%d8%a7%d9%86%da%af%db%8c/) است. هنگامی که [کسب و کارتان](https://hozhabriyan.ir/%da%a9%d9%88%da%86%db%8c%d9%86%da%af-%d8%aa%d9%88%d8%b3%d8%b9%d9%87-%d9%81%d8%b1%d8%af%db%8c/) در منزل اجرا می‌شود، ممکن است با چالش‌هایی مرتبط با تعادل زمان بین کار و زندگی خانوادگی روبه‌رو شوید. بنابراین، برنامه‌ریزی مناسب برای مدیریت زمان و تعیین اولویت‌ها بسیار مهم است. در ادامه، به برخی از راه‌های مدیریت زمان که می‌توانید در کسب و کار خانگی خود به کار بگیرید، پرداخته‌ایم:

1. برنامه‌ریزی و تعیین اهداف: برای مدیریت زمان بهتر، اولین گام باید برنامه‌ریزی دقیق و تعیین اهداف باشد. ابتدا اهداف کسب و کارتان را مشخص کنید و سپس برنامه‌های روزانه، هفتگی و ماهیانه برای رسیدن به آن‌ها تنظیم کنید. بهتر است برنامه‌ریزی‌ها را در یک دفتر یا ابزار مدیریت زمان مثل برنامه‌ریزهای الکترونیکی ثبت کنید.

2. اولویت‌بندی و تمرکز: با تعداد زیادی وظایف و فعالیت‌های مختلف در کسب و کار خانگی خود، باید بتوانید اولویت‌ها را مشخص کنید و به اجرای وظایف مهم‌تر و ضروری‌تر تمرکز کنید. این کمک می‌کند تا به بهترین نحو از زمان خود استفاده کنید و از تبدیل زمان‌های بی‌اهمیت به زمان‌های مفید جلوگیری کنید.

3. ایجاد بلاک‌های زمانی: به جای انجام تمام وظایف پشت سر هم، بهتر است برنامه‌ای را داشته باشید که زمان مشخصی برای انجام هر وظیفه در طول روز در نظر گرفته شود. بلاک‌های زمانی به شما کمک می‌کنند تا به صورت مداوم و با تمرکز بیشتر وظایف را انجام دهید و از تلف کردن زمان جلوگیری کنید.

4. انتقال تماس‌ها و ایمیل‌ها: هنگامی که مشغول کار هستید، بهتر است تماس‌ها و ایمیل‌های خود را به وقت‌های معینی مثل پایان روز یا به صورت دوره‌ای بررسی کنید. این کمک می‌کند تا تمرکز شما در هنگام کار برنامه‌ریزی شده حفظ شود و از تلف کردن زمان به دلیل مداومت در بررسی اطلاعات مختلف جلوگیری کنید.

5. استفاده از ابزارهای مدیریت زمان: امروزه ابزارهای مختلف مدیریت زمان مانند لیست‌های وظایف، برنامه‌ریزهای الکترونیکی و تقویم‌های آنلاین در دسترس هستند. استفاده از این ابزارها می‌تواند به شما کمک کند تا به طور موثر‌تر زمان‌های خود را مدیریت کنید و همچنین از انجام وظایف مهم اجتناب نکنید.

مدیریت زمان مهم‌ترین عامل در کارآمدی و موفقیت [کسب و کار خانگی](https://medium.com/@mehdi.abedineework/بازاریابی-یکی-از-اصولی-ترین-عناصر-در-موفقیت-کسب-و-کارهای-خانگی-ef3a7eaf5d57) شما است. با برنامه‌ریزی دقیق، اولویت‌بندی هوشمندانه و استفاده از ابزارهای مدیریت زمان، می‌توانید به طور موثر‌تر از زمان خود استفاده کنید و به اهدافتان نزدیک‌تر شوید.
Is it possible to call one function continuously in while loop?
Published: 2023-07-24 18:26:50

I am wondering whether it is possible or not to realize multi threads in javascript while loop.
for example,
`while(1){
    sample(param1, param2)
}

function sample(param1, param2){
    // some code here
    console.log("some result")
}
`
I tried with it but it does not show console.log result.
I think it happens because while() call function again before the sample() function execute some code and so sample() function start from scratch again.
How can I realize multi thread in javascript?
Bandit Level 5 Level 6
Tags: writeup, ctf, overthewire, bandit
Published: 2023-07-24 18:03:25

### Introduction

Bandit 6 is the seventh level of the OverTheWire Bandit wargame, we are tasked with finding a file within a directory hierarchy and extracting a password from that file.

### Steps

1. Connect to the remote server using SSH by running the following command in your terminal:
    
    ```
    ssh bandit5@bandit.labs.overthewire.org -p 2220
    ```
    
    You will be prompted to enter the password for Bandit level 6, which is `lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR`. Enter the password and hit enter.
    
2. Once you have successfully logged in, navigate to the `inhere` directory by running the following command:
    
    ```
    cd inhere/
    ```
    
    This directory contains a number of subdirectories and files, and our task is to find the file containing the password.
    
3. To find the file, we can use the `find` command with a combination of flags to search for files that meet certain criteria. In this case, we want to find files that are not executable and have a size of exactly 1033 bytes. We can use the following command:
    
    ```
    find . -type f -not -executable -size 1033c
    ```
    
    This will return a list of files that meet the criteria.
    
4. Next, we want to check the contents of each file in the list to see if it contains the password. We can use the `file` command to check if each file is an ASCII text file, and then use `cat` to print the contents of any file that matches the criteria. We can use the following command:
    
    ```
    find . -type f -not -executable -size 1033c | xargs file | grep "ASCII text" | awk -F: '{print $1}' | xargs cat
    ```
    
    This will print the contents of any file that is an ASCII text file and has a size of 1033 bytes and is not executable.
    
5. The password is located in the file `/home/bandit6/inhere/maybehere07/.file2`. Use the following command to print the contents of the file:
    
    ```
    cat /home/bandit6/inhere/maybehere07/.file2
    ```
    
    This will output the password, which is `P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU`.
    

Congratulations! You have successfully completed Bandit level 6.
My Wordle Knock-Off
Tags: python, programming
Published: 2023-07-24 18:01:24

As I'm about to start my freshman year of college in just over a month now, I decided that I want to polish up my CS skills I've learned from high school. I decided to start Codecademy's "Computer Science Career Path" which had me make a OOP terminal based game. Lucky for me, I had done this as a project my sophomore year in a CS class. The course told me to save the project to GitHub and then write a blog post for it, so why not?

My game is called Ochordle because it's an eight-letter word game instead of the standard 5. It updates every day just like the original so have fun coming back and playing it every day if you want to!
{% embed https://github.com/TrentGlimp/OchordleGameProj %}

![Me playing today's game](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5qrpx9uw4bwyj21n9y66.png)
Setting Up pgAdmin 4 on Windows with PostgreSQL on WSL
Tags: apacheage, postgressql
Published: 2023-07-24 17:57:39

In this blog post, we'll walk through the process of setting up pgAdmin 4, installed natively on Windows, to work with a PostgreSQL server running on Windows Subsystem for Linux (WSL). This guide assumes you have already installed PostgreSQL on WSL and pgAdmin 4 on your Windows system.

**Step 1: Start the PostgreSQL Server on WSL**

First, you need to start your PostgreSQL server on WSL. Use the `pg_ctl` command followed by `-D` and the directory of your database to start the server. The command should look something like this:

```
pg_ctl -D <your database directory> start
```

Upon running this command, you should see an output similar to the following:

```
waiting for server to start....2023-07-13 12:08:01.660 -03 [4659] LOG:  starting PostgreSQL 16beta1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.1.1 20230429, 64-bit
2023-07-13 12:08:01.662 -03 [4659] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2023-07-13 12:08:01.676 -03 [4659] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2023-07-13 12:08:01.707 -03 [4662] LOG:  database system was shut down at 2023-06-30 17:18:29 -03
2023-07-13 12:08:01.738 -03 [4659] LOG:  database system is ready to accept connections
```

Take note of the IPv4 address and port number where the server is listening. In this case, it's "127.0.0.1" and port "5432".

**Step 2: Add a New Server on pgAdmin**

Next, open pgAdmin and add a new server. In the "Connection" tab, enter the IPv4 address and port number you noted in the previous step into the "Host name/address" and "Port" fields, respectively.

**Step 3: Specify the Maintenance Database**

The "Maintenance database" field should be filled with the name of your PostgreSQL database. If you're unsure of your database name, you can list all available databases by running the `psql --list` command on WSL.

**Step 4: Enter Your Username and Password**

The "Username" and "Password" fields should be filled with your PostgreSQL username and password, respectively. This is the same username and password you use to connect to PostgreSQL on WSL.

**Step 5: Name Your Connection**

Finally, give your connection a meaningful name in the "Name" field under the "General" tab. This will help you identify this connection in the future.

Once you've filled out all the necessary fields, save your new server configuration. You should now be able to connect to your PostgreSQL server on WSL using pgAdmin 4 on Windows.

---

I make these posts in order to guide people into the development of a new technology. If you find anything incorrect, I urge you to comment below so I can fix it. Thanks!

___

Check Apache AGE: https://age.apache.org/.

Overview — Apache AGE master documentation: https://age.apache.org/age-manual/master/intro/overview.html.

GitHub - apache/age: https://github.com/apache/age
JavaScript full Course (Main Heading)
Tags: javascript, api, react, opensource
Published: 2023-07-24 17:21:57


 **Introduction to JavaScript:** 

Basics of JavaScript, its role in web development, and its features.

 **Variables & Data Types:** 

Declaration of variables, data types (string, number, Boolean, etc.), and basic operations.

 **Control Flow & Loops:** 

Conditional statements (if-else), loops (for, while), and switch statements.

 **Functions & Scope:** 

Creating functions, function parameters, return values, and variable scope.

 **Arrays & Objects:** 

Working with arrays and objects, accessing properties, and manipulating data.

 **DOM Manipulation:** 

Interacting with HTML elements using the Document Object Model (DOM).

 **Events & Event Handling:** 
Handling user events (click, submit, etc.) and event listeners.

 **Asynchronous Programming:** Understanding callbacks, promises, and asynchronous functions (async/await).

 **AJAX & API:** 

Making HTTP requests to fetch data from APIs and updating webpage content dynamically.

 **ES6 Features:** 

Exploring modern JavaScript features like arrow functions, classes, and modules.
Daily Journal: Week of 7/17
Published: 2023-07-24 17:51:20

ToDo: Misc
CoverLetter, resume, LinkedIn updated, Personal website

7/19/23, Wednesday
Doing
Turning in due assignments “Getting Started” and “Hello World!” modules
Roadblocks
Ask app inquiry, see screenshots
Sent email

7/20/23, Thursday
Done
Completed Getting Started
Doing
Began HTML & CSS Section
Completed first lesson in the html course

7/21-23/23, 
Done 
completed first lesson in the codeacademy html course
Raghu’s HTML Review module
If time permits Link In Bio module
Submit Link In Bio : Roadblock/ToDO [Before 7/26]
Didn’t render images on GIthub, use fly.io or something
Used fly.io
Modules completed: The fundamentals of Ruby; The String class; The Integer class, float, date, array, if, loops, each
Ruby Module
Completed 1st lesson of Code Academy [seems that much of the topics in the code academy lesson are covered in successive parts of the course.]
—-------------------------------
What Why and How Module
Roadblock/ToDO [solved]
Let TAs know that a point is missing for the “First graded code block” task, though I’ve completed the task
Understanding PLV8: A Practical Guide to Low-Code Development
Tags: docker, plv8, lowcode
Published: 2023-07-24 17:51:15

Hey there, fellow coders! Today, we're diving into the world of PLV8, a game-changer in the realm of low-code development. If you've ever wondered how to blend the power of JavaScript and SQL, you're in for a treat!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zcx1uv3zzrqxkqwzr9vx.png)
PLV8 is a PostgreSQL extension that lets us write JavaScript stored functions directly within the database. Imagine the possibilities! It's like having your cake and eating it too, but in this case, the cake is your code, and eating it is executing it right within your database.
Now, let's talk about some real-world applications. Have you ever found yourself juggling between your database and your backend, trying to get them to communicate effectively? With PLV8, you can create complex server-side functions right within your PostgreSQL database. It's like having a mini Node.js environment in there!
The beauty of PLV8 is that it opens the door to low-code development. You can create powerful applications with less code, which means less debugging, less maintenance, and more time to focus on what really matters: solving problems and delivering value.
Interested in exploring more? Check out our [GitHub](https://github.com/sibedge-llc/plv8-dockerfiles) repository and don't forget to give us a star if you find our project beneficial. Your support helps us continue our work and helps others discover our project! 
And download our [Image from dockerhub](https://hub.docker.com/r/sibedge/postgres-plv8).
Ponteiros 🤮
Tags: c, programming, tutorial, ponteiros
Published: 2023-07-24 17:41:59


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

Em C, os ponteiros são uma das características mais poderosas e complexas da linguagem. Eles permitem manipular diretamente a memória, apontando para endereços de outras variáveis e objetos. Os ponteiros são amplamente usados em C para lidar com estruturas de dados, alocar memória dinamicamente e otimizar a performance em certas situações. Aqui está uma explicação básica sobre ponteiros:

1. Declaração de ponteiros:
   ```c
   tipo *nome_ponteiro;
   ```

   Exemplo:
   ```c
   int *ponteiro_int; // Declara um ponteiro para um inteiro
   char *ponteiro_char; // Declara um ponteiro para um caractere
   float *ponteiro_float; // Declara um ponteiro para um número de ponto flutuante
   ```

2. Atribuição de endereço a um ponteiro:
   ```c
   ponteiro = &variavel;
   ```

   Exemplo:
   ```c
   int numero = 42;
   int *ponteiro_numero;
   ponteiro_numero = &numero; // O ponteiro agora aponta para o endereço de memória da variável 'numero'
   ```

3. Acesso ao valor apontado pelo ponteiro:
   ```c
   *ponteiro;
   ```

   Exemplo:
   ```c
   int numero = 42;
   int *ponteiro_numero;
   ponteiro_numero = &numero;
   printf("%d\n", *ponteiro_numero); // Imprime o valor armazenado na variável 'numero' (42)
   ```

4. Ponteiros e alocação de memória dinâmica:
   Em C, é possível alocar memória dinamicamente usando funções como `malloc` e `calloc`. A alocação de memória dinâmica permite criar arrays de tamanho variável e estruturas de dados complexas. No entanto, é responsabilidade do programador liberar a memória alocada usando a função `free` para evitar vazamentos de memória.

   Exemplo:
   ```c
   int *ponteiro_array;
   int tamanho = 5;
   ponteiro_array = (int *)malloc(tamanho * sizeof(int)); // Aloca memória para um array de inteiros com tamanho 5

   // Use o array dinamicamente alocado

   free(ponteiro_array); // Libera a memória alocada quando não for mais necessária
   ```

Ponteiros podem ser bastante poderosos e úteis, mas também podem levar a erros complexos se usados incorretamente. É importante entender bem como os ponteiros funcionam e sempre ter cuidado ao manipular memória diretamente. Além disso, o uso de ponteiros é mais comum em C do que em outras linguagens de programação, pois outras linguagens de mais alto nível tendem a abstrair o gerenciamento de memória para facilitar o desenvolvimento e evitar erros de programação relacionados à memória.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lb3pjsvdwe87ldhlpc4w.png)
DAY 51 - Power of a Number n
Tags: coding, leetcode, algorithms, tutorial
Published: 2023-07-24 17:37:49

Hey everyone! Welcome back to another day of problem-solving. It's day 51, and I'm still going strong on my quest for consistency.
Today and we will be solving the daily leetcode problem.

---

## Question: [_Pow(x, n)_](https://leetcode.com/problems/powx-n/)

_Implement_ ` pow(x, n)`, _which calculates x raised to the power n_ (`x^n`).

---

**_Example 1:_**

> - **Input:** x = 2.00000, n = 10
> - **Output:** 1024.00000

**_Example 2:_**

> - **Input:** x = 2.00000, n = -2
> - **Output:** 0.25000
> - **Explanation:** 2-2 = 1/22 = 1/4 = 0.25

---

## Intuition:

- Now I don't think the question needs a break down today so let's head right down to thinking how to approach this problem.
- We need to find `x ^ n`.
- This can also be written as `(x ^ n/2) * (x ^ n/2)`
- Due to the additive property of powers when two same numbers are multiplied we can break it down into two problems.
- Similarly we can break down these problems further and reach to a simple answer that we all know.
- Anything to the power 0 is 1.
- Any number to the power 1 is itself.
- We are following a recursive approach so let's now write down the code for this.

## Algorithm:

### Establishment of base cases.
- If n == 0 return 1.
- If n == 1 return x;

### Recursive Call:

- Ans = pow(x,n/2).
- If n is even(perfectly divisble by 2)  we return ans * ans.
- if n is odd we return x * ans * ans.
- Else if n is negative we return 1 / pow(x,-n).


### Returning the ans


- The recursive function itself returns the answer here.

## Code:

```
double myPow(double x, int n){
            if(n==0){
            return 1;
            }
            if(n==1){
                return x;
            }
            double ans = myPow(x, n/2);
            if(n%2==0)
                return ans*ans;
            else if(n%2 == 1) 
                return x*ans * ans;
            else
//                 is loop me tb jayega jb n negative hoga, or, is loop me ek hi baar jayega because isme negative wale ko positive kr rhe h, to agr koi negative hoga, to ye loop sirf ek hi baar call hoga
// this loop will only be entered if n is negative. After that it's made positive and this loop will never be called again.

                return 1/myPow(x,-n);
    }


```

**_Complexity Analysis:_**

> **Time:** O(logN)
> **Space:** O(1)
Checking overhead for walrus operator (:=) in Python
Tags: python, walrus
Published: 2023-07-24 17:15:14

Purely for myself, I decided to check whether there is an overheat when using walrus (`:=`) in Python:

![Timeit for warlus in Python](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/btov41yp3belcuidw7ta.png)

At least it works **no slower**, which is already pleasing. 

If you look deeper, you can see that when using the walrus, the `LOAD_FAST` instruction is missing, it is, as it were, replaced by `DUP_TOP`, which in theory should work a little faster.
Re-rendering in react
Published: 2023-07-24 17:05:26

A child component is re-rendered in react in three cases:
1.) If the parent component is re-rendered, then the child will be re-rendered.
2.) If the state of the parent component is updated using useState or useReducer. -> then parent component will re-render, then the child will be re-rendered.
3.) If the props of child component is updated, it will be re-rendered. (It is the main point, all other point are related to this point only.)

we can make use of React.memo or passing child as a prop to prevent form unnecessary re-rendering.
(passing child as a prop will also work beacuse apart from React.memo because a component can not change its own prop)

Also, when we pass objects or function as a prop which remains same, then to avoid unnecessary rendering of child component, we can make use of useCallback and useMemo hook.

This is because when we pass objects or function as prop from parent component, when the parent component re-renders due to some state change, a new refernce to object and function is created, which will be treated as a new prop that to be passed to the child component. So to prevent that, we make use of useMemo(for non primitive values like object and arrat) and useCallback(for functions)
Caption This! 🤔💭
Tags: watercooler
Published: 2023-07-24 17:03:08

Time to show off your captioneering chops! We need your genius to address whatever the heck is happening in the goofy pic below. 😅

![A poorly animated face superimposed on a man's body is looking blankly at a computer. The background is in green & black with a bunch of binary code layered on the screen, a bit like the layers of green and black type on the Matrix. The word "Tehc" is in the top right corner. It all seems to have been done poorly on purpose.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3q0h10o2dbiuygdc1tfi.jpg)

Follow the DEVteam for more online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
📚 Understanding the Iterator Pattern in Python! 🐍💡
Tags: python, iterator, designpatterns, cleancode
Published: 2023-07-24 16:52:05


The Iterator Pattern is a behavioural design pattern that provides a way to access elements of a collection (or aggregate) sequentially without exposing the underlying representation of the collection. It decouples the algorithm for traversing the collection from the actual collection implementation, promoting a more flexible and generic approach to iteration.



Python already provides built-in support for the Iterator Pattern through its iterables and iterators. Many objects in Python, such as lists, tuples, dictionaries, and strings, are iterables, meaning they can be used in a for loop directly. Behind the scenes, these objects use iterators to enable sequential access to their elements.



In Python, the Iterator Pattern is applied implicitly through two protocols:



1. **Iterable Protocol:** An object is considered iterable if it defines the `__iter__()` method, which returns an iterator object.



2. **Iterator Protocol:** An iterator is an object that defines the `__next__()` method, which returns the next element in the collection. Additionally, it must raise the `StopIteration` exception when there are no more elements to be returned.



Let's see a simple example of how the Iterator Pattern is used in Python:



```python

class NonIterable:

  pass



class IterableWithNonIterator(NonIterable):

  def __iter__(self):

    class NonIterator:

      pass

    return NonIterator()



class IterableWithIterator(NonIterable):

  def __iter__(self):

    class Iterator:

      def __next__(self):

        return None

    return Iterator()



try:

  iter(NonIterable()) # Raises TypeError as NonIterable is not iterable

except TypeError as e:

  pass



try:

  not_iterator = iter(IterableWithNonIterator())

  next(not_iterator) # Raises TypeError as IterableWithNonIterator's iterator is not defined

except TypeError as e:

  pass



iterator = iter(IterableWithIterator())

next(iterator) # Returns None as IterableWithIterator provides a valid iterator



```

Overall, the Iterator Pattern is an essential concept in Python, enabling you to easily iterate over various collections in a consistent and flexible manner. It provides an elegant way to handle iteration, promoting separation of concerns and a clear distinction between the iteration logic and the collection's implementation details.