teleren/devto huggingface dataset:
Signing Up For GitHub
Tags: github, git, githubeducation, githubfree
Published: 2022-03-19 05:51:51

Signing up for a new GitHub account is simple; if you already have a GitHub account, you might be going to the next lesson, which is to explore GitHub Services in more detail. For Students, A GitHub Student Developer might be helpful; you can apply with your university email. For teachers, GitHub also provides a Special Toolkit.

## Setup GitHub account

Joining GitHub is very easy. Firstly, go to GitHub SignUp Webpage and enter the unique GitHub username, email address, secure password, verify yourself, and click on create an account. 
Check your email; you will receive an email from GitHub for the email verification.
You can skip personalization or provide the required details so that GitHub can personalize some features for you, like a Student Developer Pack or a Special Pack for Teachers.
Right now, click on the continue with free; I will let you know how you can apply for the GitHub student developer pack if you are a current student.
Hurray ✨ Now you are officially on GitHub.

Let's Discuss **GitHub Pricing** briefly.

## GitHub pricing

GitHub has three pricing tiers, starting with **free tier** having unlimited private and public repositories, 2000 minutes/month for automation, which we will use during the course, as a GitHub Action tool and community support. In the **Team pricing tier**, we have code spaces, 3000 minutes/month for automation, and 2 GB of Packages storage. In the **Enterprise tier**, we have 50,000 automation minutes/month and 50 GB of Packages storage exclusively used for the prominent organization.
Students can avail GitHub student developer pack, which provides the Team tier to the students to collaborate efficiently. Next, I will explain how students can avail themselves GitHub student developer pack. 

## About GitHub Student Developer Pack

The GitHub Student pack is specially designed to avail themselves of domains, hosting, and learning resources free of cost. With the student developer pack, they can help themselves with the Team tier, through which they can benefit more advantages on the GitHub Platform.

## Summary

In this lesson, we learn how to create your first GitHub account, about the different pricing tiers of GitHub and how students and teachers benefit from the GitHub programs. I hope you have your GitHub Account, so let us get started to explore more about GitHub in the next lesson.

### Appendix
- https://github.com/join
- https://education.github.com/pack
- https://education.github.com/toolbox


If you have any question, please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/adilshehzad7/).  

* [Understanding Git Remote](https://dev.to/adilshehzad786/understanding-git-remote-jjh)
* [Back to Main](https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061)
HttpPostedFileBase
Tags: csharp
Published: 2022-02-09 07:02:38

My requirement was to send the file through the mail and save the file in binary format.

**Issue faced**
File content length became 0 after converted to the byte array.

**Solution** 

1) Created a class with properties

```
public class Model_File
    {
        public string FileName { get;private set; }
        public string ContentType { get; private set; }
        public byte[] Contents { get; private set; }
        public Model_File(string FileName, string ContentType, byte[] Contents)
        {
            this.FileName = FileName;
            this.ContentType = ContentType;
            this.Contents = Contents;
        }
    }
```

2) Read all the file using binary reader and store  in a  List of class

```
public static List<Model_File> Get_File(HttpPostedFileBase[] postedfiles)
{

var Result =new List<Model.Model_File>();
if (postedfiles.Length != 0)
            {
                foreach (var item in postedfiles)
                {
                    if (item.ContentLength != 0)
                    {
                        var R = Try_Byte(item, "Attachment");                       
                        if (R != null)
                        {
                            Result .Add(R);                            
                        }
                    }
                    
                }
            }
return Result;
}

private static Model_File Try_Byte(HttpPostedFileBase F,string CType)
        {
            Model.Model_File Result = null;
            if (F != null && F.ContentLength!=0)
            {
                using (BinaryReader dr = new BinaryReader(F.InputStream))
                {
                    byte[] content = dr.ReadBytes(F.ContentLength);
                    return new Model_File(F.FileName, CType, content);
                }
            }
            return Result;
        }

```
 3) To Send these files in mail - Create the attachment and add to the mail message 

```
public static void Send(List<Model_File> _Files)
{
MailMessage msg = new MailMessage()

if(_Files.count!=0)
{
_Files.foreach(delegate(Model_File F){

var _Attachment=Get(F)
if(_Attachment!=mull){
msg.Attachments.Add(_Attachment);
}

});
}
}
```


```
private static Attachment Get(Model_File F)
        {
            if (F != null && F.Contents!=null && F.Contents.Length!=0 && !string.IsNullOrWhiteSpace(F.ContentType))
            {
               return new Attachment(new MemoryStream(F.Contents), F.FName);
            }
            return null;
        }

```

4) Get the result- List of Model_Files objects and inserted to the database in varbinary format.For that I created the column in table with an attribute varbinary(max).
 
**Issue **
Cant covert to varbinary to varchar - this error got when added like a normal parameter.

**Solution**
Then i  declared the parameter  as below.

`Command.Parameters.Add("@Attachment", System.Data.SqlDbType.VarBinary, -1).Value = (A.Contents == null ? (object)DBNull.Value : (object)A.Contents );`
10 tips from 10 years of android development experience
Tags: android
Published: 2022-03-19 05:38:25

Developing an android app is not easy as there are thousands of different possible combinations of OEM, hardware, and Android versions.

I have developed apps that are used by a few users to millions of users.

You can read full article here [10 tips from 10 years of android development experience](https://blog.canopas.com/10-tips-from-10-years-of-android-experience-dd9a009bd51)
How does the Blockchain work?
Tags: blockchain, ethereum, crypto, bitcoin
Published: 2022-03-19 05:20:33

**Any idea about Blockchain?**

**Well**,

Let's see first, what Blockchain is! and then we will discuss how it works.

Blockchain is a chain of data blocks stored in hundred or thousands or even millions of computers (servers) distributed over a wide geographical area. It is a complete ledger that maintains a copy of all the credit/debit transactions of digital assets. It is based on decentralized technologies.

Eg. Bitcoin is a great example of a blockchain application or we can say it works on decentralized principle. That means when a new Node(server) is added to the bitcoin network, it is impossible to modify or delete that node. It works on a Peer-to-Peer(P2P) network, where each Peer acts as a server.


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

This diagram describes how a P2P network is established in a blockchain network.

I'm pretty sure, now you have got an idea about blockchain and P2P networks.

Great!

Now, let's see how blockchain works.

Excited?

Me too!

We can define the blockchain as a system that allows the group of connected computers to maintain a single updated and secured ledger. As we know blockchain is consists of a chain of blocks, for every new transaction, a new block needs to create.

So, how a block(node) is created inside the blockchain network?

The very first step of creating a block is, a user must request for a transaction to be added to the blockchain network, also that transaction must include some required information(like transaction id, hash id, timestamp, etc).

After the transaction is verified, the second step is, a new block is created into the blockchain network(but not added).

Once a block is created, then it will broadcast to a P2P(Peer-to-Peer) network. P2P networks also consist of blocks(nodes). Then, the one P2P node verifies the transaction.

After successfully verifying, the transaction again moves to the next stage, that is, other nodes in that network also need to verify, since all nodes are interlinked with each other.

and here comes to the last stage, that is

Once the transaction is validated by other nodes in the network, then the block is ready to go. And now, the block(transaction) is added to the existing blockchain network.

That is how the blockchain works.

I know it is kind of a bit confusing if you are new to blockchain. But trust me, once you understand it, it will be fun for you.

Like me :) haha

Cool!

Thanks for reading my article.

See you soon with a new topic!

Till then, drink coffee and write code
HasAllChildren
Tags: javascript, webdev, beginners
Published: 2022-03-19 05:16:44

The below is a function to check if an sub array consist of all the elements of a given array.

```
const hasChild = (array, child) => {
	const ruleA = array !== undefined;
	const ruleB = child !== undefined;
	const ruleC = array.find(c => c === child) === child;
	return ruleA && ruleB && ruleC;
}

const hasAllChildren = (array, subArray) => {
	const ruleA = array !== undefined;
	const ruleB = subArray !== undefined;
	const ruleC = subArray
		.filter(c => hasChild(array, c))
		.length === array.length;
	return ruleA && ruleB && ruleC;
}
```

Now, What this function `hasAllChildren(array, subArray)` does when called is checking if all items match to be available in the array. 

Notice - This method does not check if these passed arrays are equal. It simply checks if the elements are available.

First it checks all the arguments passed to our method are defined.

1. array (original array)
2. subArray (comparing array)

For each element we need to check if element is available in the array. We need `hasChild(array, child)` to do this. It finds the element in the array and returns `true` if found. For all `subArray` elements it needs to return true;

The reason to check if `undefined` is that if not it returns `true`.

If all elements contains we can say that count of all checked available items is equal to the original array's size.

Finally we return if all rules and checks passed by returning 
`ruleA * ruleB * ruleC`.

Thank for reading.
An Analogy about DevRel
Tags: devrel, avocados, devadvocate, analogy
Published: 2022-03-19 22:55:16

---
title: An Analogy about DevRel
published: true
date: 2022-03-19 05:00:00 UTC
tags: devrel,avocados,devadvocate,analogy
canonical_url: https://nimbinatus.com/2022/03/19/devrel-bnb-analogy/
---

So I’ve had a few folks who apparently liked my developer relations (DevRel) analogy that JJ Asghar outed for me at our panel on community building for GAN and Orbit for SXSW this year. So, since folks are asking, I'm replicating it here:

So imagine your company is a bed and breakfast in a quaint little town. Your engineering team and product team are all the people keeping things running, from cooking to cleaning to fixing. They work their tails off to make the bed and breakfast a great experience. The sales team is the folks who greet you at the door. They help you find your room, or they seat you at your table. They’re working with your business ops folks to ensure the money is gathered and counted so everyone can keep doing what they’re doing. The marketing team, meanwhile, are the folks making the front porch the most welcoming place to be. They’re maintaining the lawn, keeping the paint sparkling (and shiny compared to the neighbors), and ensuring that anyone who sees the building is drawn to it.

So where’s DevRel in all this? Well, they’re out in the town square five or six blocks away. They’re helping folks find where they’re going, they’re explaining the town’s history to passersby, they’re recommending restaurants to tourists. Oh, and they’re wearing the bed and breakfast’s logo and recommending it as a place to stay or eat with a wink and an “Of course, I’m a bit biased as they ensure I can be out here to help you.” People respond well; they go find the bed and breakfast that this nice, helpful person talked about.

DevRel professionals are out in front of your company, introducing the company to new communities by being the helpers and the teachers and driving a positive association so it’s easier for sales to call out and encourage someone to come in for a glass of sweet tea. People like me are trying to be 2-5 years ahead of where the company is now, laying the groundwork for the company so when it’s time to introduce yourself to a new community, they’re already interested in listening to you. We're making sure everyone has a great experience, one person at a time. Because that's how you win communities' hearts (and their minds will follow when they experience your product, hopefully). As some smarter folks than me said, "It's up to us to ensure they know we're here."

(I originally put this up as a thread on Twitter, in case you want to [explore the original](https://go.nimbinatus.com/devrel-analogy).)
Qué es Frontend y Backend?
Tags: frontend, webdev, beginners, backend
Published: 2022-03-19 04:59:39

Imagina un auto, la carrocería vendría a ser el Frontend, y dentro del auto hay muchos sistemas y servicios con los cuales el auto funciona, a ese conjunto de sistemas y servicios le llamaremos Backend.

![Star Wars Mechanic fixing a Landspeeder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bkyrfycq3z1ixhm7svk8.jpg)

Siguiendo esa analogía, si el carro no avanza, nos corresponde levantar el capó y revisar que todos estos sistemas y servicios funcionen correctamente. O quizás queremos aumentar el torque o caballos de fuerza. De este trabajo se encargaría un Backend Developer.

Si queremos cambiar el color o la forma del carro, corregir ciertos daños visuales o mejorar el aerodinamismo debemos llamar a un Frontend Developer.

### En la práctica, ¿de qué se encarga un Frontend Developer?

Un Frontend Developer se encarga de:

- Maquetación: Escribir código HTML y CSS para construir una vista fiel al diseño.
- Integración: Hacer llamadas a servicios externos para consumir o enviar datos.
- Aseguramiento de la calidad: Escribir tests para validar que lo que se aporta no genera errores. Ayuda a mantener código limpio, legible y fácil de mantener.
- Optimización: Mejorar las métricas de la aplicación tales como tiempos de carga, consumo de memoria, etc.

Otras actividades:

- Diseño: Apoya con ideas o toma responsabilidad del diseño de las interfaces de Usuario.
- UI: Conoce y aplica buenas prácticas de diseño de Interfaces de Usuario.
- UX: Conoce y aplica buenas prácticas de diseño de una buena experiencia de Usuario.
- Arquitectura: Se encarga de diseñar la arquitectura usando patrones de diseño y patrones de arquitectura para Frontend.

![A Frontend Developer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6x6xcg7100rscleouxhv.jpeg)

### Y, ¿De qué se encarga un Backend Developer?

Un Backend Developer se encarga de:

- Bases de Datos: Diseña y mantiene una base de datos.
- APIs: Diseña APIs y crea servicios que serán usados en un cliente (web, mobile, etc).
- Aseguramiento de la calidad: Escribir tests para validar que lo que se aporta no genera errores. Ayuda a mantener código limpio, legible y fácil de mantener.
- Optimización: Mejorar las métricas de la aplicación tales como tiempos de respuesta, consumo de memoria, etc.

Otras actividades:

- Seguridad: Se encarga de la seguridad del sitio, certificados de seguridad, autenticación, listas de control de acceso, manejo de sesiones, proxys y VPNs, etc.
- Infraestructura: Se encarga de proveer y configurar los servidores donde están desplegados los distintos ambientes de la aplicación, entre muchas otras cosas más, es todo un mundo por aprender y descubrir.


![A Backend Developer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdczlri2e96klqihgh0e.jpg)

Y tú, ¿para qué lado te inclinas más?
Hi-Lo
Tags: go, programming
Published: 2022-03-10 07:16:38

---
title: Hi-Lo
published: true
date: 2022-01-21 10:26:00 UTC
tags: Go, programming
canonical_url: https://defer.cc/b/hi-lo/
---

Inspired from [this blog post](https://ovid.github.io/blog/programming-in-1987-versus-today.html) and [basic-computer-games](https://github.com/coding-horror/basic-computer-games).

> This game is an adaptation of the game GUESS; however, instead of just guessing a number between 1 and 100, in this game you win dollars when you guess the number. The directions, in the words of the author, are as follows:

```go
package main
import (
   "fmt"
   "math/rand"
   "strings"
   "time"
)
const (
   MAX_ATTEMPTS = 6
   MIN = 1
   MAX = 100
)
func welcome() {
   fmt.Println("HI LO")
   fmt.Printf("CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n")
   fmt.Printf("THIS IS THE GAME OF HI LO.\n")
   fmt.Printf("YOU WILL HAVE %d TRIES TO GUESS THE AMOUNT OF MONEY IN THE\n", MAX_ATTEMPTS)
   fmt.Printf("HI LO JACKPOT, WHICH IS BETWEEN %d AND %d DOLLARS. IF YOU\n", MIN, MAX)
   fmt.Println("GUESS THE AMOUNT, YOU WIN ALL THE MONEY IN THE JACKPOT!")
   fmt.Println("THEN YOU GET ANOTHER CHANCE TO WIN MORE MONEY. HOWEVER,")
   fmt.Printf("IF YOU DO NOT GUESS THE AMOUNT, THE GAME ENDS.\n\n\n")
}

func play() {
   total_winnings := 0
   for {
      secret := randomNumber()
      guessed_correctly := false
      for i := 1; i <= MAX_ATTEMPTS; i++ {
         var in int
         fmt.Printf("YOUR GUESS: ")
         _, err := fmt.Scanf("%d", &in)
         if err != nil {
             panic(err)
         }
         if in == secret {
            fmt.Printf("GOT IT!!!!!!!!!! YOU WIN %d DOLLARS\n", secret)
            guessed_correctly = true
            break
         } else if in > secret { 
            fmt.Printf("YOUR GUESS IS TOO HIGH.\n")
         } else if in < secret {
            fmt.Printf("YOUR GUESS IS TOO LOW.\n")
         }
      }
      if guessed_correctly {
         total_winnings += secret
         fmt.Printf("YOUR TOTAL WINNINGS ARE NOW %d DOLLARS\n", total_winnings)
      } else {
         fmt.Printf("YOU BLEW IT...TOO BAD...THE NUMBER WAS %d\n", secret)
      }
      fmt.Printf("\n")
      fmt.Printf("PLAY AGAIN (YES OR NO)?: ")
      var answer string
      _, err := fmt.Scanf("%s", &answer)
      if err != nil {
         panic(err)
      }
      if strings.ToUpper(answer) != "YES" {
         fmt.Printf("\nSO LONG. HOPE YOU ENJOYED YOURSELF!!!\n")
      break
      } else {
      }  
   }
}

func randomNumber() int {
   rand.Seed(time.Now().UnixNano())
   return rand.Intn(MAX-MIN+1) + MIN
}

func main() {
   welcome()
   play()
}

```

[Hi-Lo on GitHub](https://github.com/mnlwldr/Hi-Lo/)
100 días de código: 87, un avance más de mi blog
Tags: spanish, 100daysofcode, nextjs, beginners
Published: 2022-03-19 04:24:03

¡Hey hey hey!

Hoy he comenzado a crear los estilos y componentes necesarios para mostrar mi blog de una forma adecuada.

Nunca había probado los estilos en módulos y ahora que comienzo a usarlos en Nextjs se sienten realmente útiles sobre todo para dividir y cargar solo el css necesario para una página.

Realmente solo he podido dedicarle el tiempo a eso debido a ciertos asuntos personales pero poco a poco he logrado avanzar bastante con este proyecto.

Ahora sigamos con la sección normal dónde digo lo que hice...

### Hoy
- Modifique algunos estilos anteriores de componentes de mi blog.
- Cree algunas media queries para los estilos en PC.
- Cree la estructura de un blog de ejemplo para revisar su correcta visualización.
- Practiqué Touch Typing.

Espero que tengan mucho éxito con sus proyectos y ánimo!

Hasta la próxima.
Reverse Integer
Tags: javascript, algorithms, career
Published: 2022-03-19 03:26:51

Don't get scared when it tells you that the integer is 32 bit. I had no idea what this was at first, but it just means the number has an upper bound and an lower bound number, meaning there are limits to its largest and lowest numbers.

We will start with the base case.

```

const reverse = (x) => {
 if (x < 0) return -1 * reverse(-x)
}
```

This line is important. If the number is negative, we will want to turn it into a positive number so we can break out of the if loop. 

```
const reverse = (x) => {
 if (x < 0) return -1 * reverse(-x)
 const solution = x.toString().split('').reverse().join('')

}
```

Next we will turn the number into a string, split it, reverse, then join it back together. 

Now let's finish it out.

```
const reverse = (x) => {
 if (x < 0) return -1 * reverse(-x)
 const solution = x.toString().split('').reverse().join('')

 if (solution > 2 ** 31 - 1) {
  return 0
  } 
  else {
 return solution
 }
```


The number has an upper bound of 2^31 -1. So, if the solution is greater than the upper bound we return 0. This is because it's too large to be in the bounds of our answer. 

If it's less, we can just return the solution.
Lessons from a Computer Science College Grad
Tags: computerscience, python, programming, beginners
Published: 2022-03-19 03:24:25

In December of 2021 I graduated with a degree in Computer Science. I've been working as a programming contractor for the USGS where I build python applications for them. I wanted to share some of the lessons I learned being in the workforce that aren't taught in school for other new programmers.


## 1. Don't Overcomplicate Your Code
If you can barely understand how your code works then how do you honestly expect others to? If your code is open source and going to be used by developers with a variety of skill levels make it easy to understand. Making your code will make it easier to maintain by decreasing the amount of time it takes to read your code. 

## 2. Write Down Your Problem Solving Process 
"The mind is messy, but paper is clean". When you're struggling to solve a complex problem writing it down takes the pressure of your brain by allowing you to offload your thoughts to the paper. This lets you clearly see the entire problem on one sheet of paper instead of a cluster of messy thoughts. It also makes the problem less intimidating by simplifying it to simple steps.

## 3. Take Notes on How to Set Up Your Dev Environment
You will forget how you set up your complex dev environment at some point. Use a tool like Notion to create a wiki where you can write down the steps you took to build your dev environment and never forget again.

## 4. Talk to Other Developers about Your Problems
Whether you are stuck on a problem or just need some inspiration talking with other developers lets you consider solutions and perspectives you would have never thought of. It helps you see the simplest and most effective solution because they aren't biased to the same solutions and mindset you are. Plus its fun!

### Check me out on GitHub 
I work on open source projects and I'd love to work with you.
https://github.com/2320sharon
วิธีแก้ไขปัญหา Bitbucket Cloud recently stopped supporting account passwords for Git authentication error
Tags: bitbucket, git, authentication, sourcetree
Published: 2022-03-19 03:23:25

**เนื่องจาก  bitbucket เปลี่ยนแปลงวิธีการ authen ในการใช้เข้าใช้งาน bitbucket ผ่านโปรแกรม sourcetreee**

่อ่านเพิ่มเติม
[https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231](https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231)

## วิธีการแก้ไข 

## Step 1 ต้องไปกำหนดค่า app password บน bitbucket ก่อน

1. เข้าไปที่เว็บไซต์ bitbucket.org website และ log in
2. ที่มุมล่างซ้ายให้ คลิกที่รูป Avatar และเลือกเมนู Personal settings
3. ใต้หัวข้อ Access management เลือกเมนู App Password
4. คลิกปุ่ม Create App password
5. กำหนด permission ให้กับ app ว่าทำอะไรได้บ้าง และกดปุ่ม create
6. อย่าลืมเก็บรหัสผ่านไว้ให้ดี

## Step 2 เปลี่ยนแปลงหรือสร้าง Bitbucket Repository ใหม่

กรณีมีอยู่แล้ว 
git remote set-url origin https://[Bitbucket_Username]:[App_Password]@bitbucket.org/[Repo_Name].git

กรณีสร้างใหม่
git clone https://[Bitbucket_Username]:[App_Password]@bitbucket.org/[Repo_Name].git