teleren/devto huggingface dataset:
Build React Native Custom Checkbox Component for Android and iOS
Tags: react, native, android, ios
Published: 2020-03-04 19:13:45

---
title: Build React Native Custom Checkbox Component for Android and iOS
published: true
date: 2020-02-07 17:00:32 UTC
tags: React ,Native, Android, iOS
canonical_url: https://www.positronx.io/build-react-native-custom-checkbox-for-android-and-ios/
---

The post [Build React Native Custom Checkbox Component for Android and iOS](https://www.positronx.io/build-react-native-custom-checkbox-for-android-and-ios/) appeared first on [positronX.io](https://www.positronx.io).

In this tutorial, we are going to learn how to create a custom Checkbox component in React Native application for Android and iOS platforms. We will learn step by step how to get Multiple checkboxes values on button click using React Native APIs.

The Checkbox is and HTML element. It is a square box that can be checked (ticked) or unchecked, and it is used to select any number of values among given options.

> Checkboxes are used when there is a list of options, and the user may select any number of choices, including zero, one, or several. In other words, each checkbox is independent of all other checkboxes in the list, and checking one box doesn’t uncheck the others.  
> <small><a href="https://uxplanet.org/checkbox-and-toggle-in-forms-f0de6086ac41" rel="noopener noreferrer" target="_blank">

Let’s get started.

#### Table of Contents



[click here to read more](https://www.positronx.io/build-react-native-custom-checkbox-for-android-and-ios/)
Gaining confidence as a coder: Question - What concepts do you want to understand more intuitively?
Tags: beginners, codenewbie, career, discuss
Published: 2020-02-07 16:41:02

If we look at skills that we feel confident about in life, really confident about, they likely have one of these characteristic.

- It's something you've done before, exactly as is - cooking a staple dish
- It's something you've been doing for a long time - driving a car
- It's something you understand intuitively, you have solid mental models of the fundamental concepts - speaking a language

Programming is hard. But not necessary harder than many other skills we all have mastered with practice since we were toddlers.

The actual physical skill of transferring an idea into keystrokes to make a machine do a thing that was in your mind is learn-able by practice (just like learning to write words to express your thoughts).

But there is a also a psychological component, constant work is required to maintain a productive mindset. There are ups and downs and this take a tole on our minds.

Feeling like you're making progress, getting better, gives you the confidence to keep practicing the physical skill of typing keystrokes into a machine to make it do what you want it to do.   
 
Another thing that has been key for me is developing intuitive understanding of foundational concepts. This give you the feeling of "I have no idea how to implement this, but I know I can figure it out". I know I *will* figure it out. That is a wonderful feeling. There might be a lot of work ahead (physical work, the labor) but there is this bedrock of a calm confident mind. It's an ongoing process and after 15 years I believe that this is a feeling worth chasing.

So if you're at the beginning of this journey, is there some fundamental concept that you desire to understand better? which you feel will move you closer to this confidence feeling?

I am asking because maybe I can make that happen by writing about it here!
Django News - Issue 9
Tags: django, python
Published: 2020-02-12 03:14:20

---
title: Django News - Issue 9
published: true
date: 2020-02-07 16:19:30 UTC
tags: django, python
canonical_url: https://django-news.com/issues/9
---

## News

### [Django security release: 3.0.3, 2.2.10, 1.11.28](https://cur.at/mswhvRB?m=rss)

This update fixes a potential SQL injection bug in Django. As ever, the safest strategy for security is to stay on the latest release!

----

### [Django Riffs, a podcast for learning Django](https://cur.at/eYoSuza?m=rss)

Announcing Django Riffs, a new podcast aimed at helping beginners learn how to use Django by Matt Layman.

----

## Articles

### [How I'm Testing in 2020](https://cur.at/MzW3Htz?m=rss)

From long-time Django core contributor James Bennett, a deep-dive on modern Python and Django testing techniques.

----

### [Common Celery Issues on Django Projects](https://cur.at/Ma0Mmdd?m=rss)

Celery is an extremely popular task manager. This article is a great overview of common issues you might encounter using it with Django.

----

### [Asynchronous tasks in Django with Django Q](https://cur.at/1JRpWqS?m=rss)

A detailed tutorial on using [django-q](https://cur.at/v00B33N?m=rss), a popular way to handle async tasks.

----

### [Learn Django - The 10 Most-Used Django Packages](https://cur.at/KPeXxxc?m=rss)

A somewhat surprising look at the most popular Django-related packages based on PyPI downloads.

----

## Podcasts

### [Django Chat Podcast - Growing Old Gracefully as a Programmer](https://cur.at/fkK2Dxl?m=rss)

Deep thoughts on how to maintain a career as a programmer.

----

### [Django Riffs - Get To Know Django](https://cur.at/6fB3DDL?m=rss)

A new podcast from popular Django teacher Matt Layman.

----

## Projects

### [django-graphql-auth](https://cur.at/eQz6bRx?m=rss)

Django registration and authentication with GraphQL.

----

### [django-sesame](https://cur.at/Fg7zBVZ?m=rss)

"Magic Links" - URLs with authentication tokens for one-click login

----

This RSS feed is published on [https://django-news.com/](https://django-news.com/). You can also subscribe [via email](https://django-news.com/#cta-newsletter).
5 programming languages you should learn in 2020
Tags: python, java, ruby, csharp
Published: 2020-02-07 16:06:11

Learning programming in a different era, at different age is completely different. Today programming has become fairly simple to learn. So many easy to pick languages are there for kids. Their syntax is easy to learn and kids can easily build the fundamentals of coding concepts to apply their knowledge practically in creating some amazing games or websites. Teaching programming to the kids helps in building other skills as well. They become good in mathematics, reading and develop good problem solving and analytical reasoning skills.

Source : https://myinquisitor.in/5-programming-languages-you-should-learn-in-2020/
Serverless Side Render
Tags: serverless, javascript, lambda, webdev
Published: 2020-02-07 15:42:48

---
title: Serverless Side Render
published: true
description: Learn how to implement SSR inside a serverless function - check out this very detailed article.
tags: serverless, javascript, lambda, webdev
cover_image: https://miro.medium.com/max/4800/1*wJmWlW5rkKTBJm2qMZqvcg.png
---

This is a shortened version of a very long and detailed article published here. https://blog.webiny.com/serverless-side-rendering-e1c0924b8da1

The article talks about our experience of implementing SSR mechanism for Webiny Serverless CMS. Many of our findings are transferable to other solutions so it will hopefully provide you with some useful insight.

In short (and believe me, this is short): 

- single page applications (SPAs) are cool but unfortunately, have bad SEO support
- learn about different approaches of rendering on the web by checking out this Google article, and choose the approach that works best for your use case
- for the Webiny Page Builder app, we decided to try “Prerendering on-demand” (using chrome-aws-lambda) and “SSR with (re)hydration”
- implementing both of these approaches in the AWS cloud can be achieved with just a couple of serverless services — S3, Lambda, API Gateway, and CloudFront
- prerendering on-demand works and it’s a good approach if the initial loading screen (shown while the app is initializing) is not an issue in terms of UX, and SEO is your only concern, otherwise use SSR with (re)hydration
- allocate more RAM (1600MB+ ) to the Lambda function that will actually be doing the pre-rendering, and a minimum amount of RAM to the one that will be just serving static files (128MB or 256MB)
- although we didn’t try it, you would probably need to implement some form of caching of the prerendered content, so that you get a better SEO results by returning the initial HTML faster
- when implementing SSR with (re)hydration, allocate more RAM to the Lambda function that will actually be generating the SSR HTML
- in general, SSR is a resource-intensive task, which will prevent you from serving your website fast enough, so you will most likely need to implement some kind of caching
- we used CloudFront CDN to cache SSR HTML and depending on the app you’re building, choose between short and long-lived cache TTLs
- if going with the latter, know that you will need to do cache invalidation which can get tricky very quickly
- do cache-invalidation selectively, or in other words, if possible, invalidate cache only for pages that actually require it — this may save you significant amount money along the way (cache invalidation requests are charged by CloudFront)
- if the content is changing very frequently, use shorter TTLs because it’s more effective
- the good news is that, with Webiny, this is all handled and maintained for you, feel free to check us out if this sounds interesting 🚀 🙂

I hope you found this useful - make sure to check out the [full article](https://blog.webiny.com/serverless-side-rendering-e1c0924b8da1).
Por mais mulheres na tecnologia: Grupo de incentivo PHPWomen-BR
Tags: php, phpwomen
Published: 2020-02-07 16:03:51

Sabemos que a inclusão da mulher nas áreas de ciência e tecnologia é imprescindível para que inovações como essas aconteçam e transformem o mundo para melhor. Com isto, a comunidade PHPWomen vem trazendo eventos periódicos que estimulam e incentivam mulheres a programar, ajudando também a inseri-las no mercado de trabalho.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ad2zrj5t9n412bo9oz8g.jpeg)

No dia 20 de julho de 2019, aconteceu mais um encontro do PHPWomen, na Infnet, unidade Rio de Janeiro. Uma das responsáveis pela coordenação é a mentora Daiane Alves, analista de sistemas e estudante de Sistemas de Informação. Um evento de mulheres organizados por mulheres, que contou com a colaboração de Adriele Ribeiro, professora da FUNDEC, ministrando aulas de programação, dando uma oficina de quase 8 horas de estudo, exercícios práticos e aperfeiçoamento da linguagem PHP. As participantes contaram com mentorias técnicas para quem estivesse com dúvidas, pela engenheira de software Bruna Leiras e pela Designer UI Luanda Pereira.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/88fov03b91r4qt58flgn.jpeg)

Em sua 2ª edição, o evento da comunidade PhpWomen vem trazendo oficinas e palestras com exercícios abordando a documentação do php.net, com uma didática multidisciplinar e metodologia de aprendizado colaborativo, se tornando um encontro de mulheres de tecnologia e desenvolvimento no Rio de Janeiro, onde mais iniciantes estão se interessando a aprender a programar e a estarem avançando em seus estudos.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ksf2vjkpbfyzcbdc2a6w.jpeg)

Caso você tenha interesse em conhecer PHPWomen, é um movimento de mulheres na tecnologia pelo mundo. No Rio você pode acessar Meetup (https://www.meetup.com/pt-BR/topics/php-women/br/) ou participar pelos grupos do Telegram PHPRio, comunidade aberta de pessoas que trabalham com PHP.
Built a full-stack web app in React + TypeScript + GraphQL + PostgreSQL
Tags: react, graphql, typescript, node
Published: 2020-02-07 15:56:28

---
title: Built a full-stack web app in React + TypeScript + GraphQL + PostgreSQL
published: true
description: The web app built with some sweet technologies
tags: react, graphql, typescript, node
---

Hi there!

Probably some of you know about [Codeforces](https://codeforces.com). It is the website built for competitive programmers to let them practice their problem-solving skills.

I have built an app [Laddy](https://laddy.app) that shows problems for your Codeforces rating so you can solve them and improve throughout the time. This app is inspired by [A2OJ](https://a2oj.com) which is retired by now.

Even though if you are not into competitive programming, you will be probably interested in the source code of Laddy which you can find on [GitHub](https://github.com/ironsoul0/laddy). It uses some cool technologies under the hood like TypeGraphQL, TypeORM, React + Typescript, Lerna for managing the monorepo, etc.

Any suggestions for code improvement are more than welcome!

If you want to register but do not have a Codeforces handle, just copy-paste mine - **ironsoul** (just for testing).
What to do if my current workplace doesn't allow me to do what I want in my free time?
Tags: anonymous
Published: 2020-02-07 15:37:08

---
title: What to do if my current workplace doesn't allow me to do what I want in my free time?
published: true
description: 
tags: anonymous
---

I'm working for a big multinational corporation as a developer. I decided to do some side-projects and coding in my free time, after work hours.
But the company does not allow me to do the following after work hours:

- **Contribute to open-source projects** - If I do, I need to get written approval from the company for each repository I would like to contribute to.
- **Do any kind of side-projects which are related to coding** - As they think I will be their competitor. They have billions of revenue each year...

After I realized how much they are limiting my free will, I started to look for other jobs. 

The problem is that if I make my side projects public, they could sue me. But, if I don't do it, how should I get a job, without anything to show in the interview or in the application?

Was somebody in the same situation? What can I do?

I prefer a remote job, as I do not want to relocate my whole family. But, it's hard to find without any 'portfolio' to show. I have several IT skills besides coding as I'm working for 10 years in IT.
Quick JavaScript tip #2: declare global variables from a function
Tags: javascript, tip, variables
Published: 2020-02-07 15:03:20

In JavaScript, variables declared using <code>var</code> are local if declared from within a function, or otherwise global. That means that a variable declared inside a function can only be accessed from within that function.
Here's an example:
```javascript
var x = "Hello World";

function myFunc() {
  var y = "Hi";

  console.log(x); // "Hello World"
  console.log(y); // "Hi"
}

console.log(x); // "Hello World"
console.log(y); // Uncaught ReferenceError: y is not defined 
```

But once in a while, you'll find yourself having to declare a global variable from a function. How can that be achieved? Let's start by understanding how global variables work.

When you declare a global variable in JavaScript, it actually creates a property of the window object. Here's an example:
```javascript
var x = "Hello World";

console.log(x); // "Hello World"
console.log(window.x); // "Hello World"
```

This means that to declare a global variable from a function, you can manually set it as a property of the window object, like so:
```javascript
function myFunc() {
  window.x = "Hello World";
}

console.log(x); // "Hello World"
```
Laravel Vue JS Axios Get Request Example
Tags: laravel, vue, axios
Published: 2020-02-07 14:55:36

Hi Artisan

In this tutorial i will discuss step by step about laravel axios get request example. I have already made a tutorial on laravel axios post example some day ago. If you dont know how to make laravel axios post. Then you cam read this below article.

https://www.codechief.org/article/laravel-vue-js-axios-get-request-example
React's Tic-Tac-Toe using React Hooks
Tags: react, reacthooks, javascript, frontend
Published: 2020-02-07 14:47:35

---
title: React's Tic-Tac-Toe using React Hooks
published: true
description: React Tic-Tac-Toe using React Hooks
tags: #react #Reacthooks #javascript #frontend
---

Hello All,
As I am learning react hooks, this is my take in changing react's tic-tac-toe game code to use hooks. 

I will jump straight to code as the documentation in reactjs.org is one of the best I've ever seen. https://reactjs.org/tutorial/tutorial.html#what-are-we-building

Functions remains same as their class counterpart: 
```Square(props), Board(props) and calculateWinner(squares) ```

The "Game" component is changed to functional component and is using hooks now.


```javascript

const Game = () => {
      const [history,setHistory] = React.useState([{ squares: Array(9).fill(null) }]);
      const [stepNumber, setStepNumber] = React.useState(0);
      const [xIsNext, setXIsNext] = React.useState(true);
      const [status, setStatus] = React.useState("");

      const handleClick = (i) => {
        const hist = history.slice(0, stepNumber + 1);
        const current = hist[hist.length - 1];
        const squares = current.squares.slice();
        if (calculateWinner(squares) || squares[i]) {
          return;
        }
        squares[i] = xIsNext ? "X" : "O";
      
        setHistory(hist.concat([{ squares }]));
        setStepNumber(hist.length);
        setXIsNext(!xIsNext);
      }
    
      const jumpTo = (step) => {
        setStepNumber(step);
        setXIsNext((step % 2) === 0);
      }
      
 
      const moves = history.map((step, move) => {
        const desc = move ?
          'Go to move #' + move :
          'Go to game start';
        return (
          <li key={move}>
            <button onClick={() => jumpTo(move)}>{desc}</button>
          </li>
        );
      });
      
      let current = history[stepNumber]; 
      let winner = 0; 
      React.useEffect(()=> {
        current = history[stepNumber];
        winner = calculateWinner(current.squares);    
        
        if (winner) {
          setStatus("Winner: " + winner);
        } else {
          setStatus("Next player: " + (xIsNext ? "X" : "O"));
        }

      });
    
      return (
        <div className="game">
          <div className="game-board">
            <Board
              squares={current.squares}
              onClick={i => handleClick(i)}
            />
          </div>
          <div className="game-info">
            <div>{status}</div>
            <ol>{moves}</ol>
          </div>
        </div>
      );

    }

```

I am updating the status and calculating the winner in a useEffect hook as this will be called at every render (update).

The working code: https://codepen.io/kuldeep-bora/pen/QWbWPrY
Rodando o Apache Kafka localmente
Tags: apachekafka, kafka, brailizandevs, microsservicos
Published: 2020-02-07 14:47:27

---
title: Rodando o Apache Kafka localmente
published: true
description: Nesse artigo, vou mostrar como rodar localmente o Kafka em uma Máquina Windows.
tags: ApacheKafka, Kafka, BrailizanDevs, Microsservicos
series: Entendendo o Kafka
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/vjb2xa2hwzvtgdks1x9v.png
---

Continuando a série de **Entendendo o Kafka**, vou criar aqui um pequeno tutorial de como rodar o Kafka localmente em ambiente Windows. 

Para desenvolvimento, recomendo usar containers Docker. Porém, para aprendizado vale a pena configurar um cluster manualmente.

# Configurando

1. Instale o JDK 8
2. Baixe a última versão do Kafka em [https://kafka.apache.org/downloads](https://kafka.apache.org/downloads)
   * Há várias versões baseadas na versão do Scala, escolha qualquer uma delas. Vamos usar a **kafka_2.12-2.4.0** por ela estar recomendada no site.
3. Extraia o arquivo
   * No Windows a extensão **.tgz** não é muito amigável, mas você precisa das ferramentas corretas. Dica, use o [7-Zip](https://www.7-zip.org/). Com ele dá pra extrair usando o menu de contexto do mouse. 
4. Feito! Não é necessário nenhuma configuração a mais. Para melhor organização eu sempre instalo em `C:\opt`, ficando o Kafka com o PATH `C:\opt\kafka`.


# Iniciando o Servidor Kafka

O Kafka depende do Zookeeper. Este é um serviço para sincronia de configurações. Provavelmente será removido em futuras release. Mas por enquanto é necessário.

Para iniciar o Kafka, abra duas linhas de comando e execute a partir da pasta de instalação do Kafka:

```
.\bin\windows\zookeeper-server-start.bat config\zookeeper.properties
```

```
.\bin\windows\kafka-server-start.bat config\server.properties
```

Pronto! Você tem um Kafka **_Up & Running_**!

## Testando o Cluster

Para testar o cluster, a instalação do Kafka já vem com alguns scripts preparados. 

Primeiro precisamos criar um tópico para enviar mensagens. Isso pode ser feito com a linha abaixo:

```
.\bin\windows\kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
```

Após criado o tópico é só, a partir de duas janelas, executar as seguintes linhas abaixo:

```
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-beginning
```

![Kafka Consumer](https://dev-to-uploads.s3.amazonaws.com/i/x6zzoik8zb1a66ytivow.png)

```
.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic test
```

![Kafka Producer](https://dev-to-uploads.s3.amazonaws.com/i/3plxrkla0kra0g7ga46p.png)

A primeira inicia um consumidor do Tópico `test` e a segunda um produtor. Cada mensagem escrita na segunda será enviada para a primeira.


# Conclusão

É fácil configurar um servidor Kafka para testes. Em outra oportunidade vou compartilhar como utilizar uma imagem docker, mas por enquanto apenas com o JDK 8 instalado é possível fazer essa configuração de qualquer ambiente.
Angular Version 9 Released
Tags: angular, javascript, news, opensource
Published: 2020-02-07 13:17:14

Here is the next benchmark in the life-cycle of the popular JavaScript framework, Angular. Version 9 has finally RELEASED TODAY with improved testing components. This release is expected to transform the scope of the entire platform including CLI and Angular Material. 

Now, Angular developers can contribute with better efforts to their community. Here is what the Angular team has to see about the major release:

“This is one of the biggest updates to Angular we’ve made in the past 3 years, and we’re excited for all of the ways it empowers developers to build better applications and contribute to the Angular ecosystem.”

Undoubtedly, we have the same excitement and enthusiasm to update to Version 9. A major highlight of the release is the **Ivy compiler and run-time**. The new version will move all the apps to Ivy by default. This will have incredible benefits and some of them are mentioned below:

>Smaller bundle sizes
Faster testing
Better debugging
Improved CSS class and style binding
Improved type checking
Improved build errors
Improved build times, enabling AOT on by default
Improved Internationalization


Lets’ talk about the addition of the components in Angular Version 9 in brief:

>This version will allow the inclusion of capabilities from **Google Maps and YouTube** to your apps.
 New components for these platforms are being released to make it easy to render YouTube Player and Google Maps. 
These components will allow adding interactivity in a way that will work as a usual Angular component.
This will save developers from learning the complete Google Maps API.
**IDE & language service improvements:** it is a drastic improvement in Angular language service extension. Many long-lasting bugs have been fixed along with stability and performance issues. 
**TypeScript 3.7 support:** Now you can work on TypeScript 3.6 and 3.7.

Apart from the improvement offered by the integration of apps to **Ivy compiler and runtime**, there are some other improvements as well. Read this complete blog by Angular to know about them ~ [Angular Version 9](https://blog.angular.io/version-9-of-angular-now-available-project-ivy-has-arrived-23c97b63cfa3).