teleren/devto huggingface dataset:
What is memoization and what’s the use it?
Tags: tutorial, java, career
Published: 2020-03-13 11:03:49

memoization is a process of building a function that is capable of remembering it’s previously computed results or values.

The use of making a memoization function is that we avoid the computation of that function if it was already performed in the last calculations with the same arguments.

This saves time but has a downside that we will consume more memory for saving the previous results.

Happy Learning! 😇
Question: What is your favorite JavaScript framework? 
Tags: react, vue, angular
Published: 2020-03-13 10:56:56

---
title: Question: What is your favorite JavaScript framework? 
published: true
description: Please comment below why you would prefer React, Vue or Angular. Pros and cons of each :) 
tags: React, vue, angular
---
Please comment below why you would prefer React, Vue or Angular. Pros and cons of each :)
Destructuring Objects in javascript
Tags: javascript, react
Published: 2020-03-13 10:49:15

Destructuring is a better way to get the values from array and objects with a concise code. let’s deep dive into it.

Let’s suppose you have the following object:

```javascript
const FullName = {
  firstName: 'Muhammad',
  lastName: 'Awais'
}
```
in the normal scenario, to get the firstname and lastname from the object, you have to create new variables and assign the object values in them, like below:

```javascript
let firstName = FullName.firstName // Muhammad
let lastName = FullName.lastName // Awais
```
While in using destructuring you can do above thing in a most better way:

```javascript
let { firstName, lastName } = FullName

console.log(firstName) // Muhammad
console.log(lastName) // Awais
```

behind the scenes, {} are telling javascript to generate the aforementioned variables and assign the object values in it, es6 power is used here.
How do you test your REST API?
Tags: question, help, api, testing
Published: 2020-03-13 10:43:37

I have a basic REST API in a server file. If I want to run tests on the routes, how do I do so?

I can think of 2 ways to do so:

1. In the test command, first start the server using a child process and then send requests to `localhost` in the unit tests.

2. Write unit tests for all the functions I've written in my code and run them without running the server (Does this mean I can't do integration testing?)

I'm really not sure what to do, I need help.
Why I unable to enable nfs into my custom VM?
Tags: help, nfs, vagrant
Published: 2020-03-13 10:17:29

I have the following question:

https://unix.stackexchange.com/q/572687/173648

In this question I try to enable nfs sharing using my team's box based upon official `ubuntu/bionic64` box. But because the vagrant is unable to run apt install in the quest fails to launch (because runs without sudo).

Can I have your 2 cents of help in that?
Question: How to test large pages in Vue/React?
Tags: vue, react, cypress, jest
Published: 2020-03-13 09:56:44

---
title: Question: How to test large pages in Vue/React?
published: true
description: How can I test large pages that consist of smaller components and lots of business logic.
tags: #vue #react #cypress #jest
---

Hello friends! :smile:  (Long question approaching... )

I'm looking for some advice on Testing large Vue SFC pages that have lots of smaller already unit tested components.

We have a pretty big enterprise application at work, and it's pretty heavily unit tested. All the smaller atom and a few big components that consist of many parts are all pretty well tested. I feel secure about them.

The problem for me comes it when it comes to page level tests that have a lot of modules and it's very taxing to simply create mocks for each module. Some of these include Vuex store modules, and DOM APIs, WebRTC streaming libraries that we plug into the component instance, etc.

It's honestly a bit worrisome when it comes to unit-testing these pages, because technically they are no longer units, and I'm worried that testing them will require me to mock so many parts of the page and I worry that  I may end up testing implementation details especially because some of the internals change a lot depending on the features we add or remove.

So I wanted to know how to go about this. I decided to write end to end tests for these pages, but this doesn't entirely cover everything that I feel should be tested. Is there a way to write these kinds of tests for big SFC pages in Vue?

On my searching journey, I've heard of integration tests, but there's very little written about this topic. Most coverage is about unit tests and E2E tests. I'd some advice and perhaps any suggestions that would guide me towards the right course of action. 🙏🏽

I might also be approaching this the wrong way! So I'm happy to gather some insight on this topic! Thanks!
Screencast: using Spring Boot, JHipster and Azure Spring Cloud together
Tags: azure, java, spring, jhipster
Published: 2020-03-13 09:51:45

---
title: Screencast: using Spring Boot, JHipster and Azure Spring Cloud together
published: true
description: Live-coding session showing how to use Spring Boot, JHipster and Azure Spring Cloud efficiently
tags: azure, java, spring, jhipster
---

Join me for a live-coding session using Spring Boot, JHipster and Azure Spring Cloud, in order to deliver microservices to cloud efficiently.

{% youtube I2czvj3V1AQ %}

Some useful links from the video:

- [The JHipster website](https://www.jhipster.tech/)
- [Microservices documentation for JHipster](https://www.jhipster.tech/microservices-architecture/)
- [The Azure portal](https://portal.azure.com/?WT.mc_id=devto-blog-judubois)
- [JHipster Online](https://start.jhipster.tech/)
- [Azure documentation for JHipster](https://www.jhipster.tech/azure/)
Bridging Education Gap with Cloud Computing in India
Tags: engineerai, cloudcomputing, education, India
Published: 2020-03-13 09:50:49

Author: Chief Wizard at Engineer.AI

The rapid pace of technological spread is changing every aspect of our lives. In India too, as technology adopts exponential adoption in some areas such as health and ecommerce, its adoption has been slow in some other areas; One major area is education.

The use of PowerPoint presentations, video narration, projectors, and other gadgets has come a long way in educational institutions, but in terms of IT infrastructure, these similar institutions, particularly schools, display a limited strategic vision.

Contrariwise, Indian students are warming up edtech platforms to enhance their learning experience. According to Wikibizpedia, in 2018, the size of the edtech market reached below $ 550 Mn, growing steadily at a CAGR of 49%. This figure is estimated to reach $ 1960 million by 2021.

<H2><b>Addressing Other Challenges with Technology</b></H2>

In addition to making the learning process more interesting for students, new age technologies have many advantages. The Government of India understands the positive impact that cloud computing has on the education sector and is therefore investing more than INR 1 lakh Cr in an initiative called RISE (Revitalizing Infrastructure and Systems in Education), which will lead to a new era. There is a strong focus on merging the new-age technologies such as cloud computing, AI and VR with education systems.

Also Read : <a href="https://www.flipsnack.com/engineerai/engineer-ai-ceo-career-advice.html">C-Suit Career Advice BY Engineer.ai CEO</a>

<H2><b>Raising Quality</b></H2>

The biggest challenge in the Indian education system is the current quality of education. In most institutions, the curriculum is not regularly updated to conform to global development.

To understand the gravity of this issue, let us look at the scenario for future jobs– which is the primary reason for undertaking education in the first place. As per a report by FICCI-EY-NASSCOM, 9% of the young Indian workforce in 2022 will be deployed in jobs that do not even exist today; whereas 37% workforce will be deployed in jobs with radically altered skill sets.

<H2><b>Improving Reach</b></H2>

The primary factors that make education a distant dream for many in India are either the unavailability of education or, if available, the high costs that come with it. Cloud computing can address both issues.

This is as remote classrooms enabled by the cloud can help in running multiple classrooms with a small group of teachers whilst also helping to overcome the lack of skilled teachers or the physical school infrastructures in more remote areas. The cloud can also play a massive role in delivering education by using streaming on the web.

Article Source @ https://inc42.com/resources/bridging-indias-education-gaps-with-cloud-computing/
Yeah! I am a beginner. Do you have any problems?
Published: 2020-03-13 09:47:04

## Yeah! I write buggy codes. So what?
You know I am a great programmer. How? I write 100 lines of codes and then I get 1000 bugs and errors. So what? I am a beginner, right? If I don't make mistakes who else will make mistakes? You? Probably. But I am pretty sure you won't write such a buggy code like me. Even if you want, you can't. Because it's me who is just starting to code not you!!!

## Yeah! I make mistakes. So what? 
You know I am a great programmer. How? I write 100 lines of codes and it never runs properly on the first try. Why? I have made mistakes. Where are the mistakes? Well, ask me which part of my code is correct because I write more mistakes than real programs. So what? I am a beginner. You can't make such mistakes like me even if you want to, can you?

## Yeah! I can't even solve easy problems in [codeforces](www.codeforces.com). So what?
I spend hours solving the easiest problem in code forces ever made but I still can't solve it. Why? I'm a beginner!!! Even if I submit, I will get either wrong answer on test case 101 or Time Limit exceed error. Sometimes, the Memory limit exceeds. But I don't care about any of these.
why?
Are you dumb like me? Why are you asking me the same question again? Didn't I tell you I am a beginner? 😡

## Yeah! I ask stupid questions in StackOverflow. Who cares?
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fknpizqq121l9wycuvhu.png)
I remember once I asked how to print hello world in StackOverflow. And I got the most number of votes that I am sure I'll never get in my entire life asking a thousand questions. Nevertheless, it was downvoted. But who cares? I am a beginner. If I don't ask silly questions who else will. You? Probably not. Don't believe me? Do you think you are more stupid than me? Great!!! prove it. 
Hurry!! You have 5 seconds to prove.

Time up! You failed. It's official. I am the "most stupidest" programmer in the world.

## Yeah! I write useless blogs at dev.to. Who reads?
Well, lucky for me, I don't need to prove this. If you have read this far you would probably know this is a useless blog. If you think this isn't enough then go to my profile the other useless blogs.

## Yeah! I can't even effectively search on google. Who bothers?
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/65qr5f9wuwdsrmam45aw.jpg)

## Yeah! I copy codes. Who notices?
Do you know I am a great student? I watch tutorials about programming every day. And I get stuck writing the code on my own...I copy the code. After all, I am a beginner. If I don't copy your codes, who else will?

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fohar283xes40q3ocwmn.jpg)
Scrimba release 28.2.2020
Published: 2020-03-13 09:25:28

## Group purchases, SASS and navigation
Good day everyone
Since it is Friday we have pushed out a new release to [scrimba.com](https://scrimba.com)! This release brings group purchases (buying 2+ licenses to a course), a framework to display notifications to users and some tweaks to the header. It also fixes some things with the unannounced SASS implementation.

**Summary:**
- Allow group purchases where the buyer gets coupons for free signups they can share with a team
- Add functionality for user notifications and show a notification dialog for completed purchases
- The bundler now supports SASS/SCSS and this fixed SASS errors and showing multi-line errors
- Replace create :heavy_plus_sign: button in top navbar with new page 'My courses' - which as name suggests lists courses the user is enrolled to.

**My courses**
We removed the `+` icon from site navbar as it was confusing for new users. It is still available with the 'new workspace' in the user profile dropdown menu. We also added a 'My courses' to the dropdown when clicking on your profile. This makes it easier to find and guide people to their enrolled courses.

**Sass**
We now support SASS and SCSS style files! :lipstick::nail_care::skin-tone-2::tophat: @Alexander Alemayhu has a short tutorial on using it: https://scrimba.com/c/cQqPggcp

**Group Purchase**
When buying a course you can now select to buy for a group. Doing that changes the purchase area to include a quantity selector.
Mint 🍃: 0.8.0
Tags: mintlang, preact, react, webdev
Published: 2020-03-13 09:14:44

**Mint 0.8.0 is released!**


- Preact instead React 
- Constants
- Tuples
- Array Pattern Matching
- Additions to the standard library
- Many bug fixes and quality of life changes!

Head over to the read the blog post on the official site: https://www.mint-lang.com/blog/mint-0.8.0

You can check out the actual change log here: https://github.com/mint-lang/mint/releases/tag/0.8.0
how to create a good looking frontend project from zero for beginners
Published: 2020-03-13 08:56:00

frontend area in web development is the best choices for developers to create user interface and user experience, and it is the most important party in wed development 

frontend includes two main parts frontend design which refers to designing and frontend development which refers to user experience and interactiveness 

before you have to create the design for how your frontend will look like 
the tools that can help to design the mockup of your website or app and the most popular one are 
[figma.com](https://www.figma.com/)
inivision studios 
adobe XD and more 
if you have a background in graphic design, this will be same as using photoshop or illustrator but it also simple to learn them if you are new in designing 
i personally prefer figma cause its easy to user and it can be used by a team and you can simply access anywhere 

checkout this tutorial for how to use figma (https://www.youtube.com/watch?v=3q3FV65ZrUs)[a free UI design prototyping tool]

once you have made your design with figma or any other tool of your choice 
you can then start implementing your design in code using HTML CSS
make sure you are following your prototype mockup in your HTML and CSS 

after everything is done now you can start applying user interactivity in your UI using Javascript 

you can use vanilla javascript or use one of best frontend  libraries for creating frontend in javascript like React Jquery or frameworks like angular or vue

once you pick the technology you are using to create your frontend development then you can start implementing user interactivity in you frontend design you have already created 
make sure you don't add too much like to much animation cause as they say " too much of every thing is always bad " keep it simple and improvement can be done later 

once you are done now you can share you frontend product to friends, co-workers, or in a market place to review and give feedback 

collect all the feedback and implement them to your project 
and that is how you create a frontend from scratch to finish
Get rid of guessing the function name supported with type hints in Python 3.6 +
Tags: python3, typehints
Published: 2020-03-13 08:44:30

---
title: Get rid of guessing the function name supported with type hints in Python 3.6 +
published: true
description: 
tags: #Python3 #type-hints
---

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

In the past, I used to work with strong-typed languages such as Java so I get a lot of suggestions when working with object / classes.

But when I moved to Python (our team use Python for automation testing), I completely feel lost when I need to know which method does the type/class support.

Recently, I’ve got more time to dig in Python, I got to know Python optional type hints.

So what is optional type hint?

1.Keep in mind that it is optional:

If the variable is not declared with type, that’s totally fine.

2.How to do the type hint:

For example, you create a method that tell Selenium to click on a button.

If you do it without type hint, it will go like this:

```javascript
def do_not_seed_action(self, driver):
    do_not_seed_btn = self.downloads_elem.find_do_not_seed_button(driver)
    do_not_seed_btn.click()
```

When you write the code, you might not know what can this instance of class/object can do

Should it click() or click_on() or click_in()?
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yp64zw3o5oty2p9uyqq8.PNG)

Instead, you can write code with type hint for getting more support from IDE:

```javascript
from selenium.webdriver.remote.webelement import WebElement
do_not_seed_btn: WebElement = self.downloads_elem.find_do_not_seed_button(driver)
do_not_seed_btn.click()
```

And you won’t need to guess what is the right word anymore:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4gfiivmmv0r3n8y0v0vh.PNG)

Tadaaa~~~

Happy coding ~~~
How to build a User Interface from start to finish
Published: 2020-03-13 07:40:31

the way of building an interface,firstly is to think about how many pages you will need,then you implement them after you start with landing page or home page,then you start to put some features needed for header and then section,lastly footer,and then do the same for all other pages and then you start to style them in CSS after you put some java script code to make you user interface behave nicely.
for me when I started user interface for home page I had putted logo and put some small picture in above url for that when user enter in my website know that he/she is in other website,then I style my header features so that it may be positioned rightly,after I have to continue with section it means part below header. I continued with footer where i have putted the address where user can find headquarter and style them.
other page that I had done is login page where I had putted header which seem to be similar like homepage and down I putted form where User can login using his/her username and password then I did the same for signup except that signup has bigger form as I wanted to have many information of user before using website as authenticated user then I had putted some java script so that when user sign up successfully may go to login page and when he/she login successfully may he/she go to user page or admin page when he/she is authenticated.
After all that I went to work on politician page and which had text area which politician express his/her interest to run for the post.
and on user page I had putted option photo which act as anchor tag which show options user can select, the same for admin page the difference is that options are different as their options privileges are different
lastly in all pages there is logo by which when you click it direct to homepage
Mybatis Cursor<T>
Tags: java, spring, mybatis, korean
Published: 2020-03-13 07:24:37

만약 `Mybatis`와 `Cursor` 를 한글로 조회하면 100이면 100 "오라클 커서"가 조회될 것이다.
압도적으로 이런 용도로 많이 쓰기 때문에 아마 대부분 Mybatis 에 `Cursor` 인터페이스가 있다는 것 조차 모르는 사람들 많을 것이다.

그래서 간단하게 쓴다.
물론 어자피 [공식 설명서](https://mybatis.org/mybatis-3/ko/java-api.html#sqlSessions) 봐도 되긴 하는데... 아무도 Cursor 사용법의 짤막한 한줄조차 번역 안되어 있더라...
대단하다...

> A `Cursor` offers the same results as a `List`, except it fetches data lazily using an Iterator.

뭐 굳이 해석하자면...

> `Cursor` 는 `List` 와 같은 결과물을 제출하지만, 데이터를 Iterator 를 사용해서 열거할 때만 가져온다.

즉, Lazy의 뜻이 아는 개발자라면, 특히 대용량 로우를 불러와야 하는 개발자라면 한줄기 빛이나 다름없다.
물론 기존처럼 `ResultHandler` 인터페이스를 구현해서 대용량 로우 불러오기를 꾀할 수 있는데, `Cursor` 는 `List` 대신에 넣으면 된다는 간편한 차이점이 있다는 거.

```java
@Repository
public interface PersonMapper {

    // 그냥 리스트 불러올 때
    List<Person> selectPersonList(Map<String, Object> params);

    // Mybatis 3.2.4 이전까지 대용량 리스트 불러올 때
    void selectPersonListHuge(Map<String, Object> params, ResultHandler handler);

    // Mybatis 3.2.4 이후 대용량 리스트 불러올 때
    Cursor<Person> selectPersonListLazy(Map<String, Object> params);

}
```

그렇다면 사용법은 어떠한가? `Cursor<T>` 인터페이스는 `Iterable<T>` 를 확장하기 때문에, `for` 문에서 `foreach` 처럼 작성할 수 있다. 또한, 잊지 말아야 할 건, `Closable` 인터페이스도 확장하기 때문에, `try` 문에 선언하거나, 쓰기 싫으면 `close()` 메소드로 닫아야 한다. 공식 설명서에서 소개한 사용법은 아래와 같다.

```java
try (Cursor<Person> lazyList = mapper.selectPersonListLazy(params)) {
   for (Person person : lazyList) {
      // 여기에 Person 가지고 뭐 할겨?
   }
}
```

[Javadoc](https://mybatis.org/mybatis-3/apidocs/org/apache/ibatis/cursor/Cursor.html) 을 참조하면 사실 별 거 없다.
그나마 유용한 메소드가 `getCurrentIndex()` 메소드인데, 현재 가져온 행 번호를 가져온다. 물론 자바답게 0부터 시작한다.

자, 소개는 여기까지.

~~아, 이건 내 경험인데, 내잘못인지 버그인지 모르겠지만, jdbc 로깅한답시고 추가한 [log4jdbc](https://github.com/arthurblake/log4jdbc) 하고 연계했더니 `Cursor<T>` 리턴은 되는데 항상 데이터 반환이 없다. 리스트가 없다고.
어디쪽 문제인지 모르겠지만, `log4jdbc` 는 더 이상 개발이 없고, `mybatis` 로깅도 나쁘진 않기 때문에, 신규 프로젝트에 Mybatis 추가할 경우 `log4jdbc` 연계는 지양하는 게 좋을 것 같다.
혹시 이거 해결한 분 있으면 제보해 주시면 감수광.~~

## 2020-03-23 업데이트

### `Cursor<T>` 의 올바른 사용법

위에 `log4jdbc` 와 충돌한 줄 알았던 내 자신을 반성하는 의미이고, MyBatis 공식 문서에 잘 나와 있지도 않아 해맸는데, 알고보니 트랜잭션 내에 있어야 한다는 것.
즉, `Cursor<T>` 사용 시, 트랜잭션 내에 있어야 한다는 것이다. Spring 을 예를 들면,

```java
@Transactional // <- 이거 이거 이거 이거 이거 이거 이거 이거 이거 이거
public List<Person> getList() {
    try (Cursor<Person> cursor = mapper.getPersonListByCursor()) {
        for (Person person : cursor) {
            // ...
        }
    }
    return ...
}
```

이렇게 `@Trasactional` 어노테이션이라던가, `TransactionTemplate` 클래스 또는 `PlatformTransactionManager.getTransaction(...)` 메소드를 통해 스레드 내 트랜잭션을 활성화해야 작동한다는 것이었다...
내가 새로 Spring Webflux 기반의 프로젝트 구성하면서 알게 되었다... 하아...

게다가, 트랜잭션 내에 있어야 작동하는 특성 상, 트랜잭션 밖에 있거나, 트랜잭션 스레드 밖에서 `for` 문 등으로 열거하는 행위는 안 될 것이다. 예를 들어 `Stream` 으로 변환해서 쓴다던지... 이런 게 트랜잭션 내에서만 되고 그 밖에서는 안된다는 것이다.
밖으로 빼내려면 `List` 로 돌리거나, 아예 `List`로 반환해야 하는 상황이다.
그래서 `reactor` 와 같이 이용할 때는 이걸 `blocking` 으로 대응해야 한다는 아쉬움이 남는다.

여담으로, Mybatis 개발자가 R2DBC 대응을 한다고는 했는데... 언제가 될 지는 모른다.
만약 Webflux를 쓴다면 DB 연동의 해답은 아직 없다는 점이 아쉬운 점 되겠다. R2DBC도 아직 베타 단계고...

###
區塊鏈 金融
Published: 2020-03-13 07:19:28

[區塊鏈重塑銀行業的五大阻礙](https://www.chainnews.com/zh-hant/articles/226781774726.htm)

[12个可以赚钱的以太坊dapp](https://www.cailuw.com/long-post/12823038857651043?h=6jOzAjr8ZozX)
零基础入门 DeFi：[手把手教你在 MakerDAO 创建 CDP 赚取以太坊](https://www.chainnews.com/articles/043142259519.htm)
Oasis Trade ([oasis.app](https://oasis.app/)) 一站式 Dai 交易、借贷、存款平台
[compound.finance](https://app.compound.finance/)
How do you get started with Kotlin (not for Android), or init a project?
Tags: help, discuss, kotlin, java
Published: 2020-03-13 07:07:42

I came from Android, so I use `gradle`.

```sh
brew install gradle
mkdir project && cd project
gradle init  # choose application, kotlin and groovy DSL
# Open the project in IntelliJ
```

But recently, I see that Maven is quite good, and might be more simple, although I don't like the looks of XML (`pom.xml`) (but can I adapt.)

Also, do you use IntelliJ or VSCode, or something else? I am starting to migrate from IntelliJ to VSCode...

Also, what to you put in `.gitignore`? Gradle init suggests,

```
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
```

But https://www.gitignore.io/ is more complex -- https://www.gitignore.io/api/kotlin

Still, I have to manually add

```
!/lib/**/*.jar
/bin/
/build/
/.gradle/
```