teleren/devto huggingface dataset:
Micro Frontends is the new way to design for AI
Tags: microfrontends
Published: 2019-11-28 09:46:54

I’ve been involving some AI-related productization projects. I played many roles in these projects. I did the PM work, set the goals and the KPIs, I designed the prototypes and the pipelines, I analyzed the data, I monitored the all the metrics, and of cause I wrote all the JS codes as a Front-End engineer.
What a Front-End engineer can do for AI?
What is Micro Frontends Architecture?
How does Micro Frontends can help AI productization?
What does the “design for AI” mean?

https://medium.com/@unbug/micro-frontends-is-the-new-way-to-design-for-ai-224d2c009cfc
Learning C as a first language
Tags: c, discuss
Published: 2019-11-28 09:26:45

Has anyone learned C as their language as people usually don't recommend learning it as your first language because it's hard because of pointers, address, DMA, no OOP, no abstractions etc.

But I do _really_ recommend learning C as your first language. Most will think that it's traditional, no one goes door to door these days, C is really old etc.
It can be though of assembly of first century. 

Learning C has it's own advantages like:
- You will understand how a computer works
- C is the lingua franca of programming.
- You will write better programs.
- You will find it much easier to learn other programming languages.

I learned C when I was making my own Pokemon game with [disassembly](https://en.wiktionary.org/wiki/disassembler) and [decomps](https://en.wikipedia.org/wiki/Decompiler) and really it helped a lot in understanding everything. Somethings were hard for me but I didn't lose hope and understood all of them. Then I tried to see other languages like Python, C++ and all. I found them very easy to understand and got well-versed.

Finding learning resources for C are really hard to know in depth. I found many of them and learned from there.

Websites:
[Programiz](https://www.programiz.com/)
[Learn C](https://www.learn-c.org/)
[Tutorials Point](https://www.tutorialspoint.com/cprogramming/index.htm)

Books:
[Programming-Language 2nd by Brian Kernighan](https://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=lp_3956_1_1?s=books&ie=UTF8&qid=1574932972&sr=1-1)
[Understanding Using Pointers Techniques Management](https://www.amazon.com/Understanding-Using-Pointers-Techniques-Management/dp/1449344186?ref_=Oct_RAsinC_Ajax_3956_4&pf_rd_r=VDN0CCHDDS1MQHPA9YFP&pf_rd_p=46207d08-921e-55fe-8a3d-5a84d9e42686&pf_rd_s=merchandised-search-6&pf_rd_t=101&pf_rd_i=3956&pf_rd_m=ATVPDKIKX0DER)
[C Programming Modern Approach 2nd Edition](https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504)

Awesome Repos:
https://github.com/kozross/awesome-c

**TODO: Add more links**
What Is Programming Language And Why It Is a useful?
Tags: computerprogramming, programming
Published: 2019-11-28 08:29:49

Programming Language is process of developing software or any small or big machine.

Programming is ways of making innovative machine like smart watch, smart car, etc.

The programming is the more powerful technique to send information to machine.

You can read this interesting information about <a href="https://shiv1367.com/whatisprogramming">best programming language</a>.
Yarn ls 
Tags: yarn, npm, node, javascript
Published: 2019-11-28 08:16:57

TL TW;
Most of the time I found myself doing cat to package.json in order to see all available scripts, yes I know there is an option to list the scripts with `npm | yarn run`, but I found it quite annoying so it brought me to write the tiny utility that can list and run cmd by your choice. And now I would like to share it with you. Maybe it will be useful for you. 
So go ahead and try it :slightly_smiling_face:

git: https://github.com/nudelx/yarn-npm-ls
npm: https://www.npmjs.com/package/yarn_npm_ls
AWS integration with VS Code
Tags: productivity, aws, vscode, webdev
Published: 2019-11-28 06:25:04

VS Code is the first choice of most of the developers today. From writing and debugging code to pushing it to GitHub, we can also deploy to cloud. 

For example,

AWS has on official extension for VS Code (AWS Toolkit). It can be installed from the VS Code extension marketplace.

(Considering you have an AWS account)

First things first:

1. Install the extension.

2. Connect to AWS using your own ACCESS KEY.

(To get the access key, just login to the AWS console. Goto username on top, select 'My Security Credentials', then goto 'Access keys for CLI, SDK, & API access' section. Create a new access key if you don't have one.)

3. Go back to AWS click connect to aws, enter any unique name, then access key id and then secret access key. 

You are done setting up the extension!

It offers following services:

1. Develop serverless applications locally and then deploy them to an AWS account.

2. Listing and deleting AWS CloudFormation stacks.

3. Listing and invoking AWS Lambda functions.

4. Select any region from the region explorer.

To use the toolkit for developing serverless applications on AWS, you need to have following things installed locally:

1. AWS CLI
2. AWS SAM CLI
3. Docker

That is it!
Understanding delegates in C# - did I get it right? Part 2
Tags: help, csharp, delegates
Published: 2019-11-28 06:09:08

The young man wrote back, unpacking his original question a little. This is what he said following by my response. Am I right? 
>Now  I am interested to know that in `GiveAction()` method, when we pass the reference of `Method1`, we directly write the name `Method1`. Normally when we call a non static method we need to write the instance variable first then we write the name of method in which we are interested.

I don't think I'm understanding the question. But I'll keep trying.

When you're giving `Method1` to the return value of `GetAction` that's getting resolved at compile time for the instance-local method of the same name.

Your code from last time could be written like this:
```csharp
using System;
using System.Diagnostics;

class Program
{
    int i = 4;
    static void Main(string[] args)
    {
        Debugger.Launch();
        Program p = new Program();
        Action y1 = p.GiveAction();
        y1();
        y1();
        Console.WriteLine(p.i);
    }
    private Action GiveAction()
    {
        Action ga = Method1;
        return ga;
        /*
        this also works
        
        return (Action)Method1;
        */
    }
    public void Method1()
    {
        this.i++;
    }

}
```
Notice the two different ways of specifying the return value of `GiveAction`. That and the way you were doing it originally all hand back an Action delegate to `Main` which gets stored in the Action delegate named `y1`. 

`GiveAction` and `Method1` are both executing in the context of the instantiated `Program` object stored in `p`. They don't need further qualification because they are not objects themselves that need to be instantiated. 

کیا میں قریب ہوں؟
Rails Routes in React (HELP)
Tags: help, rails, react, route
Published: 2019-11-28 05:15:18

In my project frontend is in React and the backend is Ruby on Rails. I was trying to get rails routes in React. 

Right now 
I am creating path using 'word1/:id/word2'.

Is there any better way of doing it?

Like the same way we do in rails -> 'word2_word1_path(:id)'?

Any suggestions will be helpful.
Understanding overflow in CSS
Tags: css, webdev, beginners
Published: 2019-11-28 04:32:41

If you have written CSS for a while, you'd probably encountered overflow property. It governs the display of overflow content in a container. 

Let's have an example. I have a div that is 300px width and 100px height like this:

```css
#container {
 border: 2px solid blue;
 height: 100px;
 width: 300px;  
}
```

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/oren45cdzyu8a1ukj2ap.png)

Let's put some text inside:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/92yfmsvd9xs3vh8iz3tx.png)

Everything is fine. Let's put some more text:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4h3p1e7oiae62p04adhp.png)

As you can see, when there is more content than the capacity of the container, the text is overflowed. 

But is this the only behavior? Obviously not. 

## Overflow possible values
There are four possible values of overflow:
1. visible (default value)
2. hidden (overflowed content will be clipped)
3. scroll (scroll bars will be added to the container <em>No matter the content's length</em>)
4. auto (scroll bars will be added when necessary)

## Overflow values in action
Let's have a look at overflow values in action
### visible
This is the default value. So, I'll reuse the above screenshot:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4h3p1e7oiae62p04adhp.png)

### hidden

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/iv7ab1n8ugwpflen0ujv.png)

### scroll
When overflow occurs:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/89mr7drf6ewyqyi1srcp.png)

When there is no overflow:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/uwgadoz2yysq8bvozd9b.png)
=> there are scroll bars no matter what :O

### auto
When there is no overflow:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/92yfmsvd9xs3vh8iz3tx.png)

When overflow occurs:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/oz82n1s41v0endzi2trf.png)

## overflow-x and overflow-y
You are not limited to using overflow only. You can use overflow-x and overflow-y to set the behavior on these axis separately (using the same value as above).
Better choice for DEV
Tags: betterchoice, react, vue, flutter
Published: 2019-11-28 04:27:57

Ready ending year 2019. I have two questions (choice). 
- Better for mobile cross-flatform:
React Native (Facebook) or Flutter (Google)
- Better for web fron-end:
VueJs or ReactJs


Rise a your choice also give some feedbacks (possible)
PHP seo_friendly_url Example For Slugger
Tags: php, seo
Published: 2019-11-28 04:19:37

function seo_friendly_url($string){
    $string = str_replace(array(‘[\’, \’]’), ”, $string);
    $string = preg_replace(‘/[.*]/U’, ”, $string);
    $string = preg_replace(‘/&(amp;)?#?[a-z0-9]+;/i’, ‘-‘, $string);
    $string = htmlentities($string, ENT_COMPAT, ‘utf-8’);
    $string = preg_replace(‘/&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);/i’, ‘\1’, $string );
    $string = preg_replace(array(‘/[a-z0-9]/i’, ‘/[-]+/’) , ‘-‘, $string);
    return strtolower(trim($string, ‘-‘));
}rim($string, ‘-‘));
  }
How to check root (jailbreak) status device (iOS or android)
Tags: rootandroid, jailbreakios, howtocheck
Published: 2019-11-28 04:05:50

You develop an application by Native programming (Java, Kotlin, ObjectC, Swift) , also Cross-platform (Flutter, React Native,...) And you need check root or jailbreak status. Have many methods to check it. After i will list some method that i know:
- Check by access permission with special path, or file.
With android, example: "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", ...
With iOS: "/usr/sbin/sshd", "/private/var/lib/apt/"
- Check exist root app (after rooted or jailbreak): Cydia.app with iOS and Superuser.apk with android
If an system be content with two conditions upper, you can return rooted (jailbreak)
Refactoring TypeScript: Black Friday Discount 👌
Tags: typescript, webdev, javascript
Published: 2019-11-28 02:28:44

---
title: Refactoring TypeScript: Black Friday Discount 👌
published: true
description: Here's a Black Friday deal!
tags: #typescript, #webdev, #javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/2vcdjvx9sxf6nrlmp5j4.jpg
---

My book _Refactoring TypeScript: Keeping Your Code Healthy_ is on sale until Cyber Monday (Dec. 2, 2019) on Leanpub!

Click on the image to get the coupon/discount:

[
![Refactoring TypeScript book](https://thepracticaldev.s3.amazonaws.com/i/anxm8ony1r8y45uqqcju.png)
](https://leanpub.com/refactoringtypescript/c/LplouncF7Kd7)

You can grab one book for $4.99 or 5 books for $13.99 (that would be great for a dev team, club, etc.)

For some samples of the book, you can check out these articles which are excerpts:

- [Why Should You Refactor Your Code?](https://dev.to/jamesmh/why-should-you-refactor-your-code-53fd)
- [Unhealthy Code: Null Checks Everywhere!](https://dev.to/jamesmh/unhealthy-code-null-checks-everywhere-2720)
- [Unhealthy Code: Primitive Overuse](https://dev.to/jamesmh/unhealthy-code-primitive-overuse-7mh)
Using proximity to turn screen black on React Native
Tags: react, reactnative, proximity, nativemodules
Published: 2019-11-28 02:22:45

---
title: Using proximity to turn screen black on React Native
published: true
description: A simple workaround to save battery and avoid having the screen "on" during processes that take time
tags: react, react-native, proximity, native modules
---

Have you ever used a sleep app that asked you to not lock the screen and keep the phone screen flipped to a table/bed during the night? Then, when you do it, the screen magically turns "off"?

Today, I'll show you how to do it using React Native and how it's simple.

First, install `react-native-proximity`. We aren't using the official lib because right now it doesn't support last React Native versions, so make sure to install it this way:

```
yarn add pakt-digital/react-native-proximity#584f46494111c639655303cf7e4bae925641dc4a
```

Install the pods required and build your app again.

```
cd ios/ && pod install
```

To make it simpler, we will be building a hook that wraps the proximity listener.

`useProximity.js`
```
import { useEffect, useState } from 'react';
import Proximity from 'react-native-proximity';

export default function useProximity() {
  const [hasProximity, setHasProximity] = useState(false);

  useEffect(() => {
    const callback = ({ proximity }) => setHasProximity(!!proximity);
    Proximity.addListener(callback);

    return () => Proximity.removeListener(callback);
  }, []);

  return { hasProximity };
}
```

Now, you can use your hook on your screen. Notice that `BlackScreen` and `Content` are abstractions for a component that should be a black view and your screen content, respectively, like the names suggest.


```
const Screen = () => {
  const { hasProximity } = useProximity();

  if (hasProximity) return <BlackScreen />;

  return <Content />;
}
```
My 2nd Time Doing The #100DaysOfCode Challenge
Tags: 100daysofcodechallenge, jrdev, programming
Published: 2019-11-28 01:50:47

---
title: My 2nd Time Doing The #100DaysOfCode Challenge
published: true
description: 
tags: #100daysofcodechallenge #jrdev #programming 
---

On October 28th, 2019, I started the #100DaysOfCode Challenge a second time. My first time was last year from November 14th, 2018 to February 21st, 2019. 


For those who don't know, the [100 Days Of Code challenge](https://www.100daysofcode.com/) is an online competition for programmers, designers, and the like. 
There are only 2 rules of the challenge:
1. Code for at least an hour every day for 100 days.
2. Share your progress online every day for 100 days. (Tweet, Blog, etc.) 


You may be asking yourself, why would I do the challenge again? What's different the second time? 

Honestly? A lot.

First, when I started the 100 Days Of Code challenge in November 2018, I was going through [a personal event](https://dev.to/camckin10/6-life-lessons-in-tech-100-days-racism-and-starting-over-4h0p) that left me considering whether or not to continue pursuing a career in tech. Participating in the challenge was a personal project I took on to regain my faith in programming. 

Second, now that I have moved on from that event, starting the same challenge that I completed almost 5 months ago will be completely different. I am in a new space mentally and emotionally, so I feel better prepared.

Third,I made a note of what worked for me the first time, so I had a guide to help me prepare again. 
(If interested, you can check out my tips in completing the challenge [here](https://dev.to/camckin10/the-junior-dev-s-guide-to-completing-the-100-days-of-code-challenge-a-k-a-don-t-panic-5c37))

Finally, I took some considerable time to plan what I wanted to create before starting the 100 days challenge again. The first time I did the challenge, I just jumped in with no concrete plan.I had some ideas, which I used, but they were not as detailed. 
Since I've started working as a programmer, I have noticed how important it is to plan your projects from *start to finish.* Wireframes, user stories, tech stack...all of this matters in order to develop a successful project. 

I feel that this time with a stronger plan of what I want to create, the challenge will be even more exciting the second time. 
I learned a lot completing the challenge the first time, and I hope to learn even more going through the challenge again. 

If you want to follow my 100 Days Of Code journey, I post my daily updates on[Twitter](https://twitter.com/TechChelsey). 

*NOTE: At the time of writing this post, I am currently on Day 30 of the 100 Days Of Code Challenge.*
Counting down to 1K followers
Published: 2019-11-28 00:26:51

I'm almost at one thousand followers (993 and counting), and I'm unreasonably excited about it.  
Interestingly, I'm also just under 10K profile views. I wonder if there's a reason for that, other than blind chance.  
Anyway, just tooting my own horn here. (Funny expression that - I'm told it comes from the days when kings would have servants who announced their entrance by playing trumpets, and it would be a poor king indeed who had to toot his own horn. So am I insulting myself by saying I'm not a king? Seems like more of a rational statement than an insult. Obviously I'm not a king. Or am I showing praiseworthy self esteem. I don't know and I'm just rambling at this point, but what I'm really trying to say is, it's a funny expression.)
My Data Science Hello World
Tags: data, python
Published: 2019-11-28 00:14:47

I've been inspired by [Nityesh Agarwal](https://dev.to/nityeshaga) and his Build to Learn community to build a data science project I don't mind showing to the world and documenting the steps in a way that beginners can follow along with. The first iteration of that exists [here](https://repl.it/@ErikKrisotferA/ted-talk-hello-world) as a repl on [repl.it](repl.it).  
What's a repl? A repl is an interactive coding environment - basically an online IDE. [Here](https://docs.repl.it/repls/intro) is some basic info about repls.  

In a recent [dev post](https://dev.to/nityeshaga/fantastic-programming-project-ideas-and-where-to-find-them-the-beginner-friendly-version-9d5) filled with project ideas, Nityesh suggested analyzing a [database](https://github.com/johnlaudun/tedtalks/tree/master/data/Release_v0) of TED talks, which contains metadata and fully transcribed texts of the the speeches.  
It was also Nityesh who suggested using Repl.it as a low-activation-energy way to get started in a preset programming environment. No need to worry about instation, dependencies, or different environments.  
My idea in doing a "Hello, World" project is to do a minimum viable proof that things are working. Printing the first speech in the database seemed like a reasonable place to start.  
That task took me longer than I'd like to admit, but I partly blame that on the being unfamiliar with the environment and the way it displays pandas dataframes. But I'm getting ahead of myself. 
The key steps are downloading the file, saving it to a local file (local to the cloud-based IDE, that is), so I don't need to download the data every time I test the code, reading that file back into the program on subsequent runs, then putting it into pandas and printing the relevant parts.
 
 
I was going to use the beginners tag, but I realized that this probably isn't material for complete beginners, since it involves the python packages `pandas` and `requests`, as well as reading and writing files.    
Later, I will write a post for beginners which walks through the code line by line, and explains my process of building it. My hope is that people can use that forthcoming post to get their hands wet with data for the first time.  
But, for now I just want to get my first step of this project out to the world, and start what will be a series of posts on this topic.

More to come soon!
Day 43 : I'll Be There
Tags: hiphop, code, coding, lifelongdev
Published: 2019-11-28 00:05:20

_liner notes_:
- Professional : Had a pretty productive day. Started off early with a Talk Prep session at 5am. Got some feedback on talk ideas I'm looking to do and questions answered. Went back and took a nap. haha Got up again and worked on integrating SMS in the current application I'm working on. I've done it before, but this time it's a little more complex because there's more that needs to be determined before I send a reply text. So it's taking more time than expected. Sat in on the Developer Educator meeting. They were discussing getting into live streaming and I'm always down for that. Pretty much for the rest of the day, just banged my head against getting the SMS to work the way I want. I feel like I'm so close! haha I'll be there soon.

- Personal : Made some pretty good progress on my side project. I now have transitions between the pages as a user navigates. Looks pretty good. Now I have to get the data to load in the right pages and look correct. I also got a few tracks together for this week's radio show. Going to try and make the same progress tonight.

![Pine trees and mountains in Gold Creek Pond, Washington State](https://thepracticaldev.s3.amazonaws.com/i/a6qs0z0kjlwbmu7zarce.jpg)

So I'm off for the next four days for Thanksgiving! Going to try and actually rest up, handle some chores around the house and start planning things for the van that should be arriving in a couple of weeks. Also got my radio show and another HIPHOP event on Saturday. Would also like to get some side project and research coding in. We'll see after Thursday's dinner how I feel. hahah

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube QMbC6OBGAxo %}