teleren/devto huggingface dataset:
Package by feature vs. feature by module
Tags: discuss, android, architecture
Published: 2018-11-25 21:40:58

---
title: Package by feature vs. feature by module
published: true
tags: discuss, android, architecture
---

Hi everyone, 

Lately I've been wanting to start a new personal Android project, and after attending a GDG DevFest event I finally found the inspiration to do so.

I'm used to organize everything following a "package by feature" logic, but I've read some articles recently where people were talking about having each feature in its own independent module. 

Now, architecturally speaking, this seems like a really good option (high cohesion, loose coupling, feature reuse and all that), but probably due to the fact that I'm used to monolithic Android apps (with well defined boundaries between components though), I'm struggling to not see this as an overkill. 

Do any of you have any experience with this? Or can you see any disadvantages? I'm figuring dependency injection and navigation might become a challenge to do in a clean way.

I'll probably end up doing it just to try it on my own, but I would like to hear your thoughts on this. Thanks! :)
How to Find VSCode Outdated Extensions! #OneDevMinute
Tags: onedevminute, vscode, vscodepro
Published: 2018-11-25 20:46:57

---
title: "How to Find VSCode Outdated Extensions! #OneDevMinute"
description: "Find the outdated extensions in VSCode that need to be updated. All that in a jiffy. #VSCodepro"
published: true
canonical_url: https://www.youtube.com/watch?v=nYnTT59rgOk

tags: onedevminute, VSCode, VSCODEpro
---

Small #OneDevMinute tip. Super easy way to be a VSCode.pro and find out the outdated extensions easily.

## 🤔 How to Find VSCode Outdated Extensions!

1. Just go to your extensions view from the sidebar
2. You can also press COMMAND (⌘) + SHIFT (⇧) + X)
3. Literally, type `@outdated`
4. VSCode will list all the outdated extensions
5. Watch me do all of this in the video below

> 📺 Watch a more detailed version on [YouTube →](https://Youtu.be/nYnTT59rgOk)


---

- 🔥 Learn to become a [VSCode Power User →](https://VSCode.pro/)
- 🐦 Twitter: https://twitter.com/MrAhmadAwais
- ✍️ Blog: https://AhmadAwais.com
- 😮 GitHub: https://github.com/AhmadAwais
- 🔗 LinkedIn: https://linkedin.com/in/MrAhmadAwais
- 🔗 YouTube: https://YouTube/AhmadAwais

{%tweet 1066791352816553984 %}

> P.S. If you like my work, feel free to share it, like it. I also have just started teaching at [VSCode.pro](https://VSCode.pro/) & I am quite active on twitter you can find me cracking silly jokes there, maybe [follow me on Twitter](https://twitter.com/MrAhmadAwais) to connect and [subscribe to my YouTube channel →](https://YouTube/AhmadAwais)

> Peace! ✌️

🗣️ Comment below if you didn't get something.
¿Cómo truncar tus datos de prueba en Laravel 5.7?
Tags: laravel, eloquent, howto, php
Published: 2018-11-25 20:39:01

---
title: ¿Cómo truncar tus datos de prueba en Laravel 5.7?
published: true
description: Una buena forma de realizar el truncado de tus datos de prueba en Laravel 5.7
tags: #laravel #eloquent #howto #php
---

Desde hace unos días me encuentro reforzando algunos conceptos sobre el framework Laravel (en su versión 5.7), he decidido retomar dicho marco para el desarrollo de APIs, así que decidí adquirir un curso en Udemy. En las primeras clases se abordó uno de mis conceptos favoritos de los framework de desarrollo, las *migraciones*. Después de hacer unas cuentas migraciones pasamos a las semillas de la API (Seeds, en ingles), una herramienta maravillosa para crear una buena base de datos para pruebas.

Es normal, que en un proceso de desarrollo continuo tengas alteraciones en tu base de datos y que, por consiguiente, debas recrear tanto la estructura de la base de datos; así como tus datos de prueba. Además, es común que tengas algunas restricciones de llaves foráneas que puedan generar algunos problemas a la hora de recrear tu base de datos. 

Así que a continuación presentaré (por medio de un gist), la que para mí es la mejor forma de truncar tu base de datos, en este caso particular en mi clase administradora de semillas:

{% gist https://gist.github.com/chepew23/b836c568c8ed237ae28c0de51d5c57e0 %}

Como lo describí en el gist (con mi mediocre ingles), no deberíamos hacer uso de sentencias nativas de MySQL (o cualquier otro modelo), desde nuestro frameworks, porqué, a no ser por un caso excepcional, estaríamos limitando la capacidad del ORM de funcionar en cualquiera de los motores de base de datos soportados (en el caso de Laravel, cuenta con soporte para MySQL, SQL Server y PostgreSQL).

Espero este post (mi primero de hecho), sea de utilidad para quien se encuentre iniciándose en este maravilloso Framework. Y estaré atento a cualquier duda y, claro, cualquier futuro aporte, pues he encontrado algunas cosas interesantes en muchos cursos de Udemy.
So why did GitHub send me this T-shirt?
Tags: github, tshirt, opensource
Published: 2018-11-25 19:41:40

---
title: So why did GitHub send me this T-shirt?
published: true
description: Here's the story and why GitHub have been been awesome
tags: github, tshirt, opensource
---

So why did @github send me this T-shirt? Here's the story and why they've been awesome.

<img src="https://thepracticaldev.s3.amazonaws.com/i/qf4mdmj5v2mhnqgz0sv3.jpg"/>

A while ago I created a Chrome extension that improves GitHub. They've seen it and also noticed I've used their logo as the extension's logo.

This is not allowed and they've reached out and asked that I'll change the logo. I promptly did and they've thanked me and sent me a gift of my choice from their store.

Other companies would have sent a cease and desist letter, but GitHub knew how to turn a bad situation into a winning situation 👏

.
.
.
BTW. Here's the repo https://github.com/berzniz/github_pr_tree
Compact or Verbose Codestyle?
Tags: programming, codestyle, maintenance, discuss
Published: 2018-11-25 17:51:41

---
title: Compact or Verbose Codestyle?
published: true
description: 
tags: programming, code style, maintenance, discuss
---


Which code style do you prefer and why?


## Compact


```js
const get = (store, key) => 
    Reflect.has(window[store], key) && 
        JSON.parse(window[store][key]) ||
        new Error(`Key "${key}" not found in window.${store}.`);
```

## Verbose


```js
const get = (store, key) => {
	if (!Reflect.has(window[store], key)) {
		return new Error(`Key "${key}" not found in window.${store}.`);
	}

	const jsonStr = window[store][key]
	const dataObj = JSON.parse(jsonStr);
	return dataObj;
};
```
Let's discuss "Ralph Breaks the Internet" 😃
Tags: webdev, discuss, review
Published: 2018-11-25 13:40:02

---
title: Let's discuss "Ralph Breaks the Internet" 😃
published: true
description: When a movie talks about the INTERNET, how can we miss a discussion
tags: webdev, discuss, review
cover_image: https://thumbs.gfycat.com/PoliteImpressiveBug-size_restricted.gif
---

#### *SPOILER ALERT*

"Wreck it Ralph" was a great movie with a lot of childhood memories but today I went for "Ralph Breaks the Internet" and it was amazing. I really liked how they represented the internet in the movie. They very cleverly showed us good and bad aspects of the internet. 

So I wanted to discuss two things

* What was your favorite moment in the movie?
    
* What was your takeaway from the movie?
How do people even work with colors?
Tags: discuss, help, css, design
Published: 2018-11-25 13:01:12

---
title: How do people even work with colors?
published: true
description: How do you work with color schemes?
tags: discuss, help, css, design
cover_image: https://images.unsplash.com/photo-1459433312032-29eb4bea7d3b
---

My monitors show colors differently.

My phone's brightness changes, depending on the lighting.

The angle at which I'm looking at the screen affects the color. 

My room's lighting differs throughout the day. 

I'm sure I see colors differently right after waking up.

I'm sure I see colors differently after I've been working for a while.

I'm not sure we all see colors the same way (Is my red the same as your red?). 

Some people are color-blind (and for them, I'm contrast-blind).

How do people even work with colors?
Understanding Array Find() In Javascript
Tags: javascript, es6, react
Published: 2018-11-25 12:55:56

---
title: Understanding Array Find() In Javascript
published: true
description: Understanding Array Find() In Javascript
tags: #js #javascript #es6 #react
---

Post Link : <a href="" > Understanding Array Find() In Javascript</a>

This tutorial explains how to use find() method in array using javascript. The find() method returns the value of the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.
Find() :- returns the first items in an array that satisfies a condition

<a href="" > Understanding Array Find() In Javascript</a>


<img src="https://4.bp.blogspot.com/-M4g5nUqmhSg/W_qZl06QQkI/AAAAAAAACKk/6qkGQ5i5iDcTTpKHvHvehMdii1rPfXtCgCLcBGAs/s400/find.png" />
Technologies of future past
Tags: discuss
Published: 2018-11-25 11:32:02

These tweets made me giggle a little bit:

{% twitter 1064231623368019969 %}

and a variation

{% twitter 1064638210280579072 %}

then in 2008

{% twitter 1063920047788310528 %}

The chain started because of this serious tweet:

{% twitter 1063563907799887874 %}



Who knows if GraphQL, WebAssembly and WebComponents will be relevant in 10 years or won't be. 

I think the real lesson from the first three tweets is twofold:

* don't be too attached to a technology (most of us, me included, have a bias when it comes to our favorite piece of tech)

* "always be learning" (as in be ready to move on when the time comes, and be curious)

## Question time

Which three technologies would you bet on in the next 10 years?

Which three technologies you think/wish won't be relevant anymore in the next 10 years?
BxJS Weekly Episode 38 - javascript news podcast
Tags: javascript, node, podcast, news
Published: 2018-11-25 10:26:38

---
title: BxJS Weekly Episode 38 - javascript news podcast
published: true
description: Listen to the best javascript news of the week in a podcast form
tags: javascript, node, podcast, news
---

Hey dev.to community!

BxJS Weekly Episode 38 is now out! 🚀
Listen to the best javascript news of the week in a podcast form right here.
You can find all the mentioned links [here on github](https://github.com/BuildingXwithJS/bxjs-weekly/blob/master/links/18-47-Episode-38.md).

You can also watch or listen to this episode on:
- [YouTube](https://youtu.be/XZAFIDNKy7g)
- [Castbox](https://castbox.fm/episode/BxJS-Weekly-Ep.-38-Nov-24%2C-2018-(javascript-news-podcast)-id1378315-id101799448?country=us)

Any feedback is appreciated 😁

Additional stuff:
- [Twitch channel](https://www.twitch.tv/yamalight)
- [Discord server](https://discord.gg/hnKCXqQ)
- [BxJS Weekly github repo](https://github.com/BuildingXwithJS/bxjs-weekly)

Social media links:
- [Twitter](http://twitter.com/yamalight)
- [Medium](https://medium.com/@yamalight)
- [Github](http://github.com/yamalight)

If you enjoy my content, please consider [supporting me](https://codezen.net/support.html) 😉
How to become a web developer (from backend)?
Tags: python, webdev
Published: 2018-11-25 08:42:40

---
title: How to become a web developer (from backend)?
published: true
description: 
tags: python, webdev
---


I've done a few years as a backend python developer. Most of what I did involved databases and making systems run, but now that I'm looking for a new job, it seems web stuff is a lot more popular.

I don't "get" all the web parts and terms. I've gotten my head around the basics of django, but it seems like how everything fits together still escapes me. Is there a point when it clicks or is it just a case of grinding through it?
Functional programming in C++, Python, etc.
Tags: functional, python, cpp
Published: 2018-11-25 07:09:59

---
title: Functional programming in C++, Python, etc.
published: true
description: 
tags: fp, python, cpp
---

Let's say I want to print to the screen. In pure functional programming languages like Haskell or Elm, you can simply leave it to the runtime engine to do it for you. Your function doesn't need to do the dirty job.

If I move on to non-functional programming languages like python, C++, etc, I cannot signal the runtime environment to print text on screen, generate a random number, talk to the DB, etc. I have to do the operations myself. This makes functions impure since they are changing the state and/or relying on external states to work.

How can I write pure functions in python, C++, JS, etc since these languages lack features like Action, Command, etc to let the function communicate with the runtime environment?

I prefer learning with simple examples. If possible, can you show me how to write a pure function which prints text on the screen using a non-functional language (preferably python or C++)?
Daily Coding Problem #2
Tags: dev, practice, algorithms, challenge
Published: 2018-11-25 07:08:04

---
title: Daily Coding Problem #2
published: true
description: Daily Coding Problem sends you a coding task every day for you to practice for coding interview tasks
tags: 
- dev
- practice
- algorithms
- challenge
---

Seeing the first post gained some popularity, here is the second problem

For quite some time I found my time procastinating after getting home from work. Untill a few days ago I stumbled upon the [Daily Coding Problem](https://www.dailycodingproblem.com/) (DCP) and decided to give it a shot. 
The code is in C#.

## How it works?
The folks at DCP send you a problem that was asked at a top company everyday for you to solve. The premium membership also offers the opportunity to verify your solution.

# Problem #2
This problem was asked by Uber.

Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.

For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6].

Follow-up: what if you can't use division?

# My solution
```
using System;
using System.Linq;

namespace Task02
{
	public class Program
	{
		public static void Main(string[] args)
		{
			var input = Console.ReadLine()
				.Split(' ')
				.Select(int.Parse)
				.ToArray();

			var result = new int[input.Length];

			for (int i = 0; i < result.Length; i++)
			{
				result[i] = 1;

				for (int j = 0; j < result.Length; j++)
				{
					if (j != i)
					{
						result[i] *= input[j];
					}
				}
			}


			Console.WriteLine(string.Join(' ', result));
		}
	}
}
```

# Explanation
Here I could not think of any better than the naive solution, which works in O(n^2) time and you never like square complexity. 
Basically for every item in the result array, foreach the input array and check if the index is different from the item's. If they are, multiply the current value of the item times the current input item

I will try to do the daily problem everyday, but sometimes life gets in the way :)
Solutions are posted in my github account

{% github cwetanow/DailyCodingProblem %}. 

Feel free to leave a like and let me know in the comments if I should continue to post my solutions.

If you also have any better solution in mind, by all means share it, so we can learn from each other.
Tofu キーボードを組み立てた
Tags: keyboard, tofu, kbdfans
Published: 2018-11-25 07:07:03

---
title: Tofu キーボードを組み立てた
published: true
description: KBDFans の Tofu HHKB Layout を作った
tags: keyboard, tofu, kbdfans
---

![](https://thepracticaldev.s3.amazonaws.com/i/iahg4votqnz28dm09lvw.jpg)

https://kbdfans.cn/collections/diy-kit/products/tofu-hhkb-layout-hot-swap-diy-kit

KBDFans の Tohu HHKB Layout の DIY Kit を買った。ゲームメインの Windows 機ではずっと Majestouch の青軸を使っていたのだけど、買ったのが JIS キーボードを使っていた頃で自分の周辺機器で最後の JIS キーボードだった。JIS の配列を手が忘れかけてきていて、いい加減ストレスだったので US 配列のキーボードに換えたかった。

60%キーボードは群雄割拠で種類がたくさんある中で Tofu を選んだのは、PCB がホットスワップになっていて、プレートに HHK 配列のものがあって、ぐらい。Aliexpress で注文してから想像してたより早く到着した。5日ほど。

まずはスタビライザーを組み立て

![](https://thepracticaldev.s3.amazonaws.com/i/w3oazsbcf9sg7b1cuia9.jpg)

この後は写真を撮るのを失念していて何もないのだけど、プレートにキーキャップを嵌めて PCB に挿し込むだけである。右上らへんが結構タイトで、挿すのが難しかった。

スイッチは遊舎工房さんで Kailh Speed Rose Pink をチョイス。

https://yushakobo.jp/shop/kailh-speed/

PCB に LED がついてて、LED をつけると結構綺麗だったのでクリアなスイッチにするか迷ったのだけど、家使いだし実用重視で。ホットスワップなので後から取り替えてもいいし。

QMK のファームウェアが使えるとのことだったので、Mac で書き込みをしようとしたけどうまくいかなかった。

https://kbdfans.cn/pages/qmk-instructions

を参考に、Windows で環境を構築した。qmkeyboard の GUI のエディタが使いづらかったので hex を Mac でビルドして、Dropbox で Windows に共有して書き込むようにした。GUI のエディタでソフトリセットのキーを仕込んでおくと裏蓋を開けてスイッチを押す必要がなくなるので、hex には必ずソフトリセットのキーを入れておくと便利。

何のキーが押されているかを確認するのは

http://keyboardchecker.com/

を使った。シンプルで使いやすい。

基本は HHK のキー配置を参考にしつつ、レイヤーに wsad でアローを入れたりレイヤーの左右 Shift に変換/無変換キーを配置して、MS-IME の設定で変換/無変換を押したら IME のオン/オフを設定しておくと Mac のように英数/かなを決め打ちで切り替えられるのでとても便利になった。

また、Windows の設定で US のキーボードを挿しても JIS のキーボードとして扱うようになっているようだったので、Windows の設定から「時刻と言語」のところからキーボードのレイアウトを US に変更すると素直に US のキーボードとして入力できるようになった。

今のお困りポイントは、PCB の左右に USB-C のポートがあるのだけど、右がとても不安定で左に挿したいのだけどケーブルの長さが足りなくて渋々右に挿している(ケーブルをサイバーマンデーで買おうという魂胆...)ことと、スタビライザーの挙動が怪しくてエンターキーは Lube を塗ったらそれなりに動くようになったのだけどスペースはキーキャップを嵌めるとキーが埋まって動かなくなってしまうこと。応急処置で1.5uくらいのキーキャップを装着してるのだけど、スペースがちょっと遠くて不便...。手元の7uのキーキャップは Pimp の Grabbag に付いてきたやつしかないのでキーキャップが歪んでるのかなー、ともおもったけどどう見てもスタビライザーの方がキースイッチの平行線上にない気がしていて、取り付け方を間違えたかな...とおもったり。ゆくゆく直したい。

あとは、ほぼ同時に組み立てた crkbd も触ってると別に複数uのキーって要らないなと思いはじめてきたので Planck みたいな1uオンリーで60%みたいなキーボードもいいかも、と。ただ、オーソリニアは使ったことがないので Normal staggered な40-60%あるといいなーとかとか。Zinc の数字列があるようなのが理想かも。
What were your "gotchas" when first learning React?
Tags: discuss, react, webdev
Published: 2018-11-25 07:00:30

---
title: What were your "gotchas" when first learning React?
published: true
description: What was your "aha!" moment when learning React?
tags: discuss, react, webdev
---

I've found there are some common stumbling blocks that people have when they're learning React, and sometimes there's an "Aha!" moment when they understand.

* The difference between ES2015, React, JSX
* Complex usage of libraries like underscore or lodash in example code
* Understanding the overall "data flow" of React (And, the "Flux" architecture as a concept)
* Shared (but different!) concepts in other frameworks like Angular, Vue or even jQuery
* The asynchronous nature of some operations (like `setState`)


Was there anything particularly tricky to get a handle on when you were learning React? What was your "Aha!" moment?
Do you Know how to { content: attr({data-attribute}); } ?
Tags: html, css
Published: 2018-11-25 06:59:45

---
title: Do you Know how to { content: attr({data-attribute}); } ?
published: true
description: CSS,HTML5
tags: HTML5,CSS
---


We can pass the deta　　to el::before,after{ content:'';}


```HTML:index.html
    <div class="button">
        <span data-attribute="HOME">HOME</span>
    </div>
```

```CSS:style.css
    .button{
        span::before {
            content: attr(data-attribute);
            }
        }
    }
```

It's bery easy!!!

I created a simple animation using this mechanism.


Thanks！！！！

<p data-height="265" data-theme-id="dark" data-slug-hash="WYJVpd" data-default-tab="css,result" data-user="Rin_T_T" data-pen-title="content data-attribute" class="codepen">See the Pen <a href="https://codepen.io/Rin_T_T/pen/WYJVpd/">content data-attribute</a> by Rin_T_T (<a href="https://codepen.io/Rin_T_T">@Rin_T_T</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
A take on immutability in CSS Custom properties
Tags: csscustomproperties, cssvariables, immutablecss
Published: 2018-11-25 06:16:40

---
title: A take on immutability in CSS Custom properties
published: true
description: Custom properties are here to stay, and there's no concrete style guide for writing them. Here's one way of doing it.
tags: CSS custom properties, CSS variables, immutable CSS
---
Originally on [Medium.com](https://medium.com/@piggyslasher/to-add-to-this-heres-a-way-to-achieve-immutability-in-css-custom-properties-35ce6908f8d) as a reply to [CSS: In defense of !important – Calidae Blog](https://calidae.blog/css-in-defense-of-important-d82393f81a5).

Debugging custom properties & `calc()` functions are not the best DX (Developer experience), yet. One way is to enforce good coding practices to help avoid issues. One of those reasons - is enforcing immutability.

Please read the article and let me know if you see more benefits that I might have overlooked!

{% codepen https://codepen.io/piggyslasher/pen/OaWpmQ %}
A family of 1000+ members
Tags: discuss, followers, celebration
Published: 2018-11-25 04:16:12

---
title: A family of 1000+ members
published: true
description: celebration of 1000 followers
tags: discuss, followers, celebration
cover_image: https://thepracticaldev.s3.amazonaws.com/i/nj5z0fqfthzkuugxa1um.jpeg
---

I joined DEV community 25 days ago (on 1st November 2018) and just 15 days ago I celebrated [100 followers](https://dev.to/sahilrajput/100-followers-in-10-days-1225) and today, I have 1000+ followers.
I never thought this many people would love to read what I write.

A virtual hug to everyone for making this possible :)X

#### {Thank you}
Anyone here live in Seattle?
Tags: discuss
Published: 2018-11-25 00:14:41

---
title: Anyone here live in Seattle?
published: true
tags: discuss
---
I'm originally from California, currently living in New York City and now thinking about relocating to Seattle. I've been there a couple of times as a tourist and I really enjoyed the city. I'm wondering what the tech culture there is though? For example, here in NYC, it's pretty mixed. You can go out and not meet anyone working in tech, which is in contrast with San Francisco, which seems like almost everyone there works in tech. I enjoy the mixed culture in New York. 

Apart from city culture, how is the nightlife? Transportation? If you live there or have lived there, feel free to drop what you love and don't love about the city!

Thanks!
FIXED: Troubles in Java please help, my teacher has been ignoring my questions for almost a week
Tags: school, java, project
Published: 2018-11-25 00:10:39

---
title: FIXED: Troubles in Java please help, my teacher has been ignoring my questions for almost a week
published: true
description: I'm working with java-script and I can't figure out why my perimeter and area aren't getting the correct numbers. I need to classes and the width and height have set numbers. And width and height need to have a default of 1
tags: #school,#java,#project
---

package com.eclipse.chancewalker;

public class rectangleCW {
    private static double width;
    private static double height;

    public rectangleCW() {
        width = 1;
        height = 1;
    }
    
    public rectangleCW(double w, double h) {
        width = w;
        height = h;
    }

    public double getArea() {
        return width * height;
    }

    public double getPerimeter() {
        return width + height + width + height;
    } 
}
----------------------------------------------------------------------------------
package com.eclipse.chancewalker;

public class rectangleTestCW {
		public static void main(String[] args) {

		rectangleCW r1 = new rectangleCW(4, 40);
		rectangleCW r2 = new rectangleCW(3.5, 35.9);

		System.out.println("The height for rectangle 1 is: " + 40);
		System.out.println("The width for rectangle 1 is: " + 4);
		System.out.println("The area for rectangle 1 is: " + r1.getArea());
		System.out.println("The perimeter for rectangle 1 is: " + r1.getPerimeter());

		System.out.println("The height for rectangle 2 is: " + 359);
		System.out.println("The width for rectangle 2 is: " + 3.5);
		System.out.println("The area for rectangle 2 is: " + r2.getArea());
		System.out.println("The perimeter for rectangle 2 is: " + r2.getPerimeter());
		}
}