投稿時間:2023-05-21 11:05:34 RSSフィード2023-05-21 11:00 分まとめ(8件)
カテゴリー等 | サイト名等 | 記事タイトル・トレンドワード等 | リンクURL | 頻出ワード・要約等/検索ボリューム | 登録日 |
---|---|---|---|---|---|
IT | ITmedia 総合記事一覧 | [ITmedia ビジネスオンライン] 「使っている醤油」ランキング、2位「ヤマサの醤油」、1位は? | https://www.itmedia.co.jp/business/articles/2305/21/news041.html | itmedia | 2023-05-21 10:30:00 |
TECH | Techable(テッカブル) | 転職活動にも役立つ!大手自動車メーカー・テックベンチャーが登壇する採用ピッチイベント開催 | https://techable.jp/archives/207888 | 三菱ふそう | 2023-05-21 01:00:59 |
python | Pythonタグが付けられた新着投稿 - Qiita | 【Python】偶数のリストを返すアルゴリズム | https://qiita.com/Takuya__/items/e9979a771ee137ef4b68 | fromtypin | 2023-05-21 10:08:55 |
python | Pythonタグが付けられた新着投稿 - Qiita | 初めてstreamlitやってみた | https://qiita.com/dockka/items/ee31595805d0b20e2813 | portstreamlitasststtitle | 2023-05-21 10:07:56 |
js | JavaScriptタグが付けられた新着投稿 - Qiita | 関数 | https://qiita.com/yskebst/items/a17bf95fc17a3d8636ac | tionshowmessagegreetname | 2023-05-21 10:46:30 |
海外TECH | DEV Community | Configuring Linux terminal to show current branch in versioned directories | https://dev.to/ernanej/configuring-linux-terminal-to-show-current-branch-in-versioned-directories-hgb | Configuring Linux terminal to show current branch in versioned directoriesMake your life easier as a developer and know the current branch in your workspace without complications And the best Without installing anything additional One of the gifts of a good developer is knowing exactly where he s pushing his changes Currently the best way to do this especially using code versioning with Git is to validate the current working directory branch We have a few ways to do this Use git s own command to show the current branch git status On branch master Your branch is up to date with origin master nothing to commit working tree cleaOr yet git branch masterWe can install some other third party terminal such as Oh My ZSH but that s a topic for another post Another option is to simply manipulate your native terminal to show your current branch whenever you have a git versioned directory This alternative is what we will see in this post Changing settings to display the current branchNormally the terminal settings do not show the branch of the current directory if it is versioned by git and by default only the user host machine name and path current path are shown However it has some settings that can be manipulated from a variable in its file named PS To do so simply open the bashrc or bash profile file in your preferred text editor and add the following command at the end export PS u h m w m git ps s m m To apply the settings it is necessary to reload the file We can do this by restarting the system logging out or simply reloading the configuration file source bashrc or source bash profileReady We already have our current branch showing in directories that are versioned by git Additional settingsWhy not go further Below I will leave some possible additional color settings for example that can be performed to make the present information as relevant as possible to your use case Values u User currently logged on the machine h Name of the machine host previously registered H Full machine name previously registered w Full current working directory W Minified current working directory base name only last segment git ps s Current branch if it s in a git versioned repository otherwise nothing will be displayed ColorsBlue m Red m Fluorescent Red m Green m Fluorescent Green m Strong White m Gray m Default m Ready This is the range of simple and powerful configurations available for use that will make it even easier for you to self localize in the development process and in addition allow customization in the way you want and find valid Mine looks like this at the time I write this post path path master Yes with emoji What has been shown here is just a little of what is possible to be done Therefore as usual I will leave some links that I used as a reference to write and that you can use to go further on the subject Good reading I hope you enjoyed this post and that it helped you find what you were looking for Links Prompt Expansion Visual effects useful and interesting bash prompts What does your command prompt look like | 2023-05-21 01:59:01 |
海外TECH | DEV Community | The difference between traditional functions and arrow functions in javascript | https://dev.to/ernanej/a-diferenca-entre-funcoes-tradicionais-e-arrow-functions-no-javascript-7e3 | The difference between traditional functions and arrow functions in javascriptMake no mistake it s not just the compactness and elegant syntax that differ the ways of declaring functions in Javascript Arrow functions is a relatively new feature implementing in ES ECMAScript which in our eyes is just a more concise and elegant syntax to declare function expressions in Javascript Although traditional functions and arrow functions work in a similar way we must beware of certain differences that may not be noticeable SyntaxThe difference in syntax between the two models is notorious since in the arrow function it becomes possible to considerably reduce the number of lines present in the function declaration especially if it is already a simple function See examples Imagine a function that takes a user s name and prints it to the console In the traditional way we could declare it like this function sayMyNane name console log My name is name sayMyNane Ernane gt My name is Ernane Already with the arrow functions present from ES we could do it as follows const sayMyName name gt console log My name is name sayMyNane Ernane gt My name is Ernane Remembering that in the case of arrow functions the braces are only necessary if an expression is present the same rule applies for parentheses since they are only necessary if there is more than one argument to be passed In this way we could reduce it even further and write the above example as follows const sayMyName name gt console log My name is name sayMyNane Ernane gt My name is Ernane Simple isn t it in this way we can see how an arrow function can facilitate the declaration of a certain function because of its syntax and still return the same result as a common declaration Use of the this keywordUnlike the traditional declaration arrow functions do not have their own this element as the value of this inside an arrow function remains the same throughout the lifecycle of the function and is always bound to the value of this in the closest traditional parent function Did that get a little weird let me try to uncomplicate with an example Returning to the example used in the previous topic imagine that we have a person object that has its name defined as one of its attributes and has a function that prints the name of that particular person to the console Depending on the type of function used it will not be able to correctly access the parent object that has the requested name attribute and therefore its return will be undefined let person name Ernane Ferreira sayMyName gt console log My name is this name person sayMyName gt My name is In the case of the function being declared in the traditional model this will work as expected and we will correctly obtain the sought attribute let person name Ernane Ferreira sayMyName function console log My name is this name person sayMyName gt My name is Ernane Ferreira Access to argumentsThe arguments object is a local variable available inside all functions and it is what makes the reference possible arguments of a function within the same using the arguments object However arrow functions have no link to the arguments object const showArguments gt console log arguments showArguments gt ReferenceError arguments is not defined In the case of a regular function we can easily access a list of the arguments passed as a parameter when calling the function function showArguments console log arguments showArguments gt Arguments Using the new operatorThe new operator allows instantiation of a user defined object type or one of the user defined types of internal objects that have a constructor function Traditional functions are constructible and can be called using the new operator On the other hand arrow functions are callable and not constructible that is these functions can never be used as constructor functions and can never be invoked with the new operator Therefore for this type of execution in traditional functions we get the following execution result function sayMyName console log My name is name new sayMyName Ernane gt ErnaneAs for the arrow functions const sayMyName gt console log My name is name new sayMyName Ernane gt Uncaught TypeError sayMyName is not a constructor Parameters with duplicate namingThe arrow functions do not allow the name of duplicate parameters but the traditional functions allow depending on the application or non application of strict mode Strict Mode in the code implementation For example the javascript below is fully valid function addTwoNumbers x x console log x x addTwoNumbers gt However the same code with strict mode applied is no longer valid use strict function addTwoNumbers x x console log x x gt Uncaught SyntaxError Duplicate parameter name not allowed in this contextWhen using arrow functions this occurs regardless of whether strict mode is applied In both cases the execution is invalid const addTwoNumbers x x gt console log x x gt SyntaxError Uncaught SyntaxError Duplicate parameter name not allowed in this context That way it s always good to pay close attention to the use of arrow functions instead of traditional functions Although their syntax is very pleasant they have some points that we must be careful not to miss In any case further study on the subject is advisable As always I will leave below some recommendation links for the deepening of the theme I hope you enjoyed this post and that it helped you find what you were looking for LinksFunctions Declarations Arrow functions expressions Javascript Arrow Functions New Features in ES | 2023-05-21 01:43:02 |
ビジネス | 東洋経済オンライン | 「BEVのデザイン」比較で見るメーカーの狙い 自由度の高いBEVの進化は始まったばかり | 森口将之の自動車デザイン考 | 東洋経済オンライン | https://toyokeizai.net/articles/-/669735?utm_source=rss&utm_medium=http&utm_campaign=link_back | 東洋経済オンライン | 2023-05-21 10:30:00 |
コメント
コメントを投稿