teleren/devto huggingface dataset:
OpenCilk tutorial
Tags: opencilk, tutorial, parallelprogramming, threads
Published: 2021-11-15 11:41:53

What is Parallel Programming?

In very simple terms, it is the use of multiple resources, in this case, processors, to solve a problem. This type of programming takes a problem, breaks it down into a series of smaller steps, delivers instructions, and processors execute the solutions at the same time.It is also a form of programming that offers the same results as concurrent programming but in less time and with more efficiency.


OpenCilk tutorial

Be aware that opencilk doesn't work for windows.
First we will download the docker image:

1)
```
wget https://github.com/OpenCilk/opencilk-project/releases/download/opencilk%2Fv1.0/docker-opencilk-v1.0.tar.gz
```

Then load the image :(which loads the image from a tar archive. It restores both images and tags.)

```
docker load < docker-opencilk-v1.0.tar.gz
```

2) Run a simple c program to confirm opencilk is installed:

```
#include <stdio.h>
#include <stdlib.h>
#define cilk_spawn _Cilk_spawn // the includes neccessary for openCilk
#define cilk_sync  _Cilk_sync
#define cilk_for   _Cilk_for

int main(){
printf("Hello world");
}

```
3)Quick overview:
Cilk extends C and C++ with three keywords: cilk_spawn, cilk_sync, and cilk_for

cilk_spawn and cilk_sync:

example 1:
```
int64_t fib(int64_t n) {
  if (n < 2) return n;
  int x, y;
  x = cilk_spawn fib(n - 1);
  y = fib(n - 2);
  cilk_sync;
  return x + y;
}
```
In the usage of cilk_spawn, parallel work is created when cilk_spawn precedes the invocation of a function, thereby causing the function to be spawned.The code immediately following the spawn — is allowed to execute in parallel with the child, instead of waiting for the child to complete as is done in C/C++.</br>
In the example fib function, the cilk_spawn spawns the recursive invocation of fib(n-1), allowing it to execute in parallel with its continuation, which calls fib(n-2).</br>
The cilk_sync is a local "barrier," not a global one as. In fib, the cilk_sync prevents the execution of fib from continuing past the cilk_sync until the spawned invocation of fib(n-1) has returned.




cilk_for:
example 1:
```
void daxpy(int n, double a, double *x, double *y) {
 cilk_for (int i = 0; i < n; ++i) {
    y[i] = a * x[i] + y[i];
  }
}
```

The cilk_for parallel-loop construct indicates that all iterations of the loop are allowed to execute in parallel. At runtime, these iterations can execute in any order, at the discretion of the runtime scheduler.

example 2:
````
void mm(const double *restrict A,
        const double *restrict B,
        double *restrict C,
        int64_t n) {
  cilk_for (int64_t i = 0; i < n; ++i) {
    cilk_for (int64_t j = 0; j < n; ++j) {
      for (int64_t k = 0; k < n; ++k) {
        C[i*n + j] += A[i*n + k] * B[k*n + j];
      }
    }
  }
}
```

To sum up, a good start would be using cilk_for to replace all the for in your synchronous code. Also using cilk_spawn and cilk_sync
for all your recursive calls.
Lost location.pathname
Tags: react
Published: 2021-11-15 11:35:57

Hello,

I'm a beginner in ReactJS.
I make a component for my menu like this : 

```javascript
import React from 'react'
import {NavLink,useLocation} from 'react-router-dom'


export default function Navigation() {
		//For active link
		const location = useLocation()
		const getNavLinkClass = (path) => {
		  return location.pathname === path ? 'active' : '';
		}
        
return (
...<li className={getNavLinkClass("/page")}> <NavLink  to={page.slug}>{page.title}</NavLink></li>...

```
It's work fine, but i need to call Api to get Pages, i do that : 

```javascript
import React,{useState,useEffect} from 'react'
import {NavLink,useLocation} from 'react-router-dom'
import axios from 'axios'

export default function Navigation() {

		const [data,setData] = useState([])
        
		//For Active
		const location = useLocation()
		const getNavLinkClass = (path) => {
					return loc.pathname === path ? 'active' : '';
		}


		useEffect(() => {
			
			const fetchData = async () => {
				const result = await axios.get('http://localhost:5000/menu')

				setData(result.data)
			}
			fetchData()
		},[])

        
        return (
...<li className={getNavLinkClass("/page")}> <NavLink  to={page.slug}>{page.title}</NavLink></li>...

```
I have this error : 
TypeError: Cannot read properties of undefined (reading 'pathname')

I don't understand.

Thaks for help
Intro To React Js
Tags: javascript, react, beginners, webdev
Published: 2021-11-15 11:24:04

React is a JavaScript library for building SPAs with interactive user interfaces.  The entire React application can be modeled as a set of independent, isolated and reusable components. In other words you can say components are the building blocks of React App. These components are put together to design complex layouts.  React makes it painless to create interactive UIs. It has a concept called state for this purpose.  Some of the websites built with React - Facebook, Netflix, Instagram, Twitter, Airbnb, Nike, MakeMyTrip, Codepen, Snapchat, Prime Videos and many more.
Hacktoberfest 2021
Tags: hacktoberfest, beginners, opensource, github
Published: 2021-11-15 11:09:27

This year, I completed my First Hacktoberfest. It was a great learning experience as I was introduced  to open source and GitHub. Through Hacktoberfest I not only learned a great lot about GitHub but also how meaningful contributions can improve ongoing projects and help strengthen the open source community.
Congratulations! to everyone who participated in Hacktoberfest. Happy Learning!
Best web tool to create a link bio Instagram gratis that will carry your brand name.
Tags: socialnetworking, startup, instagram, marketing
Published: 2021-11-15 11:05:13

As you know that nowadays many social network platforms like Instagram allow sharing only one link in the bio section, what makes it complicated for creators that have multiple content links to share them all with their followers, the choice to post a link in that section becomes hard between a Youtube chanel link, a personal store site or another social media profile and much more. With Clink.bio, that problem is solved with a prety efficient way, it allows you to easily gather all your important links and social media profiles in one successful Instagram Link in Bio which will be dedicated on a name of your choice, and it will point to a customizable microsite that you will build by yourself, it provides all the tools to help create attractive landing pages for your link. You can manage all your audience directely via your link in bio, drive sales and get more subscribers & supporters, even if you ae too lazy for the registrations and all that stuff, don't panic! you can create your link inbio with a non registration way, just add your links and social media profiles and your good to go, plus it is completely free.

you can try it out from here: https://clink.bio/
Tools to Make React Documentation a Piece of Cake! 👨‍💻
Tags: react, devops, devrel, opensource
Published: 2021-11-15 10:31:55

Documenting React components might be a cumbersome task for many. However, with the right set of tools and practices, you can make your docs look seamless and codes efficient. 

Join Sankalp Swami and Aviyel for an interesting conversation on tools he uses to document React components. Get the list of most usable documentation tools, learn how to document React components, and build your first doc in an instant. 
Join us to get hands-on experience with React, open-source, and a personalized evening with Sankalp. 

Save the Date: 📆 November 20th, 2021
Time: 9:30 AM IST
Register Here 👉 https://bit.ly/3cdf74F

Impressed? Check out the rest of our events!
Happy building, 
Team Aviyel
Love React? Join Mohmed Ishak in Documenting React Components Using Open Source Tool on Aviyel
Tags: react, opensource, reactnative, eventsinyourcity
Published: 2021-11-15 10:27:41


If you are into frontend, chances are you might have used React at least once in your career. In case, you are looking for documenting your React components but are stuck with the know-how, then Aviyel comes to your rescue. 

We bring to you Mohmed Ishak, a React developer, and open source enthusiast to get you started. Ishak will use Docz to build an SEO-friendly, production-ready doc site. What more? A chance to impress your future boss with all your developer skills.

Join us to get hands-on experience with Docz, open-source, React, and a personalized evening with Ishak. 

Mark your Calendar: 📆 November 19th, 2021
Time: 9:30 AM IST

Register NOW 👉 https://bit.ly/3FivARO

Impressed? Check out the rest of our events!
Let’s build open source together!
Team Aviyel
Global gitignore
Tags: git, macos, linux
Published: 2021-11-15 10:23:02

The .gitignore file is a powerful tool in Git for excluding certain files and directories from being tracked. However, it's essential to use it correctly and avoid including environment-specific exclusions in project-specific .gitignore files. In this article, we will discuss the proper usage of .gitignore files, distinguishing between project-specific and global exclusions.

**Project-specific .gitignore**

The primary purpose of a project-specific .gitignore file is to exclude files and directories that are specific to the project itself. It helps in keeping the repository clean and prevents accidental commits of unnecessary or sensitive information.

A good practice is to include only project-related files and directories in the project-specific .gitignore. This includes:

- Build artifacts and compiled binaries
- Dependency directories (e.g., node_modules, venv, etc.)
- Generated files (e.g., log files, cache files, etc.)
- Sensitive information (e.g., credentials, API keys, etc.)

For example:

```
# Build artifacts
build/
dist/

# Dependency directories
node_modules/
vendor/

# Generated files
*.log
*.cache

# Sensitive information
credentials.txt
secrets/
```

By focusing on project-specific exclusions, you ensure that anyone cloning or working on the project doesn't inadvertently commit or track unnecessary files. It keeps the repository clean and focused on the project itself.

**Global .gitignore**

While project-specific .gitignore files handle exclusions specific to a particular project, there may be files and directories that are not project-specific but should still be ignored across all Git repositories. Examples include IDE-specific files, operating system artifacts, and common build artifacts.

To handle such global exclusions, Git provides the concept of a global .gitignore file. This file resides outside any project and defines exclusions that apply to all repositories on your local machine.

To create a global .gitignore file, follow these steps:

1. Create the .gitignore file in your home directory or any other preferred location:

```zsh
touch ~/.gitignore
```

2. Configure Git to use the global .gitignore file:

```zsh
git config --global core.excludesfile ~/.gitignore
```

Once the global .gitignore file is set up, you can include exclusion patterns that apply globally. One convenient way to obtain these patterns is by referencing the GitHub Gitignore repository, specifically the "Global" directory:

Global .gitignore templates: https://github.com/github/gitignore/tree/master/Global

In the global .gitignore file, copy and paste the necessary exclusion patterns from the repository, depending on your specific requirements.

By separating global exclusions from project-specific ones, you maintain a clean and focused .gitignore file for each project while ensuring that common exclusions are applied consistently across all repositories on your machine.

Improved by: ChatGPT
Meet dotConnect for PostgreSQL 7.22 with support of the latest PostgreSQL 14
Tags: postgres
Published: 2021-11-15 10:13:57

---
title: Meet dotConnect for PostgreSQL 7.22 with support of the latest PostgreSQL 14
published: true
description: Devart announced the new release of dotConnect for PostgreSQL 7.22 with PostgreSQL 14 support. 
tags: postgresql
//cover_image: https://direct_url_to_image.jpg
---
Devart, a recognized vendor of world-class data connectivity solutions for various data connection technologies and frameworks, rolled out the new version of [dotConnect PostgreSQL 7.22](https://www.devart.com/dotconnect/postgresql/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dotconnectpostresql_15.11.2021). Now, users can connect their .NET projects to the latest PostgreSQL 14.

**The release includes the following updates, related to support of PostgreSQL 14 new features:**
- dotConnect for PostgreSQL now supports the various multirange data types:

int4multirange, int8multirange, nummultirange, datemultirange, tsmultirange, tstzmultirange;

the new members IntMultirange, BigIntMultirange, NumericMultirange, TimeStampMultirange, TimeStampTZMultirange, DateMultirange are added to the PgSqlType enum;

PgSqlReader.GetProviderSpecificValue returns provider-specific range types: PgSqlIntRange[] for int4multirange, PgSqlBigIntRange[] for int8multirange, PgSqlNumericRange[] for nummultirange, PgSqlTimeStampRange[] for datemultirange, PgSqlTimeStampTZRange[] for tsmultirange, PgSqlDateRange[] for tstzmultirange.

- The latest version fully supports OUT parameters in stored procedures.

- In the new release, NaN, Infinity, -Infinity values of numeric data types generate a NotSupportedException to avoid inconsistency.

**dotConnect for PostgreSQL** is a high-performance ORM enabled data provider for PostgreSQL that builds on ADO.NET technology to present a complete solution for developing PostgreSQL-based database applications. It introduces new approaches for designing application architecture, boosts productivity, and facilitates the development of database applications.

**About Devart** 
 
Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration, and backup solutions. The company also implements Web and Mobile development projects. 
For additional information about Devart, visit https://www.devart.com/.
Instantly run pull request code on your phone.
Tags: reactnative
Published: 2021-11-15 10:10:30

Recently I had a problem of trying to show the UI that I have done to my designer. The code need to be merge first an then release to test flight before he got a chance to look at it. If there is any changes, we basically need to go through the flow again which for me is time consuming.

There has to be a better way and this reminds me of a tool I read on HN but I haven't been able to find the post.

Basically, one of the staff of a company made an internal tool that would bundle up your RN code when you made a pull request. If you want to run the code, all you need to do is scan the QR code on the PR.

This makes it faster for you to try and test the code. It would also make it faster for you to take design feedback from the designer. Instead of waiting for it to be release on test flight and play store, they can just scan a QR code and try it instantly.

One caveat of this method is that it only works on PR that does not require a new native code but I think at some point most app would be mature enough that it won't need to add native code all the time.

Shopify have something called [Tophatting](https://shopify.engineering/mobile-tophatting-at-shopify-1) . I'm not sure if this is the post that i saw on HN previously. Unfortunately I don't think they open source it.

Another one that I can find is [Appr](https://github.com/FormidableLabs/appr) . Unfortunately it does not work on iOS and even if it does work, it only works on Expo based project.

I wonder if there is any tool out there that does something similar? Let me know in the comment if you know!
Chia sẻ kiến thức Công nghệ & Cuộc sống - Topmeta.vn
Tags: topmeta
Published: 2021-11-15 10:06:16

Top Meta - Kênh tổng hợp chia sẻ kiến thức nhiều lĩnh vực. Dù bạn đang muốn tìm hiểu lĩnh vực nào chúng tôi cũng sẵn sàng chia sẻ kiến thức với bạn. Với mục tiêu trở thành Blog chia sẻ kiến thức Top 3. Chúng tôi Topmeta.vn với đội ngũ có nhiều năm kinh nghiệm với mọi lĩnh vực có thể chia sẻ với bạn những kiến thức vô cùng quý giá và hữu ích. Chúng tôi tự hào là "ngôi trường" cho những bạn đam mê kiến thức để có thể thành công hơn với lĩnh vực bạn lựa chọn.
website: https://topmeta.vn/
https://www.facebook.com/topmeta.vn/
https://www.youtube.com/channel/UCczdaHaCN48Ph4rKYIlyrsw
https://topmeta.wordpress.com/
https://twitter.com/topmetavn
https://topmeta.tumblr.com/
https://topmetavn.blogspot.com/
https://www.pinterest.com/topmetavn
Cash App Login Issue? - Check Out The Steps Here
Tags: cashapplogin, howtocashapplogin
Published: 2021-11-15 09:48:46

**Cash App** is only available for the only USA users. In case of a login issue in the Cash app, you need to check your device according to the given steps below.

**Here are a few points which will help you to solve cash app login issues:**

First off, check your **internet connection** and make sure that it is fine or not. You can try refreshing your page if still not working and use mobile data rather than wifi.
If the problem still persists then try **deleting Cash from your device history** and adding it again from scratch. This way you'll surely get rid of all sorts of bugs & errors that might be causing trouble while logging in. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2ckcdyghe2puof0tqu8.jpg)
**Four Steps to Fix Cash App Login Issue - [FIXED]**

Cash App is a popular payment system. It's very easy and simple to use a cash app for money transfer or receiving or withdrawing cash . But there are many times with the user face login issue. This tutorial guides you on how to fix this kind of **[cash app login](https://autocashapps.com/cash-app-login/)** issue in 5 steps.

**Step 1** : User has to check whether the device is compatible with CashApp or not. You can do that by going to setup tab on your profile page. If it will not display any message & shows only pin sign, then it means you're using a compatible device with a cash app. In this case, you needn't follow the next step and can go forward directly with a mobile app.
**Step 2** :  If the above step doesn't show any message and shows only pin sign then users need to follow this step: Now, you have to update your app version and complete the cashtag verification process.
**Step 3** : Sometimes there is some error in the **Cash App** server due to which we can not login to our account & get issues like "currently, we are experiencing technical issues on cash app" or "Please try again later".

**Step 4** : If you are not able to **solve the cash app login issue** even after trying all the above steps then one last option is to change your cashtag or email id. You can do that by setting a tab on the profile page . Go there & change both details & try again for login, it will work.

If users still face any **cash app login issues,** they can contact the **[customer support team](https://autocashapps.com/cash-app-login/)**. They'll help you out quickly for this kind of cash app login issues.
Expert analysis of how to prepare and migrate application to cloud
Tags: cloud, docker, database, architecture
Published: 2021-11-15 09:44:12

📱 In his new article our Python Technical Lead Oleksandr Lytvynenko shares his vision on the migration of apps to Cloud. This process has many advantages, and he shares the benefits and challenges of it.

So how to make your apps ready to migrate to cloud?
‣ Make sure your app can be configured easily
‣ Decouple data from the application
‣ Use standard tools and protocols
‣ Incapsulate any environment-specific code
‣ Write platform-agnostic code
‣ Dockerize your app
‣ Design your code for scalability
‣ Fit your code for #DB scaling
‣ Consider using microservices architecture

For more detailed information follow https://codeit.us/blog/how-to-get-your-app-ready-for-cloud
NFT Gaming Marketplace – The New Playground
NOVEMBER 12, 2021
Published: 2021-11-15 09:29:08

The NFT gaming marketplace is a blockchain-based platform that allows players to purchase, sell, and trade NFT. NFT marketplaces are used in two ways in Blockchain Games. Some blockchain games work with NFT gaming marketplaces to allow in-game assets to be tokenized into game NFTs. Then there are the NFT marketplace games, which are based only on the concept of marketable collectibles. Traditional games such as football, racing, strategy, arcade, and even virtual worlds are modeled around these games.

get a free estimate:
https://brugu.io/get-free-estimation
Linode Object Storage usage in NodeJS
Tags: node, javascript, programming, tutorial
Published: 2022-07-13 06:45:37

---
title: Linode Object Storage usage in NodeJS
published: true
date: 2021-11-15 09:09:09 UTC
tags: nodejs, javascript, programming, tutorial
canonical_url: https://whyboobo.com/tutorials/linode-object-storage-nodejs/
---

Simple use case of Linode Object storage in NodeJS with AWS-SDK for S3. Learn how to handle Linode Objects in plain Javascript.

```
import { Credentials } from 'aws-sdk';
import S3 from 'aws-sdk/clients/s3';

const s3Client = new S3({
  region: process.env.LINODE_OBJECT_STORAGE_REGION,
  endpoint: process.env.LINODE_OBJECT_STORAGE_ENDPOINT,
  sslEnabled: true,
  s3ForcePathStyle: false,
  credentials: new Credentials({
    accessKeyId: process.env.LINODE_OBJECT_STORAGE_ACCESS_KEY_ID,
    secretAccessKey: process.env.LINODE_OBJECT_STORAGE_SECRET_ACCESS_KEY,
  }),
});

export async function uploadFileToObjectStorage(base64Data, path, fileName, fileType, extension) {
  const params = {
    Bucket: process.env.LINODE_OBJECT_BUCKET,
    Key: `${path}/${fileName}`,
    Body: base64Data,
    ACL: 'public-read',
    ContentEncoding: 'base64',
    ContentType: `${fileType}/${extension}`,
  };

  // see: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property
  const { Location } = await s3Client.upload(params).promise();
  return Location;
}

export async function deleteFileFromObjectStorage(url) {
  const Key = url.split(`${process.env.LINODE_OBJECT_STORAGE_ENDPOINT}/`)[1];
  const params = {
    Bucket: process.env.LINODE_OBJECT_BUCKET,
    Key,
  };

  // see: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#deleteObject-property
  // eslint-disable-next-line consistent-return
  return s3Client.deleteObject(params).promise();
}

```
Create Your First .NET MAUI App with Microsoft MVP Codrina Merigo
Tags: maui, dotnet, mobile, csharp
Published: 2021-11-15 09:03:49

Join us as we take a look at the latest cross-platform framework, .NET MAUI. In this webinar, we’ll walk you through how to install, set up, and create your first .NET MAUI application. 

To learn more and download a free trial of Essential Studio .NET MAUI visit: https://www.syncfusion.com/maui-controls 

SUBSCRIBE

--------------- 

Syncfusion on YouTube: http://bit.ly/syncfusionyoutube 

Bold BI on YouTube: http://bit.ly/3jFD5sg 

Sign up to receive email updates: http://bit.ly/syncfusionemail 

{% youtube K25RtQr0m0Y %}