teleren/devto huggingface dataset:
Deberías colaborar en proyectos open source
Tags: community, developer, opensource
Published: 2019-06-01 23:08:39

---
title: Deberías colaborar en proyectos open source
published: true
tags: community,developer,open-source
---

Hace algunas semanas en las oficinas de google de sunnyvale se hosteo el “Google Developer Expert Summit” y tuve la “gran idea” de hablar sobre porque deberíamos trabajar en proyectos open source en nuestro tiempo libre.

Y toque varios puntos que me gustaría compartir con ustedes:

### - Yo haciendo OSS?

Claro, basicamente si sabes programar podes colaborar en OSS

> ¿Qué te diferencia de la gente que lo hace? Que ellos simplemente lo hacen!

Seguramente una persona que esta haciendo hace tiempo OSS sabra algunos trucos mas que vos a la hora de crear un PR o de entender y dialogar en los tickets abiertos… Pero no se nace sabiendo, se va aprendiendo todo…

Así que a la primera pregunta es un SI, tu código en proyectos open source es posible, solo tenés que tener ganas, tiempo y hacerlo.

### No es tan fácil!

Bueno, claro que no, pero nunca te topaste con uno de esos issues bien difíciles hasta que lo sacaste?

Bueno, es lo mismo, la diferencia es que posiblemente tenga el “síndrome del impostor”

![](https://cdn-images-1.medium.com/max/926/0*yKQQUkVVSfR4H6rW)

Claro que existe, lo dice wikipedia.

La verdad que a veces uno piensa que no esta “al nivel” de los que hacen “open source” pero la verdad es que si no empezás a hacer aunque sea cambios SUPER chiquitos, no vas a empezar nunca.

### ¿Por qué necesito contribuir en open source?

![](https://cdn-images-1.medium.com/max/498/0*ssFA3EJN4f0ZyXRn)

Esta es una de las preguntas que me hicieron varias veces… Y creo que es la más fácil de responder de todas.

- Vas a entender mejor la libreria/framework
- Vas a ayudar a otros desarrolladores
- Vas a tener una mejor vision del potencial de utilizar ese proyecto
- Vas a ayudar a las personas que te ayudan a vos (los mantainers)

> ¡Aprendes una nueva forma de ayudar y mejorar tus habilidades!

¿Cómo empiezo a colaborar?

Esta es una pregunta tal vez un poco mas trabajosa (?) , bueno en realidad no, una vez que arrancas te vas a dar cuenta que es más fácil de lo que parece… pero para mí, las mejores formas de arrancar son:

- Buscando en el proyecto los issues con label “good for first PR” / “community help”
- Busca algún mentor que haga OSS
- Busca la forma de comunicarte con el team que mantiene el proyecto
- No te avergüences por preguntar o por lo que estas haciendo

> Agradecer, no cuesta nada y alegra a muchos

![](https://cdn-images-1.medium.com/max/480/0*5uhbsJVA1k2iKWg1)

Cuando alguien te ayude o te de una mano, siempre tenes que ser agradecido, no te cuesta realmente nada… Y eso va a hablar bien de vos!

#### Espero que estos pequeños tips te sirvan para arrancar a colaborar con proyecto open source y lleves tus skills a otro nivel !!

Como siempre, espero que les guste lo compartido y cualquier duda dejo mis canales:

- [Jorge Cano (@jorgeucano) | Twitter](https://twitter.com/@jorgeucano)
- [Jorge Cano](https://www.youtube.com/channel/UCdp9sM22GW5uIOaU9eZ7n6w)

Saludos
React Native Troubleshooting Tips
Tags: reactnative
Published: 2018-12-06 10:32:20

---
title: React Native Troubleshooting Tips
published: true
description: Solutions to most of my React Native problems.
tags: react native
---

This list of tips is a work in progress.

**Tip # 1: Metro Bundler errors**, such as `ENOENT: no such file or directory, uv_cwd`
`jest-haste-map: watch error`

*jest-haste-map: watch error:
  Error: EISDIR: illegal operation on a directory, read at Object.fs.readSync (fs.js:690:18)...*

It's a good idea to keep an eye on the terminal running the Metro Bundler as a lot of errors - in particular bundling and syntax errors - will show up there. 

To fix the jest-hast-map or uv_cwd error and most of other problems not syntax-related run the commands

`$ killall node` 
(This command kills all node processes so it's admittedly a bit overkill, the Metro Bundler process is the one you want to kill, and by default the Metro Bundler runs on port 8081)
`$ rm -rf ios/build/ && react-native run-ios`
Removes the iOS build first and then runs the iOS simulator again.

`$ killall node` 
`$ react-native run-ios`

**Tip # 2 Unrecognized font family 'fontcustom' fix**

`$ react-native link`

You might need to specify the package name to link.

**Tip # 3: fix laggy iOS simulator**

The React Native iOS simulator can get very slow, so slow that even opening the dev tools menu has a very noticeable lag. 
If you are having this problem you should check that "Toggle Slow Animations" is not activated. 
In the iOS simulator, click on "Debug" -> "Toggle Slow Animations" should be unchecked. 

**Tip # 4: fix XCode's 'App installation failed -
The maximum number of apps for free development profiles has been reached.'**

Delete some apps that you have installed using the same profile from your device.
Go to "Window -> Devices and Simulators". 
Then delete any apps in the INSTALLED APPS section. 
Clean the project in XCode by using the SHIFT + cmd + K and try to build the project to iPhone again.

**Tip # 5: XCode's shows "No Filter Results" in the project navigator view**

Go to "Navigate > Reveal in Project Navigator".

**Tip # 6: Fix 99% of weird problems**

Delete the app in the simulator. 
Close the simulator.
Run all or a combination of the following commands:

`$ kill $(lsof -t -i:8081)`

Stops the Metro Bundler.

`$ rm -rf ios/build/` 
`$ watchman watch-del-all`
`$ rm -rf node_modules/`
`$ npm start -- --reset-cache`
`$ npm install` 
`$ react-native run-ios`

**Tip # 7: ~~Fix~~ "“blurTextInput” ~~is deprecated~~": un-deprecated in v0.58
    
`import { Keyboard } from 'react-native';`

 `<TextInput
  ...
  onBlur={Keyboard.dismiss()}
 />`

Correction: it appears that “blurTextInput” was deprecated and then un-deprecated in v0.58. Read more about it [on React Native's repo](https://github.com/facebook/react-native/commit/476a831ea09c25d0bbcb97a536c5bef76a1c8273#diff-b48972356bc8dca4a00747d002fc3dd5).

** Tip # 8: Unwanted black borders on iPad simulator 

In XCode's Project settings, go to the General tab.
Then go to the "Build Settings" tab. 
In the search bar, type "Targeted Device Family". 
Select "1,2".
Rebuild.
Conditional compilation and runtime module names in Go
Tags: go
Published: 2018-12-06 10:15:26

---
title: Conditional compilation and runtime module names in Go
published: true
description: 
tags: go, golang
---

Conditional compilation in Go language is a very nice feature but what if we want to know at runtime what modules we just compiled (do not confuse with the new Go modules!). We can define a file as a particular module of our application. So, knowing that if the files are compiled or not can be interesting but we haven't a standard mechanism to do this at runtime.

Let supose we have three dummy files `main.go`, `module1.go` and `module2.go` doing nothing and part of package `main`.

`main.go` file

    package main
    
    func main() {
    }

`module1.go` file

    //+build module1
    
    package main

`module2.go` file

    //+build module2
    
    package main


Build arguments are given at compile time as `tags`, eg.:

     go build -tags="module1 module2" -o test

Unfortunately the build args are no more accesible after the compiling process, nowhere are writen what was compiled and what not. If we want for example at runtime to print the efective compiled files we simply can't.

Here it come the tricky part. In Go `runtime` package we have the [Caller()](https://golang.org/pkg/runtime/#Caller) function who knows the current invocation file and can be used to identify if the file is compiled or not. So, our dummy program become like following.

`main.go` file

    package main
    
    import (
        "fmt"
        "path/filepath"
        "runtime"
        "strings"
    )
    
    var mods []string
    
    // include this in every init() function to detect linked modules
    func _init() {
	    _, file, _, _ := runtime.Caller(1)
	    mods = append(mods, strings.TrimSuffix(filepath.Base(file), ".go"))

    }
    func init() {
	    _init()
    }
    
    func main() {
	    fmt.Println(mods)
    }

`module1.go` file

    //+build module1
    
    package main
    
    func init() {
	    _init()
    }

`module2.go` file

    //+build module2
    
    package main
    
    func init() {
	    _init()
    }

We has defined `_init()` function which we will include in every `init()` functions from every module. At runtime `init()` functions will update an array of names which can be easy printed. The `Caller()` parameter mean the nesting level.

Running again.

    go build -tags="module1 module2" -o test
    ./test
    [main module1 module2]
    go build -tags="module1" -o test
    [main module1]

This technique suppose that you will have a consistency between the file name and build tags, so, be care to this aspect to avoid confusion.

Enjoy.
I got all the certificates from FreeCodeCamp! Ask Something or Share Something from/with me
Tags: opensource, discuss, showdev, ama
Published: 2018-12-06 10:03:27

---
title: I got all the certificates from FreeCodeCamp! Ask Something or Share Something from/with me
published: true
description: Seems like I'm the youngest one to claim all New and Legacy certificates of freecodecamp
tags: opensource ,  discuss , showdev , ama
cover_image : https://images.unsplash.com/photo-1529101091764-c3526daf38fe
---

It happened Today!
While still working for Google Code-in , I was able to complete all the left projects and claim all certificates from FreeCodeCamp including New and Old Ones.
AND after this , i got a thought in mind . . .

## If I'm the Youngest One to Claim All Certificates ??
Automation: 🤖 Use GitHub's bots to increase your productivity
Tags: github, bot, issues, contribution
Published: 2018-12-06 09:09:59

---
title: Automation: 🤖 Use GitHub's bots to increase your productivity 
published: true
description: Use GitHub's bots to increase your productivity with your open source project and automate, also like on autopilot
tags: github, bot, issues, contribution
cover_image: https://thepracticaldev.s3.amazonaws.com/i/9h2pedi0jb0xrq9mu032.png
---

 
At the time I write this article, I'm surprised to see that only few of GitHub's users having big projects use effectively the GitHub bots to manage their upcoming issues and PRs (just look at the number of installs for each bot). 

However, they can save you a previous time and cleanup and help better the contributors of your project.

## Best "Must-Have" ProBots (my top five)
1. [Lock](https://probot.github.io/apps/lock/)
2. [Stale](https://probot.github.io/apps/stale/)
3. [Auto-delete branches](https://probot.github.io/apps/delete-merged-branch/) on PRs, after they are merged.
4. [Request Info](https://github.com/apps/request-info) when a PR or issue contains either a default title or empty description. 
5. [CMTY](https://cmty.app) My favorite one 💖 (only beta access at this time).
6. [ImgBot](https://github.com/marketplace/imgbot) - To compress all your images of your repo (don't even required a yml config file to run).

I will keep it short for now 🙂 But hopefully it will already help! 💪

![Automate your GitHub Repository thanks clever bots](https://thepracticaldev.s3.amazonaws.com/i/1orq8k9ur37gje8l21vu.png)
How to reverse a list in Python
Tags: python, tipstricks, list, slice
Published: 2018-12-06 08:23:47

---
title: How to reverse a list in Python
published: true
description: Reversing a sequence object in Python takes only 1 line
tags: ["python", "tips&tricks", "list", "slice"]
canonical_url: https://www.christianbarra.com/posts/how-to-reverse-list-in-python/
---

{% twitter 1022074115476389888 %}

Reversing a list in Python is really, really easy.

This doesn't apply only to `list` but to [sequence](https://docs.python.org/3/glossary.html#term-sequence) in general (string and tuple for example).

```python
msg = "hello there"
print(msg[::-1])
# ereht olleh

my_tuple = (1, 2, 3)
print(my_tuple[::-1])
# (3, 2, 1)
```

The secret behind this magic? The [slice object](https://docs.python.org/3/library/functions.html#slice).

```python
name = "christian"
print(name.__getitem__(slice(None, None, -1)))
# 'naitsirhc'
```

While old I really recommend reading the [Python 2.3 What's new](https://docs.python.org/3/whatsnew/2.3.html?highlight=slice#extended-slices), when the support for built-in types was introduced.
Any difference in Ruby CSV library from 2.3.3/2.4.4 vs 2.5.1?
Tags: ruby, rails, csv, mechanize
Published: 2018-12-06 07:57:47

---
title: Any difference in Ruby CSV library from 2.3.3/2.4.4 vs 2.5.1?
published: true
description: 
tags: ruby, rails, csv, mechanize
---
While migrating a small ruby app from ruby 2.3.3 to ruby 2.5.1, I am having problem parsing a `mechanize` text csv file with CSV library. Which works just fine with ruby 2.3.3 and 2.4.4.

```
csv_header = ["Rep Date", "Or No", "Qw Type", "Sett No", "Order Date", "AS Code", "ZCV", "Amount", "Qty", "BN Code", "AX Code", "User Id", "QW No", "QX Code", "WE No", "MN Code", "KL Name", "IO Id", "A AS", "DD Unit", "DD Amt", "DD Flag", "Remarks", "RRR", "KK Ref No", "TY Type", "SS Regn No", "SR Reg Date", "SU Code", "PPP", "QQQ DEC", "NM Flag", "DP Trans", "O Type"].freeze
converter = lambda { |field, _| field.strip rescue field }
response = agent.submit(form, button)

parsed = CSV.parse(response.body, col_sep: '|', write_headers: true, headers: csv_header, converters: [converter])


# in ruby 2.3.3
parsed.count # 1523

# in ruby 2.5.1
parsed.count # 0

# data in response body looks like bellow
"2018-12-05|8761|T3|9166|2018-12-03|1-R|1JF5|10000.0000|0|11|PBRANCH|88701|2030|489|2312051|4CUM|Kapoor ||41.3500|241.8380|10000.0000|Y||0.0000|66747|SP|3674|24/10/2018|||N|Y|P|NRM|\n2018-12-04|9525|T3|9166|2018-12-03|2-G|1JF5|1000.0000|0|11|BBRANCH|88701|21551|489|545481|VPA|Prasad P||41.3500|24.1840|1000.0000|Y||0.0000|78232|TP|6879|24/09/2018|||N|Y|P|NRM|\n2018-12-04.."

```
Write better code: Day 2 - Single Riffle Shuffle
Tags: challenge
Published: 2018-12-06 05:38:01

---
title: Write better code: Day 2 - Single Riffle Shuffle
published: true
tags: challenge
---

This post originally appeared on [Arjun Rajkumar](https://www.arjunrajkumar.in) 's blog. Arjun is a web developer based in Bangalore, India.

--


[This was the previous question I solved today.] (https://dev.to/arjunrajkumar/write-better-code-dec-5--question3-4ifc)



### Day 2: Question 2

Write a method to tell us if a full deck of cards shuffled_deck is a single riffle of two other halves half1 and half2.

We'll represent a stack of cards as an array of integers in the range 1..52 (since there are 52 distinct cards in a deck).

SingleRiffle: 
![SingleRiffle](https://thepracticaldev.s3.amazonaws.com/i/bupkw9f5c1f1ixmmvuhz.png)

[Question from InterviewCake](https://www.interviewcake.com/question/ruby/single-riffle-check?section=greedy&course=fc1)


If you want to follow along, feel free to post your answers in the comment. 
My answers are in the comments.
AoC Day 6: Chronal Coordinates
Tags: adventofcode, discuss
Published: 2018-12-06 05:09:04

---
title: "AoC Day 6: Chronal Coordinates"
published: true
description: "Day 6: Figuring out Manhattan Distances and more on a coordinate grid."
tags: adventofcode, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/mzq5h8y6gvvjjaqxwyo2.png
series: Advent of Code
---

[Day 6 already!](https://adventofcode.com/2018/day/6)  Around a quarter of the way through Advent of Code!

For those of you that didn't like *rectangular* shapes on 2D grids a couple of days ago, have I got a treat for you!  Now we're dealing with blobby, non-uniform shapes with possibly infinite area!  Yay us!

I'm definitely *not* going to be able to complete this one tonight.  I'll have to work on it tomorrow after a good night's sleep.

Happy plotting (X-Y plotting, I mean)!
Uncle Bob's Bowling Kata - Concerns about TDD and OOD
Tags: tdd, ood, kata
Published: 2018-12-05 19:34:40

---
title: Uncle Bob's Bowling Kata - Concerns about TDD and OOD
published: true
description: Questions about possible flaws in a popular tdd kata solution.
tags: tdd, ood, kata
---

Recently, I've gone through Uncle Bob's bowling scoring kata a couple times (http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata), and... I'm extremely disappointed with his solution. There are two big issues I have with his solution that I would like some feedback on.

Problem 1 (TDD): The third and fourth tests are garbage.

The way I understand it, and the way I've practiced it, when you're doing TDD, you make your test pass with the simplest possible code, and if the simplest code to make a test pass is some very stupid code, then you need to either write a better test or write more tests. For his third test to test spares (and he does the same thing for strikes), he is testing the scoring of spares by making a game where the first two frames are [5,5][3,0] with the remaining frames being all zeroes. He proceeds to take this and go on to write the code for scoring spares, but... the simplest code to solve this is "if roll == 3 then score += 3." Now, that's some dumb code, and you don't want to actually put that in, but that doesn't mean you just ignore it and go on to write the code you're trying to get to. It means you stop and write a better test, whether that means making a more complex game with multiple spares or whatever other thing you might have. Am I missing something here?

Problem 2 (OOD): How is it that he never breaks out a Frame class?

When I look at the Game class, and I see that all 5 of its private methods are passed in the exact same thing, a reference to every other roll (the start of a frame), it seems very straightforward to me that a Frame class needs to be broken out. The Frame just needs to be given its rolls and told about the next Frame, then it can return a score, which the Game class can then sum.

So... what am I missing here that makes these things actually make sense?
Using SDL2: Update for Pong
Tags: cpp, sdl, update
Published: 2018-12-06 04:28:15

Sorry for not updating sooner. I was busy with several things including building my own PC, installing Linux and setting it up to my heart's content, and I am currently learning OpenGL. All of these things have kept me from updating the series.

But I can't beat around the bush for any longer.

I'm canceling the Pong clone creation.

Why?

Mainly because I don't know to properly write code for a game. When I first began Pong, I almost didn't plan anything. The only part I had planned was the update and draw construct for each class. Before I wrote this article, I was trying to get collision detection for the ball working. It then hit me that with this code it wasn't possible. At least not cleanly.

I wish I had this realization sooner, but the code would need some serious refactoring before continuing. I am not going through the hassle of it and decided to cancel the series.

But Using SDL2 in C++ will continue. I hope to get another article up in a day or two.
The power of abstraction
Tags: softwaredesign
Published: 2018-12-06 02:13:18

---
title: The power of abstraction
published: true
description: the secret of good software design
tags: software design
canonical_url: http://creactiviti.com/2018/12/06/the-power-of-abstraction/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/c37vb0sjeejtfjhas7r5.jpg
---

If someone had asked me "what is the number 1, absolutely most important concept in all of software development?" I would answer it using one word: "abstraction". 

Abstraction is all about reducing an idea to its absolute essence. 

Let's look at an example: take the activity of running. If you take a closer look at what is actually happening in your body while you run, your head would spin: a myriad of muscles are keeping your body balanced, your heart is pumping blood like crazy, your lungs are working full speed to keep your blood oxygenated, your sweat glands are pouring sweat on your skin to keep you cool and on and on. 

But to you it's simply <em>running</em>. Your mind simply abstracted, or removed the non-essential details from this concept of running so you can easily think about it. 

Let's look at another example. Here's some code: 

<pre>var splitString = str.split("");
var reverseArray = splitString.reverse();
var joinArray = reverseArray.join("");
return joinArray;</pre>

Now let's add abstraction: 

<pre>
function reverseString (str) {
  var splitString = str.split("");
  var reverseArray = splitString.reverse();
  var joinArray = reverseArray.join("");
  return joinArray;
}</pre>

In the first example we have to read every line of code in sequence and keep track of what's happening in order to understand it. If this was part of a larger piece of code we would potentially have to do that over and over again throughout the lifetime of the software. 

In the second example however, we give a name to that piece of code which lets us ignore the internal details and keep the essential concept in mind: reversing a string. Aha! 

This idea is so central to computers (and life, really) that when you think about it for a moment you realize that the hardware and software you use every day are composed of "layers" (or abstractions) of software. From silicon to machine code, to assembly code, to the operating system, to your application code, each layer can be easily reasoned about without exploding our heads with details. 

Creating clear abstraction in software is the essence of software design. It's the difference between understandable, easy to maintain software and a nightmare to deal with.
TIGL3D DevLog 7+8: Polish and iteration for GDC party
Tags: gamedev, unity3d, devlog
Published: 2018-12-05 19:48:10

---
title: TIGL3D DevLog 7+8: Polish and iteration for GDC party
published: true
description: These updates cover lots of minor iteration and polish working up to a GDC party showing
tags: gamedev, unity, devlog
cover_image: https://thepracticaldev.s3.amazonaws.com/i/h84ecb5lr1d0j2521gsd.gif
---
These two devlog updates for [The Indie Game Legend 3D](http://indiegamelegend.com/) from March 2018 cover lots of iteration and polish working up to a showing at a GDC party:

{% youtube Qp-zWIhMSyQ %}

{% youtube UwhCLyPrF-Q %}

Early access in 6 days...
MP for Folkestone & Hythe vs Facebook
Tags: facebook, privacy, discuss
Published: 2018-12-06 00:00:11

---
title: MP for Folkestone & Hythe vs Facebook
published: true
description: 
tags: facebook, privacy, discuss
---


I've been thinking about this today:
https://twitter.com/DamianCollins/status/1070324913058316290

Facebooks shady practices are becoming all too common for my liking. Or perhaps I'm getting jaded with businesses in general.
Leafing through these documents it's clear there's little concern for user privacy at any meaningful level. 

I'd like to hear your latest opinions on Facebook and what social networks should be in this day and age.


Also, what is your opinion on the current government interest in Facebook and how (if at all) do you think governments with borders of jurisdiction should act in the age of the inter-connected world?