teleren/devto huggingface dataset:
NUMA Awareness Allocation and Affinity
Tags: opengauss
Published: 2023-04-18 06:18:24

Non-Uniform Memory Access (NUMA) is a computer memory design used in multiprocessing, where the memory access time depends on the memory location relative to the processor. Under NUMA, a processor can take advantage of NUMA by preferring to access its own local memory (which is faster), rather than accessing non-local memory (meaning that it will prefer not to access the local memory of another processor or memory shared between processors).

MOT memory access has been designed with NUMA awareness. This means that MOT is aware that memory is not uniform and achieves best performance by accessing the quickest and most local memory.

The benefits of NUMA are limited to certain types of workloads, particularly on servers where the data is often strongly associated with certain tasks or users.

In-memory database systems running on NUMA platforms face several issues, such as the increased latency and the decreased bandwidth when accessing remote main memory. To cope with these NUMA-related issues, NUMA awareness must be considered as a major design principle for the fundamental architecture of a database system.

To facilitate quick operation and make efficient use of NUMA nodes, MOT allocates a designated memory pool for rows per table and for nodes per index. Each memory pool is composed from 2 MB chunks. A designated API allocates these chunks from a local NUMA node, from pages coming from all nodes or in a round-robin fashion, where each chunk is allocated on the next node. By default, pools of shared data are allocated in a round robin fashion in order to balance access, while not splitting rows between different NUMA nodes. However, thread private memory is allocated from a local node. It must also be verified that a thread always operates in the same NUMA node.

Summary

MOT has a smart memory control module that has preallocated memory pools intended for various types of memory objects. This smart memory control improves performance, reduces locks and ensures stability. The allocation of the memory objects of a transaction is always NUMA-local, ensuring optimal performance for CPU memory access and resulting in low latency and reduced contention. Deallocated objects go back to the memory pool. Minimized use of OS malloc functions during transactions circumvents unnecessary locks.
Remove items matching a pattern from a list in Groovy
Tags: groovy
Published: 2023-04-18 06:18:14

Here is how you can remove items from a list that match a text pattern.



    myList = ["lice",
              "mice",
              "dice",
              "ice",
              "mosquito",
              "rice",
              "apple",
              "thrice"]

    myList.removeAll {it -> it.contains("ice")}

    assert myList == ["mosquito", "apple"]
How to Check React App Version Quickly?
Tags: react, abotwrotethis
Published: 2023-04-18 06:12:02

If you're working with a React application, knowing its version can help you stay up-to-date with the latest features and fixes. Whether you're a developer or a tester, having a quick and simple way to check the React app version can save you time and effort. In this post, we'll show you a few ways to check the React app version quickly.

## Method 1: Check the package.json file

One of the easiest ways to check the React app version is to open the package.json file. This file contains all the dependencies of your React application, including the React version. To find the React version, simply locate the "react" package under the "dependencies" or "devDependencies" section of the file.

Here's an example of how the React version appears in the package.json file:

```
"dependencies": {
  "react": "16.8.6",
  "react-dom": "16.8.6"
},
```

In this example, the React version is "16.8.6". Keep in mind that the version number may vary depending on the specific React version you're using.

## Method 2: Use the ReactDom package

Another way to check the React app version is to use the ReactDom package. This package provides a way to render React components to the DOM, and it also includes a static method called "version". This method returns the current version of React that's being used by the application.

Here's an example of how to use the version method:

```javascript
import React from 'react';
import ReactDOM from 'react-dom';

console.log(ReactDOM.version);
```

When you run this code in your application, it will output the current React version to the console.

## Method 3: Check the browser console

The final way to check the React app version is to use the browser console. This method works for applications that are running in a browser environment, such as Chrome or Firefox.

To check the React version using the browser console, navigate to your React application in your browser of choice. Then, open the browser console by pressing the F12 key (or right-clicking and selecting "Inspect Element" and then clicking on the "Console" tab).

Once the console is open, enter the following command:

```javascript
React.version
```

If your application is using React, this command will output the current React version to the console.

## Conclusion

No matter which method you use, checking the React app version is a quick and easy task. Whether you're a developer, a tester, or just curious, knowing the React version can be a valuable piece of information. Try out these methods for yourself and see which one works best for your needs.
Cleaning Maid Services Near Me
Published: 2023-04-18 05:51:08

Amazon Cleaning offers expert **_[cleaning maid services near you](https://amazoncleaning.net/)_**. Our team of experienced and knowledgeable cleaners is ready to come to your home or office for a deep clean, regular maintenance, or a one-off spruce up. We understand the importance of a neat and tidy environment and go above and beyond to deliver outstanding results. Our services include vacuuming, dusting, mopping hard floors, polishing furniture surfaces, washing dishes, changing bed sheets and towels, making beds, emptying wastebaskets, and cleaning bathrooms including toilets, sinks, and showers. For more information, visit us today.
Django Rest Framework: Map Values Before Serializing and Deserializing
Tags: django, python, rest
Published: 2023-04-18 05:29:20

When serializing and deserializing data using a serializer, you may want to map the values of certain fields before they are serialized or after they are deserialized. One common use case for this is to transform the data to match a specific format required by your API or application.

To map values while serializing and deserializing, you can use the serializer's `to_representation` and `to_internal_value` methods, respectively. These methods are called when the serializer is used to serialize and deserialize data. You can override these methods to implement your custom value mapping logic.

```py
class MySerializer(serializers.Serializer):
    my_field = serializers.CharField()

    def to_representation(self, instance):
        # Map the value of my_field to lowercase before serialization
        data = super().to_representation(instance)
        data['my_field'] = data['my_field'].lower()
        return data

    def to_internal_value(self, data):
        # Map the value of my_field to uppercase after deserialization
        data['my_field'] = data['my_field'].upper()
        return super().to_internal_value(data)
```

In this example, the `to_representation` method is overridden to map the value of the `my_field` field to lowercase before serialization, and the `to_internal_value` method is overridden to map the value of the `my_field` field to uppercase after deserialization. The methods first call the parent implementation to perform the default serialization and deserialization logic, and then apply the custom value mapping.

By doing this, the mapped value will be returned during serialization, and the mapped value will be stored in the database after deserialization.
Love Mongodb ? Try Tigris db once.
Tags: webdev, javascript, mongodb, express
Published: 2023-04-18 05:12:54

Tigris db is one the best no sql database I came across after the mongodb.

We love mongodb for it's ease of use and features, powered queries easy model setup, complex operations. 
But still there are many things we have to handle on our own, i.e. Environment based setup etc.

Whereas Tigris provide native integration for branching enviroments, we can setup the main, staging, dev branch for different database using env config.

In order to get one more step further we have a tigris db to explore. Let's discuss some key points difference of tigris db and mongodb to get more idea around it.



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



How Tigris differ from MongoDB from the tigris doc

> - Unlike MongoDB, Tigris follows a modern composable architecture with loosely coupled components. Furthermore, compute is separated from storage, allowing for independent scaling and a more resilient system.
- The storage layer in Tigris is built on FoundationDB, and Tigris inherits the strong consistency guarantees, and the scalability of FoundationDB.
- Tigris provides automatic database sharding, and shard keys are unnecessary as the data distribution is automatically handled. This ensures true serverless behavior with no painful transition from a non-sharded to a sharded MongoDB cluster.
- Tigris' open source Kubernetes-native design allows it to be deployed anywhere in the cloud in the user's account, ensuring that the user is always in control of their data.
- Some other differentiating features include global interactive ACID transactions, consistent secondary indexes, and an integrated search platform.

To try the Tigirs database with express app, visit: https://www.tigrisdata.com/
Signup, and create a test app. It'll provide a command set of npm. Create an express app using it and you'll be able to explore the codebase and queries.

Here's a reference of express tigris app: https://github.com/raviagheda/express-tigrisdb

Fun Fact: If we move to tigress db then our stacks will be as follow MEAN will be NEAT, and MERN will be TERN.

If you are here it means you may have enjoyed reading this blog. Just follow me "Ravi Agheda"
which will motivate to write more, and contribute to open source. You can make me a coffee☕️ . Small support comes a long way!
Manclub - Game Bài Đổi Thưởng Phái Mạnh - Tải Manclub IOS, APK, Máy tính
Published: 2023-04-18 05:12:15

"Đẳng cấp game bài phái mạnh Manclub, với nhiều thể loại game đổi thưởng hấp dẫn như: Tài xỉu, Tiến lên, Phỏm, Mậu binh, slot nổ hũ... Tải game +100K
Địa chỉ        Nguyễn Ái Quốc, Hiệp Phước, Nhơn Trạch, Đồng Nai, Việt Nam
Hastag        #Manclub  #TảiManclub #Manclubme
SĐT        0945522271
Website: [https://manclub.me/](https://manclub.me/)"
First ever hackaton
Tags: react, hackaton, chatgpt, beginners
Published: 2023-04-18 05:03:31

---
title: First ever hackaton
published: true
description: Little description of the experience with my first hackaton
tags: react,hackaton,chatgpt,beginners
# cover_image: https://res.cloudinary.com/dfixfnldt/image/upload/v1681618091/a8jvrznkgevzno6y9uy3.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-04-16 04:03 +0000
---
I always wanted to be part of a hackaton, and recently gave myself the opportunity, was so much fun, but since it took me so much I was pretty much the one teaching and guiding my team (2 more devs that touched react for their first time)

Once again I can confirm that I really like teaching, so kind of aiming for a devrel role as of late, anyhow!

It's a little app that fetches motivational quotes from chatgpt API & images from unsplash, once the quote is loaded you can change the image by selecting the ones in the bottom.

Already got a bunch of... pretty direct feedback from the hackaton host, so what you see now will change a lot~

![quotes](https://www.inspirebot3000.com/external/IB3K.gif)
![image selector](https://www.inspirebot3000.com/external/IB3KCarousel.gif)
Deploy link: https://www.inspirebot3000.com/

Github: https://github.com/chat-gpt-hack/Inspire-GPT
openGuass Product Positioning
Published: 2023-04-18 01:30:48

openGauss is a HA rational database that supports the SQL2003 standard and primary/standby deployment.

Multiple storage modes support composite service scenarios. The in-place update storage engine is introduced.
The NUMA data structure supports high performance.
HA is supported by Paxos consistency log replication protocol, primary/standby mode, and cyclic redundancy check (CRC).
Security features are supported, such as fully-encrypted computing and ledger database, to provide comprehensive end-to-end data security protection.
The Table Access Method interface layer supports multiple storage engines.
openGauss is a multi-core-oriented open-source relational database that provides ultimate performance, full-link service and data security, AI-based tuning, and efficient O&M capabilities. This leading database at enterprise level is developed in collaboration with global partners and is released under the Mulan Permissive Software License v2. openGauss deeply integrates Huawei's years of R&D experience in the database field and continuously builds competitive features based on enterprise-level scenario requirements.
MOT Usage
Tags: opengauss
Published: 2023-04-18 04:50:11

Using MOT tables is quite simple and is described in the few short sections below.

openGauss enables an application to use of MOT tables and standard disk-based tables. You can use MOT tables for your most active, high-contention and throughput-sensitive application tables or you can use MOT tables for all your application's tables.

The following commands describe how to create MOT tables and how to convert existing disk-based tables into MOT tables in order to accelerate an application's database-related performance. MOT is especially beneficial when applied to tables that have proven to be bottlenecks.

Workflow Overview

The following is a simple overview of the tasks related to working with MOT tables –

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qxi69u2qdcgpzzo9fkl2.png)
How To Make Order Status Visible on Frontend in Magento 2
Tags: webdev, magento, magento2tutorials
Published: 2023-04-18 03:49:48

Magento 2 is a strong online business stage that gives a ton of adaptability and customization choices for storekeepers. 

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

One such customization is the capacity to show the request status on the frontend so that clients could see, as well as the capacity to choose an auto transporting technique. Of course, Magento 2 doesn't show the request status on the frontend, yet this data can be effectively made noticeable with a couple of straightforward advances. 

In this blog, we'll tell you the best steps for **_how to make the order status visible on the frontend in Magento 2._**

For more info, visit **_https://webguru.dev/how-to-make-order-status-visible-on-frontend-in-magento-2/_**
The new era of Gamers: Crypto Gaming
Tags: blockchain, web3, crypto, game
Published: 2023-04-18 03:04:38

---
title: The new era of Gamers: Crypto Gaming
published: true
description: This article discusses the rising popularity and benefits of crypto gaming, including the play-to-earn model and ownership of digital assets.
tags: #blockchain #web3 #crypto #game
---

The world of gaming has always been a lucrative industry, and the advent of blockchain technology has opened up new avenues for players to earn money while playing their favorite games. Crypto gaming has emerged as a popular trend in recent years, with players using cryptocurrencies and digital assets to buy, sell, and trade in-game items and participate in play-to-earn games.

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

According to a recent article on our blog, the popularity of crypto gaming has been on the rise, with more players turning to these games as a way to invest in digital assets or earn money through play-to-earn games.

The article highlights some of the key benefits of crypto gaming, including the ability to earn passive income, own and trade digital assets, and participate in a more decentralized and transparent gaming ecosystem.

One of the most significant advantages of crypto gaming is the **play-to-earn model**, where players can earn cryptocurrencies or digital assets by playing games and achieving certain milestones or completing tasks. This model has revolutionized the gaming industry, as players can now monetize their gaming skills and turn their hobbies into profitable ventures. Play-to-earn games have become increasingly popular, with some games offering rewards worth thousands of dollars.

Another benefit of crypto gaming is the **ownership of digital assets**. In traditional games, players do not own the in-game items they purchase, and the game developers can revoke or delete them at any time. In crypto games, players own the digital assets they acquire, and they can sell or trade them on various marketplaces.

Crypto gaming is also a more **decentralized and transparent ecosystem** compared to traditional gaming, where game developers have complete control over the game's economy and regulations. With blockchain technology, crypto games are built on decentralized networks, making it more challenging for developers to manipulate the game's economy or impose unfair regulations.

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

In conclusion, crypto gaming has emerged as a lucrative and engaging opportunity for players to earn money while enjoying their favorite games. With the rise of blockchain technology and the play-to-earn model, crypto gaming has become an exciting and accessible way for players to monetize their gaming skills and own digital assets.

As the industry continues to evolve, it will be interesting to see how crypto gaming transforms the gaming landscape and attracts more players into the world of blockchain. Learn more about crypto gaming here: https://mirrorworld.fun/blog/crypto-game-users
Day 5. two sum with two pointers
Published: 2023-04-18 03:01:04

### Problem Set

[167. Two Sum II - Input Array Is Sorted
](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)

Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length.

Return the indices of the two numbers, index1 and index2, added by one as an integer array [index1, index2] of length 2.

The tests are generated such that there is exactly one solution. You may not use the same element twice.

**Your solution must use only constant extra space.**


### first attempt

- use two pointers
- increment both from left side
- rightP is always same or bigger than leftP+1
- when I can't find matching rightP for the target, increase the leftP+1 and update rightP starting value as well (`rightP = leftP + 1`)

**Pseudo code**
```js
1. leftP = 0, rightP = leftP+1
2. first loop: leftP increments from 0 to numbers.length - 2
3. for each leftP, find rightP from the rest of the array. 
4. second loop: rightP starts from leftP+1, and checks until the end of array. 
5. if sum = target, return
6. if sum != target, keep increasing rightP
7. if you don't find any, increase leftP++ and repeat another round.
```

**Problem**
- time limit exceeded
- it is inefficient. almost like a double for loop.

**Solution**
- How to make a better use of two pointers?
- Use *non-decreasing order array* wisely
- It means smaller value is on left, bigger value is on right
- Let's start pointers from the other ends, not adjacent (next to each other)
- We can check the sum of two pointers and compare with the target
```js
1. if sum > target, the sum has to decrease. So move the rightP(bigger value positions) to left(--)
2. if sum < target, the sum has to increase. So move the leftP(smaller value positions) to right(++)
```
- This reduces the amount of pointers movement and loops very significantly.

### Helpful links
- https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/solutions/2128501/two-pointers-visual-explanation-java/?envType=study-plan&id=algorithm-i


### Relevant problem sets

[653. Two Sum IV - Input is a BST](https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/)
[1099. Two Sum Less Than K](https://leetcode.com/problems/two-sum-less-than-k/description/)
1768. Leetcode Solution in cpp
Tags: cpp
Published: 2023-04-18 02:59:26

```cpp
class Solution {
 public:
  string mergeAlternately(string word1, string word2) {
    const int n = min(word1.length(), word2.length());
    string prefix;

    for (int i = 0; i < n; ++i) {
      prefix += word1[i];
      prefix += word2[i];
    }

    return prefix + word1.substr(n) + word2.substr(n);
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/merge-strings-alternately/
Employee Management System -Project for Practice
Tags: java, spring, hibernate, discuss
Published: 2023-04-18 02:58:57

## Project Description

In the last few weeks i being working in a interesting project the i found, just for put in practice my abilities programing in Java and using Spring Framework (first time using it).

Was to much, finally is in my GitHub you can and bring me your comment. this project is not 100% my but it take all my time.

## Areas of improvement for future
I think. this project can be great for a full and functional  HR department for all the function that you can add in the future like:

- Employee working hours calculations 
- Full Payroll function
- Accessibilities between departments

[GitHub link](https://github.com/franklinholguin/EMPLOYEE-MANAGEMENT-SYSTEM.git)
Using Zig in Rust!
Published: 2023-04-18 02:41:53

In my head I thought hey how would I go about integrating Zig and Rust together in a sorta simple way, and then it came to me...they both use FFI for C interoperability. So if I would compile a Zig file as a dynamic library and link it to my Rust program treating is a C shared library, we're good to go right? I was happy to find out it does work...

Let's create a simple zig file called `mylib.zig` with the following `add` function that's exported to C. 

```{zig}
const std = @import("std");

export fn zig_add(a: i32, b: i32) i32 {
    return a + b;
}
```

Let's now create a Rust file, `main.rs` that will have an `extern` block that will declare our `zig_add` function and in our `main` function we will use it, taking note that when using `zig_add` we will have to wrap it in an unsafe block. 

```{rust}
extern "C" {
    fn zig_add(a: i32, b: i32) -> i32;
}

fn main() {
    let result = unsafe { zig_add(1, 2) };
    println!("1 + 2 = {}", result);
}
```
In our example we will be using a Linux system because of the ease with C development on it, and the fact that we will need environment variables to set our linker path. Now let's see how we can have these files work with eachother. 

```{shell}
# compile zig file as dynamic library 
$ zig build-lib mylib.zig -dynamic 
# compile rust file linking our library 
$ rustc main.rs -L . -l mylib 
# set the linker path 
$ export LD_LIBRARY_PATH=./
$ ./main 
1 + 2 = 3
```

For those wondering, if we didn't set the linker path, we would get the following error: 
```{shell}
./main: error while loading shared libraries: libmylib.so: cannot open shared object file: No such file or directory
```