teleren/devto huggingface dataset:
Writing a curried add in JavaScript
Tags: javascript
Published: 2023-03-16 18:25:39

I wanted to create a curried `add` function that allows for unlimited chaining, like `add(1)(2)...(n)`. I started with a `curry` function that returns a curried version of the input function:

```javascript
const curry = (fn) => {
  const curried = (...args) => {
    if (args.length >= fn.length) {
      return fn(...args);
    }
    return (...moreArgs) => curried(...args, ...moreArgs);
  };
  return curried;
}
```

Next, I tried to use `curry` to create a curriedAdd function with fixed parameters:

```javascript
const add = (a , b) => a + b

const curriedAdd = curry(add)

console.log(curriedAdd(2, 3))
// 5

console.log(curriedAdd(2)(3))
// 5

console.log(curriedAdd(2)(3)(4))
// Oops an error!
// Uncaught TypeError: curriedAdd(...)(...) is not a function at <anonymous>:5:29
```
However, I encountered a problem while trying to achieve unlimited chaining using the currying technique. JavaScript functions have a fixed number of parameters, which makes it impossible to create a function that can accept an unlimited number of arguments without using some sort of workaround.

When we call `curriedAdd(2)`, it returns a function that takes another parameter and adds it to 2. Therefore, `curriedAdd(2)(3)` results in a number 5.

But attempting to call `5(4)` leads to a runtime error since 5 is a number and not a function that can accept another argument.

Instead, I came up with a solution that involves returning a function that can be called with an empty argument to indicate the end of the chain. With this approach, the user needs to manually call the function with an empty argument `()` to signal the end of the chain.

Although this requires a bit more effort from the user to call the execution, it allows for an unlimited number of arguments to be passed in a curried manner, as demonstrated by `add(1)(2)...(n)()`. 

```javascript

const add = (x) => {
  let sum = x;

  const innerAdd = (y) => {
    if (y !== undefined) {
      sum += y;
      return innerAdd;
    } else {
      return sum;
    }
  };

  return innerAdd;
};

 

add(1)(2)(3)(); // returns 6
add(1)(2)(3)(4)(5)(); // returns 15
```

Alternatively, if we know the expected number of parameters ahead of time, we can use curry with a fixed number of arguments:

```javascript

const curryN = (fn, fnArgsLen = fn.length) =>
  (...args) =>
    args.length >= fnArgsLen
      ? fn(...args)
      : (...moreArgs) => curryN(fn, fnArgsLen)(...args, ...moreArgs);


const add = (x, y, z) => x + y + z
const curriedAdd = curryN(add, 3);

console.log(curriedAdd(1)(2)(3)); // prints 6
console.log(curriedAdd(1, 2)(3)); // prints 6
console.log(curriedAdd(1, 2, 3)); // prints 6
```

While this approach isn't truly unlimited chaining, it can handle a large number of arguments and provides a flexible way to compose functions.
process to connect AGE code to GDB debugger in linux
Tags: postgres, apacheage, database, age
Published: 2023-03-16 18:13:45

**1.** go to the directory where you have installed postgres from source code.

**2.** start the server using following command:
`bin/pg_ctl -D [db cluster name] -l [logfile (optional)] start`
  for example
`bin/pg_ctl -D demo -l logfile start`

**3.**now run psql utility using command: 
`bin/psql [db name]`
  for example
`bin/psql demodb`

**4.** now find the pid (process id) of the running postgres instance.

- use system monitor and search for postgres as show in the fig below


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

- or use command:
`ps -ef | grep postgres`

**5.** open new terminal and run command: `sudo gdb`

**6.** now use command `attach [pid]` pid is process id for postgres that you have found in step **4**

  for example `attach 8024`

**7.** Attach the directory of AGE repository to GDB, so that GDB can find the code of AGE using:

For example:

`dir /home/ununtu/age_installation/age`

**8.** Now you can add breakpoints at required functions using: 
for example:

`b parse_cypher`

_Now when you pass a query through psql to postgres server, the query will stop at the breakpoints and you can move around the code using standard GDB commands._

**I hope you have learnt something from this**
if you have any question you can ask.

Visit for more about Apache AGE:

official website: [https://age.apache.org/](https://age.apache.org/)

Github: [https://github.com/apache/age/](https://github.com/apache/age/)
Drones in Hawaii
Published: 2023-03-16 18:00:10

Installing GCC on Ubuntu
For selecting [best lightweight tennis racquets](https://gettennisbar.com/arm-friendly-tennis-racquets/), many factors must be taken into consideration.
Drones are very important in nowadays life. Drones are becoming so much popular nowaday everywhere especially in Hawaii, Unites States.
To validate that whether you can fly drones in Hawaii read the guide for [drone laws in hawaii](https://discoveryoftech.com/drone-laws-hawaii/). Now if you've read that guide you can easily have a complete decision for yes or no about your question.
Security patrol service
Published: 2023-03-16 17:49:34

[Security patrol service](https://prosecurityguard.com/) is a critical aspect of modern security operations. It involves the deployment of security personnel to patrol a specific area, often on foot or in vehicles, to monitor for any suspicious activity, deter potential criminal behavior, and respond to incidents in real-time. This type of service is particularly effective in areas with high crime rates or those that are prone to security breaches. The presence of security patrols not only provides a sense of safety and security to the public but also serves as a deterrent to criminal activity. Security patrol services can be tailored to meet the unique needs of different businesses and organizations, making them an essential component of any comprehensive security plan.
New drag and drop editor for email templates creation.
Published: 2023-03-16 17:43:49


![20fix.com Email Builder Drag & Drop Editor Marketing Compaigns](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqw7dlhdj7w0rnsbi0dk.jpg)
Email marketing is a great way to reach your audience.

We're thrilled to introduce a new mobile-friendly drag and drop email template editor!

Now you can **market your business** or organization with a **fast drag and drop editor** for email templates creation. It's easy, fun, and powerful!

The new **email editor** allows you to create custom emails without writing any code or using any design tools. You can pick from a variety of different templates, customize them, and send them out as quickly as possible.

You'll also **love how easy it** is to use this editor—it takes just seconds to start creating your own templates, and you can use our library of pre-designed elements to get started right away. If you want **more control over how your email looks**, we've got you covered there too: just choose from one of our **pre-made templates** and then customize by adding your **own images**, text and links! And if you need help with anything else along the way, we have a support team standing by ready to assist at any time. We hope you enjoy using this new tool as much as we enjoyed building it!

Email marketing is a great way to **reach your audience** and build **brand awareness**. It's also a great way to get new customers, close more sales, and drive traffic to your website.

But it can be hard to come up with the right message and design, especially if you're doing it yourself. That's why <https://20fix.com> is introducing its new drag-and-drop email editor.

It's a **fast, intuitive way to create high-quality emails** that will help you **make more money**. You'll be able to send beautiful emails that your recipients will love receiving—even if they never open them!

You'll have access to **dozen templates** that come with both HTML and plain text versions so you can send the perfect message for any situation. And you can quickly change colors, fonts, and other design elements without having to learn how HTML works (or even what "HTML" stands for).

Create and send professional emails – incredibly fast and easy with <https://20fix.com>!
PHP is not going soon
Published: 2023-03-16 17:36:09

PHP, the popular server-side scripting language, has been around for over 25 years and has undergone numerous upgrades and advancements. Despite newer languages like Python and Node.js gaining popularity, PHP still holds a significant market share in web development.

One reason PHP is not going away soon is its widespread use in the web development community. Many popular content management systems (CMS) such as WordPress, Drupal, and Joomla are built using PHP, and a vast number of websites on the internet run on these platforms. As long as these platforms continue to be widely used, PHP will remain relevant.

Another reason for PHP's resilience is its versatility. PHP can handle a wide range of tasks, from simple scripts to complex web applications. It also has excellent database integration capabilities and supports a broad range of databases, making it a go-to choice for building dynamic web applications.

Furthermore, PHP has a massive library of open-source code and a vast community of developers contributing to its development, ensuring its continued improvement and relevance.

In conclusion, PHP's continued relevance can be attributed to its widespread use, versatility, and an active community. While newer languages may emerge, PHP's strong foundation and community support and ease of learning ensure that it will remain a vital part of web development for years to come.
Introducing ts-react-kit: A Comprehensive Boilerplate for Building Modern React Apps with TypeScript
Tags: javascript, react, typescript
Published: 2023-03-16 17:26:36

**_ts-react-kit_** is a comprehensive boilerplate that comes pre-configured with popular tools and libraries such as Tailwind, ESLint, Prettier, lint-staged, Jest, and React Testing Library, allowing you to build high-quality applications right from the start.
The boilerplate includes a well-structured and documented codebase, along with a comprehensive README file, making it easy for you to get started and build your React applications with ease.
Some of the key features of **_ts-react-kit_ **include:

- React 18 and TypeScript
- Tailwind CSS for easy styling
- ESLint and Prettier for consistent code formatting and linting
- lint-staged for pre-commit code checks
- Jest and React Testing Library for easy testing
- Comprehensive documentation and codebase organization

Whether you're building a small personal project or a large enterprise-level application, ts-react-kit provides a solid foundation for building scalable and maintainable React applications with TypeScript.

Check out the **_ts-react-kit_** repository on GitHub and let me know what you think!

https://github.com/dpejic/ts-react-kit
List of GitHub Repositories with public API's
Tags: github, api
Published: 2023-03-16 17:02:00

### Public APIs

A collective list of free APIs

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

Link - [https://github.com/public-apis/public-apis](https://github.com/public-apis/public-apis)

### Public API List

A collective list of free APIs for use in software and web development 🚀 (Clone of [https://github.com/public-apis/public-apis](https://github.com/public-apis/public-apis))

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

Link - [https://github.com/public-api-lists/public-api-lists](https://github.com/public-api-lists/public-api-lists)

### OpenAI Directory

🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format

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

Link - [https://github.com/apis-guru/openapi-directory](https://github.com/apis-guru/openapi-directory)

### API Guidelines

Microsoft REST API Guidelines

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

Link - [https://github.com/microsoft/api-guidelines](https://github.com/microsoft/api-guidelines)

### Public APIs

📚 A public list of APIs from round the web.


![Image-5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vfrolnak78aad8nzcs8.png)

Link - [https://github.com/n0shake/public-apis](https://github.com/n0shake/public-apis)

### Public APIs

A collective list of free APIs for use in software development

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

Link - [https://github.com/VNAPNIC/public-apis](https://github.com/VNAPNIC/public-apis)

### Google APIs

Public interface definitions of Google APIs.

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

Link - [https://github.com/googleapis/googleapis](https://github.com/googleapis/googleapis)

### GraphQL APIs

📜 A collective list of public GraphQL APIs

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

Link - [https://github.com/IvanGoncharov/graphql-apis](https://github.com/IvanGoncharov/graphql-apis)
Reflection on this week
Published: 2023-03-16 16:59:04

Its been a couple weeks since I wrote anything on here. I am setting myself a goal to write more and to reflect my learning.This week has been full of growth when it comes to event planning, Networking, and connecting. We had speakers from many different fields in Tech. I was able to see the diversity that exist in the tech world. I am grateful that all these opportunities presented themselves.
How To Search Past Commands in Powershell
Tags: powershell, cmd, command
Published: 2023-03-16 16:41:17

You need to issue a command that you had issued in past, but you cannot remember the how command is again.

There is hope if you can remember a part of the command.

Open Powershell, and do `Control + R`, you should have something like this:

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

After doing `Control + R` you will have `bck-i-search`: then you should begin typing your keyword. As you are typing the keyword (`Kernel` is my keyword here ), Powershell will show the latest command that matches your keyword. 

You will see `failed-bck-i-search` if your keyword does not match any past commands.


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



To see other commands that matches your keyword, keep doing `Control + R`

Which other ways do you do this, I want to hear from you.

Cheers
Does Typescript make you slower?
Tags: webdev, javascript, programming, typescript
Published: 2023-03-16 16:31:42

This Post is all about Typescript and DX (Developer Experience) 😎.

Many folks think writing down code in typescript creates more errors, and writing unnecessary code.
Even I had also the same thoughts at a point in time when I started learning about TypeScript and replacing it with JavaScript in my development workflow.

It seems difficult to set up a typescript express server on your own, without using any templates.

Earlier, using TypeScript in your codebase increases one extra step that’s to convert typescript into javascript and then run it in an environment like Node.js. But with the increasing popularity of Typescript among developers, new runtime environments like Bun and Deno supports, Typescript as First Class Language that’s Typescript can directly be compiled and run. 

So, why use TypeScript?

- Intellisense
- Standard Documentation
- Can be converted to the previous version of the javascript
- Type Safety

Editors like Vs code provides special privileges like intellisense, error checking and more when working with well documented languages like TypeScript.

Using typescript allows to convert code into any other javascript version, so compatibility not being an issue working with typescript.

Type Safety, dynamically typed languages like javascript are very great for writing well structured code, but increases chances of error also when a variable is undefined or null. although it can be handled using try and catch. but this doesn't seems efficient way throughout codebase.

Typescript is among top 4 in most loved programming language. 


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

Thanks for reading this article. 
For more, follow
[kunal.dev](https://linktr.ee/kunal.dev)
Lets hit the road running!
Tags: womenintech, beginners, programming, javascript
Published: 2023-03-16 16:18:58

Hello Everyone!

```
const myNameIs = `Vaschell McKenzie`
``` 
<p>I'm excited to announce that I've recently started my coding journey with FlatIron coding bootcamp. Before I go into details about how my first few weeks in the program have been, I would like to give special thanks to Amazon Career Choice for funding this program and helping employees upscale to become qualified for other jobs within or outside of the company!</p> 

I would just like to start off by saying prior to me taking this program did have some knowledge of the basics since I was pursuing a Computer Science Degree, but I chose to do this bootcamp over the degree because...
<ol>
<li>The sake of time, it would've taken me 4yrs to get my degree.
</li>
<li>I don't like taking classes that have absolutely nothing to do with what I'm studying.</li>
</ol> 
Never the less even with my prior knowledge there are still things I don't know about programming and I feel this bootcamp can help me achieve my career goals.
7 Motivos para fazer um curso de Informática Básica
Tags: cursos, educao, informatica, computacao
Published: 2023-03-16 16:09:05

Muitas pessoas têm interesse em aprender sobre informática, mas elas não sabem por onde começar. Se você é desse grupo, um [curso de Informática Básica](https://baitacursos.com.br/curso-de-informatica-basica/) é a melhor opção. Estas são 7 boas razões para participar de um curso deste tipo:

1. **Aprender os fundamentos da computação** – Um curso de Informática Básica lhe dará a base para entender como os computadores funcionam. Você também aprenderá conceitos básicos de programação, redes e outros assuntos relacionados à computação.

2. **Desenvolver habilidades com aplicativos** – Durante o curso, você trabalhará com aplicativos essenciais, como os pacotes Microsoft Office. Você aprenderá a criar documentos, planilhas e outros trabalhos úteis para seu dia a dia.

3. **Melhorar suas habilidades digitais** – Aprender sobre computação também significa entender o básico da tecnologia usada na vida moderna. Isso inclui coisas como desenvolver um site, gerenciar mídias sociais e outras ferramentas que você precisa para ter sucesso na web.

4. **Desenvolver suas habilidades de tecnologia** – Ao aprender os conceitos básicos da computação, você também desenvolverá as habilidades necessárias para trabalhar com outras áreas da tecnologia, como hardware e software. Isso lhe dará a chance de entender mais sobre o funcionamento dos equipamentos modernos, bem como melhor usufruir do que eles oferecem.

5. **Criar projetos próprios** – Por meio de um curso de Informática Básica, você pode criar projetos próprios. Você aprenderá a programar com linguagens de computação simples e escrever seu próprio software para atender às suas necessidades.

6. **Ganhar certificações** – Ao concluir o curso, você terá a chance de ganhar algumas certificações em informática que lhe abrirão novas oportunidades profissionais. Com essas certificações, você poderá se destacar em áreas relacionadas à tecnologia.

7. **Aprender a trabalhar em equipe** – Um curso de Informática Básica lhe dará oportunidades para trabalhar em equipe com outros alunos. Isso não só melhorará suas habilidades interpessoais, mas também lhe dará conexões importantes que poderão se tornar positivas no futuro. 

Com tudo isso em mente, é fácil perceber por que participar de um curso de Informática Básica pode ser uma ótima ideia. Não só você aprenderá os fundamentos da computação, como também desenvolverá habilidades tecnológicas importantes e ganhará certificados que lhe darão vantagens competitivas no mercado de trabalho. Se você estiver procurando por algo para melhorar suas habilidades digitais, um curso deste tipo é definitivamente o caminho a seguir.
Just Finished Bootcamp. Now What?
Tags: bootcamp, flatiron
Published: 2023-03-16 16:07:31

As I sit here reflecting on my experience, I can't help but feel a sense of pride and accomplishment. I have just finished a coding bootcamp, and it was one of the most challenging things I have ever done.

From day one, I knew that this was going to be a difficult journey. The curriculum was rigorous and fast-paced, and I had to learn an incredible amount of material in a short amount of time. But despite the challenges, I never lost sight of my goals.

One thing that I am particularly excited about is the opportunity to learn a new language like Python. During the bootcamp, I was exposed to many different programming languages, javaScript, Ruby, Rails, React Framework, but I was particularly drawn to the versatility and power of Python and need to keep building my skills. Now that I have completed the bootcamp, I can't wait to dive deeper into this language and start building some cool projects.

Another thing that has me excited is the prospect of exploring new career paths. The tech industry is constantly evolving, and there are so many different fields and specialties to explore. With the skills and knowledge that I gained during the bootcamp, I am confident that I will be able to find a career path that is both challenging and fulfilling.

Of course, finishing the bootcamp is just the beginning of my journey. There is still so much more to learn and explore, and I know that I will face many challenges and obstacles along the way. But with the support of my cohort, instructors, and mentors, I am confident that I can achieve my goals.

In conclusion, finishing a coding bootcamp is an incredible accomplishment. It requires hard work, dedication, and a willingness to push yourself beyond your limits. But for those who are willing to put in the effort, the rewards can be enormous. I am excited to see where my newfound skills will take me, and I can't wait to explore all of the possibilities that lie ahead.
🌟 🌟 The Fabulous Five Fullstack Roles 🎊💡
Tags: fullstack, backend, frontend, devops
Published: 2023-03-16 16:03:07

## Front-end Ninja 🥷🎨

Front-end Ninjas leap between HTML tags, CSS styles, and JavaScript functions like graceful digital acrobats. They make sure websites are as visually stunning as a cherry blossom tree in full bloom. These ninjas have a sixth sense for user experience, striking the perfect balance between form and function. 🌸🤸‍♂️

## Back-end Magician 🧙‍♂️🔮

Back-end Magicians wave their code wands and cast intricate incantations to create the enchanting world behind the screen. They summon APIs and vanquish performance bottlenecks with ease. Just like the legendary Merlin, they're the unsung heroes that make the internet a magical place. 🌌✨

## Database Guru 📚🔍

Database Gurus are like wise librarians, curating and cataloguing vast tomes of data in their digital sanctuaries. They can navigate through complex data mazes, unlocking the secrets hidden within tables and documents. With their vast knowledge, they ensure that every query receives the answers it seeks. 🧭📖

## DevOps Alchemist 🧪⚙️

DevOps Alchemists conjure powerful potions of automation, turning ordinary code into a smoothly-running masterpiece. They build intricate pipelines, seamlessly merging the realms of development and operations. With their cloud cauldrons bubbling, they keep the gears of the software machine well-oiled and purring like a content cat. 🐱💨

 
## App Development Maverick 📱🚀

App Development Mavericks are the cowboys of the coding frontier, wrangling mobile devices with their coding lassos. Whether it's a trusty iOS steed or a wild Android stallion, these mavericks know how to tame them all. They create experiences that fit in our pockets but expand our horizons like a vast, open prairie. 🌄🐎