teleren/devto huggingface dataset:
Learn R Programming from Scratch: Day 1 Install on Windows
Tags: rdatascience, datascience, rlanguage
Published: 2019-01-26 20:51:10

---
title: Learn R Programming from Scratch: Day 1 Install on Windows
published: true
description: Install R and RStudio on Windows 
tags: #rdatascience #datascience #rlanguage
---

Like many of my office friends I have decided to learn R language. So why sudden need for the R? I am into front end and testing for some time. But these days that's just not enough. My company has decided to get into the data set. And they are training lot of interns and existing employees on data science. It seems like data is new direction for many companies in the social media and the analytics specific companies. 

My only issue however is that unlike most of my seniors, I have Windows to use at workplace. And as per current HR announcement we are not going to be switching to linux or mac any time soon. So my first step towards the R is starting with the [Install R and RStudio in Windows](https://www.youtube.com/watch?v=-L2Ihqa3pnc). And here I have like two choices. One is to install the Cran R and RStudio. 

[**CRAN-R**](https://cran.r-project.org/)

This is the official place from where you can download R. You get one console binary and one simple editor. Either way you choose to run the script works. This is free to download unlike Rstudio which has one premium version too. If you use this then you'll understand how to download the packages from scratch which is much more simple with Rstudio than official R installer. I'd recommend CRAN-R if your company does not want to use Rstudio. 

![RStudio Windows](https://thepracticaldev.s3.amazonaws.com/i/v0p9bj0gf8023dirh5un.png)

[**RStudio**](https://www.rstudio.com/)

Rstudio is the best IDE you can use on Windows for learning R. Currently we are not using it in the company for no idea what reason. If you happen to know any reason why any company would not allow employees to use Rstudio do let me know. You have free version and premium server version for download. You can learn [How to install RStudio on Windows](https://www.youtube.com/watch?v=q5qKjKRbGYo). I think if you want simplicity then compared to CRAN R, this looks lot better. 

So my current approach is to learn this from script level instead of REPL. I have however downloaded Rstudio at home. And it seems like much better and comfortable to use. I am now on to try some of the generic tutorials on the web and I'll write about my journey as I try some of those examples. Do let me know how you learned R and how you approached this language while learning data science.
{… Many ways in JavaScript }
Tags: javascript, recatjs, angular, vue
Published: 2019-01-26 18:19:10

---
title: {… Many ways in JavaScript }
published: true
description: In this Post, we are going to learn, How to solve the same problem by multiple ways in JavaScript.


tags: #javascript #recatjs #angular #vuejs
---
**IIFE(Immediately Invoked Function Expression)**

An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.

Here we are going to write IIFE by 12 ways.

{% gist https://gist.github.com/rao123dk/2dd35f760dd9bdce2db5e11f97ccdaa2 %}

**Creating Arrays**

The JavaScript Array object is a global object that is used in the construction of arrays; which are high-level, list-like objects. For this topic I would like to say thanks to 2ality.com .

Here we are going to create array by 10 ways.
{% gist https://gist.github.com/rao123dk/10cecd9ecedc842417b5aa20f0ba7516 %}

**Define Function**

Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure — a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.

Here we can write function by 6+ ways.

{% gist https://gist.github.com/rao123dk/8e9c7f6689da304b660a57cfeeb9be53 %}

**Covert to Number**

The Number JavaScript object is a wrapper object allowing you to work with numerical values. A Number object is created using the Number() constructor. A primitive type object number created using the Number() function.

Here we can convert string to Number by 9 ways.

{% gist https://gist.github.com/rao123dk/c2d6e714c93a0017c49ecb3bd2eb68e5 %}
Glamorization of effort in the study and work
Tags: discuss
Published: 2019-01-26 18:05:09

---
title: Glamorization of effort in the study and work
published: true
tags: discuss
---

When we want learn something new either for study or same in work's task we spend more time than normal to get done this.

Either staying in te computer for a long time or staying until dawn working or studying.

Some people says : "Work hard to achieve objectives. " 

This routine for now seems no harmful but doing this by a long time will be so painful.

Then in my head we should divide our time to not to reach this stage all messed up, where we need spent more time than necessary,  degrading our body and our mind.

_**I don't saying that we shouldn't spend time to level up your career, but within our limits.**_

Folks, whats do you think about this? Some routine that you uses to separate hour to studying and turn off technology enviroment.
I use the GitHub Desktop app for one thing. Am I doing this wrong?
Tags: discuss, opensource, github, help
Published: 2019-01-26 18:00:54

---
title: I use the GitHub Desktop app for one thing. Am I doing this wrong?
published: true
description: 
tags: discuss, opensource, github, help
---

When I go to review a PR that cannot be purely evaluated on the code, I click this link:

![](https://cl.ly/22d4b8e211b5/[f3d1a9246da555505da17b175ac13f4e]_Image%202019-01-26%20at%2012.55.07%20PM.png)

I've found that to be the most seamless way to check out the branch and give the working app a manual look-see. Otherwise I use the git CLI, but I've found this to be my favorite way so far.

But it seems _off_ to me. I have this app running all the time for this singular purpose. It also seems _off_ because I have to scroll all the way to the bottom of the page and click a text link. If this were the _appropriate_ behavior, it would make sense to me that this button would look a lot more like the "Squash and Merge" button next to it.

I know this has worked for me, but I'm just curious if I'm missing something.
Boost your Website Speed with 2 Lines of Code
Tags: react, vue, angular, javascript
Published: 2019-01-26 16:41:18

---
title: Boost your Website Speed with 2 Lines of Code
published: true
description: Faster subsequent page-loads by prefetching in-viewport links during the idle time
tags: reactjs, vue, angular, javascript
---

Consider you're reading a blog post. While reaching the bottom you can see **related posts**. What if your browser will preload those pages even before you click?

Super fast inner pages, right?

# Introducing Quicklink
[QuickLink](https://github.com/GoogleChromeLabs/quicklink) is a tiny JavaScript code that will detect links within the viewport and prefetches URLs to the links.

### Installation
`npm install --save quicklink`

```js
import quicklink from "quicklink/dist/quicklink.mjs";
quicklink();
```
[Full api docs](https://github.com/GoogleChromeLabs/quicklink#api)

### But it will load unnecessary data, will it slow down my user?
Quicklink waits until the browser is idle, checks if the user isn't on a slow connection or has data-saver enabled.

Result? Those URLs will load instantly!

### Will it slows down my website?
It's only < 1KB minified/gzipped


## Did it help?
Follow me on [Twitter](https://twitter.com/gijovarghese141), I share a lot of cool stuff there
How the Beginner would Try Cryptocurrency Exchange Script 
Tags: cryptocurrencies, cryptocurrency, exchange, script
Published: 2019-01-26 16:11:54

---
title: How the Beginner would Try Cryptocurrency Exchange Script 
published: true
description: Everyone could run the cryptocurrency exchange himself. There are different ways how to do it and what script to choose. Of course the variety of scripts is great. 
tags: cryptocurrencies, Cryptocurrency, Exchange, Script
---

![Cryptocurrency Exchange](https://thepracticaldev.s3.amazonaws.com/i/bidkny1oh6tsz3l3p4j0.jpeg)
The intensity of exchanging cryptocurrencies business is incredible. Exchange rates arouse interest of investors, traders and other participants of the market. But besides observing everyone could run the cryptocurrency exchange himself. There are different ways how to do it and what script to choose.
Of course the variety of scripts is great. Many companies or teams of freelancers offer different ones and assure that they are the best or near that. But don’t hurry up, even multifunctional improved script could be not appropriate to your project.
If the theme is actual for you and you are interested in Cryptocurrency Exchange Script follow http://merehead.com/blog/cryptocurrency-bitcoin-exchange-script/. Here you could read about the usage of different scripts. And lots of them are really useful, but firstly buy some of them have a practice!
Use free scripts as the first step. Work with them for some period of time. Then when you become a bit experienced ask for trial version. Don’t be in a rush paying some one. Check it properly whether it is appropriate for you. Even if it is not free, the seller should offer to you its trial version and only after working with it you may conclude to buy it or not.
Doing this way you’d avoid disappointment and save money. Only considerable steps could conduce in running crypto exchange business.
5 Tips to ace an interview over the webcam
Tags: career, beginners, webdev, javascript
Published: 2019-01-26 14:39:17

---
title: 5 Tips to ace an interview over the webcam
published: true
description: I do job interviews with Junior/Senior developers and sometimes I'm amazed at what I see or hear.
tags: #career #Beginners #webdev #javascript
---
I do job interviews with Junior/Senior developers and sometimes I'm amazed at what I see or hear. 

Here are some tips that could help you to land your dream job!

1) Find a pleasant background. Think about the other persons, they will have to look at it for at least 30 minutes. Don't sit in your bad. Don't do it in a place with a lot of people who are talking in the background.

2) Wear something appropriate. I have seen people doing their interview in an old dirty white T-shirt. You don't have to dress up as you would go to your own wedding. Wear something you like and feel good in.

3) Take a look at the website of the company. The change that the interviewer will ask you the following question is almost written in stone. "Do you know what we are doing?" or any question like that. If you don't understand what the company is doing its okay. Tell that, so the company can improve their website.

4) Prepare some questions that you can ask. Usually, I ask several times in the interview "Do you have any questions?". For me, it's a good sign if the interviewee has some questions. So I know he is listening and it also shows that the interviewee has some deeper knowledge. 

5) Be honest. Really be honest as much as you can! If you don't understand something or don't know something, it is totally okay! Nobody is perfect and nobody can know everything.

Do you agree? Do you have other tips? Leave a like Comment down below!

Thanks for reading!

Say Hallo! [Instagram](https://www.instagram.com/lampewebdev/) | [Twitter](https://twitter.com/lampewebdev) | [LinkedIn](https://www.linkedin.com/in/michael-lazarski-25725a87) | [Medium](https://medium.com/@lampewebdevelopment)
Socket Programming in C: Communication Styles
Tags: c, sockets, networking
Published: 2019-01-26 14:35:28

Being there are multiple different types of sockets available for our use, we will take a brief look at some of them. When we get to socket creation, the second argument takes a number that represents the communication style. Each number has a symbolic constant.

## 1. SOCK_STREAM

A socket that streams data over a connection like a cable or a pipe. It transmits data like a stream of bytes reliably.

## 2. SOCK_DGRAM

This style of sockets doesn't have a connection but instead, each packet is addressed and sent individually. Also, this an unreliable style of communication unlike SOCK_STREAM. Each data written to this kind of socket is converted into one packet. The only guarantee this socket gives you is it will try its best to transmit every packet you send.

## 3. SOCK_RAW

Most user-level programs will not use this kind of communication as it provides low-level access to protocols and interfaces.
React explained to newcomers
Tags: discuss, react
Published: 2019-01-26 14:14:16

---
title: React explained to newcomers
published: true
description: How would you explain the benefits of React to a dev that has never worked with the library?
tags: discuss, react
---

### How would you explain the benefits of React to a dev that has never worked with the library?

I'm mentoring a friend that's currently mastering JavaScript/jQuery, but I'd like to eventually introduce him to a more modern stack (most likely webpack, React AND Vue, Babel, etcetera). I was wondering what's the best approach to explain the benefits of React as a whole without making that explanation too complex.
Be careful who you work for!
Tags: job, softwarestack, employer, interview
Published: 2019-01-26 08:37:58

---
title: Be careful who you work for!
published: true
description: An "experience"
tags: job,software-stack,employer,interview
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vm6k2joifn7j74tiipza.jpg 
---
This is my first post here! And here it goes:

I was working for a company for 4 months last year and there was one big mistake that made those couple of months really hard for me and that was not paying attention to what/who I was working with. 
	
### The interviewer
First off, don't trust what you hear in the interview, which can mean two things: 
1- The interviewer may not be that honest with you or, 
2- He/she may not see the job as you should (In a technical view).
	
### When you should start looking for more
When you get to the stage that you know what you're doing,  there are a couple of things beside salary and co-working experience and other obvious things that you should make sure about:
		1. 	What software stack they're using and how suitable it is for you to work with that stack
		2. 	How experienced they are in managing the position they're hiring you for

### What it can cause
Not knowing the above may lead to the experience that I had, a bad software stack led to losing my coding passion and therefore not delivering with the quality that I should have. And the second part led to not being able to manage the tasks and not knowing what to expect from the developer; which, in a rather small team, messes up the whole developing team and puts a lot of pressure on the developer.
	
So all in all, **be careful who you work for!**
Add unit tests on a project already in progress
Tags: testing
Published: 2019-01-26 13:48:04

---
title: Add unit tests on a project already in progress
published: true
description: I give you my advice to set up unit tests even on big apps
tags: testing
cover_image: https://thepracticaldev.s3.amazonaws.com/i/smlcdpgndmqss3iyubbf.jpg
---

## My experience

I am currently in a project and we did not use unit tests. Here we are, one year after, and as the issues were more and more about stuff we were confident with, I felt it was the right time to propose unit tests.

Did you found yourself in my experience? If yes, I give you below my advice to kindly start using unit tests.

## One fix = one unit test

Your code base is already big. You do not have the human bandwidth to parse all your methods and create the unit tests. 

However, you could start by creating one unit tests for each new issue you fix.


```javascript
// Fixes issue #31
it('should not allow planning a publishing date in the past', function() {
  // ...
});
```

## Benefits of progressive unit tests

- they make you more confident when you create your pull requests
- they forces you to think out of the box by stating what is the expected result of your fix
- they make you earn some time when you search which edge case you did not thought of if the issue comes back
- PR reviewers quickly understand which case you are solving

## Not convinced yet?

Pavol also wrote about the benefits of unit testing a project in progress in this article. Take a look at it if you need more points of view.

{% link https://dev.to/rapasoft/why-writing-tests-for-legacy-code-is-a-good-thing %}

## Conclusion

Coding can be frustrating, or even worse, stressing, in a production environement. Deadlines can make us take shortcuts and avoid simple or obvious coding principles, leading to avoidable issues.

I think unit tests are the right tool to help us make our job more enjoyable, by making sure we are building some code on solid basis.

I hope this post made you want to start trying unit testing your code if you did not already!

Photo by [Startup Stock Photos](https://www.pexels.com/@startup-stock-photos?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels) from [Pexels](https://www.pexels.com/photo/schedule-planning-startup-launching-7376/?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels)
Respecting Rails app time zone in cron jobs
Tags: ruby, rails, cron, whenever
Published: 2019-01-26 13:22:04

---
title: Respecting Rails app time zone in cron jobs
published: true
description: In this article we will discover how to make whenever gem respect Rails app time zone
tags: ruby, rails, cron, whenever
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xfao686c8jrhry8ma1po.jpg
---

Let's imagine that you need to set default time zone in your Rails app. You go to `application.rb` and write: 
```
config.time_zone = 'Central Time (US & Canada)'
```
As simple as that. Now your app will take into account this info when you will perform some actions based on time.

Now, let's say, you need to add some recurring jobs. Most probably you will use [`whenever`](https://github.com/javan/whenever) gem and will have this kind of code in gem generated `schedule.rb`: 

``` ruby
every :monday, at: '9am' do
  rake 'send_weekly_reports'
end
```

What this code will do? It will run `send_weekly_reports` rake task each Monday at 9am. But. 9am at what time zone? Maybe time zone that we previously set as our app default time zone? No. It will use server time zone.

But what if you want to use your app time zone? We have 2 options here:
a) we can change our server time zone to the same time zone as we use in our app;
b) we can handle it inside our app.


Let's see how you can handle it inside the app.

You will need to add this code to your `schedule.rb` file:
``` ruby
require_relative './environment'

def timezoned time
  Time.zone.parse(time).utc
end

every :monday, at: timezoned('9am') do
  rake 'send_weekly_reports'
end
```

Now you will need to use method `timezoned` by passing required time to it and get your time parsed to UTC which is mostly used by servers.
`require_relative './environment'` is here to be able to call `timezoned` method code.

As a result, now if we are setting some job to be run at 9am, it will run at 9am at the time zone defined by you at `application.rb`.

_Cover image by [Stanley Dai](https://unsplash.com/@stanleydai) on [Unsplash](https://unsplash.com/photos/SEB_I5Cl_sw)_
Injecting Custom JavaScript Into React Native Webview
Tags: react, reactnative, es6, javascript
Published: 2019-01-26 11:57:52

---
title: Injecting Custom JavaScript Into React Native Webview
published: true
description: Injecting Custom JavaScript Into React Native Webview
tags: #react #reactnative #es6 #js
---

---
Source : <a href="https://www.skptricks.com/2019/01/injecting-custom-javascript-into-react-native-webview.html" >Injecting Custom JavaScript Into React Native Webview </a>
---

This tutorial explains how to inject custom javascript in webview component in react native application.The injectedJavaScript is a custom prop of the React native Webview component. You can pass any JavaScript code ( as string ) to this prop, and React native will inject this JavaScript code into the Webview. The injected JavaScript will get executed once the Webview is finished loading.

<a href="https://www.skptricks.com/2019/01/injecting-custom-javascript-into-react-native-webview.html" >Injecting Custom JavaScript Into React Native Webview </a>

<img src="https://2.bp.blogspot.com/-XlVMUqqwmss/XERZAPc19_I/AAAAAAAACWg/FPk6iQlcTt0JIo32jQUfT_slYQFKDwtdQCLcBGAs/s640/custome%2Bwebview.png" />
How To Enable & Disable JavaScript Code In WebView React Native
Tags: react, reactnative, javascript, es6
Published: 2019-01-26 11:56:25

---
title: How To Enable & Disable JavaScript Code In WebView React Native
published: true
description: How To Enable & Disable JavaScript Code In WebView React Native
tags: #react #reactnative #js #es6
---

---
source : <a href="https://www.skptricks.com/2019/01/how-to-enable-disable-javascript-code-in-webview-component.html" > How To Enable & Disable JavaScript Code in WebView React Native </a>

----


This tutorial explains how to enable and disable javascript code in WebView component using react native application. This features helps the android and iOS application user to stop executing JavaScript and jQuery on their webpage loaded inside WebView in device. we are going to make a react native app with Enable and Disable JavaScript Code functionality and Stop executing JavaScript + jQuery code on their WebView Component using javaScriptEnabled={Boolean Value} prop in Android  or iOS application.

<a href="https://www.skptricks.com/2019/01/how-to-enable-disable-javascript-code-in-webview-component.html" > How To Enable & Disable JavaScript Code in WebView React Native </a>
<img src="https://4.bp.blogspot.com/-jo33b_xOw_M/XEROjFnSvAI/AAAAAAAACWM/9WSf504FpSMA9OVeOiva9x7N2FPajcnywCLcBGAs/s640/enable.png" />
Haskell in One Slide
Tags: haskell, short, slide, pic
Published: 2019-01-26 10:46:57

---
title: Haskell in One Slide
published: true
description: 
tags: haskell, short, slide, pic
---

This pic is from the video by professor Simon and explains the function syntax clearly.

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

{% youtube 6COvD8oynmI %}
$ in haskell
Tags: haskell
Published: 2019-01-26 09:36:01

---
title: $ in haskell
published: true
description: Function composition plays a very important role in functional programming and in haskell things get better with the `$` operator.
tags: haskell 
---

P.S: This is a cross post from [h3manth.com](https://h3manth.com).

Function composition plays a very important role in functional programming and in haskell things get better with the `$` operator.

`$` AKA `Application operator` helps us in avoiding parentheses during function, a quick type check reveals:

```hs
Prelude> :t ($)
($) :: (a -> b) -> a -> b
```

```hs
($) :: forall r a (b :: TYPE r). (a -> b) -> a -> b infixr 0
```

That implies `(f x)` is same as `(f $ x)` but it helps us in rewriting `f (g (h x))` as `f $ g $ h $ x`

So, say we have:

```hs
take 5 (reverse (filter odd [1..10]))
```

We can re-write it as:

```hs
take 5 $ reverse $ filter odd $ [1..10]
```

It gets interesting with the function composition operator `.`

```hs
Prelude> :t (.)
(.) :: (b -> c) -> (a -> b) -> a -> c
```

We can re-write the `$` expression to:

```hs
take 5 . reverse . filter odd $ [1..10]
```

or

```hs
(take 5 . reverse . filter odd) [1..10]
```

Another example would be using the `$` and `.` with `interact`.

```hs
Prelude> :t (interact)
(interact) :: (String -> String) -> IO ()
```

^ Input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.

Say, we need to accept multiple inputs from the standard input and add them up, we could do it as:

```hs
main = interact $ show . sum . map read . words 
```

If we are trying the same in `Prelude`, you must use `lines` with it. (Better not to use `interact` in `GHCi`)

```hs
Prelude> interact $ show . sum . map read . words . head . lines
```

So, the thing to remeber is:

* `f $ x = f x`

* `(f . g) x = f (g x)`