teleren/devto huggingface dataset:
How the SauSaGe gets made
Tags: opensource, cpp, beginners, programming
Published: 2022-09-13 00:20:45

I just finished making my [SauSaGe](https://github.com/rudychung/SauSaGe) (Static Site Generator), excuse my idea of a "creative name". 

## The Process
I chose to create my SSG in C++ because I was familiar with how it handled file reading, which this project required a decent knowledge of. 

In order to create and remove directories, I required the filesystem standard library which was introduced in C++17. I was not familiar with the library at the time of starting the project. But, I managed to learn what I needed to using reference material available online. 

Something else I needed to learn was how to work with command line arguments in C++. It turned out to be more mundane than I thought it was. However, I am not 100% sure that the way I have done it is the standard method of getting it done. 

Overall, I found the process of creating this project to be helpful in learning some new ideas in a programming language I thought I was familiar with.

## How to use
To use the program, download the `SauSaGe.exe` file from the repo and execute it in a command line interface (i.e. PowerShell, cmd) with one of the following options:

- `-v` or `--version` - display the application name and version
- `-h` or `--help` - display application options
- `-i` or `--input` - set the input file/directory
- `-o` or `--output` - set the output directory (`./dist` by default)

HTML files will be generated based on the file(s) specified as input. The output directory specified will be deleted and re-created. The output file(s) will be placed into the output directory or dist by default. 

## Usage Examples

- `SauSaGe -i textFile.txt`
- `SauSaGe -i inputDir`
- `SauSaGe -i inputDir -o outputDir`

## Optional Requirements Implemented

- Parses title from input files, changes HTML page title and header accordingly.
- `-o` and `--output` options allow specification of output directory.
- Recursively searches directory structure for text files and converts all of them into `.html` files.
- Creates an `index.html` file that links to the output files created if a directory is specified as input
A conversation about trunk-based development
Published: 2022-09-14 08:17:27

---
title: A conversation about trunk-based development
published: true
date: 2022-09-13 00:00:00 UTC
tags: 
canonical_url: https://jhall.io/archive/2022/09/13/a-conversation-about-trunk-based-development/
---

The Tiny DevOps podcast is back!

I’m joined by Jason Adam who is a software developer with a non-traditional background in biology, business development, and data analytics. Now he’s active as a developer, and on the lookout for proven practices he can introduce to his team. On this episode we talk about Trunk-Based Development, and the related topics of continuous integration and deployment, infrastruture as code, and much more.

## In this episode

- How Trunk-based development differs from GitFlow and other branching strategies
- Two flavors of trunk-based development
- How Trunk-based development fits into the larger picture of continuous integration and continuous delivery
- Techniques for working in smaller batches
- How test-driven development enhances trunk-based development
- Using feature flags for smaller batches
- How to keep pull requests small
- Cherry-picking small changes out of a larger pull request
- How Infrastructure-as-Code works with CI and CD
[Listen](https://jhall.io/tinydevops/2022-09-13-2c2d7428/#player),[watch](https://jhall.io/tinydevops/2022-09-13-2c2d7428/), or[read the transcript](https://jhall.io/tinydevops/2022-09-13-2c2d7428/#transcript)  
[![](https://jhall.io/images/icon-podcast-512-bw.png)](https://jhall.io/tinydevops/2022-09-13-2c2d7428/#player)  [![](https://jhall.io/images/icon-watch-512-bw.png)](https://jhall.io/tinydevops/2022-09-13-2c2d7428/)  [![](https://jhall.io/images/icon-transcript-512-bw.png)](https://jhall.io/tinydevops/2022-09-13-2c2d7428/#transcript)  

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Front-end Pokédex Project
Tags: javascript, css, beginners, showdev
Published: 2022-09-12 22:59:46

We are happy to share this [Pokédex project](https://github.com/blueycode/pokedex), which may be helpful in one way or another for **beginners** in web development.
It was built with HTML, CSS, and JavaScript. Also, in order to get the data from all Pokémon, asynchronous JS was used to fetch data from an external API.

Likewise, keep in mind that the entire development process was recorded and is available on my YouTube channel. The [video] (https://youtu.be/ohYJswoGlH0) covers the **project setup**, all the way to pushing it live on **GitHub pages**. Check it out!

As always, any feedback is appreciated.
Week 9
Published: 2022-09-12 19:37:48

Time for another post! 

`At this week’s huddle, we talked about job titles & associated responsibilities. You’ve been a software engineer for a few weeks now. How do your day-to-day responsibilities differ from what you expected? Have you been surprised by the breakdown of work each week?`

My time spent at my host company so far has been pretty busy. For the last few weeks we've been learning the tech we will use on our project, as well as the project structure. This is the first time I've worked with a large codebase or have even seen one! Honestly, it is sort of overwhelming at times. However, at this point my host company just wants me to get familiar with the tech/existing code base before we start contributing and I couldn't be more happy with that 🤣. At times, I still feel like I don't know 'enough'. I guess that is the infamous IMPOSTER SYNDROME. 


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

So far, just a lot of learning and I LOVE that. That's why I'm here. 😊

One thing that's pretty surprising to me is the amount of discussion/meetings that happen within a team. Prior to the Develop Carolina apprenticeship and being placed with my host company, I had no point of reference. I always thought developers were just slinging out code all day. Just the process of 'how to work' is amazing to me. My employer host also provided two full days of 'intro to agile' training that was extremely helpful to understand terms/concepts I've overheard in standups and why we work the way we do. 

I feel like I say this in most of my post but just learning as much as I can and enjoying every minute!!
How to add a screenshot in Github Desktop.
Published: 2022-09-12 22:16:42

The importance of  a readme file is to give a brief preview of the contents of the project.It explains how we can install and use the uploaded project.
A well written readme file is more important if you intend to show those projects in your resume.

Did you know it allows the uploader to add images and videos to help the reader navigate through the project?


## How to add the image screenshot



. On your project repository click on the issues tab and open new issue.

   
   ![Issues page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2c1cz5ryeresgdipy78.png)

  ![New Issue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53t8a8xnozpexur94ebe.png)

. Attach files by drag and dropping the screenshot(s)


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

. Wait for the screenshot to finish uploading and you will get a .png link which you will then copy and paste to your README under screenshots heading.

  ![Uploaded screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jn756yyc2gzp57lse4g.png)

**Key Take aways**
- You can use the issue to upload several screenshots.
- You don’t have to save the issue once you are done.
- You don’t have to give the issue a title.

And Voilà your README is now much more inviting to the readers and reviewers.
𝐖𝐡𝐚𝐭 𝐀𝐫𝐞 𝐭𝐡𝐞 𝐆𝐫𝐞𝐞𝐧𝐞𝐬𝐭 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐋𝐚𝐧𝐠𝐮𝐚𝐠𝐞𝐬
Tags: java, cpp, python
Published: 2022-09-12 22:15:27

Orignal post from [check this](https://medium.com/codex/what-are-the-greenest-programming-languages-e738774b1957)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8t10wi9ckdh2w5btdss5.png)
Generate more detailed errors in controllers using 'rescue_from' in Ruby on Rails
Tags: webdev, ruby, rails, programming
Published: 2022-09-12 22:06:22

The most important parts of a web page application is returning information to the user while providing errors in order for a better understanding of why a problem is occurring when a user is interacting throughout the app. Through the application controllers, CRUD(Create, Read, Update, Destroy) methods are developed in order for the front-end to interact with the database created in the back-end.

##.find vs .find_by
When creating the `create`, `show`, and `update` routes, the id of the data being displayed must be found. If the id cannot be found, an error will occur. For example, lets say we have a show methods in a movie controller:
```javascript
class MoviesController < ApplicationController
  def show
    movie = Movie.find_by(id: params[:id])
    if movie
      render json: movie, status: :ok
    else
      render json: {error: "Movie not found"}, status: :not_found
    end
  end
 end
```
By using `.find_by`, the return value is `nil` if the movie cannot be found. Therefore, an `if/else` statement needs to be formulated in order to generate an error that will be used to display to the user.

We can also use a `rescue` that ruby provides that can take the exception and use it as the error, replacing the `if/else` statement for a more DRY approach:
```javascript
class MoviesController < ApplicationController
  def show
    movie = Movie.find_by(id: params[:id])
    render json: movie, status: :ok
rescue ActiveRecord::RecordNotFound
  render json: {error: "Movie not found"}, status: :not_found
  end
 end
```

But there is an even DRY-er way for handling errors. If we use the `.find` method, ActiveRecord returns an exception that contains a more detailed error. For example, if we make a fetch request to `localhost:3000/movies/99`, the exception will look like:
```
ActiveRecord::RecordNotFound (Couldn't find Movie with 'id'=99)
```
We can use this exception to generate our error and apply it to every controller with a `RecordNotFound` error but writing our rescue in the `ApplicationController`:
```javascript
class ApplicationController < ActionController::API
  rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
  private
  def record_not_found(error)
    render json: {error: error.message}, status: :not_found
  end
end
```
Since the error is being handled inside our "top" controller, the methods in the `MoviesController` do not need to contain errors and therefore create a more DRY form:
```javascript
class MoviesController < ApplicationController
  def show
    movie = Movie.find(params[:id])
    render json: movie, status: :ok
  end
 end
```
How to use maven to download jars for static project
Tags: java, maven, lib
Published: 2022-09-12 22:04:12

If you have a old style java project that you just copy the jar files to 'JRE/lib/ext' you can you maven to do this job.

[Create a maven app ](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html),  edit you pom.xml, and put all your dependencies into dependencies block. 

```
<dependencies>
      <dependency>      
        <groupId>org.deeplearning4j</groupId>      
        <artifactId>deeplearning4j-core</artifactId>
        <version>1.0.0-beta5</version>    
      </dependency>         
      <dependency>      
        <groupId>org.deeplearning4j</groupId>      
        <artifactId>deeplearning4j-modelimport</artifactId>      
        <version>1.0.0-beta5</version>    
      </dependency>                       
      <dependency>      
        <groupId>org.nd4j</groupId>      
        <artifactId>nd4j-native-platform</artifactId>
        <version>1.0.0-beta5</version>    
      </dependency>
      <dependency>      
        <groupId>com.google.cloud.dataflow</groupId>      
        <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>  
        <version>2.5.0</version>     
      </dependency>
   </dependencies>
```

Then ou can create your package, open a terminal navigate to your project and execute the command:

mvn package

After the BUILD you can copy only the jars that the project uses (also all dependencies), using the next command:

mvn dependency:copy-dependencies

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


And check the folder "target/dependency" and all jars will be stored into this folder, and you can copy this for your JRE/lib/ext.
Adding new JRE/JDK ubuntu
Tags: linux, ubuntu, java
Published: 2022-09-12 21:27:26

This command helps you to add an alternative JDK/JRE a like Azul/Zulu or adoptopenjdk.

After extract your JDK/JRE usually we extract on "/usr/lib/jvm" debian/ubuntu systems.

We will need 3 commands if we are adding a JDK.

To Set directly

```
sudo update-alternatives — set java <Directory where JAVA has been extracted>/bin/java
sudo update-alternatives — set javac <Directory where JAVA has been extracted>/bin/ javac
sudo update-alternatives — set javaws <Directory where JAVA has been extracted>/bin/javaws
```

To install as new option

```
sudo update-alternatives — install “/usr/bin/java” “java” “<Directory where JAVA has been extracted>/bin/java” 1
sudo update-alternatives — install “/usr/bin/javac” “javac” “<Directory where JAVA has been extracted>/bin/javac” 1
sudo update-alternatives — install “/usr/bin/javaws” “javaws” “<Directory where JAVA has been extracted>/bin/javaws” 1

```
And to select a new one

```
sudo update-alternatives — config java
```
rysnc command
Tags: linux, beginners
Published: 2022-09-12 21:10:19

There is the commands that I like to backup my data.

To copy and update all data.

`rsync -hvrPt /media/source/ /media/target`

Delete the files align the files after sync.
`rsync -a --delete /media/source/ /media/target/`

**or Combine the command to make a mirror**

`rsync -hvrPt /media/source/ /media/target`

If you use to send over ssh remote, use the option **--no-i-r**  improve the remote performance,

`rsync -hvrPWt --no-i-r /media/source /targert`

Its solve my life


[Check this Thread](https://unix.stackexchange.com/a/149504/541135)
¿Cómo funcionan la decodificación y la codificación de las URL?
Tags: webdev, software, spanish
Published: 2022-09-12 20:20:57

Cada vez que visitas un sitio web, tu navegador codifica y decodifica las URLs detrás de cámaras. Esto se hace para evitar la transmisión de datos no válidos o inseguros; veamos cómo funciona la decodificación de URL a nivel básico y por qué es importante.

Codificar una URL es el proceso de tomar una cadena como esta:

`https://example.com?param=value#someAnchor`

Y aplicar algunas reglas de transformación para que se parezca a esto:

`https%3A%2F%2Fexample.com%3Fparam%3Dvalue%23someAnchor`

Esta transformación es importante ya que las URLs deben seguir el estándar de sintaxis URI para enviar sólo datos válidos y seguros. La decodificación y la codificación de las URLs suelen ser gestionadas por el navegador o el servidor web que estés utilizando. Sin embargo, hay ocasiones en las que puedes necesitar codificar o decodificar una URL tú mismo, así que vamos a ver cómo funciona a nivel básico.

### Conceptos básicos de decodificación/codificación de URLs

Como hemos mencionado anteriormente, hay que seguir la norma de sintaxis URI. Sólo se permite un subconjunto especial de caracteres ASCII en las URL. Este consiste en los conocidos símbolos alfanuméricos, y algunos caracteres reservados para su uso como caracteres de control.

![Tomada de https://developers.google.com](https://res-3.cloudinary.com/hc43cqwj4/image/upload/q_auto/v1/ghost-blog-images/Nuevo-proyecto.png)

### Métodos de codificación y decodificación

El sistema de codificación más común es el llamado codificación porcentual, que consiste en tomar un signo `%` y añadir la representación hexadecimal del valor ASCII de este carácter. Por ejemplo, el signo `@` se representa con `#40`, ya que 40 es el valor de este carácter en la tabla ASCII.

A veces también se utiliza el método base64. Con este método, cada carácter se representa por un conjunto de seis caracteres. Por ejemplo, el carácter `#` se representaría como `iVBORw0K`; puede obtener más información sobre base64 en nuestro post anterior sobre Sistemas comunes de decodificación/codificación: <https://es.artofcode.tech/sistemas-comunes-de-codificacion-y-decodificacion/>

Esperamos que este post le haya ayudado a entender un poco más cómo funcionan las tecnologías web modernas y los navegadores web detrás de cámaras.

Mira este post en Art Of Code: https://es.artofcode.tech/como-funcionan-la-decodificacion-y-la-codificacion-de-las-url/
Crédito de la imagen: Richy Great en Unsplash.
How does URL decoding and encoding work?
Tags: webdev, software
Published: 2022-09-12 20:14:46


Every time you visit a website, your browser is encoding and decoding URLs under the hood. This is done in order to avoid transmitting invalid or unsafe data; let's see how URL decoding works on a basic level and why it is important.

Encoding a URL is the process of taking a string like this one: `https://example.com?param=value#someAnchor`

And apply some transformation rules to make it look like this one:

`https%3A%2F%2Fexample.com%3Fparam%3Dvalue%23someAnchor`

This transformation is important since URLs must follow the URI syntax standard to send only valid and safe data. URL decoding and encoding are usually handled by the web browser or web server that you are using. However, there are times when you might need to encode or decode a URL yourself, so let's see how it works on a basic level.

### URL decoding/encoding basics

As we mentioned earlier, the URI syntax standard must be followed. Only a special subset of ASCII characters is allowed in URL's. This consists of the familiar alphanumeric symbols, and some reserved characters for use as control characters.

![Taken from https://developers.google.com](https://res-2.cloudinary.com/hbig9cpoo/image/upload/q_auto/v1/ghost-blog-images/uri-valid-characters.png)

### Encoding and Decoding Methods

The most common encoding system is called Percent-encoding, which consists of taking a `%` sign and appending the hexadecimal representation of the ASCII value of this character. For example, the `@` sign is represented by `#40`, since 40 is the value of this character in the ASCII table.

The "base64" method is also sometimes used. With this method, each character is represented by a set of six characters. For example, the character `#` would be represented as `iVBORw0K`; you can learn more about base64 in our previous post on Common decoding/encoding systems: <https://artofcode.tech/common-encoding-and-decoding-systems/>

We hope that this post has helped you understand a bit more about how the modern web technologies and web browsers work under the hood.

Check out this post in Art Of Code: https://artofcode.tech/how-does-url-decoding-and-encoding-work/
Image credit: Image from Richy Great on Unsplash.
☎️ An Open Source Java SDK to validate phonenumbers in New-Caledonia 🧑‍🤝‍🧑
Published: 2022-09-12 20:14:00

## ❔ About

Recenlty we saw a very nice & interesting Discussion landing on our [`opt-nc` Github Organization](https://github.com/opt-nc) : 


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5j76qiha1j6al8xii5gz.png)](https://github.com/orgs/opt-nc/discussions/13)

With a very well explained use case :

> _"Bonjour, disposer d'un SDK voire d'une API permettant de valider des numéros de téléphone ou encore de détecter si un numéro est un numéro de fixe ou un numéro de mobile."_

> _"Avec ces outils, il serait possible facilement d'améliorer la qualité de bases de données ou encore rendre des formulaires web plus efficaces."_

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f4gr0wh3xp5sz7nxwd7z.png)](https://github.com/orgs/opt-nc/discussions/13)

Quite rapidly we discovered that it could help a lot of people enhancing the data quality of Information Systems... and even ours !

This first intro post is dedicated to announce the release of the SDK.

## 😎 Open source repo

Here is the repo :

{% github opt-nc/phonenumber-validator %}

##  🚀 Get started

[Add SDK to your repo](https://github.com/opt-nc/phonenumber-validator#-maven), then :

```java
System.out.println("Type de numéro : " + PhoneNumberValidator.getPhoneType("+687514243").name());
System.out.println("Mobile ? : " + (PhoneNumberValidator.isMobile("+687514243") ? "oui" : "non"));
System.out.println("Fixe ? : " + (PhoneNumberValidator.isFixe("+687514243") ? "oui" : "non"));
System.out.println("Special ? : " + (PhoneNumberValidator.isSpecial("+687514243") ? "oui" : "non"));
```

## 🛡️ Security

As dependencies are monitored and code security is enabled, you can safely analyze code and see if any toxic code is embedded in the SDK :

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j5btmqhte6b11tlhflr2.png)](https://github.com/opt-nc/phonenumber-validator/security/code-scanning)

## ➰ Feedbacks

Feel free to send feedback by :

🎫 [Dropping an issue](https://github.com/opt-nc/phonenumber-validator/issues)
🧑‍🤝‍🧑 [Opening or participating to a discussion](https://github.com/opt-nc/phonenumber-validator/discussions)
🎁 [SDK delivery](https://github.com/orgs/opt-nc/discussions/13#discussioncomment-3629378) for [#ProgrammersDay](https://twitter.com/hashtag/ProgrammersDay) 🤓