teleren/devto huggingface dataset:
Why so much Latex?
Tags: rust, tex
Published: 2022-02-12 18:54:42

I've recently got myself into yet another project, and again it's based upon producing Latex files. This project aptly named `tex-rs` is a Rust library that can be used to create Latex documents using Rust. 

In all honesty, the answer to the post is simply I'm not that creative and I've been thinking of a back end to `texcreate` for quite a while now. So how does it work?

The idea of this library is attaching the elements, so relating to my last post on Latex Basics Part 2, the hierarchy of content is: 

- Part 
- Chapter
- Section 
- Paragraph 
- Text

So the rule in this library is you can attach things to each other as long as they have less priority (Confusingly I have 0 as top priority), so how does this look like: 

```rust 
use std::path::Path;
use tex_rs::*;
fn main() {
    let mut latex = Latex::new();
    latex.set_class(Class::Article);
    latex.set_metadata(Metadata::new("A title", "An author", "What day is it?"));
    latex.add_package("dramatist".to_string());
    latex.add_package("listings".to_string());

    let mut part = Part::new("Part 1");
    let mut chapter = Chapter::new("Chapter 1");
    let mut section = Section::new("Section 1");
    let mut text = Text::new("Some text", TextType::Underline);

    section.attach(Element::from(text)).unwrap();
    chapter.attach(Element::from(section)).unwrap();
    part.attach(Element::from(chapter)).unwrap();

    latex.set_elements(&vec![Element::from(part)]);
    latex.write(Path::new("test.tex").to_path_buf()).unwrap();
}
```
> Note: 0.1.0 is a very early build and future builds will break this code, so I do recommend waiting until 0.2.0 has been released. 

As you can see when you add part in `latex.set_elements()`, it brings everything that's inside it along as well. 

I hope to do a lot more in this project like bringing elements and user-defined commands, so if you're interested in contributing contact me at [mustafif0929@gmail.com](mailto:mustafif0929@gmail.com) or feel free to push pull requests  to the [repo](https://github.com/MKProj/Tex-rs)
Null vs Undefined in Javascript
Published: 2022-02-12 18:23:23

### Null is an assignment value. It can be assigned to a variable as a representation of no value:

There are two features of null you should understand

 1. `null` is an empty or non-existent value.
 2. `null` must be assigned
 3. When you assign `null` to a variable, you are declaring that this value is explicitly empty.
 ```js
 let age = null;
 console.log(age); // null
```

### Undefined usually means a variable has been declared, but not defined.

When you try to access a `property` of an `object` that doesn't exist you will get `undefined` in return.

```js
const shashank = {
	name : 'Shashank',	
}

console.log(shashank.age) // undefined
```

-   Both  `null`and  `undefined`are primitive values in JavaScript.
-   When you do loose equality check on both it returns `true`

```js
null == undefined // true
```

because both are considered `falsy` values.

### Summary

-   null is an assigned value. It means `nothing`.
-   undefined typically means a variable has been declared but not defined yet.
-   null and undefined are `falsy` values.
-   `null`!==  `undefined` (strict equality) , but  `null`  ==  `undefined` ( loose equality)
How to solve FilePermissionError after installing rbenv on Mac
Tags: ruby, tutorial
Published: 2022-02-12 18:23:00

Today I decided to solve a forem (the open-source platform that powers dev.to) bug and had to install it locally.

{% github https://github.com/forem/forem %}

However, I've troubled into this Ruby error when trying to run `gem install bundler` after installing [rbenv](https://github.com/rbenv/rbenv) on Mac.

**ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.**

This happens because Ruby is trying to use its Mac system version, which is the reason why the [forem's installation guide](https://developers.forem.com/getting-started/installation/mac#ruby) recommends using `rbenv` in the first place.

The solution that worked for me was adding `rbenv` path to my shell. 

With the following commands you'll be able to do the same, auto initialize `rbenv` when loading your shell and refreshing it so you don't have to close and open it again.

```bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
```

If you're not using [oh-my-zsh](https://ohmyz.sh/), replace `.zshrc` to `.bashrc`, for example.

That should be enough, but if you're still having problems, try changing the global ruby version on `rbenv` and rehash it by running:

```bash
rbenv install <version>
rbenv global <version>
rbenv rehash
```

Also, quoted from [Forem Mac Instructions](https://developers.forem.com/getting-started/installation/mac):

> Note: If you are using a Mac with an M1 CPU that uses Ruby compiled for ARM, you may need to force the platform that Bundler uses to ruby. This will allow you to build the C extensions used by Forem's dependencies. To force the platform to use ruby, you can either:
```
- set `BUNDLE_FORCE_RUBY_PLATFORM=true` in the shell environment  
- run `bundle config set force_ruby_platform true` to set `ruby` in Bundler globally 
```

Now `gem install bundler` should be working!

Hope it helps someone in the future!
Circuitpython and ESP32-C3
Tags: programming, circuitpython, esp32c3, esp32
Published: 2022-02-12 17:57:40

Hello
Thanks for listening to me.
I work on the realization of home automation modules to improve my solar houses to make them as efficient as possible.
I have a problem with Circuitphyton.
I manage to flash it with ESPTOOL but then nothing happens, the mu software does not recognize it.
I take this opportunity to ask two other questions:
Can we use the "native" USB port in the current version of circuitpython (which is in Beta version).
And how to assign PINs from the chip to the I2C protocol (there are no dedicated PINs in the base).
Here is my toolchain.
W10/Python 3.7(64)/Esptool V3.2/Node MCU-Series ESP-C3-32S-Kit 4MB
yves
iPad has a build in Calculator. For Real!
Tags: ipad, calculator, ipadfordevelopers, tipstricks
Published: 2022-02-12 17:57:30

OK People, recently i just bough an iPad. As i was looking and searching it i discover that no calculator app is available! 


This is crazy, right?


Did you ever used your iPad like a real Macos Computer? This is where you will find that spotlight work pretty much the same way on the iPad. 


Let me just show you. Are you ready?


1. First you have to unlock to iPad and drag down from the menu screen. This will open Search ( Spotlight ).

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

1. Enter your Math query. This should be handled just fine!

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



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




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




What do you think people? 😀

I would appreciate any recommendations, looking forward to add more tips & tricks about iPad! 

My name is Kyriakos Michael and I'm working as a Front-end developer. I would like to explore how a Developer can use iPad for his work since helloo, we are not everyone a Video and Photo Editor! People do other jobs as well!

Thanks for reading this out.
Twitter: https://twitter.com/Key__michael
República Dominicana como uno de los mercados emergentes más atractivos
Published: 2022-02-12 17:46:36

Morgan Stanley, el banco de inversión americano, ha declarado que República Dominicana tiene grandes posibilidades de registrar una reducción de su carga pública durante el 2022.

“Tiene una menor deuda que la mayoría de los países con calificación BB”.

Se ha realizado un rápido y sólido crecimiento económico, junto con una trayectoria fiscal que hacen de República Dominicana uno de los mercados emergentes más atractivos de Latinoamérica.

Los principales medios del país, como [Listin Diario](https://millonesdevoces.org/), se hacen eco de esta información, que consolida a República Dominicana como un punto de inversión, gracias a la gestión del turismo, por parte del Gobierno.

En el informe publicado, se explica que el país ha logrado una recuperación del 11% del PIB, que prevén se mantendrá durante 2022.

Esto va a ayudar a que República Dominicana obtenga una de las tasas de crecimiento más altas de la región.

“Una fuerte recuperación del turismo, un nivel récord de envíos de remesas, altas tasas de ingresos, junto a reformas del sector energético, nos dejan con una visión positiva de República Dominicana”.
Latinoamérica es uno de los mercados más atractivos para los pagos digitales
Published: 2022-02-12 17:41:29

Se sabe que Latinoamérica es un mercado emergente con un gran potencial de crecimiento referente al ecosistema digital y en los últimos años, se ha demostrado que la penetración de mercado del comercio electrónico en dicho continente ha crecido un 3%, tanto en México como en Brasil, mientras que otros países de la región muestran cifras aún más bajas. En comparación, China se sitúa en un 22% y USA en un 15%. Si bien hay un progreso importante, los números bajos muestran un enorme potencial para ser desarrollado en los próximos años.

Por otro lado, en términos de pagos transfronterizos su adaptación en la región ha ido a paso lento, pero están por tomar un impulso prometedor. La sinergia de las nuevas tecnologías con una renovada determinación entre las autoridades de diversos mercados locales está dando paso a importantes mejoras. Prueba de ello, solo el último año América latina representó el 5% de todas las transacciones y hoy en día la región se puede caracterizar como impulsada por tarjetas de crédito y liquidez, según el Informe de Pagos [Globales de McKinsey](https://millonesdevoces.org/) 2020. 

Las compañías cada vez más se están digitalizando y continúan innovando, creando nuevos productos o servicios según las necesidades del mercado, hoy en día se está ante una nueva era en donde los ecosistemas financieros online se han convertido en la solución para generar un mayor acceso a diversos productos y servicios.
Cómo planear una boda de ensueño
Published: 2022-02-12 17:40:20

Para una boda en un lugar exótico y atractivo, pero a la vez accesible para los invitados, la República Dominicana es el lugar ideal del Caribe. Punta Cana es el segundo lugar más popular para una boda romántica, con conexiones a más de 28 países y 96 ciudades de todo el mundo. El Aeropuerto Internacional de Punta Cana se encuentra a poca distancia de Bávaro, destino de los mejores resorts de lujo todo incluido de la República Dominicana.

Los resorts de Punta Cana, destacan por proporcionar paquetes y servicios especiales para bodas, incluyendo certificados de matrimonio, organizadores de eventos y fotógrafos, tratamientos de spa, pastel de bodas personalizado, catering, música y arreglos florales, entre otros detalles, dejando a los novios el tiempo suficiente para disfrutar del viaje.

La playa perfecta para la ceremonia
Con más de 1,000 kilómetros de costas, a la República Dominicana no le faltan playas. Pero si hay que elegir solo una para bodas junto al mar, Playa Bávaro está avalada por National Geographic y millones de críticos de TripAdvisor® en todo el mundo. Bávaro Beach es una de las 10 mejores playas del mundo por su barrera coralina que frena el oleaje y la convierte en una piscina natural. Aquí, se encuentra ubicado uno de los complejos más completos del Caribe con más de 35 años de experiencia en bodas, [Barceló Bávaro](https://millonesdevoces.org/) Grand Resort.
We haven't learned anything
Tags: discuss, world, wtfishappening
Published: 2022-02-12 17:40:18

---
title: We haven't learned anything
published: true
description: We haven't learned anything
tags: discuss, world, wtfishappening
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b150ba1p8e37lxirk7xn.jpg 
---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/we-havent-learned-anything/)._

> There's a saying that those who do not learn from history are doomed to repeat it. I fear we haven't learned much, and are seriously toying with the path of repeating it. Again 🤦

---

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
How This JavaScript Game Made More Than $1,000,000
Tags: javascript, webdev, discuss, career
Published: 2022-02-12 17:35:38

In this article I will explain how the game "Wordle" was worth more than $1,000,000.

Keep reading to learn how, ONE DAY, your game could be worth even more ;)

## The Story of Wordle

Josh Wardle, a former Reddit software engineer, knew that his partner liked word games, so he created one for just the two of them, and called it [Wordle](https://www.powerlanguage.co.uk/wordle/).

They also shared it to their relatives on Whatsapp, which got them so much positive feedback that they decided to release it to the world wide web.

This [graph](https://trends.google.com/trends/explore?date=2021-12-01%202022-02-12&q=wordle) shows the extremely rapid rise of Wordle:

![Wordle's popularity grew from 0 to 100 in a short time-span from January 2 2022 to February 5 2022](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbvmx7xan4ffv31ynlxg.png)

The most prominent source of this popularity is Twitter, where users have endlessly memed the colored grid of Wordle:
{% twitter 'https://twitter.com/MKBHD/status/1491065937017163779' %}
{% twitter 'https://twitter.com/rhartman/status/1481361845424312322?cxt=HHwWhMCqxf6v7Y4pAAAA' %}

Not long after this fame, the New York Times reached out to Josh Wardle, in an offer to buy his game and add it to their collection of word games.

He agreed, and the game was sold for an undisclosed amount. The only public information they shared was that it was between $1,000,000 and $10,000,000 (it was in the "low seven-figures")

{% twitter 'https://twitter.com/powerlanguish/status/1488263944309731329' %}
Should I move from web2 to web3 
Published: 2022-02-12 17:33:29

 There was web1 and web2. web1 started with static webpages and web2 was about dynamic webpages (PHP, SQL, java) that had more control over the look of the webpage. Now we are in web3 that is all javascript using APIs to talk to servers (even if they are on your own computer). As a webdeveloper you need to understand this things and start to implement web3 features.

Where web1 webpages were static webpages, web2 was all dynamic webpages (PHP, SQL, java) that had more control over the look of the webpage. Now we are in web3 that is everything javascript using APIs to talk to servers (even if they are on your own computer). As a webdeveloper you need to understand this things and start to implement web3 features.

If webpages still were static webpages, web2 was all dynamic webpages (PHP, SQL, java) that had more control over the look of the webpage. Now we are in web3 that is everything javascript using APIs to talk to servers (even if they are on your own computer). As a webdeveloper you need to understand this things and start to implement web3 features.

What will make web 3 explode?

Web3 is the web of the future and like web2 webpages will become more dynamic on the front end (and maybe more on the back end). To be able to create web3 webpages you need to understand javascript, APIs and node.js . As a webdeveloper you need to go through this learning processes if you want to survive in webdevelopment.

What will make web3 explode?

Web3 is the web of the future and like web2 webpages will become more dynamic on the front end (and maybe more on the back end). To be able to create web3 webpages you need to understand javascript, APIs and node.js . As a webdeveloper you need to go through these learning processes if you want to survive in webdevelopment.


What made web2 so big?

Web2 was all about dynamic webpages using PHP, SQL and java . These webpages where build on the web servers of the hosting company of your website (hint: if they were good web developers they used web2 too).

Is it a must to learn web3 webdevelopment?

Yes it is! Web3 webdevelopment enables you to create webpages with more control over the look. The javascript language (Node.js) opens up for web workers that are not webdevelopers (e.g.: designers that know how to use photoshop, indesign or illustrator). This will result into webpages with web3 webdevelopment that will have better looks and more control over the look of your webpages.

Will web3 fail at some point?

There is a big chance web3 will fail at some point. Javascript and node.js are not well known in the webdevelopment community (most web developers use PHP, SQL and java for dynamic webpages).
War should never be the solution
Tags: discuss, world, wtfishappening
Published: 2022-02-12 17:32:12

---
title: War should never be the solution
published: true
description: War should never be the solution
tags: discuss, world, wtfishappening
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ys9kfg6cc33zxgvp58gb.jpg
---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/war-should-never-be-the-solution/)._

> War should never be the solution.

---

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
Compiler & Transpiler
Tags: javascript, programming, webdev
Published: 2022-02-12 17:07:41


To Understand the difference between a **Transpiler** and a **Compiler**
, we first need to understand what is a compiler and what is a transpiler.

The **compiler** takes in some code as input and produces a binary executable code aka machine code as output. For example - we use GCC compiler to compile the **C/C++** code and it produces the machine code.

!['Image description'](https://cdn.hashnode.com/res/hashnode/image/upload/v1641719701412/grAiaVThD.png?auto=compress,format&format=webp)

**Transpilers** aka source-to-source compilers read the code in one language and produce the code in another language.

!['Image description'](https://cdn.hashnode.com/res/hashnode/image/upload/v1641719432278/TPthn9AJ3.png?auto=compress,format&format=webp)

```
ES6 version:
let a=10;
console.log(a);
```

```
ES6 to ES5 (Transpiling):
var a=10;
console.log(a);

```

For Example, A **Transpiler** will convert a code from Java to kotlin whereas a **Compiler** will convert Java into bytecode. Similarly, A **Transpiler** will convert a code from python to Javascript whereas a **Compiler** will convert a code from Java to bytecode.

This was my honest try to make you understand the difference better with diagrams as we have a photographic memory and this way it stays long. Do let me know if I need to add more to this and how can I improve more.
What is easier to learn: React or Angular?
Tags: react, javascript, webdev, angular
Published: 2022-02-12 17:02:14

tl;dr

If we compare apples to apples: Angular

I am actually a senior developer that works with Angular and React for several years.

It gives me an deep insight into both technologies, what is unique. Because usually peofirstple work with one or the other making their opinions biased.

What people don't know about React and Angular is that they are two different products. React is a presentation library. While Angular is a framework.

There is a debate where is the line between a library and a framework. It is a fluid term and what doest makes me call Angular a framework is just that it takes care of more stuff than React.

It does not mean however that you can not create a framework with React. Surely you can, and it is what people do. There are in fact tens of tens of various frameworks built on top of React in a combination with other libraries. They shape something together that can be comparable to Angular.

However, if it comes to your question, people compare learning time for React and Angular without all other libraries that you have to learn when using React that form together something comparable to Angular.

That is the secret of why React is always rather ad the one that is easier and faster to learn than Angular. Pure marketing.

If we would just take the part of Angular that is handled by React, and learn only that part, I'd be brave enough to say Angular presentation part is easier to learn and can be learned faster than React.

There are two reasons that influence my opinion. First, Angular is based on OOP principles and Typescript. So of you happen to know OOP you already know 70% of Angular.

Second, React creators made a horrible mistake of dumping object oriented programming. As a result React with it's lovely but quacky replacement for component life cycle and necessity to wrap almost everything into hooks and useEffects is actually more complicated to learn.

I won't mention Redux (external necessity?) that is just a stone that drives React down while Angular built in services are easy to use and make functional programming a pleasure.

I could go for hours comparing these two birds…

I personally love both React and Angular. They chose two different paths and it is exciting to see how they evolve.

Dislaimer: This is a probono article. The author is not compensated for his work. All possible gains from you reading it go to dev.to owners.
Angular Data Bindings
Tags: angular, webdev
Published: 2022-02-12 15:47:20

**_#prerequisite_**

`ng new property-binding-demo`
`ng g c home`

- 
**_String Interpolation_**

In Angular, Interpolation is used to display data from component to view (DOM).

The code in your **_home.component.ts_**

```
public appName : string  = 'My first string interpolation';
```

 The **_home.component.html_**  should look like as follows
```
<h3>String interpolation</h3>
<p>{{appName}}</p>
```
- 
_**Event Binding**_
If there is any action (mouse click or keyboard action) then the event will be raised. We have different ways to bind an event to DOM element.

The _**home.component.ts**_ has a function which receive an event parameter  

```
public logEvent(event) {
  console.log(event.target)
}
```
The _**home.component.html**_ has to call the _logEvent()_ method as follows

```
<h3>Event Binding</h3>
<button (click)="logEvent($event)">Click ME</button>
```

- 
**_Property binding_**
This used to bind the data from property of a component to DOM elements. It is denoted by [].

```
public userName : string  = 'Bob';
```
In the _**home.component.html**_  input element will be initialized with _userName_ value

```
<h3>Property binding</h3>
<input type="text" [value]="userName">
```

- 
Class Binding

It helps to create component with dinamic styling.

Define css classes in in _**home.component.css**_

```
.red {
    background-color: red;
}

.blue {
    background-color: blue;
}
```
In _**home.component.ts**_ declare a propery and bind one of the css class name and create a function which chnages its value.

```
public colorProperty : string = 'red';

public changeColor() {
    this.colorProperty === 'red' ? this.colorProperty = 'blue' : this.colorProperty ='red'
 }

```
In _**home.component.html**_ bind from component to view as below

```
<h3>Style binding</h3>
<div [style.color]="colorProperty">
  Style binding content
</div>
<button (click)='changeColor()'>Change Color</button>
```

- 
Two-way Binding

Is a two-way interaction, data flows in both ways (from component to views and views to component).
**_FormModule_** do the necessary setup to enable two-way data binding, therefore it is necessary to import.

Create a separate property for twoWayBinding in _**home.component.ts**_

 
```
 public twoWayBinding : string = 'init';
```
Update HomeComponent view (home.component.html) as mentioned below

```
<h3>Two-way data binding</h3>
<input type="text" [(ngModel)]="twoWayBinding"/>
{{twoWayBinding}}
```
Property is bind to form control ngModeldirective and if you enter any text in the textbox, it will bind to the property.