teleren/devto huggingface dataset:
LOVE DP DISPLAYS
Tags: lovedp
Published: 2023-08-12 02:32:48

HEART FOR LOVE DP DISPLAYS A TRUE SELF
When it comes to choosing a display picture (DP) for social media, many people opt for pictures that depict their physical appearance or showcase their achievements. However, I believe that the true essence of an individual can be captured through a heartfelt DP that symbolizes love. Love is a universal emotion that transcends all boundaries and speaks directly to the core of our being. By choosing a DP that represents love, we are showcasing our true self - someone who values and cherishes this powerful emotion.
**[Click](https://nameboost.blogspot.com/love-dp-displays)**
how to create basic REST API in Flask
Tags: python, beginners, api, programming
Published: 2023-08-12 02:31:00

here is the begineers guide to create a basic REST API in Flask


Step 1: go to vscode extensions install -> ProjectPro
Step 2: type !flask
Step 3: execute file (install flask if not present) done!

try it - [vscode extension](https://marketplace.visualstudio.com/items?itemName=ProjectPro.projectpro-helper)
Why Mockbean doesn't work in new thread
Tags: springboot, multithreading, mockito, junit4
Published: 2023-08-12 02:28:23

Have you ever encountered a situation where `MockBean` from Mockito doesn't seem to work when used in a new thread? It can be quite frustrating, especially when you're trying to write clean and effective unit tests for your software. In this article, we'll explore why `MockBean` may not work as expected in a new thread and discuss some possible workarounds.

First, let's understand the basics. `MockBean` is a powerful feature provided by Mockito that allows you to mock dependencies in your unit tests. It helps you isolate the code under test and verify its behavior without relying on the actual implementation of the dependencies. However, when it comes to working with new threads, things can get a bit tricky.

One possible reason why `MockBean` doesn't work in a new thread is that the mocking framework is not properly initialized within that thread. Mockito relies on certain thread-local state to keep track of the mocked objects and their interactions. When you create a new thread, this state may not be automatically propagated, resulting in unexpected behavior.

Another reason could be that the code in the new thread is not properly configured to use the same instance of the mocked object as the main thread. This can happen if you're using dependency injection frameworks like Spring, where the beans are managed by a container. In such cases, you need to ensure that the same instance of the mocked object is injected into both the main thread and the new thread.

So, how can you overcome these challenges? Here are a few possible workarounds:

*   Instead of creating a new thread, consider using an `ExecutorService` or a `CompletableFuture` to run your code asynchronously. These abstractions handle the thread management for you and can ensure that the mocking framework is properly initialized.
*   If you must use a new thread, make sure to manually propagate the necessary state to that thread. You can do this by copying the relevant thread-local variables or by explicitly passing the mocked objects as method parameters to the new thread.
*   In case you're using a dependency injection framework, ensure that the same instance of the mocked object is injected into the new thread. This may require additional configuration or customization of the dependency injection framework.

Remember, using `MockBean` in a new thread can be a bit tricky, but with the right approach, you can still write effective unit tests. So, don't let it discourage you from writing clean and testable code!

References:

*   Mockito documentation: [https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html](https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html)
*   Spring Framework documentation: [https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/testing.html#mock-objects](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/testing.html#mock-objects)
Sum of all tables / dataframes for all elements (in a list) in R
Tags: r, sum, tables, dataframes
Published: 2023-08-12 02:27:58

In R, working with tables and dataframes is a common task for software developers. Often, we need to perform calculations or manipulations on multiple tables or dataframes at once. One common operation is to calculate the sum of all tables or dataframes for all elements in a list.

To achieve this, we can use the `Reduce()` function in R. The `Reduce()` function applies a binary function to the elements of a list in a cumulative way. In our case, the binary function will be the addition operator `+`.

Let's say we have a list of tables or dataframes called `my_list`. Each element in the list represents a table or dataframe. We want to calculate the sum of all tables or dataframes in `my_list`.

Here's an example:

`\# Create some sample tables/dataframes table1 <- data.frame(A = c(1, 2, 3), B = c(4, 5, 6)) table2 <- data.frame(A = c(7, 8, 9), B = c(10, 11, 12)) table3 <- data.frame(A = c(13, 14, 15), B = c(16, 17, 18)) # Create a list of tables/dataframes my\_list <- list(table1, table2, table3) # Calculate the sum of all tables/dataframes in my\_list sum\_of\_all <- Reduce("+", my_list)`

In this example, we create three tables/dataframes: `table1`, `table2`, and `table3`. We then create a list called `my_list` that contains these tables/dataframes.

To calculate the sum of all tables/dataframes in `my_list`, we use the `Reduce()` function with the addition operator `+`. The result is stored in the `sum\_of\_all` variable.

Now, we can access the sum of all tables/dataframes by simply printing the `sum\_of\_all` variable:

`print(sum\_of\_all)`

This will output the sum of all tables/dataframes:

`A B 1 21 30 2 24 33 3 27 36`

As you can see, the sum of all tables/dataframes is calculated by adding the corresponding elements from each table/dataframe in the list.

Using the `Reduce()` function in R makes it easy to calculate the sum of all tables/dataframes for all elements in a list. It's a powerful tool for software developers working with data manipulation in R.

References:
-----------

*   [R Documentation: Reduce](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/Reduce)
How to load checkpoints to flax state in jax 0.4.14 when the save path is changed?
Tags: jax, flax, softwaredevelopment, checkpoints
Published: 2023-08-12 02:27:35

How to Load Checkpoints to Flax State in JAX 0.4.14 When the Save Path is Changed
---------------------------------------------------------------------------------

When working with machine learning models in JAX, it is common to save checkpoints of the model's state during training. These checkpoints serve as snapshots that can be loaded later to resume training or make predictions. However, sometimes we may need to change the save path for these checkpoints, which can lead to difficulties when trying to load them back into the Flax state. In this article, we will explore how to overcome this challenge and successfully load checkpoints even when the save path has changed.

To begin, let's assume you have previously trained a Flax model and saved checkpoints using the `flax.jax\_utils.save\_checkpoint` function. However, due to various reasons, you now need to change the save path for these checkpoints. Here's how you can load these checkpoints into the Flax state:

1.  Identify the new save path where the checkpoints are located.
2.  Use the `flax.jax_utils.unreplicate` function to remove any replication axes from the model's state. This ensures that the state is compatible with the original checkpoint format.
3.  Load the checkpoints using the new save path and the `flax.jax\_utils.restore\_checkpoint` function. This function takes care of restoring the model's state from the checkpoint files.
4.  Reapply any replication axes to the model's state using the `flax.jax_utils.replicate` function. This step is necessary to restore the original replication configuration of the model.
5.  Verify that the checkpoints were successfully loaded by checking the model's state and any associated variables.

By following these steps, you can load checkpoints into the Flax state even when the save path has changed. It is important to note that the replication configuration of the model must match between the original training session and the session where you are loading the checkpoints. Otherwise, you may encounter errors or unexpected behavior.

Remember, loading checkpoints can be a fun and exciting process, especially when you encounter unexpected surprises along the way. So, don't forget to enjoy the journey while debugging any issues that may arise!

### References:

*   Flax Documentation: [https://flax.readthedocs.io/en/latest/](https://flax.readthedocs.io/en/latest/)
*   JAX Documentation: [https://jax.readthedocs.io/en/latest/](https://jax.readthedocs.io/en/latest/)
How to Install JDK for Debian using ARM64: Fixing 'dpkg: error: archive 'jdk-20.0.2' is not a regular file'
Tags: java, oracle, wget, tar
Published: 2023-08-12 02:02:57

How to Install JDK for Debian using ARM64: Fixing 'dpkg: error: archive 'jdk-20.0.2' is not a regular file'
-----------------------------------------------------------------------------------------------------------

Are you a software developer working on a Debian system with an ARM64 architecture? If so, you might have encountered the frustrating 'dpkg: error: archive 'jdk-20.0.2' is not a regular file' while trying to install JDK. Don't worry, we've got you covered! In this article, we'll walk you through the steps to successfully install JDK on your Debian ARM64 system and fix that annoying error.

### Step 1: Update Your System

Before we begin, let's make sure your system is up to date. Open your terminal and run the following command:

`sudo apt update && sudo apt upgrade -y`

This will update your package lists and upgrade any outdated packages on your system.

### Step 2: Download JDK

Visit the official Java SE Downloads page (URL: [https://www.oracle.com/java/technologies/javase-jdk11-downloads.html](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)) and download the JDK for ARM64 architecture. Make sure to choose the correct version for your Debian system.

### Step 3: Extract the Archive

Once the download is complete, navigate to the directory where the JDK archive is located. Right-click on the archive file and select 'Extract Here' to extract its contents.

### Step 4: Install JDK

Open your terminal and navigate to the extracted JDK directory. Run the following command to install JDK:

`sudo dpkg -i jdk-20.0.2.deb`

Replace 'jdk-20.0.2.deb' with the actual name of the JDK package you downloaded.

Now, here's the tricky part. If you encounter the error 'dpkg: error: archive 'jdk-20.0.2' is not a regular file', don't panic! It's a common issue with JDK installation on Debian ARM64 systems. We just need to apply a simple workaround.

### Step 5: Fix the 'dpkg' Error

To fix the 'dpkg' error, run the following command:

`sudo dpkg-deb -R jdk-20.0.2.deb jdk-20.0.2`

This command will extract the contents of the JDK package into a directory named 'jdk-20.0.2'. Now, navigate to the extracted directory:

`cd jdk-20.0.2`

Finally, run the following command to install JDK:

`sudo dpkg -i DEBIAN/control`

That's it! JDK should now be successfully installed on your Debian ARM64 system without any 'dpkg' errors.

Now you can go ahead and start developing amazing software with the power of Java!

### Conclusion

Installing JDK on a Debian ARM64 system can be a bit tricky, but with the steps outlined in this article, you can overcome the 'dpkg: error: archive 'jdk-20.0.2' is not a regular file' issue and get JDK up and running smoothly. Remember to always keep your system updated and download the correct JDK version for your architecture.

### References

*   [https://www.oracle.com/java/technologies/javase-jdk11-downloads.html](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)
Let's explore OOP concepts using the example of a Royal Enfield motorcycle
Published: 2023-08-11 15:45:35

Object-Oriented Programming (OOP) is a programming paradigm that revolves around the concept of organizing data and code into objects, which are instances of classes. OOP encourages the use of classes and objects to model real-world entities and their interactions

**Class**: A class is a blueprint for creating objects. In the context of a Royal Enfield bike, we can define a **Bike** class.

```
class Bike {
  constructor(model, color) {
    this.model = model;
    this.color = color;
    this.speed = 0;
  }

  start() {
    console.log(`${this.color} ${this.model} bike is started.`);
  }

  accelerate(speed) {
    this.speed += speed;
    console.log(`Accelerating to ${this.speed} km/h.`);
  }

  brake() {
    this.speed = 0;
    console.log("Brakes applied. Bike is stopped.");
  }
}
```
**Object**: An object is an instance of a class. Here, we can create two instances of the **Bike** class.

```
const classic350 = new Bike("Classic 350", "Black");
const bullet500 = new Bike("Bullet 500", "Desert Storm");

```

**Encapsulation**: Encapsulation is the concept of bundling data (attributes) and methods (functions) that operate on that data within a single unit, i.e., the class. In our example, the **Bike** class encapsulates the bike's attributes (model, color, speed) and methods (start, accelerate, brake).

**Inheritance**: Inheritance allows a class (subclass or derived class) to inherit the properties and behaviors of another class (superclass or base class). For example, we can create a **RoyalEnfield** subclass that inherits from the **Bike** class and adds specific features.

```
class RoyalEnfield extends Bike {
  constructor(model, color, variant) {
    super(model, color);
    this.variant = variant;
  }

  displayDetails() {
    console.log(`Model: ${this.model}, Color: ${this.color}, Variant: ${this.variant}`);
  }
}

```
**Polymorphism**: Polymorphism allows objects of different classes to be treated as objects of a common super class. It allows methods with the same name to have different implementations in different classes. In our example, the **Bike** and **RoyalEnfield** classes can both have an **accelerate** method, but they might behave differently.

```
classic350.start();        // Output: Black Classic 350 bike is started.
classic350.accelerate(60); // Output: Accelerating to 60 km/h.

bullet500.start();         // Output: Desert Storm Bullet 500 bike is started.
bullet500.accelerate(70);  // Output: Accelerating to 70 km/h.

const thunderbirdX = new RoyalEnfield("Thunderbird X", "Blue", "X Series");
thunderbirdX.start();      // Output: Blue Thunderbird X bike is started.
thunderbirdX.displayDetails(); // Output: Model: Thunderbird X, Color: Blue, Variant: X Series

```

These are some of the fundamental OOP concepts demonstrated through the example of a Royal Enfield bike. OOP provides a structured and organized way to model and interact with real-world entities in a software application.
Connecting People Right On The Sites You Stand - What Do You Think?
Tags: discuss, web3, developer, community
Published: 2023-08-12 01:50:59

![Devto Community](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ombtzoo1mnofm6jsxr3o.png)

Hello everyone, I'm Edric. I'm a developer and tech enthusiast.

During my time browsing, I came across many helpful resources such as classic startup articles, insightful blogs, and impactful videos. And guess what? I’m not alone. Thousands like me are seeking wisdom too.

Websites are like tribes, where like-minded people gather. Think about forums such as IndieHackers, HackerNews, and ProductHunt… 

That's when it hit me: Why don't we connect directly with millions on the sites we love? 

That's why we made Builder - a browser extension that allows you to dive into communities right from the sites you're browsing. Instantly hang out, create topics, and collaborate with everyone on the websites you visit. 🚀🚀

Each website domain operates as a community, with child pages having a chat room where visitors can discuss topics related to each page's content.


![Buidler Extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59yu5iqt0th8qzpqblyy.png)

🔗 Our extension(Beta): https://chrome.google.com/webstore/detail/buidler-one-extension-any/omhbdacaeafhladkifficmjmpeaijlfc

🌐 Learn more about us: https://buidler.app/

📀 Our intro video: https://www.youtube.com/watch?v=Qs3sZNW2nNA

Currently, we’re try to seeking feedback from all users. Please take a few minutes to share your thoughts with us.

Just install the extension, and you don't need to download any additional apps. The extension functions independently from the website and is community-driven.

And let's talk use cases, shall we?

✅ **Tech Enthusiasts:** Geek out with tech enthusiasts on news sites, and forums
✅ **E-Commerce Shoppers:** Chat with shoppers, get product recommendations, and share experiences while browsing online stores.
✅ **Education Sites:** Work with classmates, discuss assignments, and get help from friends directly on the website.
✅ **Trading Platforms:** Traders can chat and monitor markets all in one place with Trading Platforms like TradingView.
✅ And many scenarios remain available for use.

Our vision is to create a messaging layer for websites that enables free communication and fosters online communities around the internet.

Please try using it and give us any feedback/suggestions you have!

Thank you! 😊
Google Chrome Customization
Published: 2023-08-12 01:47:10

Hey guys!! I changed the default chrome browser appearance and made a frontend web development project on **[Google Chrome Customization](https://0909092001.github.io/pratim-code-project/[](https://0909092001.github.io/pratim-code-project/


))**. Check it out and put your view.Here is my github repository I have the link below[](https://github.com/0909092001/pratim-code-project/commits?author=0909092001)
Android Studio 2022.3.1 (Mac Intel) cannot create Flutter projects
Tags: flutter
Published: 2023-08-12 01:34:07

Are you an Android developer who loves using Flutter for your projects? Well, we have some unfortunate news for you. It seems that the latest version of Android Studio, 2022.3.1 (Mac Intel), is having some trouble creating Flutter projects. So, if you're planning to dive into the world of Flutter development, you might want to hold off on updating your Android Studio just yet.

Now, you might be wondering what exactly is going on with Android Studio 2022.3.1 (Mac Intel) and why it's having trouble creating Flutter projects. The issue seems to be related to the compatibility between Android Studio and the Flutter framework. While Android Studio is a powerful IDE for Android development, it relies on various plugins and extensions to support different frameworks like Flutter. Unfortunately, the latest version of Android Studio seems to have some compatibility issues with the Flutter plugin, resulting in the inability to create Flutter projects.

But fear not, dear developer! The Android Studio team is aware of the issue and is actively working on a fix. They are committed to providing a seamless development experience for Flutter developers and are working diligently to resolve the compatibility issues. So, while you may have to wait a little longer to create Flutter projects in Android Studio 2022.3.1 (Mac Intel), rest assured that a solution is on the way.

In the meantime, if you're itching to get started with Flutter development, there are a couple of workarounds you can try. One option is to use an older version of Android Studio that is known to be compatible with Flutter. You can find previous versions of Android Studio on the official website and give them a spin until the compatibility issue is resolved.

Another option is to use an alternative IDE for Flutter development. There are several IDEs available that have excellent support for Flutter, such as Visual Studio Code and IntelliJ IDEA. These IDEs have dedicated Flutter plugins that make it a breeze to create and develop Flutter projects. So, if you're not too keen on waiting for the Android Studio fix, you can explore these alternative IDEs and continue your Flutter development journey.

Remember, software development is often a game of patience and problem-solving. While it can be frustrating to encounter compatibility issues, it's important to stay positive and find alternative solutions. So, hang in there, fellow Flutter enthusiasts! Soon enough, Android Studio 2022.3.1 (Mac Intel) will be able to create Flutter projects, and you'll be back to creating amazing apps in no time.

References:
-----------

*   [https://developer.android.com/studio](https://developer.android.com/studio)
*   [https://flutter.dev/](https://flutter.dev/)
*   [https://code.visualstudio.com/](https://code.visualstudio.com/)
*   [https://www.jetbrains.com/idea/](https://www.jetbrains.com/idea/)
code block trong MSWord
Tags: documentation, sep490, msword
Published: 2023-08-12 01:19:11

---
series: SEP490
---

Khi viết các tài liệu liên quan tới IT, việc chèn vào đó một vài đoạn code là chắc chắn, nhưng nếu viết code ở font "thường" thì nhìn nó không "hợp lý" 

nếu viết để xuất bản ở dạng web, thường chỉ cần 3 dấu backtick trong markdown là đủ, một số website còn cho bạn chọn syntax highlight, nhưng khi viết trong MSWord thì sao? 

Syntax Highlight thì chịu rồi, cơ mà chúng ta có thể dùng chức năng "Style" trong MSWord để định dạng 1 "paragraph" là "code block", cách làm như sau 

1. chọn 1 đoạn văn bản, định dạng thành loại font thích hợp (code nên sẽ là `monospace`, mà trong Word mặc định thì font `monospace` thích hợp nhất là `Consolas` 😍 chứ cái `Courier New` nhìn xấu òm 🥲
2. Select đoạn đó, right-click chọn Paragraph, để chỉnh lại cái spacing, indent, border.   
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y7htoeioafpppkpydwgz.png)
3. thông thường, text trong các tài liệu dạng paper này sẽ là spacing double, nên mình sẽ chọn cho cái code block là
  font : Consolas 
  font size = 10 (1 dòng trong trang A4 margin left right 1 inch chứa dc 80 kí tự) 
  line spacing single 
  mấy cái này là phong cách thôi, các bạn căn chỉnh cho phù hợp nhé!
  chọn thêm Outside border 
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ox5em4u2most8rpgrqn8.png)
4. kết quả dc như sau 
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/56mor6aqq31pz56qr26e.png)
5. sau đó chúng ta mở control Style, chọn tạo 1 style mới với định dạng của đoạn văn bản vừa thực hiện 
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7o85tzkgr1h6h7qq6hn.png)
6. lần sau khi cần chọn 1 đoạn văn bản làm "Code Block" thì chỉ cần select đoạn đó và chọn style ở trên chỗ mục Style là xong. 
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qor527t9c1ilo3tnw68o.png)