teleren/devto huggingface dataset:
[HIRING] Java mid/senior from Eastern Europe
Published: 2021-11-18 15:21:14

Hey, looking for a full-time mid/senior Java, Spring dev from Eastern-Europe. Good spoken/written English is needed. Salary $2500 - $3000. Fully remote. Visiting Estonia preferred once in a while (paid). Small 2 person dev team. Friendly and relaxed working culture. Apply here: apply.crewnew.com/?p=121&f=LinkedIn_88&q=26-31-23
Published go-optional: Go's Generics friendly optional/option type library
Tags: go, generics, optional
Published: 2021-11-18 15:19:33

I've published go-optional, which is a library that provides [Go's Generics](https://go.dev/blog/generics-proposal) friendly [option/optional type](https://en.wikipedia.org/wiki/Option_type) functions.

{% github moznion/go-optional no-readme %}

This library provides "typed option" by using generics, it implies this would be a replacement of "nil checking" for the purpose of value existence inspection. This has the pros of strong typing.
 
You can see the basic usage of this in the [synopsis](https://github.com/moznion/go-optional#synopsis) and [examples](https://github.com/moznion/go-optional/blob/main/examples_test.go).
Currently, this brings the following utility option functions:

- `IsSome()`
- `IsNone()`
- `Take()`
- `TakeOr()`
- `TakeOrElse()`
- `Filter()`
- `Map()`
- `MapOr()`
- `Zip()`
- `ZipWith()`
- `Unzip()`
- `UnzipWith()`

This library uses Go's under-developing feature "Generics", so if you'd like to try this library, you may have to use the edge of go runtime at this moment (i.e Nov 18, 2021). I suppose [gotip](https://pkg.go.dev/golang.org/dl/gotip) would help you to get and install the latest go runtime.
Also you can try this on The Go Playground for gotip: https://gotipplay.golang.org/p/mWGdFIfcK8c

Unfortunately, the Go compiler prohibits putting type parameters on a method so far. For example:

```go
type Something struct {
}

func (s *Something) Echo[V any](v V) V {
	return v
}
```

at the first glance, this code seems valid syntactically but...

```
./main.go:6:25: methods cannot have type parameters
./main.go:6:26: invalid AST: method must have no type parameters
```

the compiler raises the compiling error like the above. This means a method (i.e. a function that has a receiver) cannot have type parameters at present.
Actually, there is a workaround for this by transforming a method to a function like a bellow:

```go
func Echo[V any](s *Something, v V) V {
	return v
}
```

Therefore, some features (e.g. `Map()`) are implemented as the function instead of the method in this library.

---

I wrote this library for my learning the Generics features then I felt Go Generics is almost production-ready, and I believe this library would be also useful :)

Enjoy!
Amend a specific commit
Tags: github, beginners, tutorial, commandline
Published: 2021-11-18 15:15:45

Here is my situation: I had to do a dev that I cut into two different commits. I asked for a review from my team and got feedback on the first commit. I realized I didn’t know how to amend a commit that wasn’t the last one in the git history. I really didn’t want to create a specific commit for this fix, it wouldn’t be clean. I wanted to amend the first commit to have a clean git history. Here is the process I followed to be able to do that successfully :

Select the number of your commit, here we want to modify the commit bac653ad. So I had to run :
```
git rebase --interactive 'bbc643cd^'
```
In the default editor, you will have this kind of view :
```
pick bac653ad fix: first commit 
pick ac39035 feat: second commit
```
Change the name of the commit if you want, or keep it how it is and save. Then run :
```
git rebase --continue
```
Now you can push force :
```
git push --force
```
Your changes should have been added to the specific commit you wanted.

Shut out to [StackOverflow](https://stackoverflow.com/questions/1186535/how-to-modify-a-specified-commit) for helping me solve this problem!
Los sistemas cloud de Seguridad a Medida 

Published: 2021-11-18 14:56:15

Cada vez son más las empresas que suman a su entorno soluciones basadas en el respaldo en la nube o sistemas cloud, caracterizados por proporcionar a los usuarios protección a sus archivos, ante las crecientes amenazas de seguridad en el entorno digital.

La popularización de los sistemas cloud se debe a que estos aportan controles, tecnología y procedimientos destinados a proteger los datos, aplicaciones e infraestructura en la nube. Por ello, incluso las empresas de seguridad están haciendo uso de este sistema para garantizar un mejor servicio a sus clientes.
Un ejemplo de lo anterior es Seguridad a Medida, una empresa especializada en sistemas de seguridad avanzados. Cuenta con un servicio basado en sistemas cloud para análisis de vídeo y grabación en la nube, lo que proporciona mayor protección de los datos.

Sistemas cloud: innovación y protección
En la actualidad, los avances tecnológicos han alcanzado diversos sectores de manera notable. Las empresas de seguridad no han quedado fuera de esta realidad, por este motivo, innovar en sus servicios utilizando opciones de la tecnología para satisfacer las demandas de sus clientes es elemental.

https://despertarandino.com/
Truncate text using CSS ellipsis
Tags: css, tutorial, beginners, programming
Published: 2021-11-18 14:53:47

You might want to truncate a string of text, and you struggle with how to use the property ellipsis.
Here is an example of how you should use it. Note that all the following are mandatory. Your string has to be a straight line (that explains the white-space: nowrap). Its width has to be fixed and the overflow hidden.
```
.ellipsis {
  width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
```

More details about this property on this article from [CSS-Tricks](https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/).
Unconventional Programming Tips: Comments
Tags: programming, discuss, design
Published: 2021-11-18 14:48:01

Originally posted on my [personal blog](https://kiru.io/articles/coding-comments/). 

*Random thoughts on programming*

I was recently reading [Best Practices for writing code comments](https://stackoverflow.blog/2021/07/05/best-practices-for-writing-code-comments/) by Ellen Spertus. 
While there are some helpful tips, it misses the most important ones for me:

- **Add "why" comments when you write the code.**
- **Add all the other comments when you read the code.**

<p>
What is the main purpose of comments? <br>

They should help me understand the code easier. More than often, when I write the code, it is immediately clear what I was trying to solve. I have the context and the reason for my decisions are freshly in my mind.

</p>

<p>
Few days later, re-reading the code, I don't know anymore why I wrote the code like that. That is when I add the most valuable comments. Many people tell you not to duplicate code with comments, but if it makes it easier to understand the code - why not? Don't follow any advices blindly - even the above ones.
</p>

Consider this example:

```
while (element.parentElement != null){
   // do some stufff
}

while (element.parentElement != null){ // we didn't reach root
   // do some stufff
}
```

On a daily basis, I don't tend to write many while loops. That makes while loops not always easy to grasp. If I encounter one, it is not very easy to understand the conditions. In the above case, the condition is simple, nevertheless the added comment improves the code quality for me. I don't have to focus on the condition, I can read the inner parts knowing they are executed until we reach the root.

In many cases, null checks are another good example. Null has so many semantics, while I write the code, I know the meaning of a variable being null, but when I read it again, it is not clear what the initial reason was:

- is it because null means the value has not been set?
- is it because null means the value was there, but has not been set?
- is it because null means the value is invalid?
- is null the expected value?

Try to add a comment why you expect null. You don't have to add it each time - only in the cases where it is not clear from reading the code.

**TLDR**: Best comments are written when you read the code - not when you write it.
ดู document ของ Bash builtin commands ผ่านคำสั่ง help
Tags: linux, bash
Published: 2021-11-18 14:46:04

พวกคำสั่งที่เป็น builtin ของ Bash บางครั้งใช้ man เพื่อดู manual ไม่ได้ แต่ Bash เองเตรียมคำสั่งชื่อว่า help มาไว้เพื่อดู document ของพวก builtin commands เหล่านี้ได้

ถ้าเราสั่ง help เฉยๆจะขึ้นลิสต์ command ที่สามารถดู document ได้ เช่น

![help list commands](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5iatv38aiwkrxltlcw4q.png)

ถ้าเราอยากดู document ของแต่ละ command ก็สั่ง help ตามด้วยชื่อ command นั้นๆเช่น

```
help echo
```

![help echo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ik6x0bjux9uolkaztj5d.png) 

คำสั่ง help ช่วยได้เยอะเลยยิ่งถ้าต้องเขียน shell script เพราะบางคำสั่งเราใช้ใน script บ่อยกว่าที่จะสั่งตรงๆเช่น if หรือ for

```
help for
```
![help for](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lqmzaqzg8zh4tf9tm6e.png)
 
```
help if
```
![help if](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxqmn1fvy948pqrxs56i.png)
How to squash commits
Tags: github, commandline, tutorial, beginners
Published: 2021-11-18 14:45:00

It happens to me very often that someone help me out on a branch and pushes their code on a fix up commit. Every time it happens, I panic because I want to squash this commit into my previous commit so the git history looks clean. I used to be very bad at git, my tree will have unexpected merges and all. However, I decided to learn and focus on this point this last year to avoid these silly mistakes and get better at it. Here is how I managed to squash my commits using the command line. Note that you might use a graphical git manager, this could make this process easier.

##Start an interactive rebase
Squashing commits means that you have to start an interactive rebase. Choose the starting commit, for me it’s 2 because I just want to squash a fix up commit in my previous commit.
```
git rebase -i HEAD~2
```
At this point your editor of choice will pop up, This is the file that will open:
```
pick 571afa fixup commit
pick 652fec feature: commit message specific to the feature
```
Replace the pick by squash, or s for brevity, in front of the commit you want to squash. Then save the file and close it.
```
squash 571afa fixup commit
pick 652fec feature: commit message specific to the feature
```
A new window will open with the 2 messages of the commits you want to squash together, change the name of the commit if you want one clean commit message and save. Then run:
```
git push -f
```
You can check the outcome on your git repository, only one commit gathering the modifications you did on your two old commits should be in the git history. Easy right?!
Top 5 programming forum you should join (growing)
Tags: webdev, productivity, beginners, programming
Published: 2021-11-18 14:43:45

These are the list of some top 5 growing programming, gamedev, android dev and webdev related forum you must join. These forums may help you to get your answers for bug fixes and related topics.

1. Webmatrices Forum
   A lot of posts of this forum ranks on Google. It really has the highest **`Daily Pageviews per Visitor: 6.1`** and **`daily time on site: 5:52`**. It also has a decent amount of content in it. Users mostly talk about web/app development, game development and blogging/SEO related stuff here. This forum is also growing really fast.
   Suggest you to join this forum if you wanna learn about web development, frameworks, API security, gameDevelopment and blogging/SEO.
   Visit here: [https://webmatrices.com/](https://webmatrices.com/t/programming)

2. Codeproject
   This forum is kinda popular in web as well. According to alexa rank, it has 1.53 Daily Pageviews per Visitor and 1:50 daily time on site. It has slightly lesser ranks than Webmatrices. The number of content, questions and answers is also pretty good. People generally talk about Python, C++ and Ai related stuff here.
Visit here: <https://www.codeproject.com/>

3. Codeguru
   This website is genuinely awesome for learning OS-related stuff. It has 1.3 Daily Pageviews per Visitor and 1:26 daily time on site. People discuss C programming, Onion architecture, .NET, vb.net and other OS-related stuff. Joining this forum would be great if you wanna about OS. Although there's a decrement rate in Alexa rank of this forum website, I guess the rate will be changed soon.
   Visit here: <https://forums.codeguru.com/>

4. DaniWeb
   This website is also somehow related to hardware and OS related stuff. Daily Pageviews per Visitor and daily time on site are 1.3 and 1:34 respectively. Members usually discuss about VB.NET, Computer Hardware, Python and os related stuff.
   I suggest you to join this forum if you really wanna dive more into OS, hardware development and C programming.
   Visit here: <https://www.daniweb.com/>

5. thecodingforums This forum is the smallest of all mentioned here, but growing really nice. 1.4 Daily Pageviews per Visitor and 0:57 Daily Time on Site is the Alexa report of this site. People here talk about Python GUI, Tkinter, HTML, CSS and Java. I suggest you join this forum if you're really new to the programming world.
   Visit here: <https://www.thecodingforums.com/>

> As I mentioned, these are growing forums, you are the one who gonna be the another growth factor of these forums.
The ephemeral miniconf - LIVE NOW
Tags: perl, raku, conf
Published: 2021-11-18 14:22:27

# [Invitation link](https://us02web.zoom.us/j/81869065466?pwd=bzVFTVg1TWxBN0VOTFUwRmdPaTFuZz09)

(if you read this, the miniconf is over now)
Guide on How to Unzip Files in Linux?
Tags: linux, tutorial, programming, beginners
Published: 2021-11-18 14:13:43

it's consistently dangerous when we work with sudo advantages in a Linux machine as you approach all the setup and framework records, and if you mess up with them, your entire framework may crash. So we encourage you to run the underneath referenced orders with absolute attention to detail.

Additionally, to utilize the unfasten order, it's required to have the unfasten bundle introduced on our Linux machine. You can basically utilize the bundle administrator of any famous Linux circulation you are rushing to introduce the unfasten bundle. Notwithstanding, the vast majority of the Linux appropriations come pre-introduced with this bundle.

`
$ sudo apt-get -y install unzip
`

![Linux unzip](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o95hv3nc6d7d1lk2tjyy.png)

If you are using Fedora, CentOS, etc. and you have yum package manager, you can use:

`
$ sudo yum install unzip
`
## [How to Unzip Files in Linux](https://www.techgeekbuzz.com/how-to-unzip-files-in-linux/)?

When we run the unzip command without any options, in the most native form, it simply extracts all the files and directories inside the current directory that you are in.

`
$ unzip archive.zip
`

![unzip archive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xxlcbup22mty340h6fg.png)

**Output Suppression**

You can see that the unzip command enlists the details of the files that it is extracting from the archived file. To avoid printing the details and suppress the output, we can simply use the quiet (-q) option along with the unzip command.

`
$ unzip -q archive.zip
`

![unzip -q archive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jm4xxt7f8t50kgfndao.png)

### How to Extract Files to a Different Directory in Linux? 

If you want to extract them to a different directory, you can use the -d option and specify the path to the destination directory. Please note that if you don’t have write access to the destination directory, you can use the sudo command to get the root privileges.

`
$ unzip archive.zip -d ~/Documents
`
![unzip archive.zip -d ~/Documents](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lqukh6ss19ww537s4b0y.png)

### How to Extract a Password-Protected File in Linux?

If you want to unzip a file that is password-protected, you can use the -P option along with the unzip command.

`
$ unzip -P <password> <zipped-file>
`

![unzip -P <password> <zipped-file>](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqf24cdl5o8cutfxdzh7.png)

However, typing the password as plain text in the terminal (command line) could be insecure. What you can do is simply extract the zipped file in a normal manner. When it tries to unzip the files and finds a file with a password, it will automatically prompt you to input the password.

`
$ unzip archive.zip
`

![unzip archive.zip](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uuui6pej4yx86xf8tpce.png)

## Wrapping Up!

To conclude this detailed and comprehensive article, we discussed how to unzip files in Linux using the unzip command.
Top Trending Mobile App Development Technologies in 2021-2022
Tags: android, ios, startup, help
Published: 2021-11-18 14:05:56

Explore the top trending mobile app development technologies in 2021:
•	React Native
•	Flutter
•	Ionic
•	Xamarin
•	Corona
•	PhoneGap
•	Mobile Angular UI
If you still have any queries regarding any other latest technologies, you can contact a . <a href="https://www.mobulous.com/mobile-app-development">mobile app development</a>
A One Piece of CSS Art!
Tags: showdev, css, html, webdev
Published: 2021-11-18 13:49:03

After my first "draft" of [Livaï Ackerman](https://dev.to/afif/rate-my-first-css-drawing-51m5), I am back with another CSS art and this time I am exploring the One Piece universe.

A CSS-only Monkey D. Luffy

{% codepen https://codepen.io/t_afif/pen/bGrQGXG %}

This time, the result was quite good compared to the last one. I dropped the use of `clip-path` and focused on gradients.

I used only 11 Divs (I can do better but I got lazy ...) and spent around `10h`. 

It's responsive and the browser support is good

{% codepen https://codepen.io/t_afif/pen/xxLMXry %}

It's on twitter if you want to give some likes or share it  👇

{% twitter 1461297540909965312 %}

See you the next CSS Art.

----

### <center>You want to support me?</center>

[![buy me a coffee](https://cdn.buymeacoffee.com/buttons/default-orange.png)](https://www.buymeacoffee.com/afif)

<center>**OR**</center>

[![Become a patron](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/db3jtgy2i5l4w8slkps5.png)](https://www.patreon.com/temani)
Ruby Thread Pooling
Tags: ruby
Published: 2021-11-18 13:36:22

I have been always, naively, restrain myself from using multi-threading in Ruby because, as you know *Ruby doesn't have real threads* until I read these awesome [article](https://www.speedshop.co/2020/05/11/the-ruby-gvl-and-scaling.html) by [Nate Berkopec](https://twitter.com/nateberkopec).

I was working on a web crawler, and aside from the huge (and expected) performance boost I implemented a thread pooling function that made my job easier not just for this particular usage but for almost every multi threading application, and I think it might helpful to share.

{% gist https://gist.github.com/akhal3d96/e18e03227e842d2b3349bbe4ff1afb33 %}

Usage:
```ruby

# Create a Queue (they are thread-safe)
jobs = Queue.new

# Create tasks and add them to the queue
samples = read_samples
samples.each { |sample| jobs << sample }

results = thread_pool(pool_size: 4, jobs: jobs) do |job|
  # Each thread will excute this method
  # with each item pop'ed from the queue
  amazoneg = AmazonEG.new(job)
  amazoneg.scrap
end

p results
```

Feedback are always welcome.
Bubble sort Algorithm
Tags: javascript, html, react, css
Published: 2021-11-18 13:27:37

Hello Guys today i am going to show you how to apply bubble sort algorithm. The Language i have used is javascript and for the frontend end or GUI part HTML AND CSS and The React JS Framework.

Lets get started...

What is Bubble Sort Algorithm?
Bubble sort algorithm is an algorithm that sorts the array by comparing two adjacent elements and swaps them if they are not in the intended order. Here order can be anything like increasing order or decreasing order.

How Bubble-sort works
We have an unsorted array arr = [ 1, 4, 2, 5, -2, 3 ] the task is to sort the array using bubble sort. 

Bubble sort compares the element from index 0 and if the 0th index is less than 1st index then the values get swapped and if the 0th index is less than the 1st index then nothing happens.

then, the 1st index compares to the 2nd index then the 2nd index compares to the 3rd, and so on…

Syntax
BubbleSort(array){
  for i -> 0 to arrayLength 
     for j -> 0 to (arrayLength - i - 1)
      if arr[j] > arr[j + 1]
        swap(arr[j], arr[j + 1])
}

Implementation - 

```javascript
import React from 'react'
import './App.css';

function App() {

// Creating the bblSort function
function bblSort(arr){
	
  for(var i = 0; i < arr.length; i++){
    
      // Last i elements are already in place
      for(var j = 0; j < ( arr.length - i -1 ); j++){
        
        // Checking if the item at present iteration
        // is greater than the next iteration
        if(arr[j] > arr[j+1]){
          
        // If the condition is true then swap them
        var temp = arr[j]
        arr[j] = arr[j + 1]
        arr[j+1] = temp
        }
      }
    }
 
  }
  
  
  // This is our unsorted array
  var arr = [234, 43, 55, 63, 5, 6, 235, 547,100,98,70,900,80,1];
  const UnSortedArray = arr.map((number) =>
      <li>{number}</li>
    );

  //function calling
  bblSort(arr)

  //this is our sorted array
  const SortedArray = arr.map((number) =>
      <li>{number}</li>
    );

  return (
    <div className='main-div'>
      <div className='bg-dark text-light text-center'>
        <h1 className='display-3 text-light my-3'>Unsorted Array</h1>
        <ul>
          {UnSortedArray}
        </ul>
      </div>
      <div className='bg-primary text-light text-center'>
        <h1 className='display-3 text-light my-3'>Sorted Array Using Bubble Sort</h1>
        <ul>
          {SortedArray}
        </ul>
      </div>
     

    </div>
  );
}

export default App
```

CSS Part - 

```css
.main-div{
  display: grid;
  place-content: center;
  grid-template-columns: repeat(2,1fr);
  padding: 2rem;
 
}

.main-div > div{
  border-radius: 10px;
  padding: 1rem;
}

ul{
  list-style-type: none;
  
}

ul > li{
  font-size: 25px;
}
```


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

NOTE -  I have used bootstrap in the code so please install it either through npm or using cdn.

THANK YOU FOR READING THIS POST IF YOU FIND ANY MISTAKE OR WANTS TO GIVE ANY SUGGESTION PLEASE MENTION IT IN THE COMMENT SECTION.
HELP: I can't contact dev.to
Published: 2021-11-18 13:17:19

Hi here I am asking for a help from community.I am creating this article without any tags. I'll delete this post when I received an answer.

Moderater said that my articles are spammy. And he is deleting some tags in my new articles.

I wanted to contact him but he wasn't responded. Then I wanted to contact yo@dev.to , but they wasn't replied to my email. I sent a msg to http://twitter.com/thepracticaldev , but no reply.

Please help me!!! How can I fix this.