teleren/devto huggingface dataset:
Browser Cookies
Published: 2024-01-07 22:27:55

# What are Cookies
Cookies are small files of information that are stored within a users browser. The user's web browser stores the cookie for a defined period of time or for the duration of the user's session.  

# What are the different types of Cookies and their uses

## Session Cookies
A session cookie tracks a user's activity while browsing a website. A use case for a session cookie can be to keep track items within a shopping cart. While the user navigates and add/removes items from the shopping cart the cookie can store this information. A session cookie has no set expiry date which tells the browser that the cookie should be deleted upon the end of the session.

## Persistent Cookies
Persistent Cookies can be used to store information about a user. For example a persistent cookie can be used so the website can remember if a user is logged in to a system. A persistent cookie has a set expiry date which can be hours, days, months and years. After the set expiry date the cookie will be deleted from the browser.

### Authentication Cookies
An authentication cookie is a type of persistent cookie. As mentioned these types of cookies can be used to track if a user is logged into a system.

### Tracking Cookies
A tracking cookie is also a type of persistent cookie. A tracking cookie can be used to record a user's activity on a website. This means the next time a user visits the website products or other information may be shown to the user based on the information stored in the tracking cookie. 

## Essential/Strictly Necessary Cookie
Essential Cookies are needed so the website can function as expected. Due the importance of these cookies, they are automatically placed in a user's browser without the need for user consent. An example of an essential cookie may be a cookie that is needed to authenticate with an api so data can be sent between the browser and a backend service.

## Zombie Cookies 
Zombie cookies are a type of 3rd party cookie (more n 3rd party cookies below) which is not stored in the same places as other cookies. Zombie cookies can regenerate after they are deleted making it difficult to completely remove from a user's browser. These cookies can be used by advertisers or potentially cyber attackers.

## First Vs Third Party Cookies 
A first party cookie is created directly from the website a user is visiting. An example of a first party cookie may be an essential cookie.

A third party cookie comes from another domain rather than the website the user is visiting. Third party cookies are mainly used for tracking and advertising between websites. Third party cookies build a profile from a user's browsing history. Third party cookies are created when the current website is making a request to another service.
Asynchronous programming
Tags: python, asyncio, software, programming
Published: 2022-10-14 06:35:21


It would be best if you had at least a basic understanding of asynchronous programming to build fast-reacting trading software. 

  
 

The problem with the synchronous approach used most of the time is that our program must wait for data input from dedicated sources before proceeding to further actions. Connecting to WebSockets and receiving tick data updates or open order updates from exchanges using synchronous software is nearly impossible. 

  
 

Asynchronous programming allows us to skip waiting for data input and proceed to the control stream or data processing stream. This approach radically improves our software speed and performance.

  

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

We will use [asyncio](https://docs.python.org/3/library/asyncio.html) python library for building an asynchronous application.

  
 

We need to learn a few concepts to start building asynchronous software.

  
 

First, our functions are marked as asynchronous with **async** word, like in JavaScript. Example:

  
 

```plaintext
async def my_function()
```

  
 

Second, we use **await** word to tell the program where it can switch control from one stream to another. Example:

  
 

```plaintext
await asyncio.sleep(0)
```

  
 

This line of code does nothing but tell our program not to wait for data input or some long calculations, so our program can switch to another task.

  
 

Third, in building asynchronous software, we operate not only functions but **tasks**. A task can contain one or more functions inside.

Example:

  
 

```plaintext
async def input_func():
    pass


async def input_task():
    await asyncio.sleep(0)
    await self.input_func()
```

  
 

And, finally, **loops**. Our tasks are run inside loops, which can be called ‘control streams’. 

Example:

  
 

```plaintext
ioloop = asyncio.get_event_loop()
tasks = [ioloop.create_task(input_task()), ioloop.create_task(another_task())]
wait_tasks = asyncio.wait(tasks)
ioloop.run_until_complete(wait_tasks)
```

  

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

This is an example of a simple asynchronous application. You can find it in [this GitHub repo](https://github.com/Jungle-Sven/efficient_trading_software/blob/main/1_asynchronous_programming.py).
12in24 - One language a month
Tags: devresolutions2024, learning, challenge, 12in24
Published: 2024-01-07 21:30:48

Credit to @amtzespinosa for the [idea](https://dev.to/amtzespinosa/12in24-trying-12-languages-during-2024-1c8d).

During 2024, I will try out a new programming language monthly, one that I have never used before. I'll record some of what I learn here, and you can find all of the programs I make in the Github [repo](https://github.com/Kaamkiya/12in24).

I chose the languages using this Python script:

```python
import random

languages = ["8th", "AWK", "COBOL", "Common Lisp", "Crystal", "D", "Dart", "Delphi Pascal", "Elixir", "Elm", "Emacs Lisp", "Erlang", "F#", "Fortran", "Gleam", "Go", "Groovy", "JavaScript", "jq", "LFE", "Lua", "MIPS Assembly", "Nim", "Objective-C", "OCaml", "Perl", "PHP", "PL/SQL", "Prolog", "PureScript", "Racket", "ReasonML", "Red", "Ruby", "Rust", "Scala", "Scheme", "Standard ML", "Swift", "Tcl", "TypeScript", "Unison", "V", "Vim script", "Visual Basic", "Web Assembly", "Wren", "x86-64 Assembly", "Zig"]

print('\n'.join(random.sample(languages, 8)))
```

The list of languages contains every language on [Exercism](https://exercism.org/tracks/), excluding ones that I've used before, web languages, or ones that I can't download for some reason. 

The output I got was:
```
x86-64 Assembly
D
Perl
Crystal
Elixir
AWK
Wren
OCaml
Nim
Zig
Emacs Lisp
Erlang
```
So those are the languages I'm going to play with! Quite a cool selection. I've heard of some of them, but never used most, so it should be fun!


My goal is to make some simple programs with all of them, and keep working with the ones I like. 

Here's the [Github repo](https://github.com/Kaamkiya/12in24).

What are you doing in the new year?
Ibuprofeno.py💊| #16: Explica este código Python
Published: 2024-01-07 21:26:18

## **<center>Explica este código Python</center>**
#### <center>**Dificultad:** <mark>Básico</mark></center>

```py
l = [1, 2]
l.extend([3, 4])
print(l) 
```

- A. `[1, 2, 3, 4]`
- B. `[3, 4, 1, 2]`
- C. `[1, 2]`, `[3, 4]`
- D. `Ninguna de las anteriores`

---

Respuesta en el primer comentario.
TESTED AND TRUSTED CRYPTOCURRENCY RECOVERY SERVICE
Published: 2024-01-07 21:23:08

Losing my bitcoins was a devastating blow, but Pro Wizard Gilbert Recovery came to the rescue with their exceptional dedication and unwavering commitment to helping me recover my assets. From the moment I reached out to them, their professionalism and expertise shone through, providing me with a glimmer of hope in the midst of my distress. Their relentless pursuit of solutions and thorough understanding of blockchain technology set them apart in the field of cryptocurrency recovery. The team worked tirelessly, leaving no stone unturned in their quest to retrieve my lost bitcoins. Their unwavering determination and tireless efforts ultimately led to the successful recovery of my digital assets, restoring not only my bitcoins but also my faith in the power of expertise and support when facing adversity. I wholeheartedly recommend their services to anyone grappling with similar challenges, as their exceptional skills and unwavering dedication have not only recovered my lost bitcoins but also reignited my confidence in overcoming obstacles with the right support. Pro Wizard Gilbert Recovery, I found not just a solution to my problem, but a team of professionals who genuinely care about helping others navigate the complex world of cryptocurrency recovery. Their commitment to their clients is truly unparalleled and thankful for their assistance. Kindly contact me through email prowizardgilbertrecovery(@)engineer . com or visit their  website: www.prowizardgilbertrecovery
Intro to CSS
Published: 2024-01-07 21:19:39


I learned that CSS is used to style elements within an HTML document; such as style, font-size, font-color, and other styling options.
Similar to code for an HTML document, the code for CSS is composed of opening tags and attributes, but with the addition of a declaration, property, and value. 
Just like when we are creating links within our HTML document we can do the same to create a link for our CSS code. The relative path is the easiest and most commonly used way to link HTML and CSS, instead of using a URL that links outside of the file.

</style>
</head>
Type Annotation vs Type Inference
Published: 2024-01-07 21:14:36

in the world of TypeScript, every assignable value has a type (as discussed in the last blog). Now to identify what type of a certain value has we have Type Annotations and Type Inferences.

##1️⃣Type Annotations - 

Type Annotation at its core is just a small amount of code that we write to tell TypeScript what type of value a variable will refer to.
So we developers tell typescript what types of values we are working with.

###Example of Type Annotations


_**Type Annotation with variables**_

```
const numCars: number = 5;
```
so the `:number` is our Type Annotation, now this tells typescript that we are only going to assign a type of number to numCars variable, and if we try to assign any other type we will quickly see an error.


![example of Type Annotation for variables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ve8locrcy3veudki28bw.png)

more examples of Type Annotation with different types are :

```
let speed: string = 'fast';
let isSuperCar: boolean = false;
let sunroof: null = null;
let nothing: undefined = undefined;
const todayDate: Date = new Date();
```

##2️⃣Type Inference -

Type Inference just simply is a way in which typescript tries to find out what type a value is going to have.
the general example of type inference with variables looks like this :

`let isSuperCar = false;`

now if we try to assign a value that is not a boolean we will see an error.


![example of Type Inference with variables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr83hk266psqlnqm2d8g.png)

if we see in the error typescript has identified what type of value `isSuperCar` has even though we have not told that typescript what type isSuperCar is going to have.

##3️⃣When to use Type Annotation and Type Inference - 

###When to use Type Annotation:

- 
 When we have a variable whose variable can't be inferred, suppose we have a variable which can either have a boolean or a number value.
In that case type inference will not be able to identify the type of variable on its own, the we need type inference an the syntax looks like this :

```
//A car can either have one sunroof or none

let sunroof: boolean | number = false;

//Now if we assign it a value of 1, we will not get an error 

sunroof = 1;

//It will not give an error as we have annotated that it is going to have either a boolean or a number as a value

```

- 
 When we declare value on one line and initialize it later,
earlier type inference worked because we had the declaration and initialization on the same line.

- 
 When a function returns the 'any' type in that case we need to clarify the value beforehand.

###When to use type inference - 

Except for the above corner cases, we always try to rely on type inference.


**_In the next blog we will see more examples revolving around Type Annotation, Type Inference, and the corner cases_**
e-Signing Microservice for Fintech and Beyond
Published: 2024-01-07 21:13:26

Hey everyone 👋,

We have open sourced a project which we believe could be of immense help for fintech startups and other businesses looking to implement digital signing capabilities in-house.

I'm eager to hear your thoughts, suggestions, whether it's code improvements, documentation, or use-case ideas, all input is welcome!

And here's the GitHub repository: https://github.com/iCreateWorks/esigning

Looking forward to your feedback and contributions!

Check out the article here for more information: https://www.infoq.com/articles/electronic-signing-service-cloud/
Devgym 2023/2024
Published: 2024-01-07 21:12:47

Wow, que ano! 2023 foi o primeiro ano da [Devgym](https://www.devgym.com.br/), isso quer dizer o primeiro deploy, a primeira feature, [o primeiro incidente](https://youtu.be/HA9fybIu8rc?si=58KfmrxXJqchjau1), o primeiro aluno, a primeira black friday... ufa! Foi uma jornada muito divertida pra nós e espero que para você também que acompanhou nossas retros por aqui. 

Depois de muitas reuniões, conversas com alunos e olhares vazios para janela pensando no futuro (haha) decidimos dois pontos importantes pros próximos passos da plataforma, e isso será nosso foco para 2024: 

**Comunidade**
Desde o dia 1 da Devgym, tínhamos uma ideia de ser uma plataforma social, uma comunidade onde você encontra pessoas para trocar experiências e resolver problemas de forma individual ou em grupo. Chegamos no momento de trabalhar nessa direção para que nossos alunos tenham um espaço pra discussões, code review e até mesmo resolver juntos desafios privados para essa comunidade. 

**Novos conteúdos**
Estamos muito empolgados com uma nova linha de desafios que vai chegar na plataforma no segundo semestre do ano. A Devgym tem um propósito de entregar conteúdo de valor que agrega na comunidade de software muitas vezes em pontos que não são tão abordados. Ter começado com a linguagem Go tem muito a ver com isso já que há um _lack_ de conteúdo nesse sentido. 
Então pode esperar esperar conteúdos incríveis para te levar a um nível muito maior em breve.

A verdade é que somos muito aptáveis, se percebemos que não estamos indo na direção correta, mudamos. A única certeza aqui é não parar.  

Obrigado por estar com a gente em 2023 e que esse novo ano seja incrível para nós, vamos juntos!
This week I learned #1
Published: 2024-01-07 21:09:41

**On these posts, I will list what I learned, or discovered, or reflected about during the last week. I believe that, by doing this, I will learn much better and keep learnings at a good pace. Also, as a byproduct, probably some readers will also learn something from these, or maybe they think I’m wrong and would like to comment something, so we can debate.**

In any case, welcome every one.

**Life/Work balance**:

- Working from home is amazing, and it’s much more amazing when you can share time with your partner and child. Seeing my baby grow, and being able to spend more time with him is much better than any benefit I could get.

**Python**:

- Virtual environments are a mess. It’s much better to use Docker. There is an extension on Visual Studio Code called “Dev Containers”. It’s developed by Microsoft, and lets you run a terminal on a Docker Container, with the content of your VS Code project.

**Elixir**:

- GenServer is the default way of handling state in Elixir. A GenServer stands for “Generic Server”, and it’s a process which run an contains a piece of state. You can send messages to that GenServer process by using its process ID (or pid), and mutate that state in a very “functional” way.
- A module you own should `use GenServer` to be usable as a GenServer. Think of it as an interface being implemented.
- If you include your GenServer as an application `children`, then the module you send to it is started as a process right away when the app starts.

**Web Development**:

- Microsoft Azure has a service called Azure Container Apps, in which every app is containerized using Docker. All the apps (you can think of them as microservices) communicate using a Virtual Network (v-net).
- Microsoft Azure has a language (DSL) called Bicep, which is similar to AWS CloudFoundation, to maintain infrastructure using IaC.
- DAPR (Distributed Apps Runtime) is an initiative that was started by Microsoft, and nowadays maintained by the Cloud Native Foundation. Using DAPR, you can use the services defined on the standard to communicate with other microservices, handle state (using Redis, for example), add Telemetry, use Pub/Sub mechanisms, and other things. The specs defined in DAPR are like “abstract classes”. There is always an actual “component” which implements the spec. For example, you use the DAPR state management service, but under the hood, you’re using Redis to keep track of key/value pairs for that state.

**Artificial Intelligence**:

- This week, I’ve been reading content and preparing myself for an upcoming project that will use LLMs.
- This article is amazing: **[The architecture of today's LLM applications](https://github.blog/2023-10-30-the-architecture-of-todays-llm-applications/)**

**IoT**:

- I’m preparing myself to work on internet of things projects using Nerves.
- Nerves is a tool written in Elixir for creating IoT applications.
- You can actually run Nerves project without having an actual device (like a Raspberry pi)! This is called “Host Mode”.
"undefined this keyword variable" issue in JavaScript
Published: 2024-01-07 20:23:57

When encountering an "undefined this keyword variable" issue in JavaScript, it typically occurs when trying to access a property or method using this in a function but the context of this is lost or not set correctly. There are several ways to address this problem:

**Arrow Functions:** Arrow functions do not have their own this context and inherit this from the surrounding code. If you're using ES6 or later, consider using arrow functions to maintain the correct this context:

```
const obj = {
  property: 'some value',
  method() {
    const innerFunction = () => {
      console.log(this.property);
    };
    innerFunction();
  },
};
obj.method(); // Output: 'some value'

```


**Explicitly Binding this:** You can use bind, call, or apply methods to explicitly set the context of this:

```
function example() {
  console.log(this.value);
}

const context = { value: 42 };

const boundFunction = example.bind(context);
boundFunction(); // Output: 42

```


**Using a Variable:** Store this reference in a variable to maintain its context:

```

const self = this;
function example() {
  console.log(self.value);
}


```

**Using** Function.prototype.bind():

```
const obj = {
  property: 'some value',
  method() {
    function innerFunction() {
      console.log(this.property);
    }
    const boundInnerFunction = innerFunction.bind(this);
    boundInnerFunction();
  },
};
obj.method(); // Output: 'some value'

```
**Using Arrow Functions Inside Methods:** To avoid losing this context inside methods, you can use arrow functions for the inner functions:

```
const obj = {
  property: 'some value',
  method() {
    const innerFunction = () => {
      console.log(this.property);
    };
    innerFunction();
  },
};
obj.method(); // Output: 'some value'

```
These methods can help maintain the context of this within your functions and prevent encountering an "undefined this keyword variable" issue in JavaScript.

Thanks for reading,
DGI Host.com
Day 1.5: Ways to launch Cloud Services
Tags: aws, cloudpractitioner, beginners, day1
Published: 2024-01-07 20:52:17

|**Methods**|**Description**|**Use Case**|
|--|--|--|
|**_<u>AWS Management Console:</u>_**| Web-based interface that allows users to access and manage AWS services through GUI.| Simply log in to the AWS management console, navigate to the desired service and configure settings visually.|
|**_<u>AWS Command Line Interface(CLI):</u>_**| A command-line tool that enables to interact with AWS services using commands in a terminal or command prompt.| Users can script and automate the repetitive tasks using AWS CLI commands.|
|**_<u>AWS Software Development Kits(SDKs):</u>_**| Provides libraries for various programming languages, allowing developers to integrate AWS services directly into their apps.| SDKs are available for popular programming languages like Java, Python, JavaScript, and more.|
|**_<u>AWS Elastic Beanstalk:</u>_**| fully managed service that simplifies the deployment and management of applications in various languages.| Users just upload their app's code, and Elastic beanstalk handles the deployment and scaling.|
|**_<u>AWS Marketplace:</u>_**| online store that allows users to find, buy and immediately start using software and services.| users can discover and launch pre-configured solutions from third party vendors directly form the AWS marketplace.|
Have you heard about the anterior midcingulate cortex?
Published: 2024-01-07 20:45:07

The anterior midcingulate cortex (aMCC) is an amazing area in the human brain that plays a vital role in decision-making, emotional processing, and even pain perception. More interestingly, it acts as a crucial network hub for those tough cost/benefit calculations that fuel our perseverance, willpower, and tenacity.

Let's talk about facing challenges. Whether it's cracking complex equations or gearing up for a marathon, we all respond differently. Some might find the effort too overwhelming and step back, while others dig in their heels and push through without immediate rewards. This trait of persistence, increasingly spotlighted in research of the aCMM, correlates with better outcomes in health, academics, and career success.

Now, here's where it gets really cool: when programming, especially during those head-scratching moments that we might not particularly enjoy, our aMCC gets super active. Ever found yourself in a coding conundrum, feeling frustrated to the point of wanting to quit? That's your aMCC in action, getting stronger. It's akin to facing a steep climb while running; challenging, maybe not enjoyable, but incredibly effective in building mental strength and resilience.

So, remember, pushing through a tough coding problem does more than solve an issue on your screen. It's an aMCC workout, enhancing your brain's capacity to navigate complex tasks and manage emotions. It's a double win - improving your coding skills and boosting brain power, even when it feels tough at the moment =).

Nice to know, right?