teleren/devto huggingface dataset:
Using a Chromebook for Web Development
Tags: tools, beginners, chromebook
Published: 2019-07-20 19:21:53

As many of you know, I have been using a borrowed laptop for my coding classes and projects since May of this year and have been in search of one of my own! I wrote an article requesting expert advice on [Laptop Requirements for Coding](https://dev.to/angelarae63/laptop-requirements-for-coding-3l0n). You all did not disappoint! I had some really good suggestions about what I should look for and what everyone was using for their development setup. But, nothing intrigued me more than this comment from [Matthew Clairmont](https://dev.to/clairmont32):
>I primarily do security tool development and contribute to a couple of open source projects. That said, I do a good amount of work on my Samsung Chromebook Plus since it has a built-in Linux distro while I'm commuting into work or sitting on the couch.


You had me at "built-in Linux." I already love the simplicity and security of Chromebook OS, but with Linux built in?! That sounded too good to be true! And so, my research began!

At first, I saw a lot of tutorials on using Crouton to essentially jailbreak the Chromebook, which did not seem appealing to me at all. But, as I researched further, I found that Google added built in functionality to run Linux on a VM using a container that lives separately from the Chrome container. Brilliant! [Tyler V.](https://dev.to/tvanblargan) wrote an excellent article about how this works [here.](https://dev.to/tvanblargan/chromebook-coding-kickoff-4g72). 

In this video, Google Engineers discuss the efforts they are taking to make Chromebooks secure devices for software development. 
{% youtube pRlh8LX4kQI %}


My plan is to buy a used Chromebook on the list of machines that have this feature built in. If you are interested in trying this, too, there is a [reliable list here.](https://www.reddit.com/r/Crostini/wiki/getstarted/crostini-enabled-devices) I will enable the Linux container and let you all know how it goes in my next installment of this series. I hope to do that next week. 


Has anyone else tried this setup or are you as excited by the prospect as I am? Let me know in the comments below! I can't wait to see everyone's input!
Pursuing a permission-less career
Tags: discuss
Published: 2019-07-20 19:21:34

> Tldr; I wrote a [note](http://weiweihsu.com/2019-07-12/pursuing-a-permission-less-career) on gaining personal creative freedom and financial independence.

It wasn't until leaving school, that I realized how much creative autonomy I had in experimenting and exploring with different project ideas. 

I've been asking myself how I can create a similar school environment but in a way that's financially sustainable. 

Taking a lot of inspiration from communities like Gumroad, Product Hunt, Indie Hackers, and Maker Log, I'm going to be learning to code and building a product a month. 

Have you ever thought about building your own small products?
Don't Let Gamification Bring You Down
Tags: discuss
Published: 2019-07-20 18:46:46

<figcaption>Photo by Kay on <a href="https://unsplash.com/photos/V3qzwMY2ak0">Unsplash</a></figcaption>

I was recently having a conversation that comes under the general header of ["you are not your code."](https://dev.to/josegonz321/comment/38f3) It's an expression I had never heard before coming to `dev.to` and I think it's an excellent reminder. Anyway the conversation was about how it's okay for a machine learning model to perform at less-than-perfect accuracy. It made me realize that gamification platforms, (like Kaggle, CodeWars, HackerRank, and DeepRacer) can change how we look at ourselves if we let them. *Just like any other competitive game.*

In reality, if you have a predictive, value-adding model in production where previously none existed, that's a big win. If you get it from .9 to .99 accuracy, that's a big win too. Likewise, if you can beat a 6kyu "easy" kata on CW, way to go! And if you can beat another version of the kata at "master" 1kyu, way to go!

It's great that these platforms give us a venue to compete, get excited, and show our skills. It's also important to keep it in perspective -- you are not your code. You can still be yourself if you lost a [horse](https://en.wikipedia.org/wiki/Variations_of_basketball#H-O-R-S-E) competition. Don't let yourself think you aren't a developer unless you can beat grand-master-level katas, or not a Data Scientist because you don't win top prizes on Kaggle. That's not what those services are about.

What have been your experiences with gamification platforms? What's your take?
Resubmit Logic Apps using C# ❤❤
Tags: azure, logicapps, csharp
Published: 2019-07-20 18:26:23

Ok. Straight to the point. The logic app that am supposed to monitor ( which I did not apparently, quite well ) failed a terrible 492 odd times. When I did notice the failures, it was quite late as you can Imagine.
Ah Ok !! The Logic App had one of its API Connections misconfigured. Gotcha.. Got that fixed. Now all the failed instances of the logic app needs to be re-run
Like everyone else I was looking for a Select All Checkbox + ReSubmit Button and found it nowhere. The only option left was to select 492 check boxes ( individually ) and then Resubmit in OMS. And am not a great fan of clicking my way out.

So ended up writing a C# Console Application that can Iteratively resubmit each instance of the failed logic app.

# There are three things to be done to accomplish in order to bulk resubmit the failed logic apps

+ GetAccessToken
+ GetWorkflowHistoryRuns
+ ReSubmitFailedLogicApps

What do you need to Know to Run this Console Application ?

# There are few settings that needs to be configured before running the App

1. AAD TenantId
2. Client AppId and Secret that has contributor permissions to the ResourceGroup Running the Logic App
3. Subscription Id, Resource Group Name, Logic App Name and the trigger name of the Logic App

{% gist https://gist.github.com/irajbalakrish/c3b24c5435561f0fef661211530e0207 %}

# How does it work ?

* GetAccessToken fetches the bearer token to transact with Azure Management API’s

{% gist https://gist.github.com/irajbalakrish/2094ce0465646f39972ff5a946514b7b %}


* GetWorkflowHistoryRuns fetches the list of failed logic app instances Iteratively

{% gist https://gist.github.com/irajbalakrish/9d68dadf2438708708d602b44b28bcb8 %}

* ReSubmitFailedLogicApps submits the list of failed logic app instances to Azure to be Re-Run

{% gist https://gist.github.com/irajbalakrish/2094ce0465646f39972ff5a946514b7b %}
What is the cdc variable in chromedriver?
Tags: chromedriver, selenium, testing
Published: 2019-07-20 18:25:26

---
title: What is the cdc variable in chromedriver?
published: true
description: 
tags: chromedriver,selenium,testing
---

I saw this thread on reddit and wondered myself WTF is the cdc variable in chromedriver

https://www.reddit.com/r/selenium/comments/cfjydg/selenium_chromdriver_replaced_cdc_variable/

So what is it and why would you even care?

It is a variable that shows up in document when you are using chromedriver. With one tiny subtle thing... if you just run driver.get and do not interact with the page in Selenium the variable does not show up...

Websites that know about it can detect that they are being called/displayed from an automated browser.

You can see it if you look at document["$cdc_asdjflasutopfhvcZLmcfl_"] in javascript. You can verify this by adding this code to a Selenium script in Python.

```python
print(driver.execute_script("return document['$cdc_asdjflasutopfhvcZLmcfl_']"))
```
This will always return something if you are using chromedriver (or at least as of chromedriver 75).

Where does that variable come from? It is code that is embedded in chromedriver. You can find it yourself in the chromium source code. https://github.com/chromium/chromium/tree/master/chrome/test/chromedriver

What if you want to change it so your Selenium scripts will be undetected? The not so easy way is to compile it yourself (but you get points for being a nerd).

The much easier way is to change that variable is to edit your chromedriver executable. See that link below for a reasonable way to do that. Be aware when you change the executable it will trigger a Win10 virus scan the first time you run it again after you hacked it.

I have used this with vim on Windows 10 and it works.

https://stackoverflow.com/questions/33225947/can-a-website-detect-when-you-are-using-selenium-with-chromedriver
React Native Copy Text To Clipboard Example
Tags: reactnative, ios, android, javascript
Published: 2019-07-20 17:31:29

---
title: React Native Copy Text To Clipboard Example
published: true
description: React Native Copy Text To Clipboard Example
tags: #reactnative #ios #android #js
---

Source : <a href="https://www.skptricks.com/2019/07/react-native-copy-text-to-clipboard-example.html" > React Native Copy Text To Clipboard Example</a>

This tutorial explains how to perform copy text to clipboard in react native application with simple example. Reading and writing from the Clipboard is incredibly easy in React Native by using the Clipboard API. It will work on both Android and IOS platform. Clipboard is a clean slate temporary storage area in computers & mobile phones used to perform cut, copy and paste text functionality. By default the cut, copy and paste functionality works automatically in TextInput component in react native. Sometimes developer needs to manually push and pop the values of Clipboard. We would use the react native’s Clipboard component API to manually insert and get value of Clipboard.

<img src="https://1.bp.blogspot.com/-vHeiqH9s2Ew/XSxE0e9KK2I/AAAAAAAADGg/xpo2tYGPaKIf4G1x7lmy52Dx3eX4MZPZgCLcBGAs/s400/react-native-copy-text-to-clipboard-example.jpg" />


<a href="https://www.skptricks.com/2019/07/react-native-copy-text-to-clipboard-example.html" > Click here to read more... </a>
Disable Screen Rotation Landscape Mode in Android React Native
Tags: reactnative, android, ios, javascript
Published: 2019-07-20 17:33:08

---
title: Disable Screen Rotation Landscape Mode in Android React Native
published: true
description: Disable Screen Rotation Landscape Mode in Android React Native
tags: #reactnative #android #ios #js
---

Source : <a href="https://www.skptricks.com/2019/07/disable-screen-rotation-landscape-mode-in-android-react-native.html" >Disable Screen Rotation Landscape Mode in Android React Native </a>

This tutorial explains how to disable screen rotation landscape mode in android react native application. There are two different types of orientation in android device, Portrait mode and Landscape mode. Portrait mode is default mode in mobile devices and if we rotate the device it turns into Landscape mode.But While making an application we normally design for the Portrait mode and let the system manage in Landscape mode (You can manage both) but in some cases, we don’t want the system to change the orientation while the user is using our App.
But in some case developer wants to disable the Landscape Mode screen rotation in android mobile device, in that case you need to follow the below steps in your react native project.

<img src="https://1.bp.blogspot.com/-nyeiPtBU-4g/XTLFg5lYIuI/AAAAAAAADHE/J_1G7goD1Mkc3JZTM7u0k8qYJ24VL0DwACLcBGAs/s400/disable-screen-rotation-landscape-mode-in-android-react-native.jpg" />

<a href="https://www.skptricks.com/2019/07/disable-screen-rotation-landscape-mode-in-android-react-native.html" >Click here to read more... </a>
React Native Make A Phone Call – Open Phone Number In Dial Screen
Tags: reactnative, android, ios, javascript
Published: 2019-07-20 17:29:46

---
title: React Native Make A Phone Call – Open Phone Number In Dial Screen
published: true
description: React Native Make A Phone Call – Open Phone Number In Dial Screen
tags: #reactnative #android #ios #js
---

Source : <a href="https://www.skptricks.com/2019/07/react-native-make-phone-call-open-phone-number-in-dial-screen.html" >React Native Make A Phone Call – Open Phone Number In Dial Screen </a>

This tutorial explains how to make a phone call in react native application using Linking component in react native application. Linking gives you a general interface to interact with both incoming and outgoing app links. In mobile applications you may have seen many times there is a calling button present and when you press the call button it would open the phone numbers on mobile dial pad screen. This functionality would give you more easiness in our application and helps to make a call from application.

<img src="https://1.bp.blogspot.com/-cDNFTqoNgco/XSv94Ed4mnI/AAAAAAAADF8/4MHlcXg9hekgOdgNFB1TyucqUjD_yYfuwCLcBGAs/s400/react-native-make-phone-call-open-phone-number-in-dial-screen.jpg" />


<a href="https://www.skptricks.com/2019/07/react-native-make-phone-call-open-phone-number-in-dial-screen.html" > Click here to read more... </a>
Favicon Fun - Dynamically Updating Your Site Icon with ReactJS
Tags: react, javascript, webdev, beginners
Published: 2019-07-20 17:07:25

Want to make your website or app standout? One way could be what I cover in the video below, using Javascript to dynamically edit your website's favicon based on the state of your application. 

## How can I use this
The most obvious is to notify users of interactions on your site. For example, if you have a chat app, you could dynamically adjust the favicon to show users they have a message waiting even if they are in another tab. 

A more advanced example would be swapping through an array of images to create an animation effect similar to a gif. I will be covering that in a future tutorial so be sure to subscribe

{% youtube STwulrEM574  %}
Turning audio into pictures!
Tags: audio, pictures, python, creative
Published: 2019-07-20 16:43:09

---
title: Turning audio into pictures!
published: true
description: 
tags: audio,pictures,python,creative
---

I've started a project and recently made public with the goal of turning audio into pictures, meaning, I want to create an accurate visual representation of an audio file, especially music tracks.

Here's the link: https://github.com/hpez/tunegraphy

Check it out and let me know if you like it or have any ideas! Also any contribution is more than welcome!
JavaScript INSTAGRAM bot
Tags: javascript
Published: 2019-07-20 15:04:51

You know a little bit of <strong>JavaScript</strong>, and you want to build your following on Instagram, but don't want to share your password with some app, and you don't know BackEnd?! Don't worry, I got you fam! 😁 

I'm gonna show you how to build your personal instagram "bot" 😁 

1. First, open Instagram in a new tab, log in, then type the hashtag you want, open the first image. 

2. Now you are gonna inspect the ❤️ button, the browser console will open, and you will see the class of the button. Usually you have to use the second or third class. 

3. Open the console. Create a variable by the name <strong>like</strong>, and do the same for the arrow pagination ➡️, calling the variable <strong>next</strong>. Access the button element and the pagination with <strong>querySelector</strong>.

4. Now use the <strong>setInterval</strong> method.

5. Using the if statement, if there is a like button add a click event for the button. Then add another click event for the pagination. 

6. Because Instagram likes to ban accounts with "strange" activities, set the interval to 15-20 seconds. And Voilà! 

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

You now have your personal bot without "sharing" your password. You can use this for following people on instagram, or maybe on some other social media. It's up to you!

Btw I'm not sure if this classifies as a BOT, but it will help 😁
Node JS 101: What is Node Js
Tags: node, javascript
Published: 2019-07-20 13:20:50

**What is all the fuss about Node Js?**

Companies are in awe of the speed at which Node.js functions. It runs on the V8 engine developed by Google that uses JavaScript into native machine code and operates at super speed

LinkedIn opted for Node.js from Ruby on Rails to serve their mobile traffic and that reduced the number of servers from 30 to 3 and made the applications 20 times swifter. PayPal recorded a 35% decline in their response time at the same time doubled requests per second after using Node.js applications.

Companies such as PayPal, Uber, Netflix Walmart, Yahoo, etc. rely on Node for a large chunk of their application portfolio. Node Js speed is amazing.

**Are you convinced it is worth learning? Yes? Ok great!**
<h2>What is Node JS? </h2>
Node is a cross-platform, run-time environment for executing JavaScript code outside of a browser. Node is not a programming language or a framework. It is a run-time environment for executing JavaScript codes. 10-15 years back, JavaScript was only functional on client side applications, today you can build full stack (front and back end application) without leaving the JavaScript environment.

**NodeJS is Javascript outside of the Browser.**

In 2009, Ryan Dahl took Google Chrome's V8 engine, which is normally confined to a browser, added an event loop, package manager and a low level I/O API, embedded inside a C++ program and ran on his computer. Node.js opened a whole new world what JavaScript could do: access the files, listen to network traffic and HTTP requests, access databases directly, etc.

Node.js, basically, allows JavaScript to do anything one could with PHP , Ruby on Rails, or Python

__What can you build with Node?__

<li>Chat applications/servers</li>

<li>Your version of Google Hangout or Skype?</li>

<li>Instant messaging services apps</li>

<li>Full eCommerce platforms</li>

<li>Online gaming apps</li>

<li>Netflix</li>

The list is endless.....

How to download and install Node

go to https://nodejs.org
In most cases download the stable version. i.e recommended for most users.

Follow the installation instructions on this website to guide you.

https://www.guru99.com/download-install-node-js.html
Congratulations! you just installed Node. Let us check on our command prompt if node was installed. To check if Node was successfully installed, type node -v on your command prompt or node --version
Need Ideas to learn building a Spring Boot REST API
Tags: discuss
Published: 2019-07-20 14:12:49

---
title: Need Ideas to learn building a Spring Boot REST API
published: true
description: Hi all, i need some cool ideas to try out as i am planning to learning spring boot , building some REST Service :)
tags: #discuss 
---

Hi all, i need some cool ideas to try out as i am planning to learning spring boot , building some REST Service :)
Daily Challenge Post #20 - Number Check
Tags: challenge
Published: 2019-07-20 13:53:18

---
title: Daily Challenge Post #20 - Number Check
published: true
description: Part of "Daily Challenge" series 
tags: #challenge
series: Daily Challenge
---

Create a function which checks a number for three different properties.

>Is the number prime?
>Is the number even?
>Is the number a multiple of 10?

>Each should return either true or false, which should be given as an array. 

Today's [challenge](https://www.codewars.com/kata/5507309481b8bd3b7e001638) comes from sohilpandya on Codewars.

***
_Thank you to [CodeWars](https://codewars.com/), who has licensed redistribution of this challenge under the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause)!_

_Want to propose a challenge for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Nothing is Permanent
Tags: motivation, growth, career
Published: 2019-07-20 13:51:44

---
title: Nothing is Permanent
published: true
description: 
tags: motivation, growth, career
cover_image: https://dzwonsemrish7.cloudfront.net/items/0l3W1t1H1z3c0q3V1P1b/nothing%20is%20permanent.png
canonical_url: https://rizwanjavaid.com/blog/nothing-is-permanent
---

Nothing is Permanent

Imagine a friend who you work closely with told you they have given notice at work because they found a perfect opportunity in another city. How would that make you feel? 

Hopefully, you feel happy for them and the opportunity they have decided to pursue, but maybe you also feel sad in seeing them go because it seemed things were going to stay the same and you latch on to that feeling.  

This happens to us all. We get caught in the feeling that things will always be the same and never change. We get comfortable with our daily lives and events like a friend moving can shake us up. 

This is a good time to reflect on why we feel things are permanent. Instead of worrying about how their decision affects us we can focus on them and be genuinely happy for them. Look at the amazing opportunity they have decided to pursue. Think about how this will help them achieve their goals. 

So the next time a big change happens in your life remember that nothing is permanent.
Rust failure
Tags: rust, errors, failure, fail
Published: 2019-07-20 13:45:10

---
title: Rust failure
published: true
description: Rust failure
tags: Rust, error, failure, fail
---

大家都建议error handling用[failure](https://docs.rs/failure/0.1.5/failure/)这个库，看了看（：

先贴代码
```rust
use failure::{Error, Fail};
use reqwest;

#[derive(Fail, Debug)]
enum MyError {
    #[fail(display = "filed {} not exist", _0)]
    FileNotExist(String),
    // #[fail(display = "http error: {}", _0)]
    // HttpError(#[fail(cause)] reqwest::Error),
}

fn http_get(url: Option<String>) -> std::result::Result<(), Error> {
    if url == None {
        // just test
        return Err(MyError::FileNotExist("url".to_string()).into());
    }
    let client = reqwest::Client::new();
    let result = client.get(&url.unwrap()).send()?.text()?;
    println!("{}", result);
    Ok(())
}

fn main() {
    http_get(Some("https://www.baidu.com".to_string())).unwrap();
}

```

我们可以用failure::Error来替换掉std::error::Error，我们自己的error呢就去实现Fail这个trait，这里我们用了他的过程宏，让它给我们默认实现了，可以cargo expand展开看下
```rust
#[allow(non_upper_case_globals)]
#[doc(hidden)]
const _DERIVE_failure_Fail_FOR_MyError: () = {
    impl ::failure::Fail for MyError {
        fn name(&self) -> Option<&str> {
            Some("fail::MyError")
        }
        #[allow(unreachable_code)]
        fn cause(&self) -> ::failure::_core::option::Option<&dyn ::failure::Fail> {
            match *self {
                MyError::FileNotExist(ref __binding_0) => return None,
            }
            None
        }
        #[allow(unreachable_code)]
        fn backtrace(&self) -> ::failure::_core::option::Option<&::failure::Backtrace> {
            match *self {
                MyError::FileNotExist(ref __binding_0) => return None,
            }
            None
        }
    }
};
```

其实遇到的最大的问题不是这个，而是，我```return Err(MyError::FileNotExist("url".to_string()));``` 的时候要报错说要的是failure::failure::Error而我返回的是这个我自定义的Error，但是不是说好的是实现了Fail接口就行吗？文档也没写，又来在某个issue里面发现，说要么into()，要么?

所以得写成
```rust
return Err(MyError::FileNotExist("url".to_string()).into());
```
或者

```rust
Err(MyError::FileNotExist("url".to_string()))?;
```