teleren/devto huggingface dataset:
🎨 Primitive Data Types are like Primary Colors for creating Non-Primitive Data Types 🎨
Tags: cpp, computerscience, datascience
Published: 2022-12-21 00:02:56

> "When you mix any of the primary colors: red, yellow, blue. it results in a secondary color. Similarly, when you mix Primitive Data type, it results in a Non-Primitive Data type."- Ayesha Mahmood

**Example:**
An example of a **primitive data type** is  "char". **A char is a C++ data type used for the storage of a single letter**. For eg. we have the char "H" as the primitive data type. So when we mix and combine the primary primitive data type i.e. **char "H"** with other letters like **"e", "l", "l, "o"**. **It results in a string "hello" which is a Non-Primitive data type**. **Hence we see that we can similarly in this manner mix other primitive data types to create secondary Non- Primitive Data Types**.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmseagbu4v1n2f7d3ea8.png)
**Previous Post:** Importance of Data Structure in Computer Science
{% embed https://dev.to/ahseya03/data-structure-why-it-is-so-important-348i %}
Javascript Callback Hell and how to avoid it
Tags: javascript, programming
Published: 2022-12-21 00:00:49

_"Callback hell" is a term used to describe situations in which nested callback functions (also known as "callback pyramids") make code difficult to read and maintain. This can happen when using callback functions to handle asynchronous operations in JavaScript.

To avoid "callback hell", there are a few techniques that can be used:_

1. Use functions to break up the callback chain: Instead of chaining callbacks directly, you can use functions to separate out different parts of the code.

```
function doSomething(callback) {
  // Asynchronous operation
  setTimeout(() => {
    // Call the callback function with a value
    callback('Done!');
  }, 1000);
}

function handleResult(result) {
  console.log(result); // 'Done!'
  doSomething(handleResult);
}

doSomething(handleResult);

```
2. Use promises to handle asynchronous operations: As mentioned in a previous response, promises can be used to handle asynchronous operations in a way that is easier to read and write.

```
const doSomething = new Promise((resolve, reject) => {
  // Asynchronous operation
  setTimeout(() => {
    // Resolve the promise with a value
    resolve('Done!');
  }, 1000);
});

doSomething
  .then((result) => {
    console.log(result); // 'Done!'
    return doSomething;
  })
  .then((result) => {
    console.log(result); // 'Done!'
    return doSomething;
  })
  .then((result) => {
    console.log(result); // 'Done!'
  })
  .catch((error) => {
    console.error(error);
  });

```
3.Use async/await: With the introduction of async/await in JavaScript, it is now possible to write asynchronous code that looks and behaves more like synchronous code. This can help to reduce the complexity of callback chains.

```
async function doSomething() {
  // Asynchronous operation
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      // Resolve the promise with a value
      resolve('Done!');
    }, 1000);
  });
}

async function main() {
  let result = await doSomething();
  console.log(result); // 'Done!'
  result = await doSomething();
  console.log(result); // 'Done!'
  result = await doSomething();
  console.log(result); // 'Done!'
}

main();

```
I hope these examples help to illustrate some strategies for avoiding "callback hell" in JavaScript.
Custom AnimNotify in Unreal Engine 5
Tags: gamedev, unrealengine
Published: 2023-04-22 00:03:36

---
title: Custom AnimNotify in Unreal Engine 5
published: true
date: 2022-12-21 00:00:00 UTC
tags: gamedev, unrealengine
canonical_url: https://tinygame.dev/posts/Custom-AnimNotify-in-UE5/
---

How do you trigger custom C++ code from an animation in Unreal Engine 5?

## Adding a new AnimNotify class

Unreal Engine offers a few stock notify types for things like playing audio or triggering particle effects from animation montages, but I'm assuming you need to run some custom C++ code at specific points in an animation. In that case, we can create a new notify type and use this to run any code we'd like.

1. Tools > New C++ Class... and create a new C++ class with AnimNotify as its parent. Give it some time for the engine to be recompiled.
2. Open up an animation montage and right-click a Notify track to add a new notify. The list should include your recently created custom notify class.
3. Override the Notify() function in the newly created .h and .cpp files. Code should look something like below.

CustomAnimNotify.h
```cpp
#pragma once

#include "CoreMinimal.h"
#include "Animation/AnimNotifies/AnimNotify.h"
#include "CustomAnimNotify.generated.h"

UCLASS()
class YOURPROJECT_API UCustomAnimNotify : public UAnimNotify
{
	GENERATED_BODY()

public:
	virtual void Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation) override;
};
```

CustomAnimNotify.cpp
```cpp
#include "CustomAnimNotify.h"

void UCustomAnimNotify::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation)
{
	if (GEngine)
	{
		GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, TEXT("Custom AnimNotify triggered!"));
	}
}
```

Save, recompile, reload, and when that animation montage plays it should now print the above message on screen.
Immutability is overrated
Tags: functional, javascript, webdev
Published: 2022-12-20 23:59:49

#### Immutability fine, but not always, right?!

As the author of [Xania](https://github.com/xania/view) a javascript UI library I ask myself this question countless times. 

Immutability as an unbreakable rule does not make sense to me and I have been thinking about this for years, Could you help me make sense of it? I've heard all the popular arguments but I am still not convinced, let me explain..

Sure I do agree on the importance of immutability, and to be very precise I dont argue that, but disallowing immutability always and in all cases feels like a handicap in programming languages or in some case libraries in language like JavaScript where mutability is possible but make it inconvient to work with mutable data.

#### Pure functions have side-effects
I found [this article](https://www.johndcook.com/blog/2010/05/18/pure-functions-have-side-effects/) that inspired me investigate this more

take for example the functions `f` and `wasm`
```javascript
function f(x, y) {
  return x + y;
}

function wasm(esi, ecx) {
  let eax = ecx;
  eax += esi;
  return eax;
}
```

It is generally accepted that `f` is pure, and it is.  But `wasm` mutates the variable `eax` so it is generally accepted to say that `wasm` is inpure, but is it really?
Suprisingly `wasm` is kind of how `f` would look like if it was compiled to WASM. We can also image how `wasm` can be decompiled back to `f`, so without going deep into theory we can say `f` and `wasm` are the _same_, correct me if I am wrong but I think this is called isomorphic in category theory, because following rule applies...

| `f` o `wasm` == `wasm` o `f` == id

Despite the fact that `wasm` has mutations we should consider it as pure just as `f` because they are the _same_.
In general, a mutation does not always conclude if the given function is pure or not.

#### Rules for Mutability

Like in the article above by John D. Cook, pure functions only make sense at certain the level of abstraction. sounds like we can agree on it but this raises the question, what are pricesly those levels where we allow mutations in a pure function? Is the level boundary defined by the language runtime?
Is it thinkable to extend the mutation to the user code (even in haskell) if rules of mutability are satisfied? 

This is where my brain starts to hurt. What are your thoughs and do you know if there are resources on this subject?
ASK Great Questions
Tags: webdev, programming
Published: 2022-12-20 23:56:26

> "Good questions save time. Bad questions waste time. Bad questions create unnecessary back-and-forth conversations, which create frustration and conflict. People that ask bad questions get frustrated because they can’t get help, and people that are trying to help get frustrated because answering bad questions is so damn frustrating." - Gordon Zhu

While taking the Foundations Course on Odin Project, I was led to read a great article by Gordon Zhu Founder at https://watchandcode.com on [How to be great at asking coding questions](https://medium.com/@gordon_zhu/how-to-be-great-at-asking-questions-e37be04d0603).

It is really a helpful one and it corrected how I asked questions before in Stack Overflow and got a  downvote. It was such an embarassing experience, but I learned a lot! Here are the process that are worth remembering when asking questions according to Gordon Zhu:

1. Understand the code to the best of your ability.
2. Clearly describe the problem.
3. Provide the code that illustrates the problem.
4. Make sure the code you’re sharing can reproduce the problem.
5. Format your code consistently.
6. Check yourself for typos.
7. Explain what you did to troubleshoot the problem.
8. Explain what you think the problem might be.
9. Proofread your question.
10. Send updates and remember this will not be your last question.

I hope it helps as it helped me a lot. Happy Coding! 

As a Christian, I also write blogs about the goodnews. If you are interested, please read here: [The Glorious Gospel](https://hgcbcc.com/2021/03/04/the-glorious-gospel/)
Como ⚡ publico una udf para Athena ? Parte I
Tags: udf, athena, aws, java
Published: 2022-12-20 23:54:44

Bueno esta fue la pregunta inicial que dará origen a la siguiente aventura, suponga que en su datalake implemento un complejo pipelile de datos y se dio cuenta que en medio del proceso su motor no cuenta con una funcionalidad sql 🙇, en mi caso fue st_buffer, por cierto que en Athena si esta implementada pero en grados decimales (iuhggg), por lo que necesitábamos la preciada función en metros.
Bueno luego de un corto googleo aparece el siguente Workshop de bastante utilidad y bien explicado:
[Taller de Amazon Athena :: Hands on Labs](https://catalog.us-east-1.prod.workshops.aws/workshops/9981f1a1-abdc-49b5-8387-cb01d238bb78/en-US/50-udf)

Para comenzar recomienda usar Cloud9, pero es yo utilice WSL Ubuntu 22 sin mayores problemas.
Bueno en simples pasos una vez que se configura el sam-aws-cli , credencial aws , maven y git , nos clonamos un repo el cual contiene un boilerplate con la estructura de un proyecto java 11 , que posee handler con algunos metodos a modo hello world, listo en este punto solo falta compilar el jar y ejecutar un sh para hacer un deploy de la aplicación , se necesita un permiso especial para poder hacerlo "serverlessrepo:CreateApplication" en el recurso "arn:aws:serverlessrepo:us-east-1:<acount-id>:applications/*" 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e749lln51rw50482o0vo.png)
Listo se publicó la aplicación ahora qué ?, solo seguir el paso "Configuración del conector UDF" , en ese caso seguir el enlace y buscar aplicaciones privadas seleccionar "AthenaUserDefinedFunctions" y completar los datos , luego deployar , tómese una cerveza y Prepárese para probar su función UDF


`USING EXTERNAL FUNCTION redact(col1 VARCHAR ) RETURNS VARCHAR 
LAMBDA 'customudf' SELECT redact('StringToBeCompressed');`

Excelente nuestro hello world , próximamente en la parte II detallare el proceso para manipular datos geoespaciales y hacer el buffer con java, que esta algo fuera de mi zona de confort pero con GPT3 veremos si da alguna sorpresa.
Build Healthy OSS Communities with OpenSauced
Tags: webdev, javascript, beginners, podcast
Published: 2022-12-20 23:42:02


Original: https://codingcat.dev/podcast/2-47-Build-Healthy-OSS-Communities-with-OpenSauced

{% youtube https://youtu.be/g1X1fo57LR8 %}

## Questions

1. Can you tell us more about yourself and some of your background in tech?
2. How did you get into open source work and why is it so important to you?
3. What was the goal behind creating [https://opensauced.pizza/](https://opensauced.pizza/)?
  1. What is an intelligence platform?
4. What stack do you use for OpenSauced?
5. What is the long term goal for OpenSauced?
  1. I hear you have hired someone else amazing from the community to work with you on it, can you tell us more about that and is there a plan for future funding or hiring?
6. How can people get involved?
O que é BPMN?
Tags: productivity, notation, bussiness
Published: 2022-12-20 23:33:51

BPMN (Business Process Model and Notation ou Modelo e Notação de Processos de Negócio em português) basicamente é um modelo de notação que expressa graficamente fluxos processuais em forma de diagrama com diversos níveis de detalhamento. (Quanto mais detalhado for, mais complexo será, causando uma explosão da documentação)

**Para que serve o BPMN?**
De forma resumida, o BPMN serve para criar processos de negócios e definir melhorias para um processo atual, devido a capacidade de análise dos fluxos processuais que já existem nesse processo. Documentar ou definir novos processos (existentes ou novos) ajudando a melhorar o sistema analisado.



**Objetos de Fluxo (Flow Objects)**
Os objetos de fluxo (Flow Objects) são os elementos gráficos descritivos dentro do BPMN. Eles se dividem em atividades, eventos e decisores.
![Fluxo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fs1o4r2eamwed2701m7e.png)
<u>Atividades</u>: uma atividade é um trabalho que precisa ser executado dentro do processo.
<u>Eventos</u>: uma coisa que aconteceu ou que pode acontecer em um processo, afetando o fluxo e causando um impacto.
<u>Gateway/Decisores</u>: são usados para controlar o fluxo de frequência, além de controlar a divergência e a convergência. Desse modo, é possível determinar decisões tradicionais.
<u>Pools</u>:
![Pool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hx414oca74izk04ageem.png)
Pool é um contêiner de determinado processo do negócio que também é usado junto aos objetos de fluxos.



**Considerações Finais.**
De fato, o BPMN é uma ferramenta poderosa e indispensável no momento de se analisar uma rotina de processos. Sendo necessário sempre ter um olhar crítico do processo atual afim de buscar melhorias.
✂Destructuring em JavaScript e React⚛
Tags: javascript, beginners, programming, react
Published: 2022-12-20 23:30:20


![random code illustration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s8eyhw97wtx1wazg159u.jpg)
No JavaScript, _destructuring_ é uma forma de **extrair valores** de arrays ou objetos e atribuí-los a variáveis. Isso pode ser útil quando você deseja extrair determinados valores de um objeto ou array e usá-los em seu código.

Em <u>React</u>, o _destructuring_ pode ser particularmente útil ao trabalhar com props. Por exemplo, considere o seguinte componente que recebe uma prop `user` contendo um objeto com várias propriedades:

![code example image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iyabolh4c0de3ahs72i4.png)
Neste exemplo, estamos usando o _destructuring_ para extrair as propriedades `name`, `age` e `location` do objeto `props.user` e atribuindo-as a variáveis com o mesmo nome. Isso nos permite usar as variáveis `name`, `age` e `location` diretamente em nosso JSX, em vez de ter que usar `props.user.name`, `props.user.age` e `props.user.location`.
<br>
O _destructuring_ também pode ser usado com arrays. Por exemplo:
![code 2 example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iz28iaap2a4tgzqq5zq0.png)
Neste exemplo, estamos usando o _destructuring_ para extrair os valores do array `colors` e atribuí-los às variáveis `firstColor`, `secondColor` e `thirdColor`.
<br>
O destructuring pode ser uma ferramenta útil para tornar o seu código **mais conciso** e **fácil de ler**, especialmente ao trabalhar com props ou arrays em React.
LET’S EXPLORE THE IMPROVED ROUTING, LAYOUTS & RENDERING IN NEXTJS 13
Tags: javascript, react, nextjs, webdev
Published: 2022-12-20 23:06:27

Next.js 13 was recently released at the Next.js conference. Many new features are included, including new routing, a new way to fetch data (React suspense), Vercel fonts, og image generation, layouts, and more.

These new features have the potential to be game changers, and they promise to be extremely fast. But not without consequences.

**Let’s go into more detail about them.**

## Turbopack: The successor to Webpack.

Turbopack, the brand new build tool led by the creator of Webpack, Tobias Koppers, will be the Web’s next-generation bundler. Rust was used to construct it from the ground up. It incorporates turbo repo in order to cache duplicate operations. Turbopack is extremely fast.

It updates large applications 10x faster than Vite and 700x faster than Webpack. On larger applications, the difference is even greater — Vite is frequently 20x faster. It has built-in support for Server Components, TypeScript, JSX, CSS, and other technologies.

However, it is currently in alpha, which may make migration difficult for existing apps due to webpack’s vast ecosystem of plugins.

## A NEW NESTED ROUTING SYSTEM

Next.js 13 includes a new file-system-based router built on React Server Components, which supports layouts, nested routing, loading states, error handling, and other features. This opens up new possibilities and improves the framework’s overall performance.

The `/app` directory (currently beta – at the time of writing) includes support for the following:

- Layouts: Easily share UI while preserving state and avoiding re-renders.
- Server Components: Making server-first the default for the most dynamic applications.
- Streaming: Display instant loading states and stream in updates.
- Suspense for Data Fetching: The new use hook enables component-level fetching.

The `/app` directory can coexist with your existing pages directory for incremental adoption.

The new app directory retains file system-based routing, but it is now entirely directory-based, with a variety of naming conventions for different use cases. To make a page, you give the route’s direct name. js file to it, which exports the component you want to display there in a nice and simple way.

However, because it is a directory, we can co-locate additional components here rather than creating a separate components directory or following some other convention.


![Check this demo app from Vercel](https://i0.wp.com/mushfiqweb.com/wp-content/uploads/2022/12/fHJmGKW.gif?resize=720%2C540&ssl=1)

[Check the whole article here](https://mushfiqweb.com/lets-explore-the-improved-routing-layouts-rendering-in-nextjs-13/)
JavaScript Async/Await: A Beginner's Guide
Tags: javascript, codenewbie, beginners, tutorial
Published: 2022-12-20 22:59:41

Async/await is a language feature in JavaScript that allows us to write asynchronous code in a synchronous-looking style. It makes it easier to read and write asynchronous code, as it eliminates the need for chaining multiple .then() and .catch() blocks together.

Before we dive into async/await, it's important to understand the concept of promises in JavaScript. A promise is an object that represents the result of an asynchronous operation. It can either be resolved (successful) or rejected (failed). We can use the .then() and .catch() methods to handle the resolved and rejected states of a promise, respectively.

### **Here's an example of using promises to make an HTTP request:**

![fetch example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cba4og0ezh35zcqcluwt.png)

As you can see, the .then() and .catch() methods are chained together, which can make the code look cluttered and hard to read. This is where async/await comes in.

To use async/await, we need to declare a function as async by adding the async keyword before the function declaration. Then, we can use the await keyword inside the function to wait for a promise to resolve.

Here's the same example using async/await:

![async await example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d3yh13horq7c9qf3di5v.png)

As you can see, the code looks much cleaner and easier to read with async/await.

It's important to note that the await keyword can only be used inside an async function. Additionally, the value of an await expression is the resolved value of the promise.

### **There are a few other things to keep in mind when using async/await:**

- If the value of an await expression is not a promise, it will be wrapped in a resolved promise automatically.
- If an await expression throws an error, it will be caught by the nearest enclosing try/catch block.
- If an async function returns a value, it will be wrapped in a resolved promise automatically.

I hope this brief introduction to async/await in JavaScript has been helpful. Happy coding!

Let me know if you have any questions or if you'd like me to clarify anything.

NathanNOSudo
python special string
Published: 2022-12-20 22:57:15

在需要在字符中使用特殊字符时，python用反斜杠(\)转义字符。如下表：

转义字符

描述

\(在行尾时)

续行符

\\

反斜杠符号

\'

单引号

\"

双引号

\a

响铃

\b

退格(Backspace)

\e

转义

\000

空

\n

换行

\v

纵向制表符

\t

横向制表符

\r

回车

\f

换页

\oyy

八进制数yy代表的字符，例如：\o12代表换行

\xyy

十进制数yy代表的字符，例如：\x0a代表换行

\other

其它的字符以普通格式输出
Weekly 0041
Tags: weeklyretro, devjournal
Published: 2022-12-20 22:38:07

### Monday

In the morning I did some tests with GPT3 and Brandplane. I wanted to test if we can create contents for marketing. The test was OK and we started to use OpenAI API for our product.

For the rest of the day I wrote documentation for Red Origin.

**Mood:** ✍️

### Tuesday

In the morning I worked on a new feature for Brandplane. I created a page to display more then 250 templates for emails. It’s the first version but you can see the entire list of the templates and the user can download the HTML directly from our application. It’s one of the requests we received from our survey.

From the middle morning to the afternoon I still wrote Red Origin Documentation.

During the day I did a call with a friend of mine about some architecture choices he needs to make it in new projects and products.

**Mood**: 📞

### Wednesday

In the early morning I have implemented the sentiment analysis for contents in Red Origin. I use Azure Cognitive Services for this purpose.
I know this service very well. I use it since many years.
Now we have a page where the user can insert a long text and Brandplane analyses the overall sentiment and the sentiment for each sentence.

Then I wasted 2 hours to find a bug on Red Origin and at the end was a double / in a API route.

In the afternoon I had a meeting with a Brandplane prospect and they shared with us some useful feedbacks.

**Mood: ✈️**

### Thursday

In the early morning I recorded the demo of Brandplane with the latest version.

For the rest of the morning I work on a issue about SharePoint Recycle Bin and PnP.
I finally solved the issue but with a ugly workaround.
Basically I use the token retrieved from PnP library for C#, to call the “old” SharePoint CSOM to restore the items from the Recycle Bin.

This is the code that I use: 
{% embed  https://gist.github.com/kasuken/c7c71702fcf19556fb2c3a18ddb350ff %}

In the afternoon we had a call with an investor for Brandplane, but we were not happy about the result.
Sometimes we found in this kind of calls not so much good people. It’s a part of the game.

**Mood: 🤖**

### Friday

Day Off. 🎅

**Mood:** 🎅
Welcome Note
Published: 2022-12-20 22:32:20

Hi All, I'm Timmy Falade! A professional frontend developer since 2016 and I use my skills and experience to build ground-breaking UI Designs for business having worked in fintech industry.

One thing about writing a good frontend is that it creates a better User Experience which is THE most important thing for a business in the 21st century era of Websites and Mobile Apps. It helps you gain a market share by providing highly usable and tested interfaces to your users.

Currently using HTML, CSS, JavaScript, and ReactJS.

Some of the following tools I use include Vscode and IntelliJ .

Hoping to learn and share my ideas here and network of course .

I love football and i can't pick between MESSI and RONALDO .

Best Regards ,
Timilehin Falade