teleren/devto huggingface dataset:
4 Steps To Make You Busy And Calm While You Are Under Self-Quarantine
Published: 2020-03-16 13:17:29

Nowadays most people prefer to work at home or just to stay at home because of the coronavirus.  But it is quite difficult to spend the time productively or to concentrate on your work when your family members are at the same place. 
Make a corner
If you should work, don't sit in your kitchen or bedroom or living room. Make a workspace that is for work time only. Make sure that your family members, roommates won't bother you while you are working. 
Keep to a strict sleep schedule
It is quite difficult to keep your sleeping regime when you stay at the same place for a week or more. You shouldn't wake up or sleep whenever you want to do.  Set alarm if you need it, try everything to keep a sleep schedule. 
Read or watch
Reading is one of the most effective ways of spending time, especially when you are at home and there is nothing to do. Try to find a book that really interests you. But if you don't like reading watch a film or series of Netflix. In this way, you won't be bored.
Connect with your friends or relatives.
Stay connected with your friends via calls, texts, Slack, Skype, or any other mode of communication. It really helps. Stay active on social media. 
And most importantly stay positive! Sometimes just having a good outlook on the situation is all you need.
DOCWIKI Released:-Call to Join Opensource Project : OSINT for Epidemics and Virus outbreaks like Corona Virus
Tags: php, opensource, css, javascript
Published: 2020-03-16 13:08:06

refer :
(https://dev.to/manishfoodtechs/call-to-join-opensource-project-osint-for-epidemics-and-virus-outbreaks-like-corona-virus-28de)
(https://dev.to/manishfoodtechs/team-ui-call-to-join-opensource-project-osint-for-epidemics-and-virus-outbreaks-like-corona-virus-18dn)

If you’ve heard the name but are wondering what it means, OSINT stands for open source intelligence, which refers to any information that can legally be gathered from free, public sources about an individual or organization. In practice, that tends to mean information found on the internet, but technically any public information falls into the category of OSINT whether it’s books or reports in a public library, articles in a newspaper or statements in a press release. OS stands for Open Source while INT stand for Intelligent System. If you have data available from public / labs / hospitals / doctors then you can analyze it in different ways for betterment of Human Health races.


Documents are here :
This project is opened in  Github .
[document wiki ](https://github.com/Manishfoodtechs/OSINTHRH/wiki)

This project is opened in  Github Official Opensource repo.
{% github https://github.com/open-source-ideas/open-source-ideas/issues/227 %}
LeetCode: Two Sum II – Input array is sorted
Tags: leetcode, algorihtms, array
Published: 2020-03-16 13:23:54

---
title: LeetCode: Two Sum II – Input array is sorted
published: true
date: 2020-03-16 13:03:00 UTC
tags: LeetCode,Algorihtms,Array
canonical_url: https://coderscat.com/leetcode-two-sum-ii-input-array-is-sorted
---


Challenge Description: [Two Sum II – Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)

## Approach #1: binary search

Note the input array is already sorted. So we can iterate all the elements, for each element(suppose with a value of v1), we try to find another element with the value of `target-v1`. Binary search will suitable for this task.

The overall time complexity is \(O(NlogN)\).

```cpp
class Solution {
public:
    vector<int> twoSum(vector<int>& numbers, int target) {
        for(int i=0 ;i<numbers.size() - 1; i++) { 
            int l = i + 1; 
            int r = numbers.size() - 1;
            int t = target - numbers[i];
            while(l <= r) { 
                int m = (l + r) / 2;
                if(numbers[m] == t) { 
                    return vector<int> { i+1, m+1 };
                } else if (numbers[m] > t) { 
                    r = m - 1;
                } else {
                    l = m + 1;
                }
            }
        }
        return vector<int>{};
    }
};

```

## Approach #2: two-slice

The idea of two slices is similar to binary search. In this approach, we use two index, index `l` is from left to right, index `r` is from right to left.

In each iteration, we compare the current sum of two elements with the target. There are tree cases:

1. **sum == target** , then we need return current two indexes.
2. **sum > target** , then we need to decrease index `r` .
3. **sum < target** , then we need to increase index `l`.

The time complexity is \(O(N)\).

```cpp
class Solution {
public:
    vector<int> twoSum(vector<int>& numbers, int target) {
        int l = 0; 
        int r = numbers.size()-1;
        while(l < r) { 
            int s = numbers[l] + numbers[r];
            if(s == target) return vector<int> {l+1, r+1};
            if(s > target) r--;
            if(s < target) l++;
        }
        return vector<int>{};
    }
};

```

The post [LeetCode: Two Sum II – Input array is sorted](https://coderscat.com/leetcode-two-sum-ii-input-array-is-sorted) appeared first on [CodersCat](https://coderscat.com).
Weekly Links – 3/16
Tags: links, ai, cosmos, government
Published: 2020-03-16 15:03:58

---
title: Weekly Links – 3/16
published: true
date: 2020-03-16 13:00:36 UTC
tags: Links,AI,cosmos,government
canonical_url: 
---

So this week had a few things going on. Mainly as COVID-19 grips the united states, things have been more than a little crazy.

![](http://www.welldocumentednerd.com/wp-content/uploads/2020/03/b9d70fce1898b0c0c5f53ea9c6054c88-1036693789.jpg)

So down to business…

- [Accelerate modernization with new migration services in Azure Government](https://devblogs.microsoft.com/azuregov/accelerate-modernization-with-new-migration-services-in-azure-government/) : Pretty cool to see new opportunities to handle migrations in azure government. 
- [Azure Cosmos DB Free Tier and Autopilot](https://channel9.msdn.com/Shows/Azure-Friday/Azure-Cosmos-DB-Free-Tier-and-Autopilot) : Pretty awesome to see a free tier, for as much as I loved the emulator, it wasn’t the same as developing against Cosmos properly. 
- [Azure Government continues to expand FedRAMP High coverage](https://devblogs.microsoft.com/azuregov/azure-government-continues-to-expand-fedramp-high-coverage-2/) : Always good to see this coverage expand. 
- [Bot Framework – Building awesome experiences in Microsoft Teams (Part 1 of 3)](https://channel9.msdn.com/Shows/AI-Show/Bot-Framework--Building-awesome-experiences-in-Microsoft-Teams-Part-1-of-3) : I’ve been doing some work recently with bot framework, and I have to admit the bot interface has grown on me recently. 
- [Empowering the next generation through the Hidden Genius Project](https://channel9.msdn.com/Shows/On-NET/Empowering-the-next-generation-through-the-Hidden-Genius-Project) : Really interesting to see how Microsoft is trying to empower the next generation of world changers. 
- [Ethics of AI in 2020 Panel from NDC London](http://www.dotnetrocks.com/default.aspx?ShowNum=1678) : Fascinating podcast and discussion on the ethical AI and the implications. 
- [Love in a time of Corona Virus – Tips, Tricks and Best Practices for Working Remotely](https://www.hanselman.com/blog/LoveInATimeOfCoronaVirusTipsTricksAndBestPracticesForWorkingRemotely.aspx) : Great article on working from home for anyone now doing it. 

### Fun Stuff

Ok, so I have to admit there has been a lot of stuff going on and a lot to look at. Right now I’ve been really enjoying the John Hickman run on X-Men. Now full transparency, I have never liked X-men, I don’t like the movies, I don’t like the shows, I don’t like the comics. For me it feels like there is only ever one story, “I have powers and people hate me.” But Hickman did the impossible and gave it an interesting spin.

![](http://www.welldocumentednerd.com/wp-content/uploads/2020/03/51hnrywnral-456072990.jpg)
Daily Developer Jokes - Monday, Mar 16, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-03-16 13:00:14

---
title: "Daily Developer Jokes - Monday, Mar 16, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20Mar%2016%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12588592f15.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why did the security conscious engineer refuse to pay their dinner bill?

___A:___ Because they could not verify the checksum.
 -->
How to build a User Interface from start to finish
Tags: interface, design
Published: 2020-03-16 12:45:00

Building a user interface is not that complicated as you may think once you get the basics for the development process and there is nothing as satisfying than creating a user interface that every user feel comfortable with, so let’s get started.

I will try to make it simple and short, for someone to develop or build something from scratch first you need a little bit knowledge about the fundamentals and tools required to implement a certain idea that you in mind. Read books and search for the internet about the tools and languages used to develop an interface.

Secondly, when developing an interface you need to know the current design trends that are on the market sort of new models that user are tending to like more than others those can be for example hamburger button when it comes to deal with a website responsiveness on small screens. This is an important stage in the user interface development process to help the developer understand what’s the users are liking more in a given period of time.

Starting to develop a user interface one thing you have to keep in mind is that you are developing something which will be used by someone else hence it’s important to know who are build it for and then create a prototype by using example using adobe XD or other sketching program that help you to visualize the interface and show it to other people so that they can give some feedback which helps a lot in the development cycle of an interface, now you start developing in accordance to the prototype and feedback’s received.

Lastly something we have to know is that people have different taste and hence not everyone will fully appreciate your user Interface but when following the steps I described am sure you will concur as many users as possible with your creativity.
How to Easily Add JWTs to Slim PHP
Tags: jwt, jsonwebtokens, slimphp, php
Published: 2020-03-16 12:42:47

---
layout: post
title: "How to Easily Add JWTs to Slim PHP"
description: "The easiest way to add JWT authorisation to Slim PHP is via the library PSR-JWT."
tags: [jwt, json web tokens, slim php, php]
published: true 
---
Slim PHP is one of my favourite [web frameworks](https://www.slimframework.com/), it's simple to learn, lightweight, and great for building small websites and applications.

One of the best use cases for [Slim PHP](https://www.slimframework.com/) is when you need to build a small API with a handful of endpoints. In this scenario you may need to add a layer of security to authorise resource requests. A great way to do this is with [JSON Web Tokens](https://tools.ietf.org/html/rfc7519).

JWTs allow you to provide users with access to API endpoints and their resources in a granular manner. Access can be time limited, restricted to certain user groups and more. 

The easiest way to add JWT authorisation to Slim PHP is via the library [PSR-JWT](https://packagist.org/packages/rbdwllr/psr-jwt). It is a [PSR 7 / 15](https://www.php-fig.org/psr/psr-7/) compliant JWT creation and validation library, which works perfectly with Slim PHP as it is also PSR 7 / 15 compliant. 

[PSR-JWT](https://packagist.org/packages/rbdwllr/psr-jwt) is built on top of [ReallySimpleJWT](https://github.com/RobDWaller/ReallySimpleJWT) and it exposes authorisation middleware which can easily be added to Slim PHP's routing system.

Here's an example of how to add the middleware to a Slim PHP route:

```php
require '../../vendor/autoload.php';

$app->get('/route/example', function (Request $request, Response $response) {
    $response->getBody()->write("JSON Web Token is Valid!");

    return $response;
})->add(\PsrJwt\Factory\JwtMiddleware::json('Secret123!456$', 'jwt', 'Authorisation Failed'));
```

It's literally a few lines of code, you just pass the `JwtMiddleware::json()` method a token secret, a request key and a response message. If the JSON Web Token passed with the request is invalid you'll see the response message and if it is valid the route will load as expected.

PSR-JWT is also completely customisable, you can even use your own [handlers](https://github.com/RobDWaller/psr-jwt#handlers) to define how authorisation works and what the response should be. You can also use the library to generate JSON web tokens.

```php
require 'vendor/autoload.php';

$factory = new \PsrJwt\Factory\Jwt();

$builder = $factory->builder();

$token = $builder->setSecret('!secReT$123*')
    ->setPayloadClaim('uid', 12)
    ->build();

echo $token->getToken();
```

Have a read of the [documentation](https://github.com/RobDWaller/psr-jwt/blob/master/README.md) to find out more about all the features available in PSR-JWT. Also if you want to understand JSON Web Tokens in more detail I suggest you give [RFC 7519](https://tools.ietf.org/html/rfc7519) and [RFC 6750](https://tools.ietf.org/html/rfc6750) a read. If you have any questions feel free to drop me a message on Twitter [@RobDWaller](https://twitter.com/RobDWaller).
My "New" VSCode Settings
Tags: vscode, ide, style
Published: 2020-03-16 08:54:37


<h2>Hey there!</h2>
<h4>For some reason I redo my vscode settings again lmao</h4>
{
    "explorer.openEditors.visible": 0,
    "editor.fontFamily": "JetBrains Mono",
    "editor.fontSize": 13,
    "editor.fontWeight": "300", 
    "editor.letterSpacing": 1.2,
    "editor.lineHeight": 22,
    "editor.fontLigatures": true,
    "files.autoSave": "afterDelay",
    "window.zoomLevel": 0,
    "C_Cpp.updateChannel": "Insiders",
    "workbench.colorTheme": "Dark hacker theme",
    "breadcrumbs.enabled": false,
    "customizeUI.font.regular": "JetBrains Mono",
    "explorer.confirmDelete": false,
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true,
    "workbench.editor.highlightModifiedTabs": true,
    "editor.cursorBlinking": "smooth",
    "explorer.sortOrder": "type",
    "todo-tree.tree.showScanModeButton": true,
    "todo-tree.highlights.enabled": true,
    "workbench.statusBar.visible": true,
    "todo-tree.tree.autoRefresh": true,
    "todo-tree.highlights.defaultHighlight": {
        "type": "text-and-comment"
    },
    "todo-tree.highlights.customHighlight": {
        "TODO": {
            "foreground": "black",
            "background": "green",
            "iconColour": "green",
            "icon": "check",
            "type": "text"
        },
        "FIXME": {
            "foreground": "black",
            "background": "red",
            "iconColour": "red",
            "icon": "bug"
        },
        "REVIEW": {
            "foreground": "black",
            "background": "cyan",
            "iconColour": "lightblue",
            "icon": "eye"
        },
        "HACK": {
            "foreground": "black",
            "background": "#FFA500",
            "iconColour": "orange",
            "icon": "alert"
        },
        "REF": {
            "foreground": "black",
            "background": "grey",
            "iconColour": "grey",
            "icon": "link",
            "type": "tag"
        }
    },
    "todo-tree.general.tags": [
        "TODO",
        "FIXME",
        "REVIEW",
        "HACK",
        "REF"
    ]
}
<h4>Needed extensions: Todo Tree, Dark hacker theme, customise UI</h4>
<h4>Needed others: JetBrains Mono</h4>
<h2>Hope this helps you!</h2>
NLP を使わず簡単に中国語と日本語を仕分ける方法
Tags: 日本語, tutorial, programming
Published: 2020-03-20 14:05:51

---
title: NLP を使わず簡単に中国語と日本語を仕分ける方法
published: true
date: 2020-03-16 12:41:35 UTC
tags: 日本語,tutorial,programming
canonical_url: https://blog.1a23.com/2020/03/16/nlp-wo-tsukawazu-kantan-ni-chugokugo-to-nihongo-wo-shiwakeru-houhou/?utm_source=rss&utm_medium=rss&utm_campaign=nlp-wo-tsukawazu-kantan-ni-chugokugo-to-nihongo-wo-shiwakeru-houhou
---

このブログの他の記事と同じ、この記事も自分の[オープンソースプロジェクト](https://github.com/blueset/project-lyricova)を作るときに発見したものである。音楽ライブラリーのタイトル、歌詞などのデータに読みがなをつけたいときに、中国語と日本語のテキストを区別する方法が欲しかった。ボクの音楽ライブラリーに中国語、日本語とアルファベット系の言語しかなかった。アルファベット系の言語は大した処理をいらす、簡単にソートすることができるだが、中国語と日本語はそんなに簡単ではなかった、特に漢字に対する処理の仕方が違う。

タイトルで言ったの通り、これはあくまで **簡単かつ荒い** 方法である。この方法を使うにはいろんな制限があり、正確度も完璧ではない。多くの場合は「まあまあ使える」の程度が目安です。当然、日本語と中国語はたくさんの共通点がある。例えば、「人生」という言葉はどちらでも通じるものです。もしこれがどっかのタイトルであって、この二文字でどの言語であるかは全く判断できないことである。

この方法をつかう条件はただ一つ：判断したい文字列は必ず日本語と中国語のいずれであって、複数の言語を混在しないこと。これ以上複雑な状況はこの方法で処理できないだろう。

どんなものかを総じて言えば、ずばり：

> 日本語独自の文字を見つかったら、この文字列を日本語とし；中国語独自の文字を見つかったら中国語とする。

とのことです。

ご存知の通り、日本語も中国語も、もう一方の言語で使えない文字がある。例えば：

1. ひらがな、カタカナ
2. 日本語の一部の新字体、国字
3. 中国語の一部の簡体字

一つ目はシンプルで、Unicode ではカナをすでに一括りにまとめました。主な努力は二つ目と三つ目を見つけることである。リサーチをいろいろしたところ、日本語と中国語の漢字を変換するオープンソースコードで日本語独自の漢字のまとめを見つけました。

僕は日本語独自のひらがな、カタカナ、変体仮名、丸囲みカタカナ、半角カタカナ、組み合わせ単位と年号、そして前述の漢字などをまとめてみた。もし文字列にこれらのもじのいずれかがあったら、この文字列を日本語と判断することができる。


    ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖ゛゜ゝゞゟ゠ーｰ𛀁𛀂𛀃𛀄𛀅𛀆𛀇𛀈𛀉𛀊𛀋𛀌𛀍𛀎𛀏𛀐𛀑𛀒𛀓𛀔𛀕𛀖𛀗𛀘𛀙𛀚𛀛𛀜𛀝𛀞𛀟𛀠𛀡𛀢𛀣𛀤𛀥𛀦𛀧𛀨𛀩𛀪𛀫𛀬𛀭𛀮𛀯𛀰𛀱𛀲𛀳𛀴𛀵𛀶𛀷𛀸𛀹𛀺𛀻𛀼𛀽𛀾𛀿𛁀𛁁𛁂𛁃𛁄𛁅𛁆𛁇𛁈𛁉𛁊𛁋𛁌𛁍𛁎𛁏𛁐𛁑𛁒𛁓𛁔𛁕𛁖𛁗𛁘𛁙𛁚𛁛𛁜𛁝𛁞𛁟𛁠𛁡𛁢𛁣𛁤𛁥𛁦𛁧𛁨𛁩𛁪𛁫𛁬𛁭𛁮𛁯𛁰𛁱𛁲𛁳𛁴𛁵𛁶𛁷𛁸𛁹𛁺𛁻𛁼𛁽𛁾𛁿𛂀𛂁𛂂𛂃𛂄𛂅𛂆𛂇𛂈𛂉𛂊𛂋𛂌𛂍𛂎𛂏𛂐𛂑𛂒𛂓𛂔𛂕𛂖𛂗𛂘𛂙𛂚𛂛𛂜𛂝𛂞𛂟𛂠𛂡𛂢𛂣𛂤𛂥𛂦𛂧𛂨𛂩𛂪𛂫𛂬𛂭𛂮𛂯𛂰𛂱𛂲𛂳𛂴𛂵𛂶𛂷𛂸𛂹𛂺𛂻𛂼𛂽𛂾𛂿𛃀𛃁𛃂𛃃𛃄𛃅𛃆𛃇𛃈𛃉𛃊𛃋𛃌𛃍𛃎𛃏𛃐𛃑𛃒𛃓𛃔𛃕𛃖𛃗𛃘𛃙𛃚𛃛𛃜𛃝𛃞𛃟𛃠𛃡𛃢𛃣𛃤𛃥𛃦𛃧𛃨𛃩𛃪𛃫𛃬𛃭𛃮𛃯𛃰𛃱𛃲𛃳𛃴𛃵𛃶𛃷𛃸𛃹𛃺𛃻𛃼𛃽𛃾𛃿𛄀𛄁𛄂𛄃𛄄𛄅𛄆𛄇𛄈𛄉𛄊𛄋𛄌𛄍𛄎𛄏𛄐𛄑𛄒𛄓𛄔𛄕𛄖𛄗𛄘𛄙𛄚𛄛𛄜𛄝𛄞🈀〱〲〳〴〵゛゜゠ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヷヸヹヺ・ーヽヾヿㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ㋐㋑㋒㋓㋔㋕㋖㋗㋘㋙㋚㋛㋜㋝㋞㋟㋠㋡㋢㋣㋤㋥㋦㋧㋨㋩㋪㋫㋬㋭㋮㋯㋰㋱㋲㋳㋴㋵㋶㋷㋸㋹㋺㋻㋼㋽㋾･ｦｧｨｩｪｫｬｭｮｯｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜﾝ𛀀㌀㌁㌂㌃㌄㌅㌆㌇㌈㌉㌊㌋㌌㌍㌎㌏㌐㌑㌒㌓㌔㌕㌖㌗㌘㌙㌚㌛㌜㌝㌞㌟㌠㌡㌢㌣㌤㌥㌦㌧㌨㌩㌪㌫㌬㌭㌮㌯㌰㌱㌲㌳㌴㌵㌶㌷㌸㌹㌺㌻㌼㌽㌾㌿㍀㍁㍂㍃㍄㍅㍆㍇㍈㍉㍊㍋㍌㍍㍎㍏㍐㍑㍒㍓㍔㍕㍖㍗㍻㍼㍽㍾㍿増楽薬霊塡犠渓著雑祖猟槇祉栄畳福込帰朗鉱獣砕呉響碑捗僧繊粋瀬繁層厳隠変頬剰拠剤斎専琢廃匂巣転黒社舗蔵伝歩鋳餠愼験抜読猪廊郞曽仮駅譲欄酔桟済気斉囲択経乗満穀難錬嘆戻醸虜寛銭様歳毎奨艶帯侮挙逸署器両釈節墨挿従権憎嬢都倹豊戦庁謁卑歓駆観揺徴悪徳壌団暑営娯弾渇恵祝縁枠勤隣対漢謹検卽摂類視発緖壊拡粛掲涙穏総圏拝沢贈圧浄顔仏図陥歴亀壱梅眞煮闘髪円扱塩騒懐覚敏軽峠戸頼荘黙晩諸継蛍遅逓祥練喩応悩姫険齢撃聴覧痩値鉄禍塀続勉臭鶏辺縄悔絵郷捜懲者鬪海児実薫亜渚歯駄渋弐広姉巻剣証塁単顕価禎祐突穂暦払栃訳渉県労麺糸焼勲神舎縦賓髄丼暁桜滝脳稲勧鎭祈売


正規表現を使えばもっとコンパクトにすることができる。

これに似てる方法で、中国語の簡体字から独自な漢字を選別して簡体字の文字列を判断することができる。しかし、このプロジェクトでそう言った需要がない為、ここで割愛させていただきます。

P.S.：漢字を選別する正規表現

```js
const hasHan = /[\u4E00-\u9FA5\u9FA6-\u9FEF\u3400-\u4DB5\u{20000}-\u{2A6D6}\u{2A700}-\u{2B734}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u2F00-\u2FD5\u2E80-\u2EF3\uF900-\uFAD9\u{2F800}-\u{2FA1D}\uE815-\uE86F\uE400-\uE5E8\uE600-\uE6CF\u31C0-\u31E3\u2FF0-\u2FFB\u3105-\u312F\u31A0-\u31BA\u3007]/u;
```

The post [NLP を使わず簡単に中国語と日本語を仕分ける方法](https://blog.1a23.com/2020/03/16/nlp-wo-tsukawazu-kantan-ni-chugokugo-to-nihongo-wo-shiwakeru-houhou/) appeared first on [1A23 Blog](https://blog.1a23.com).
How to manage zsh startup files with correct settings.
Tags: beginners, zsh, productivity, codequality
Published: 2020-03-16 12:41:26

The shell program uses a collection of startup files that helps users to create an environment. Each file has a specific use and may affect login and interactive environments differently. If an equivalent file exists in your home directory it may override the global settings. This makes it more important to hold the correct information in each file.

So here is the list of startup files along with the details of the information required in them.

##.zshenv##

This file is always sourced, so it should set environment variables that need to be updated frequently. It often contains exported variables that should be available to other programs, For example, `$PATH`, `$EDITOR` are often set in `.zshenv`. This file is read when zsh is launched to run a single command as well.
The commands which run **which runs once** and which should be **updated on each new shell** must be declared in this file.

##.zshrc##
`.zshrc` is for interactive shell configuration. We can set the following options for the interactive shell in this file.
* command completion, correction, suggestion, highlighting.
* aliases
* key bindings
* commands history management
* set any variables that are only used in the interactive shell `$LS_COLORS`.

_Non-Interactive shell is used to execute a script for once whereas an Interactive shell is invoked whenever we open a new terminal_

##.zlogin##
`.zlogin` is sourced at the start of a login shell. This file is sourced after `.zshrc` file and it helps in maintaining **commands to be run when the shell is fully setup**.

##.zprofile##
`.zprofile` is basically the same as `.zlogin` except that it's sourced directly before `.zshrc` is sourced instead of directly after it. According to the `zsh` documentation, "_**`.zprofile`** is meant as an alternative to **`.zlogin`**. The two are not intended to be used together, although this could certainly be done if desired._". 

It is advised to have command in `.zprofile` which may take **some time to complete or variables that are not updated frequently**. 

##.zlogout##
It is used to **clear and reset the terminal**, so it should be used to release all the resources acquired at the time of login.