teleren/devto huggingface dataset:
과연 Android Gradle Plugin 4.1.0 에선 Desugaring 을 써도 되는걸까?
Tags: android
Published: 2020-12-08 02:19:52

---
title: 과연 Android Gradle Plugin 4.1.0 에선 Desugaring 을 써도 되는걸까?
published: true
description: AGP 4.1.0 에선 버그가 수정되어 desugaring 써도 된다. 
tags: android 
//cover_image: https://direct_url_to_image.jpg
---

**한줄 요약** : AGP(Android Gradle Plugin) 4.1.0 이상부턴 안심하고 java8 desugar 기능을 써도 될 것 같다.

## Java8 Api Desugar 
안드로이드는 특정 OS 이상에서만 java 8을 제대로 지원한다. 예를 들어 `java.time` 패키지의 [javadoc](https://developer.android.com/reference/java/time/package-summary?hl=en) 을 보면, 최소 지원 버전이 API 26 ( Android 8.0 오레오 ) 인 것을 확인할 수 있다. 이러한 불편함을 해소하기 위해 빌드 도구에 [Java 8+ Api desugaring 지원](https://developer.android.com/studio/write/java8-support) 기능을 추가하였다. 구형 OS의 sdk에 없는 java 8 관련 코드를 앱 빌드에 심어줘서 앱 입장에선 OS 구분 없이 API를 사용할 수 있게된다.

Kotlin을 주력으로 쓰는 입장에서 다른 API는 별 흥미가 없지만, `java.time` 은 꽤 매력적이다. 기존엔 이 API를 쓰려면 [ThreeTenABP](https://github.com/JakeWharton/ThreeTenABP) 를 써야 하는데, desugaring의 은총을 입으면 별도 라이브러리 없이도 그냥 `java.time` 을 쓸 수 있게 된다. 

## AGP 4.0.0 의 버그
하지만 기존 AGP 4.0.0 버전에선 문제가 있었다. 마시멜로 이하 단말에서 특정 클래스에 접근할 때 `NoClassDefFoundError` 가 발생한다. 이 이슈는 [구글 이슈 트래커](https://issuetracker.google.com/issues/157681341?fbclid=IwAR2f2EJk-P4Se_cUPVfWLLM30QtZCbN4RzpQ2Zu-3K4jdF8p_ktCItjDBeU) 에 잘 정리되어 있다. 회사 프로젝트에서도 이 문제가 발생해서 들어내는 작업을 했었다.

그럼 이젠 문제가 해결되었을까 궁금했다. 위 이슈엔 친절히 문제가 발생하는 repo의 링크가 걸려있어 실험을 해 봤다.

## AGP 4.1.0 실험 
링크의 repo를 받아 그대로 빌드해서 실행해봤다. 예상대로 앱이 뜨자마자 크래시가 난다. 그럼 AGP 4.1.0 을 적용해보면 어떨까? 그런데 링크 repo의 기반 환경이 꽤 예전 것이라 AGP 4.1.0 을 바로 적용하기 어려워 삽질을 좀 한 끝에 아래 두 가지 환경에서 테스트 해 봤다.

  * kotlin 1.4.20 / gradle 6.7.1 / desugar 1.0.9 / **AGP 4.1.0-alpha09** : **크래시 발생**
  * kotlin 1.4.20 / gradle 6.7.1 / desugar 1.0.9 / **AGP 4.1.0** : **실행 성공**

## 결론 
다른 부분은 desugaring 에 큰 영향을 미치지 않는다고 가정할 때, AGP 4.1.0 에선 해당 버그가 **진짜로** 수정되었다고 가정할 수 있다. `java.time` 쓰러 가즈아!
Github Profile Readme 
Tags: github, productivity, showdev
Published: 2020-12-08 01:13:48

I recently released the Readme for my Github Profile with a cool new look. See it <a href="https://github.com/MadhuNimmo">here</a>.
If you like it and want a similar one, read further.

I used the <a href="https://rahuldkjain.github.io/gh-profile-readme-generator/">Github Profile Readme Generator</a> to generate it and to customize it further I used <a href="https://github.com/anuraghazra/github-readme-stats">Github Stats</a> .

And, that's it you are done.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/lD76yTC5zxZPG/giphy.gif">

For more inspiration and customization though feel free to check the below links:
<a href="https://github.com/matiassingers/awesome-readme">Awesome Readme</a>

<a href="https://github.com/coderjojo/creative-profile-readme">Creative Profile Readme</a>
"Why did you decide to study Software Engineering?”
Published: 2020-12-08 01:09:33

I have always had an interest in Technology and a creative mind. I am very observant and persistent which helps me when problem-solving. These qualities aided me in my Military career but I wanted to use this in a civilian career. All of these qualities apply to the field of Software Engineering. I decided to study Software Engineering because I wanted to use my interests and qualities in a career. I study Health Informatics at University and I see how the Medical Field is behind the Technology curve. I want to make a difference in that field using skills I learn as a Software Engineer. I hope to one day create software that can be used across the United States to create more consistency in record keeping and communication. I also have a passion for learning. Careers in the tech field require continuous learning because technology is growing and changing so I will stay interested by learning. I am excited about this journey.
I'm Stuck
Tags: devjournal, webdev, beginners, discuss
Published: 2020-12-08 01:01:59

Right now I am twenty years old. I have been trying to teach myself development (web development, then application development, and now I am back to web development) for about 4 years. When I was in high school I got my first gaming PC and I discovered that PCs are multi-purpose tools. I discovered HTML and was surprised that it really is that easy to create a static web page. I was amazed at making words bold with the `<strong>` tag and making words big with the `<h1>` tag. In my senior year in high school, I took a 'web design' course. The web design course was for some reason taught by the school's business and marketing instructor. Most of the assignments I finished in a day when other kids took a week to complete them. At times I even felt like I knew more than the instructor. After this course, I thought I was a web development genius. Then I started looking online at things people had made and things people could do, I started looking at job postings and learned that I knew almost nothing.

By the time I was seventeen or so I had purchased a udemy course called the complete web developer bootcamp taught by Colt Steele. I started going through all of the modules and then for some reason I stopped.

By the time I was eighteen I got a job at an Amazon fulfillment center (a really bad place to work in my opinion). When working at Amazon they had internal wiki pages that people could make for themselves and I made a few and realized that that is what I want to do as a job. Web development. I needed to get back into it. I quit my job at the fulfillment center and enrolled in community college.

The first semester I took Intro to computer programming where we used Python, I took a class where we learned Oracle databases and SQL, and I took Computer Science I: C++. I easily got high marks in all of my classes and I did so for the rest of my semesters as well. The problem is that I didn't feel as if I was learning anything and I still don't.

I started to go back to the udemy course I mentioned earlier and felt that I was learning more valuable skills there than in school.

I have completed most of my requirements to graduate (all except four classes), but I still feel like I don't know what I need in order to get a development job.

Currently, I am still trying to learn development. I have been hung up on CSS lately and am working on my own framework called NimbleUI. I really do hope something comes of this because I am stuck and I feel like I have been going nowhere for the past two years.

Anyway, thanks for reading my first post. I hope to keep posting about anything development related as I continue to learn. Maybe even a dev log about NibleUI. ☕☕☕
Why am I here ?
Tags: welcome, webdev, programming, productivity
Published: 2020-12-08 00:47:06

So, I've been lurking a bit in this community since COVID. While it seemed great and supportive, at the time I was really busy with work and didn't have much time to be involved.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/VgSjnwSoqiPjRRIJ1F/giphy.gif">

Well, as of today, I thought, let's do this. Let me share some of my experiences and learnings with you all too. Looking forward to having great discussions.

Stay safe. Stay well.
Leetcode Two Sum - Solution & Video Explaination
Tags: cpp, algorithms, interview, leetcode
Published: 2020-12-08 00:29:00

{% youtube wEpviAgbDtk %}

## Solving using the Brute Force method

```cpp
vector<int> TwoSum(vector<int>& nums, int target) {
			
  vector<int> target_indices;

  for (int i = 0; i < nums.size(); i++) {
    for(int j = i+1; j < nums.size(); j++) {
						
      if(nums.at(i) + nums.at(j) == target) {
        target_indices.push_back(i);
        target_indices.push_back(j);
        break;
      }

    }
  }

  return target_indices;
}
```

## Solving using Hashmaps

```cpp
vector<int> TwoSum(vector<int>& nums, int target) {
  vector<int> target_indices;

  unordered_map<int, int> hash_table;
  for (int i = 0; i < nums.size(); i++) {
    int second_integer = target - nums.at(i);

    if (hash_table.find(second_integer) != hash_table.end()) {
      target_indices.push_back(i);
      target_indices.push_back(hash_table.find(second_integer)->second);
      break;
    } else {
      hash_table[nums.at(i)] = i;
    }
  }

  return target_indices;
}
```

## Complexity

Runtime: O(n)
Space: O(1)
Day 271 : Better
Tags: hiphop, code, coding, lifelongdev
Published: 2020-12-08 00:03:17

_liner notes_:
- Saturday : Actually got some coding in before the radio show. Did the radio show and my co-host made his return! Had a really good time. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Graph showing that there were 229,077 new cases of coronavirus in the United States on December 4th 2020 with the words Dec 5th 2020, Our Money](https://dev-to-uploads.s3.amazonaws.com/i/a5qdfxb6fqqvprtj6iq0.jpg)

- Sunday : Finished up some promo work for the radio show and got to work on my side project. I was able to clip a video sent to my server using FFMPEG. Felt pretty good. I've always wanted to be able to use the web to edit video automatically and this a good first step, I think. Right now, plan is to use a third party API to do the fancy edits, but the more basic ones, I'll use what I created. I've got some other things I can use it for.

- Professional : Got up early to go on our weekly live stream show. Picking up some experience so I'll be better prepared when I start doing my shows. I think a big thing is consistency and having a goal / purpose for the show. After that I got to help out with a conference. Met with my manager and showed him an app I made to help me test our SDK. He wants me to push the code to the community repository because he said it would be a good tool to help other developers. So I'll clean up some stuff and layout the information better and upload it.

- Personal : I really want to launch a couple of side projects next year. Some stuff that will hopefully be helpful to others. Pretty excited to see what comes from them.

![View of the mountain range of the Grand Tetons, WY, USA from a field](https://dev-to-uploads.s3.amazonaws.com/i/r2bpvzp8al237ibaqi5d.jpg)

Tonight going to work on my https://otech.events project. I would like to add a backup method just incase the connection to YouTube doesn't happen at the start of the event. The Vonage Video API allows for archiving of the live stream. My plan is to take the archive and then use the back end to upload to YouTube and a couple of other places. Maybe watch some "Legion". I haven't been able to in a couple of days.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube bgUSw3Redi4 %}
Advent of Code 2020-08 with R
Tags: rstats, adventofcode
Published: 2020-12-15 20:40:30

---
title: Advent of Code 2020-08 with R
published: true
date: 2020-12-08 00:00:00 UTC
tags: rstats, adventofcode
canonical_url: https://colinfay.me/aoc-2020-08/
---

Solving Advent of Code 2020-08 with R.

[Disclaimer] Obviously, this post contains a big spoiler about Advent of Code.

## Instructions

Input looks like this

```r
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6

```

- There is a global var called `accumulator`, starting at 0

- `acc n` increases or decreases `accumulator` by `n`, and goes to next row

- `jmp n` jumps to a its position + `n`

- `nop` does nothing but going to the next execution

- If the program tries to execute a row twice, we stop, and the eturned value is the value just before that

Find the complete instructions at:[https://adventofcode.com/2020/day/8](https://adventofcode.com/2020/day/8).

## R solution

### Part one

```r
# Reading the data
input <- read.delim(
  sep = " ",
  "2020-08-aoc.txt", 
  header = FALSE, 
  stringsAsFactors = FALSE
)

give_me_a_break <- function(input){
  
  accumultor <- 0
  current_row <- 1
  done_row <- c()
  exit_code <- 0
  
  while(TRUE){
    if (current_row %in% done_row){
      exit_code <- 1
      break
    }
    if (current_row > nrow(input)){
      break
    }
    done_row <- c(done_row, current_row)
    curr_row <- input[current_row,]
    if (curr_row$V1 == "nop") {
      current_row <- current_row + 1
    }
    if (curr_row$V1 == "acc") {
      accumultor <- accumultor + curr_row$V2
      current_row <- current_row + 1
    }
    if (curr_row$V1 == "jmp") {
      current_row <- current_row + curr_row$V2
    }
  }
  return(
    list(
      accumultor = accumultor, 
      exit_code = exit_code
    )
  )
}

give_me_a_break(input)

## $accumultor
## [1] 1528
## 
## $exit_code
## [1] 1
```

### Part two

```r
for (i in which(input$V1 %in% c("nop", "jmp"))){
  
  modified_ipt <- input
  
  if (modified_ipt[i, 'V1'] == "nop"){
    modified_ipt[i, 'V1'] <- "jmp"
  } else {
    modified_ipt[i, 'V1'] <- "nop"
  }
  
  res <- give_me_a_break(modified_ipt)
  
  if (res$exit_code == 0){
    print(res$accumultor)
    break
  }
  
}


## [1] 640
```
Making a custom 404 page in Next.js
Tags: nextjs, blogvent
Published: 2020-12-08 21:40:06

---
title: Making a custom 404 page in Next.js
published: true
date: 2020-12-08 00:00:00 UTC
tags: nextjs, blogvent
canonical_url: https://www.netlify.com/blog/2020/12/08/making-a-custom-404-page-in-next.js/
---

Welcome to Blogvent, day 8!

If you’ve ever messed around enough with your Next.js applications and poked around with new routes, you’re probably familiar with this error page:

![Next.js 404 Error Page](https://www.netlify.com/img/blog/the404.png "Next.js 404 Error Page")

It’s a well-designed, simple page, but what if you want to add your own branding and linking to it? Well, luckily for you, they thought of that, and it’s as simple as adding a `404.js` file inside of your `pages/` directory.

Here’s a quick example of what you could do:

```jsx
// 404.js
import Link from 'next/link'

export default function FourOhFour() {
  return <>
    <h1>404 - Page Not Found</h1>
    <Link href="/">
      <a>
        Go back home
      </a>
    </Link>
  </>
}

```

Because this is just like any other page component in Next.js, you can add whatever styling, links, data, or copy you’d like.

For other errors, you can do the exact same thing with an `_error.js` file in the `pages/` directory! The 404 error is special because it is always statically generated, but the others rely on the server. If you’d like to use the server-rendering aspects of Next.js on Netlify, check out [our one-click install build plugin](https://www.netlify.com/blog/2020/12/07/announcing-one-click-install-next.js-build-plugin-on-netlify/?utm_source=blog&utm_medium=nextplugin-cs&utm_campaign=devex).

Wanna a custom Next.js 404 page in action? [Take a look at the 404 page on Jamstack Explorers](https://explorers.netlify.com/youareverygoodlooking?utm_source=blog&utm_medium=404-cs&utm_campaign=devex)! You can also [check out the code here](https://github.com/netlify/explorers/blob/main/src/pages/404.js).
How to reverse the array without mutating the original array in JavaScript?
Tags: javascript
Published: 2020-12-08 00:00:00

---
  title: How to reverse the array without mutating the original array in JavaScript?
  published: true
  tags: JavaScript
  date: Tue Dec 08 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/reverse-array-without-mutating-original-array
  cover_image: https://melvingeorge.me/_next/static/images/main-5852365f10afc57601a4d0d93ee29021.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/reverse-array-without-mutating-original-array)
  
To reverse an array without mutating the original array in JavaScript. First, we can use the `slice()` method on the array to create a copy of the array and then use the `reverse()` method on that array to reverse the elements or items in the array.

```js
/* Copy and Reverse the Array */
const reverseArr = arr.slice().reverse();
```

Suppose I have an array of numbers like this,

```js
// array of numbers
const numsArr = [1, 2, 3, 4, 5];
```

First, let's make a copy of the array using the `slice()` method on the array.

- If nothing is provided as an argument to the `slice()` array method, it copies the entire array and then returns a new array.

```js
// array of numbers
const numsArr = [1, 2, 3, 4, 5];

// copy array using slice() method
const copyArr = numsArr.slice();
```

After that we can use the `reverse()` method on the copied array to reverse the elements.

- The `reverse()` array method returns a new array with elements reversed.

```js
// array of numbers
const numsArr = [1, 2, 3, 4, 5];

// copy array using slice() method
const copyArr = numsArr.slice();

// reverse the copied array
// using the reverse() method
const reverseArr = copyArr.reverse();

console.log(reverseArr); // Reversed array: [5, 4, 3, 2, 1]

console.log(numsArr); // Original array: [1, 2, 3, 4, 5]
```

Yes! 🔥.

We have successfully reversed our array without mutating the original array.

See this example live in [JSBin](https://jsbin.com/xilajefudu/2/edit?js,console).

### Feel free to share if you found this useful 😃.

---
How to Choose Tech Stack for Mobile App Development
Tags: mobile, engineering, software
Published: 2020-12-07 23:27:43

When it comes to developing a digital software product, your choice of the technology stack is the most important prerequisite for its success. Regardless of the [development process](https://jelvix.com/services/mobile-app-development) you are going to follow, it will not be fruitful unless it explores all the current advancements of software engineering. 

As a rule, business individuals have a clear idea about the business aspect of their digital project, but they usually lack experience and necessary skills to bridge it with actual product implementation. In particular, they face difficulties choosing the right programming language, development tools, software framework, etc.

Choosing the right technology stack might not only future-proof your software but also make it easily maintainable, compatible, and secure to support your business’ growth. In order to achieve these objectives, most startups appeal to professional mobile software development agencies that have in-depth experience in designing, developing, deploying, and supporting a wide range of mobile, web, and desktop apps. 

As an award-winning, custom software development company, we have the necessary experience to make your app development process less painful and can provide a clear idea of what features your tech stack should implement. We have created this guide so that you can make the most of today’s advanced software technologies and succeed in implementing your product.

So, read further to find out about different tech stacks for mobile development, and how to pick the best one for your business project.

**What is a Software Development Stack?**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3f24acw50p44l4b8u6c0.jpg)

Before we dive into numerous architecture choices and programming languages for developing mobile apps, let’s define what tech stack is. A technology stack is a combination of programming languages, frameworks, libraries, and tools employed to create a mobile or web application.

A complete tech stack can be divided into two main areas – front-end and back-end development. These are also referred to as client-side and server-side of an application. There are also other critical areas that constitute the anatomy of an application, such as development platform, user experience, security, robustness, scalability, etc.

Your choice of the mobile app tech stack will determine the future success and performance of your application; any wrong or hasty decision can cost you money, time, and resources, and lead to the project failure. So, it is important that you dive deep into the mobile app design and development process to identify and evaluate your app idea before choosing the best tech stack. 

Full guide: [How to Choose Tech Stack for Mobile App Development](https://jelvix.com/blog/how-to-choose-tech-stack-for-mobile-app-development)
Backing up files with F# Scripts and MongoDB GridFS
Tags: mongodb, fsharp, dotnet, scripting
Published: 2020-12-07 23:21:48

F# 5.0 has strong scripting capabilities thanks to the updated `#r "nuget: "` directive, this allows you to pull any NuGet dependency and start using it from your F# scripts right away. To show off this feature I'll propose the following use case

> I want to backup files from a directory into a database and be able to restore them back to the directory I want

There are some ways we can do this from saving the data to a database and uploading to AWS/GCP/Azure/Dropbox in this case I wanted to showcase one of the Libraries I worked on previously called [Mondocks](https://github.com/AngelMunoz/Mondocks) which allows you to write MongoDB commands and execute them via the normal .NET MongoDB Driver.
I have a Raspberry PI on my LAN with a 1TB HDD and it has docker running so I can save my files there.

Let's start with the Backups, also I added some comments so you can read the source code and continue reading hereafter

{% gist https://gist.github.com/AngelMunoz/48e8e81e81571a73340f67a718d6333f file=backup.fsx %}

that's all we need to start backing up either the current directory or a directory we specify with our arguments, that should look like the following Gif

![Backup Files](https://dev-to-uploads.s3.amazonaws.com/i/6ol1ynkt7lb0zem4wra9.gif)

Now Let's continue with the restores

{% gist https://gist.github.com/AngelMunoz/48e8e81e81571a73340f67a718d6333f file=restore.fsx %}
The restoration process was hopefully as simple as the backup and should look like this
![Restore Backup](https://dev-to-uploads.s3.amazonaws.com/i/0l2k9as2pm2wdr3bg1so.gif)

And that's it! Hopefully, I showed you a bit of the F#'s scripting capabilities as well as how simple is to use Mondocks without sacrificing the MongoDB driver, since it's a side by side usage thing here's the project if you'd like to take a look

{% github AngelMunoz/Mondocks %}

Also, Shout out to [Spectre.Console](https://spectresystems.github.io/spectre.console/) for the amazing console output.


# Closing thoughts
Remember that F# is cross-platform, so if you want to run these scripts on Linux/MacOS as well you should be able to do so. F# is powerful yet it won't get in your way, it will most likely help you figure out how to do things nicely.



If you have further comments or doubts, please let me know down below or ping me on Twitter 😁