teleren/devto huggingface dataset:
Answer.dev v0.4.0 released!
Tags: go, webdev, programming, opensource
Published: 2022-11-21 15:51:28

Thanks to our contributors! **Answer.dev 0.4.0 released, which contains some bug fixes, and performance improvements.** Let's together see more details.

### New Features
- Add: Customized branding icons and favicons.
- Add: Terms of service, privacy page settings.
- Add: Recommend tag, required tag, and reserved tag config. It can now be better organized with tags.

### Bug Fixes
- Fix: Post summary in search results [#70](https://github.com/answerdev/answer/issues/70)
- Fix: The user status cache is incorrect [#82](https://github.com/answerdev/answer/issues/82)
- Fix: Tags cannot be searched correctly [#78](https://github.com/answerdev/answer/issues/78)
- Fix: The routing path of the answer type in the search result page is incorrect [#90](https://github.com/answerdev/answer/issues/90)

### Performance Improvements
- Optimized: Form generator.
- Optimized: Page response speed. [#87
](https://github.com/answerdev/answer/issues/87)
**Answer is still under very active development. Watch on [GitHub](https://github.com/answerdev/answer) to receive updates.**

---

Being highly scalable and modern, **Answer.dev is the best open-source Stack Overflow alternative, with which you can efficiently build various Q&A communities,** ranging from customer support to user communication. 

For more information on past and future versions of Answer.dev, please see: [https://github.com/answerdev/answer](https://github.com/answerdev/answer)
How to run MongoDB in Ubuntu?
Published: 2022-11-21 15:28:31

Hello Every One! I have some issue while running mongodb in ubuntu
I have some Error While I installing mongodb in Ubuntu.
command : ```sudo apt-get install mongodb```                                                                   

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


But I ignored this issue and then moved to next step.
when I commanded ```sudo systemctl status mongod ``` the result was below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsatkv2wcr8ry6v1jq47.png)
and if you have time for me, please explain me more about install and run mongodb in ubuntu exactly!
kind regards!
Resist the urge to push and move on immediately.
Tags: productivity
Published: 2022-11-21 15:27:16

It never hurts to read through your code one more time. But how you read through it is fairly important too. I have gotten used to the mentality of "make sure it works then optimize later", which is fairly ok for the most part. But sometimes, I will write a piece of code that works, tell myself I will optimize it later, then start working on something else entirely and I forget to optimize my code. Which would leave me having to try and explain why I did not do a rather obvious optimization.

So for the past couple weeks, I have decided to commit my code, but not push until I have re-checked my work. How does this look like? Well, say I am implementing feature A today. I will write the tests, and try to make them pass. Once the tests are passing, I will commit and walk away from my code( By walk away I mean literally not even look at anything remotely associated with the codebase.) I'll watch a youtube video or go outside for a well deserved break. The goal here is to make sure that when you go back to your code, you have a fresh pair of eyes on the issue. A hack I was taught by @jeremyf , is to just walk through a door way. No idea why it works, but it does. 

Coming back I will ask myself, "What does this line/block do? Is it critical?" for each line or block of code I had previously written. This helps me remove those pesky bits of dead code or random logs. Similarly, I will go through the tests and start thinking about the random edge cases. If it is a UI issue, I will ask myself, "is this the best look for the system?" "Can it perhaps be made to look better than this?", and other questions pertaining to UX. 

Making sure your code works correctly seems like a pretty obvious thing to do, but it's always good to remind yourself the goals that you are striving for in your code. Makes for much better and well thought out code.
What are your goals for the week of November 21?
Tags: watercooler, discuss
Published: 2022-11-21 15:24:46

For many of us in the US this is a short week for the Thanksgiving holiday. 

What are your goals for this week? 

- What are your goals for the week?   
- What are you building? 
- What will be a good result by week's end?
- Did you meet your goals last week?

**Last Week's Goals**
 How did I do?

- [:white_check_mark:] **Continue Job search.** 
- [:x:] **Do some code challenges.** No challenges. 
- [:white_check_mark:] **Write blog posts.** Wrote some tips for new Mastodon users.
- [:white_check_mark:] Make a Pomodoro timer. Version 1 done. Now to expand and adapt it. 
- [:white_check_mark:] Support VC members with monthly Challenge. We at 50,000 for the month. Our collective goal is 100,000. We'll do it. You can see our progress on our [Monthly Challenge page.](https://virtualcoffee.io/monthlychallenges/nov-2022)

- Personal Monthly goal is to beat my word count for last year's blog challenge. It was 3,511. (currently at 2,272)


**This Week's Goals** 
Short week my son only has two days of school. I don't expect much networking after Wednesday. 

- Continue Job search. 
- Expand on Pomodoro timer 
- Write blog posts. Virtual Coffee has a blogging Challenge for the month. Inspired by NaNoWriMo we're trying to as a group hit 100,000 words for the month. I plan to write at least one blog post a week. 
- Support VC members with our Monthly Challenge.

Cover image is my macro photography.


```
-$JarvisScript git push
```
A huge collection of UI resources
Tags: frontend, react, opensource, webdev
Published: 2022-11-21 15:06:56

I created a collection of UI resources since I just started to study front-end development. 

I will continue to update the list and website UI. Currently not mobile responsive.

**Website:** [https://uiresources-io.vercel.app/](https://uiresources-io.vercel.app/)
**Repo:** [https://github.com/junsantilla/uiResources.io](https://github.com/junsantilla/uiResources.io)

**Updates:**
=> Add theme selection
=> Add footer section
=> Use daisyUI drawer for navigation mobile responsiveness
=> Main content mobile responsiveness
Matching search Text become small like google suggestions in Js
Tags: searchtext, matchtext, arrayofarray, javascript
Published: 2022-11-21 15:04:52

**Making pain Text match data normal text and others become bold**  

```
 let term = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,';
      let search1 = 'Lorem';
      let parts = term.split(search);
      console.log("parts", parts)
      return parts.map((item, i) => (
        <>{item && <strong>{item}</strong>}{(i !== parts.length - 1) ? search1 : null}</>
      ))
```
**Array of Array match Make suggest text bold matching with search text **

```
let termData = [
       { "title": "apple orange banana" },
       { "title": "upload app koro na kn???" },
        { "title": "range ban apple ana" },
        { "title": "Hello world" },
        { "title": "Hello no world" },
    ];
    let search = 'app';
    const matchData = termData?.filter((product) => product.title.toLowerCase().includes(search.toLowerCase()));

    let newArray = [];

    matchData.map(item => {
        return newArray.push(item.title.split(search))
    })

    return newArray.map((item, index) => (
        <>
            {item.map((second, i) => (
                <span onClick={() => alert(`"hey MR.", ${index}`)}>{second && <strong>{second}</strong>}{(i !== item.length - 1) ? search : null}</span>
            ))}
            <br />
        </>
    ))
```
Kotlin Springboot -- Part 17 usecase の UT で usecase のインスタンスを DI で作成する
Tags: kotlin, mockk, spring
Published: 2022-11-21 15:01:38


## 前提知識

https://dev.to/kaede_io/kotlin-ji-chu-part-7-di-dependency-injection-kontenahenodeng-lu-shi-yong-k5g

Spring または Java の DI コンテナのアノテーション

UT は Unit Test, 単体テストのこと。

----

## 参考

https://mockk.io/

mockk 公式

Annotations の章にサンプルが有る

---

## why

```kotlin
        val personPort = mockk<PersonPort>()
        val target = PersonsUsecase(personPort)
```

これを毎回全ての関数に書くのを楽にするため

自動 DI コンテナ登録を Rest の実装だけではなく、Usecase の単体テストでもやりたかった

---

## mockk の @InjectMockks と @Mockks を使う

k が 2 つな方を使う。mockito からも似た名前ででているが
こっちを気づかず使うとエラーになるので注意

```kotlin
class PersonsUsecaseTest {
    @InjectMockKs
    lateinit var target: PersonsUsecase
    @MockK
    lateinit var port: PersonPort
```

フィールドインジェクションをする。

target というクラス内部のグローバル変数を
PersonUsecase クラスの型だけ指定して
中身は Null の状態で作る。

port も同様に、呼ばれた時に Mockk で作成されるように
中身を Null で PersonPort の型だけ指定する。

---

## MockKAnnotations.init で作成して unmockkAll で破壊する

MockKAnnotations.init(this) をすると
Mockk のアノテーションがついているフィールドインジェクションが
全て中身を入れ始める。

```kotlin
   @Test
    fun `全てのPersonを取得する`() {
        MockKAnnotations.init(this)
        val persons = mockk<Persons>()
        every { port.getAllPersons() } returns persons
        val actual = target.getAllPersons()
        actual shouldBeEqualTo persons
        unmockkAll()
    }
```

これで Mockk のアノテーションを走り、
この段階で port の偽物が作られ、
それを利用して usecase の偽物も作られる。

そして port や target、つまり usecase が使われる。

最後に unmockkAll() をする。
これで Mockk のアノテーションで作成された偽物や
偽物を利用して作られた本物が爆発四散する。ｱｲｴｴ!!!

なお、MockKAnnotations.init(this) が走るタイミングで
すでに偽物たちが作られていた場合は上書きされるので
最後の unmockkAll() は要らないかも知れない。
How we assist the company’s own team with servicing the project’s technical debt.
Tags: ruby, webdev, rails
Published: 2022-11-21 14:58:17

Ruby engineers from Singula Team have got involved with Gett to help them design the application’s backend. You can read more about the work progress on the website of the team that invited us to [the project.](https://evrone.com/gett
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av5oak5t8bh8a775joz6.png))
How to Install dbForge Studio for MySQL on Linux
Tags: mysql, database, linux
Published: 2022-11-21 14:56:52

---
title: How to Install dbForge Studio for MySQL on Linux
published: true
description: How to install dbForge Studio for MySQL on Linux?
tags: #mysql #databases #linux
# cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nljjnpt9lsrncftm1afr.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-21 14:49 +0000
---
This video provides a step by step guide on how to install and use dbForge Studio for MySQL on Linux using CrossOver -https://youtu.be/vaAupw3Ku-M
Shirdi One day Trip From Aurangabad
Published: 2022-11-21 14:50:25

Shirdi one day trip from Aurangabad by private cab is the best way to travel. You can explore the famous tourist attractions in Shirdi at your own pace and in a comfortable way. The round trip fare includes the cost of petrol, driver’s bhata, and parking charges.

Shirdi One day trip From Aurangabad: Famous tourist attractions – Sai Baba Samadhi Temple, Dwarkamai, Chavadi, Khandoba Temple, Gurusthan, Pick up & drop from Aurangabad city by private cab/car. Book Now! [read more](https://onedaytravel.in/shirdi-one-day-trip-from-aurangabad-by-private-cab/)
Spread Operator
Tags: javascript, beginners
Published: 2022-11-21 14:47:13

# Spread Operator

Let’s go to the use cases!

## Spreading an Array

In a case, we want duplicate an array. We can’t copy just like this.

```jsx
const arr = [1, 4, 2];
const arr2 = arr; 
```

If we do that, when we manipulate `arr` the `arr2` will be affected.

```jsx
arr.push(100);
console.log(arr); // [1, 4, 2, 100]
console.log(arr2); // [1, 4, 2, 100]
```

Output what we want is 

```jsx
console.log(arr); // [1, 4, 2, 100]
console.log(arr2); // [1, 4, 2] => we don't even touch `arr2` so it should be the same
```

This case happens because we **pass by reference to `arr2`**. Simply, we don’t really **have `arr2`.** We may call arr2 just an alias of `arr`.

To completely copy `arr` to `arr2` we can use something called **spread operator**. 

> Spread operator is three dots `...` operator.
> 

Before we copy `arr`, if we do `console.log(...arr)` the output will be

```jsx
1 4 2
```

It means we now have 3 values that is not belong to any variables or constants. So we can do this to copy an array.

```jsx
const arr = [1, 4, 2];
const arr2 = [ ...arr];
// arr = [1, 4, 2] 
```

If we push stuff to `arr`, `arr2` will stay the same.

```jsx
arr.push(50);
console.log(arr); // [1, 4, 2, 50]
console.log(arr2); // [1, 4, 2]
```

Spread operator can be used to combine multiple arrays. 

```jsx
const newArr = [...arr1, ...arr2, ...arr3, ...arr4];
```

## Spreading an Object

Spread operator can also implemented to an object.

Let’s say we have two objects.

```jsx
const personProfile = {
	name: 'Esto',
	age: 22,
}; 
const personHobbies = {
	indoor: ['Reading', 'Sleeping', 'Coding'],
	outdoor: ['Football', 'Running']
}
```

We can combine two object with this code.

```jsx
const person = { ...personProfile, ...personHobbies };
```

Or we can copy `personProfile` to `personProfileBackup`.

```jsx
const personProfileBackup = { ...personProfile };
```

## Conclusion

The best case to copy an object or an array is when our app have “Customize” feature. 

When user customize their theme, that customized configuration stored in a new object without replacing the old one.

If user click reset, we can replace modified object with the old one. Of course, we will find other use cases if we started building real world project!

See you!
Who or what are you grateful for in tech?
Tags: discuss
Published: 2022-11-21 14:43:00

---
title: Who or what are you grateful for in tech?
published: true
description: 
tags: discuss
published_at: 2022-11-21 14:43 +0000
---

It's Thanksgiving in the US this week, and we're taking some time to think about who and what we're grateful for, and we want to know the same from you!
Mobile app with a serverless backend
Tags: aws, serverless, mobile
Published: 2022-11-21 14:37:14

So you have you mobile application and do now realize that you need a backend service but you don't want to host any servers. How can you achieve this?

In this article I will show you how you easily with AWS can make use of several tools to handle this and without handling any servers (serverless).

Our architecture would looks something like this:

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

Let's go through each part below.

## 1. Amazon Cognito
We'll use Amazon Cognito for the login which will return User Pool tokens (note: with Amazon Cognito you can also use Amazon Cognito federates third party identity such as Facebook and Google).

## 2. Amazon API Gateway
With HTTPS request and the included Amazon Cognito tokens we'll make use of Amazon API Gateway to call the appropriate endpoint

## 3. AWS Lambda
Amazon API Gateway sends HTTPS requests to the appropriate Lambda based on the requested resource

## 4. Amazon DynamoDB
We'll use Amazon DynamoDB as a NoSQL database which our Lambdas will use to post/retrieve data

For this application we have used three different tiers.

1. Presentation - mobile application
2. Logic - Amazon API Gateway with AWS Lambda
3. Data - DynamoDB

## Summary
That's it! A short summary of how you can use a serverless backend to your mobile applications.

Any comments, questions or discussions are always welcome!
Enable AWS CLI Completer for increased productivity
Tags: aws, awscommunitybuilder, productivity, tips
Published: 2022-11-21 14:33:00

---
title:  Enable AWS CLI Completer for increased productivity
published: true
description: save keystrokes and time by using AWS CLI autocomplete
tags: #aws, #awscommunitybuilder, #productivity #tips
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-21 05:32 +0000
---

Days ago I was scrolling LinkedIn and noticed a video post from [AWS Hero Andrew Brown](@andrewbrown).

[![Andrew Brown - AWS CLI Prompt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfsz4cqulyqsv6gu53jg.png)
](https://www.linkedin.com/posts/andrew-wc-brown_aws-aws-cloud-activity-6999086879954362368-Aoko/?utm_source=share&utm_medium=member_desktop)

A prompt/autocomplete for AWS CLI Prompt?!? Cool!

Is that available only within [Cloud Shell](https://aws.amazon.com/de/cloudshell/) he's using in the video?
As Andrew already mentions in the comments, you can use it everywhere you have [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-prompting.html), therefore I immediately tried it out, and it was mind-blowing.

Just type:

```
export AWS_CLI_AUTO_PROMPT=on-partial
```
in your terminal and everything you type next will be autocompleted ( or if there are more matches, the available matches will be prompted).

The cool thing is not that it autocompletes the available services - sure you can save some keystrokes if when typing `aws dy` you can get it autocompleted to `aws dynamodb` but that would not be so helpful.

No, it will prompt you all the available commands for that resource!

![AWS CLI Prompt command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xpcg98s7hak4yrq5uipz.png)

and most importantly, its parameters!

![AWS CLI Prompt parameters](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h82m5pqdz8zpd5ku3y7a.png)

That is really cool, but... do I have to export that variable every time I launch a terminal window? of course not: 

Basically, Open your shell of choice ( I use .zsh ) export the **Completer** path (not just the **Prompt** variable), reload it and tadaa!

``` 
PATH=/usr/local/bin/aws_completer:$PATH
```


Check [the docs](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html) to find out how to set it up for your shell (bash, zsh and so on)
DB SEEDER & ELOQUENT FACTORY IN LARAVEL 9
Tags: laravel, webdev, programming, tutorial
Published: 2022-11-21 14:16:47

In this post i am going to explain about creating dummy data in database by using Laravel Factory and Seed The Database by using Database Seeder.

## Eloquent Factory

Eloquent Factory is nothing but a image of Model with fake data.

To create a model factory you have to run command below.

```php
php artisan make:factory UserFactory --model=User
```

This will generate file in database/factory/UserFactory.php

Now let's add fake data for each column.

```php
<?php

namespace Database\Factories;

use Illuminate\Support\Str;
use Illuminate\Support\Facades\Hash;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
 */
class UserFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition()
    {
        return [
            "name" => $this->faker->name(),
            "email" => $this->faker->unique()->safeEmail(),
            "username" => $this->faker->unique()->userName(),
            "mobile_no" => $this->faker->phoneNumber(),
            "password" => Hash::make("Password"),
            "email_verified_at" => now(),
            "remember_token" => Str::random(10)
        ];
    }
}
```

Now to run the factory you can use Laravel Tinker.

In terminal you can run the command below to enable Laravel Tinker.

```php
php artisan tinker
```

Now run the factory using model to generate single record with fake data.

```php
App\Models\User::factory()->create();
```

To generate more than one record you have to specify the `count` for records.
```php
App\Models\User::factory()->count(10)->create();
```

## DB Seeder

To make a seeder For UserTableSeeder by running command below.

```php
php artisan make:seed UserTableSeeder
```

This command generate a file in `database/seeders/UserTableSeeder.php`

Next Update the run function of seeder file.

```php
<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;

class UserTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        User::factory()->count(1000)->create();
    }
}
```

Now Run the command below to seed the data,

```php
php artisan db:seed --class=UserTableSeeder
```

You can watch the explanation video for more clarity.

{% youtube dROeStI4uvI %}

If you face any issues while implementing, please comment your query.

Thank You for Reading

Reach Out To me.
[Twitter](https://twitter.com/techtoolindia)
[Instagram](https://www.instagram.com/techtoolindia/)
[YouTube](https://www.youtube.com/c/TechToolIndia)
Xóa thuộc tính khỏi Object trong Javascript (2 cách)
Tags: javascript
Published: 2022-11-21 13:49:15

Làm việc với Javascript nhiều, bạn sẽ thấy rằng công việc chủ yếu là thao tác với các Object. Từ việc tạo mới, clone object hay cần cập nhật giá trị cho các thuộc tính trong Object.v.v…

Như chúng ta cũng biết, Object là một tập hợp các thuộc tính, trong đó mỗi thuộc tính là một cặp key – value

Ví dụ:
   ```
const employee = {
      name: 'Dương Anh Sơn',
      position: 'Quản trị viên',
      website: 'https://vntalking.com'
    };
```
Đôi lúc bạn cần phải xóa một vài thuộc tính trong Object cho nó gọn, tránh dư thừa dữ liệu không cần thiết. Chẳng hạn như xóa thuộc tính position thì phải làm như thế nào?

Thế mạnh của Javascript đó chính là có rất nhiều công cụ hỗ trợ làm việc với Object. Thông qua bài viết tìm hiểu javascript cơ bản này, mình sẽ giới thiệu với các bạn 2 cách mà mình hay sử dụng.

Nguồn bài viết: https://vntalking.com/xoa-thuoc-tinh-khoi-object-trong-javascript.html
My First Blogpost
Published: 2022-11-21 13:59:18

My first beginning of a journey started with love and happiness.I always wanted to be a blogger but never knew how to start about it. now as a student of MORINGA SCHOOL i was able to be introduced on how to get started with blogging looking forward to enjoy it and looking for a good eperience with it. This first blog of me is to boast of being a moringa student
The Coding Monster
Tags: beginners, career, writing
Published: 2022-11-21 13:58:36

Programming has a reputation for being one of the most difficult disciplines to master; believe me: it is totally true, but mastering it is not impossible.

I am a faithful believer that everything happens at the right time and that nothing in our life is a coincidence; it is rather a result of our actions and decisions.

Several years ago, sitting in a Microcontrollers class, I told myself that Coding was not for me and that I would never be good at programming. Those words haunted me for many years. I did not dare to apply to any job that involved programming, and every time I saw a few lines of code my mind automatically told me: "you do not understand this."

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4y0irr2rimmkzzvwwm8n.jpg)
For many years I lived in fear of the Coding Monster, until one day I decided that I could no longer escape my destiny and that it was time to take action. I began my search for a bootcamp and 6 weeks later I am here writing this post before entering my first Ruby class.

Each person has a different way of learning. Some people learn faster and others learn slower. I am not going to say that coding is an easy discipline; it is certainly complicated but it is not impossible. Like everything in life, practice makes perfect and that's what makes a good programmer.

This path is long and like all careers related to engineering it is a constant learning process. The journey of a programmer does not end when you get a job or finish a BootCamp. From here on there will be a long journey of learning and updating skillsets.

**Welcome to the coding world, Are you ready to beat the coding monster?**