AWS |
AWS Japan Blog |
Amazon Cognito と AWS Lambda を使って OAuth 2.0 デバイスフローを実装する |
https://aws.amazon.com/jp/blogs/news/implement-oauth-2-0-device-grant-flow-by-using-amazon-cognito-and-aws-lambda/
|
この認可フローではデバイスのユーザがスマートフォンなどの高度な入力やブラウザ能力がある台目のデバイスで認可リクエストを検証できます。 |
2022-01-17 13:46:58 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
AtCoder Beginners Selection 11問をpythonで解いてみた |
https://qiita.com/hahum/items/fa54a36acac3ea188e10
|
AtCoderBeginnersSelection問をpythonで解いてみたAtCoderの初心者向け問題集であるAtCoderBeginnersSelectionの問をPythonで解説します。 |
2022-01-17 22:47:17 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Blenderでフラクタル |
https://qiita.com/SaitoTsutomu/items/4fb8d255a5e7f528651e
|
BlenderでフラクタルシェルピンスキーのギャスケットBlenderでシェルピンスキーのギャスケットを作ってみました。 |
2022-01-17 22:46:26 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
querySelectorはdocument以外のElementでも使える |
https://qiita.com/notsunohito/items/405a8ff7f97ccc972e76
|
|
2022-01-17 22:07:57 |
Linux |
Ubuntuタグが付けられた新着投稿 - Qiita |
Ubuntu開発環境構築インストールリスト |
https://qiita.com/ezotaka/items/4be1a61e61e6f42fc4c7
|
curlobashnvminstallltsnodeversionvGotargzファイルをダウンロードしてusrlocal以下に展開し、usrlocalgobinにパスを通す。 |
2022-01-17 22:43:55 |
Linux |
Ubuntuタグが付けられた新着投稿 - Qiita |
AppArmorでApache用のプロファイル作る |
https://qiita.com/hoogee/items/7f96f2d533b5cf9576cd
|
おそらく環境により必要なルールが変わるので、デフォルトを用意しても制限キツすぎて脳死で除外されるか、ガバガバで無意味になるかにしかならないと思うなお、apacheから他のプログラムを呼び出すような場合も、親プロセスのルールを継承させることもできるし、別プロファイルに切り替えることもできるため、問題なく使える。 |
2022-01-17 22:35:37 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWSの資格を二つ取得して感じたこと |
https://qiita.com/Shane59/items/2108d8eaf7920ccc0d47
|
当日このようなことが起きると、精神てきによくないので余裕を持ってチェックインを開始して下さい。 |
2022-01-17 22:52:25 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS Cloud Practitioner Essential まとめ6 |
https://qiita.com/bhkbb2/items/8502879bf38dda52f046
|
exECを停止し忘れるのを防ぐため、ECのCPU使用率が一定の閾値を下回った使用していないと判断できる際に、自動的に停止するアラームを作成できる。 |
2022-01-17 22:51:01 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
Nuxt.jsにChart.jsを導入してグラフを表示する |
https://qiita.com/Bezzi05791520/items/f6b1bac934eda4666910
|
|
2022-01-17 22:21:24 |
Azure |
Azureタグが付けられた新着投稿 - Qiita |
Azure Synapse Analyticsでデータをロードする時にファイルは分割した方がいい?分割しなくてもいい? |
https://qiita.com/masahiro-yamaguchi/items/cc12eecbd4bfb0783775
|
AzureSynapseAnalyticsでデータをロードする時にファイルは分割した方がいい分割しなくてもいいデータロード時のファイルは分割した方がいいか分割しない方がいいかAzureSynapseAnalyticsSQLプールでCSVなどのファイルをロードする場合、ファイルは分割した方が高速にロードできるのか、分割しない方が高速にロードできるのかこれは結論から言いますと、「ロードするファイルが圧縮されているのか、圧縮されていないかによって異なる」という事のようです。 |
2022-01-17 22:21:47 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
Cloudflare PagesのGitクローン失敗( an internal error occurred) |
https://qiita.com/CloudRemix/items/976143a229ef057120b1
|
CloudflarePagesのGitクローン失敗aninternalerroroccurred「gitリポジトリのクローンを作成しています」のタイミングで毎回失敗するInitializingbuildenvironmentThismaytakeuptoafewminutestocompleteSuccessFinishedinitializingbuildenvironmentCloningrepositoryFailedaninternalerroroccurredファイル数orファイルサイズが原因CloudflarePages“FailedduetoaninternalerrorによるとGitリポジトリの総ファイル数か個々のファイルサイズが制限を超えると発生する。 |
2022-01-17 22:19:57 |
海外TECH |
MakeUseOf |
How to Add a LinkedIn Profile Badge to Your Blog, Online Resume, or Website |
https://www.makeuseof.com/how-to-add-linkedin-profile-badge-blog-resume-website/
|
online |
2022-01-17 13:31:22 |
海外TECH |
MakeUseOf |
How to Block a Phone Number on Your iPhone |
https://www.makeuseof.com/tag/block-phone-number-ios/
|
messages |
2022-01-17 13:15:11 |
海外TECH |
DEV Community |
Apprendre le PHP : Manipulation des tableaux |
https://dev.to/ericlecodeur/apprendre-le-php-manipulation-des-tableaux-41f4
|
Apprendre le PHP Manipulation des tableauxAujourd hui vous apprendrez la manipulation des tableaux en PHP Ce cours accéléréPHP est gratuit et sera publiéici sur dev to Je publierai un nouvel article tous les deux jours environ Pour ne rien manquer vous pouvez me suivre sur twitter Follow EricLeCodeurTout d abord voici un scénario très courant dans le développement Web qui vous aidera àcomprendre pourquoi nous avons besoin d Array Dans l exemple suivant nous devons afficher une liste de produits et leurs prix product iPad product iPhone product iWatch price price price echo product price lt br gt echo product price lt br gt echo product price lt br gt Comme vous pouvez l imaginer ce code est loin d être optimal Imaginez si nous avions produits ou même produits Il existe un moyen de faire l exemple précédent de manière beaucoup plus efficace Les tableaux Les tableaux en PHP sont des listes de valeurs Les valeurs d un tableau peuvent être de types différents Pour définir un tableau nous utilisons des crochets products La variable products est un tableau videIl est possible de créer un tableau avec du contenu products iPad iPhone iWatch Ce tableau contient trois chaînes iPad iPhone iWatchChaque élément du tableau est séparépar une virgule Il est possible d avoir des tableaux avec différents types de variables array First entry true Il est même possible de créer un tableau dans un tableau array First entry iPad iPhone false Pour accéder àun élémentecho array First entryLes éléments d un tableau sont indexés àpartir de Ainsi le premier élément est àla position le second àla position et ainsi de suite array First entry iPad iPhone false Pour accéder àun tableau dans un tableau vous utilisez la syntaxe suivanteecho array iPhoneIci nous affichons l élément c est à dire iPad iPhone alors que le sous élément est l iPhoneSi vous tentez d accéder àun élément inexistant PHP renverra un avertissement et la valeur null array First entry true echo array null Warning Undefined array key Nombres d items dans un tableauPour déterminer le nombre d éléments dans un tableau vous pouvez utiliser la fonction count array First entry true echo count array Manipulation de tableauxAjouter un élément àla fin du tableau array Last First entry iPad iPhone false Last Supprimer un élément du tableauunset array iPad iPhone false Last Convertir un tableau en chaîne avec la fonction implode array One Two Three echo implode array One Two Three Le premier paramètre est le séparateur Transformer une chaîne en tableau avec la fonction éclater text Mike Shawn John echo explode text Mike Shawn John Le premier paramètre est le séparateur Itérer àtravers tous les éléments d un tableauLa fonction foreach exécute le code pour chaque élément du tableau names Mike Shawn John foreach names as name echo Hello name Le premier paramètre est le nom du tableau àparcourir le deuxième paramètre représente la référence àl élément courant Tableaux associatifsJusqu àprésent nous avons appris comment fonctionnent les tableaux Ils ont une clénumérique commençant à Il est possible de créer des tableaux avec une clépersonnalisée C est ce que PHP appelle des tableaux associatifs person age gt genre gt men Ici «l âge »et le «genre »sont les clés et men sont les valeurs associées àces clés Notez que certains langages de programmation appellent ce type de tableau un dictionnaire Les tableaux associatifs sont très pratiques et vous devez bien les comprendre car vous les utiliserez très souvent Ils sont parfaits pour stocker des informations product id gt name gt iPad price gt L accès àune valeur de tableau se fait avec la cléecho Product product name L ajout d une clé valeur au tableau est possible en spécifiant une nouvelle clé product qty Il est possible de vérifier si une cléexiste product id gt name gt iPad price gt echo array key exists id product true Boucle dans un tableau associatif avec des valeurs et des clésforeach names as key gt value echo key value Concaténation Joindre deux tableaux names Mike Paul Tom names John Sam allNames array merge names names Mike Paul Tom John Sam Concaténation avec l opérateur de propagation names Mike Paul Tom names John Sam allNames names names Mike Paul Tom John Sam Ici l opérateur de propagation avant le nom du tableau names déconstruit le tableau Un tableau de tableaux associatifsUn modèle que vous utiliserez souvent est un tableau contenant des tableaux associatifs items id gt name gt product id gt name gt product id gt name gt product id gt name gt product Ce type de tableau est excellent pour représenter les données Il est possible de boucler et d afficher chaque élémentforeach items as item echo item name lt br gt L instruction as crée une référence àl élément de tableau Récupère une partie d un tableauIl existe plusieurs fonctions qui permettent de récupérer une partie d un tableau Récupérer uniquement les clés ou les valeurs person age gt genre gt men Return an array with only keysecho array keys person age genre Return an array with only valuesecho array values person men Fonctions avec fonction comme paramètreDans cette partie du tutoriel nous allons voir trois fonctions qui permettent la manipulation des tableaux Ces fonctions sont array filter array map array reduce Ces fonctions sont particulières car elle ont chacune une fonction callback comme paramètre Une fonction callback est une fonction anonyme qui s exécute de la même façon qu une fonction classique Le concept des fonctions callback peut être plus difficile àcomprendre Donc si vous ne saisissez pas tout du premier coup c est normale array filter Permet la récupération des éléments qui correspondent àun critère spécifique items id gt name gt product id gt name gt product id gt name gt product id gt name gt product filteredItem array filter items function product return product id gt print r filteredItem items id gt name gt product id gt name gt product La fonction array filter est une fonction avec une fonction de rappel en paramètre Pour chaque élément du tableau une expression sera évaluée Si l expression est vraie l élément courant sera inclus dans le tableau résultant Recherche dans un tableau items id gt name gt product id gt name gt product id gt name gt product id gt name gt product found key array search product array column items name La fonction array search permet de rechercher une cléspécifique selon un critère de recherche Dans le dernier exemple nous recherchons la clédu produit dans la colonne nom Créez un nouveau tableau avec la fonction array map items id gt name gt product id gt name gt product id gt name gt product id gt name gt product mapItems array map function product return id gt product id name gt product name items print r mapItems id gt name gt product id gt name gt product id gt name gt product id gt name gt product La fonction array map renvoie un tableau qui contient ce que chaque élément de rappel renverra La fonction array map doit avoir deux paramètres une fonction callback et un tableau ex array map fonction de rappel tableaux La fonction array map boucle sur chaque élément du tableau et construit en même temps un nouveau tableau Chaque élément du nouveau tableau est le résultat retour de la fonction callback Dans le dernier exemple chaque boucle a renvoyéun élément avec l identifiant et le nom du produit La table d origine n est pas modifiée une nouvelle table est créée La fonction array reduce Cette fonction prend un tableau et le réduit àune seule valeur Par exemple a renvoyéle résultat de l addition de tous les nombres contenus dans un tableau numbers sum array reduce numbers function num total return total num print r sum La fonction array reduce prend deux paramètres une référence àl élément réel et une variable totale A chaque itération la fonction callback retourne le résultat dans la variable total ConclusionC est tout pour aujourd hui je publierai un nouvel article tous les deux jours environ Pour être sûr de ne rien rater vous pouvez me suivre sur twitter Suivre EricLeCodeur |
2022-01-17 13:45:33 |
海外TECH |
DEV Community |
PHP crash course : Array manipulation |
https://dev.to/ericchapman/php-crash-course-array-manipulation-4m1k
|
PHP crash course Array manipulationToday you will learn array création and manipulation in PHP This PHP crash course is free and will be posted here on dev to I ll be releasing a new article post every two days or so To not miss anything you can follow me on twitter Follow EricTheCoder First here is a very common scenario in web development that will help you to understand why we need Array In the next exemple we need to display a list of products and their prices product iPad product iPhone product iWatch price price price echo product price lt br gt echo product price lt br gt echo product price lt br gt As you can imagine this code is far from optimal Imagine if we had products or even products There is a way to do the previous exemple in a much more efficient way Arrays Arrays in PHP are a lists of values Values in an array can be of different type To define an array we use square brackets products The variable products is an arrayIt is possible to create an array with content products iPad iPhone iWatch This array contains three strings iPad iPhone iWatchEach array element is separated by a comma It is possible to have arrays with different type of variable array First entry true It is even possible to create an array within an array array First entry iPad iPhone false To access an itemecho array First entryThe elements of an array are indexed from So the first item is at position the second at position and so on array First entry iPad iPhone false To access an array within an array you use the following syntaxecho array iPhoneHere we display element i e iPad iPhone Then element is iPhoneIf you attempt to access a non existent item PHP will return a warning and the value null array First entry true echo array null Warning Undefined array key CountTo determine the number of items in an array you can use the count function array First entry true echo count array Array manipulationAdd an element at the end of the array array Last First entry iPad iPhone false Last Remove an element from the arrayunset array iPad iPhone false Last Convert an array to a string with the implode function array One Two Three echo implode array One Two Three The first parameter is the separator Transform a string into an array with the explode function text Mike Shawn John echo explode text Mike Shawn John The first parameter is the separator Iterate through all elements of an arrayThe foreach function executes code for each element of the array names Mike Shawn John foreach names as name echo Hello name The first parameter is the name of the array to browse the second parameter represents the reference to the current element Associative arraysSo far we have learned how arrays work They have a number key starting from It is possible to create arrays with a custom key This is what PHP calls associative arrays person age gt genre gt men Here age and gender are the keys and men are the values associated with these keys Note that some programming languages call this type of array a dictionary Associative arrays are very practical and you must understand them well because you will use them very often They are perfect for storing information product id gt name gt iPad price gt Access to an array value is done with the keyecho Product product name Adding a key value to the array is possible by specifying a new key product qty It is possible to check if a key exists product id gt name gt iPad price gt echo array key exists id product true Loop in an associative array with values and keysforeach names as key gt value echo key value Concatenation Join two arrays names Mike Paul Tom names John Sam allNames array merge names names Mike Paul Tom John Sam Concatenation with the spread operator names Mike Paul Tom names John Sam allNames names names Mike Paul Tom John Sam Here the spread operator before the array name names deconstructs the array An array of associative arraysA pattern that you will use often is an array containing associative arrays items id gt name gt product id gt name gt product id gt name gt product id gt name gt product This kind of table is excellent for representing data It is possible to loop and display each itemforeach items as item echo item name lt br gt The as statement create a reference to the array item Retrieve part of an arrayThere are several functions that allow you to retrieve part of an array Retrieve only keys or values person age gt genre gt men Return an array with only keysecho array keys person age genre Return an array with only valuesecho array values person men Retrieval of items that match a specific criterion with the array filter function items id gt name gt product id gt name gt product id gt name gt product id gt name gt product filteredItem array filter items function product return product id gt print r filteredItem items id gt name gt product id gt name gt product The array filter function is a function with a callback function as parameter For each item in the array an expression will be evaluated If the expression is true the current item will be included in the resulting array Search in an array items id gt name gt product id gt name gt product id gt name gt product id gt name gt product found key array search product array column items name The array search function allows you to search for a specific key according to a search criterion In the last example we look for the key of product in the name column Create a new array with the array map function items id gt name gt product id gt name gt product id gt name gt product id gt name gt product mapItems array map function product return id gt product id name gt product name items print r mapItems id gt name gt product id gt name gt product id gt name gt product id gt name gt product The array map function returns an array that contains what each callback item will return The array map function must have two parameters a callback function and an array ex array map callback function arrays The array map function loops over each array item and at the same time builds a new array Each item in the new array is the result return of the callback function In the last example each loop returned an item with the id and the product name The original table is not modified a new table is created The array reduce functionThis function takes an array and reduces it to a single value Eg returned the result of adding all numbers contains in an array numbers sum array reduce numbers function num total return total num print r sum The array reduce function take two parameters reference to actual item and a total variable For each iteration the callback function return the result in the total variable ConclusionThat s it for today I ll be releasing a new article every two days or so To be sure not to miss anything you can follow me on twitter Follow EricTheCoder |
2022-01-17 13:42:59 |
海外TECH |
DEV Community |
How to make full stack social media website using HTML, CSS and JS | Part 01 |
https://dev.to/kunaal438/how-to-make-full-stack-social-media-website-using-html-css-and-js-part-01-3o7l
|
How to make full stack social media website using HTML CSS and JS Part Hello In today s article we ll learn to create a social media website basically an Instagram clone I ll make it full stack from front end to backend This is the first part of it And in this part we ll learn to create Home Page Post page and user profile page All the pages are amazing but not responsive well we ll make them responsive in next article So without wasting more time let s start Video TutorialYou can watch the video tutorial for demo amp step by step guide If you do like the tutorial make sure you subscribe my channel It will really motivate me CodeLet s start So first let s see what files and folders we have in our project Well we have a CSS folder for styles and JS folder for scripts And also you can download the images here If you want to get its source code Click Here Home page Let s begin with our home page In home page we have main elements A navbar a post section and a suggestion section So let s make them step by step NavbarFirst write basic HTML Template inside index html file and link style css file to it Also I am using GOOGLE POPPINS FONTS So if you want to use it make sure you link it Okay once you are done with linking all style files and fonts Let s move on to our navbar For navbar make a nav element inside body and make the below elements Index html lt navbar gt lt nav class navbar gt lt img src img logo png class logo alt gt lt form class search box gt lt input type text placeholder search name search query id search input gt lt button class search btn type submit gt lt img src img icon search png class search icon alt gt lt button gt lt form gt lt div class nav links gt lt a href class nav links gt lt img src img icon home fill png class nav icon alt gt lt a gt lt div class activity log gt lt img src img icon heart nofill png class nav icon alt gt lt div class activity container hide gt lt div class activity card gt lt img src img user png class user img alt gt lt p class activity gt lt b gt siri lt b gt liked your post lt p gt lt img src img posts post png class activity post alt gt lt div gt lt div class activity card gt lt img src img user png class user img alt gt lt p class activity gt lt b gt siri lt b gt liked your post lt p gt lt img src img posts post png class activity post alt gt lt div gt lt div class activity card gt lt img src img user png class user img alt gt lt p class activity gt lt b gt siri lt b gt liked your post lt p gt lt img src img posts post png class activity post alt gt lt div gt lt div class activity card gt lt img src img user png class user img alt gt lt p class activity gt lt b gt siri lt b gt liked your post lt p gt lt img src img posts post png class activity post alt gt lt div gt lt div gt lt div gt lt a href class nav links gt lt img src img icon add nofill png class nav icon alt gt lt a gt lt a href class nav links gt lt img src img profile img png class nav icon user profile alt gt lt a gt lt div gt lt nav gt Well the above HTML code is a lot Isn t it if you do understand it well you are amazing but if don t get it I suggest you watch the video tutorial there you ll make the navbar and all the elements step by step Anyway let s add some CSS to it Style css margin padding box sizing border box body width position relative font family poppins sans serif background fafafa navbar width height px position fixed top left z index background fff border bottom px solid padding px vw display flex align items center justify content space between logo height px search box width px height px display flex search input width px height background fafafa border px solid padding px text transform capitalize search btn background fff cursor pointer border px solid border left none padding px search icon width px height px nav links display flex align items center gap px nav icon width px height px cursor pointer user profile width px height px border radius activity log position relative height px activity container width px height auto max height px position absolute top right background fff border px solid activity card width display flex justify content space between align items center padding px padding bottom margin bottom px cursor pointer activity card hover background fafafa activity container hide pointer events none opacity user img width px height px border radius activity width px font size rem activity post width px height px object fit cover OutputWell its looking amazing If you notice our nav HTML you ll see activity log element This element we ll use to make an activity pop up Well in CSS part we are done styling that activity popup so we just need to add JS to make it work post jsMake sure you link post js file to index html using lt script src path gt Once you are done with that let s write JS let heartIcon document querySelector activity log nav icon let activityContainer document querySelector activity container heartIcon addEventListener click gt activityContainer classList toggle hide changeIcon heartIcon const changeIcon icon gt let src icon src split if icon src includes nofill icon src src fill png else icon src src nofill png In the above code I am first selecting the heartIcon which is our heart icon And then I am selecting activityContainer which it the activity box using querySelector And then I am adding click event to heartIcon using addEventListener inside it I am just toggling the class of activityContainer using classlist toggle and the calling a changeIcon function Well changeIcon function we made to change the icon image from fill to nofill to fill The code is simple but if you don t get it let me know in the discussion After this if I click on the heart icon on the navbar I should see the activity popup Output On Click PostsSo we are done with our navbar and after that we have posts in our home pageLet s create posts now for that you can code the below HTML code after nav element Index html lt main section gt lt section class main gt lt post section gt lt div class post container gt lt div class post gt lt div class post header gt lt img src img user png class user icon alt gt lt p class username gt modernweb lt p gt lt div gt lt div class post feed gt lt div class post overlays gt lt img src img icon red heart png class like icon alt gt lt div class share window gt lt h class title gt share the post with others lt h gt lt div class share link container gt lt input type text id share link value disabled gt lt button class copy btn gt copy lt button gt lt div gt lt div gt lt div gt lt div class post img container gt lt img src img posts post png alt gt lt img src img posts post png alt gt lt img src img posts post png alt gt lt img src img posts post png alt gt lt img src img posts post png alt gt lt div gt lt div gt lt div class post detail gt lt div class detail intracables gt lt img src img icon heart nofill png class like btn alt gt lt img src img icon send nofill png class send btn alt gt lt img src img icon comment nofill png class comment btn alt gt lt div gt lt span class likes gt k likes lt span gt lt p class username gt modernweb lt p gt lt p class post des gt Lorem ipsum dolor sit amet consectetur adipisicing elit Dolores ipsa incidunt obcaecati esse illo voluptates libero debitis nisi Id tempora vel illum vitae temporibus commodi non cupiditate atque voluptas Ipsam lt p gt lt div class comment box gt lt input type text id comment input placeholder Add a comment gt lt button class add comment btn gt lt img src img icon comment nofill png alt gt lt button gt lt div gt lt span class comment count gt comments lt span gt lt div gt lt div gt more posts lt div gt lt section gt To be honest in our home page the most difficult thing is the post itself I almost lost in code like twice when coding the post section I will recommend you to watch the tutorial if you really want to learn something from it Okay moving on let s style it Style css main section main width position relative margin top px display flex padding vw px gap px post section post container width post width border px solid background fff margin bottom px post header display flex align items center padding rem gap px post header user icon width px height px border radius post header username font size rem font weight post feed width height px position relative post img container width height display flex overflow hidden post img container img min width height object fit cover transition s post detail padding rem detail intracables display flex gap px detail intracables img width px height px cursor pointer likes color aaa display flex margin px post username font weight post des margin px font size rem line height rem opacity comment box width height px display flex border px solid comment input width height px background fafafa border none padding px line height px z index font size rem comment input placeholder color bbb comment input focus outline px solid fff add comment btn display flex justify content center align items center width px height px cursor pointer border none outline none background fff add comment btn img width px height px comment count font weight color aaa font size rem display flex margin top px opacity post overlays position absolute width height display flex justify content center align items center pointer events none like icon width px opacity transition s like icon show opacity animation popup s forwards keyframes popup transform scale transform scale transform scale transform scale transform scale share window position absolute top left transform translate background fff padding px width transition s opacity share window active opacity pointer events all share window title font size rem font weight text transform capitalize margin bottom px share link container width display flex border px solid share link height px padding px background fafafa border none color width copy btn background cff border none outline none cursor pointer color cff text transform capitalize width px OutputNow if you see the HTML code we have post overlay element This element is for like and share window elements We already styled those elements in CSS we just have to add JS now Post jsconst addInterationsToPost post gt post like let likeBtn post querySelector like btn let likeImg post querySelector like icon likeBtn addEventListener click gt if likeBtn src includes nofill likeImg classList add show if shareBtn src includes fill shareBtn click changeIcon likeBtn setTimeout gt likeImg classList remove show post share let shareBtn post querySelector send btn let shareWindow post querySelector share window shareBtn addEventListener click gt shareWindow classList toggle active changeIcon shareBtn let postLink post querySelector share link value let copyLinkBtn post querySelector copy btn copyLinkBtn addEventListener click gt navigator clipboard writeText postLink then gt shareBtn click postlet posts document querySelectorAll post posts map post gt addInterationsToPost post The above code is pretty easy we just selecting each post card and passing it to the addInteractionToPost function Inside that function we are adding click event to like and share button And inside the click events just toggling the desired classes of specific elements Output Clicked on like button Clicked on share button That was a lot SuggestionNow its time for the last section of our HOME PAGE Yeah right let s make user suggestions section Make to code this inside main section after post container element Index html lt right section gt lt div class user about section gt lt div class user info gt lt img src img profile img png class user dp alt gt lt div class info container gt lt h class name gt Kunaal Kumar lt h gt lt p gt Lorem ipsum dolor sit amet consectetur adipisicing elit Consectetur eius animi non commodi lt p gt lt div gt lt div gt lt h class suggestion heading gt suggestions lt h gt lt div class suggestion container gt lt div class user card gt lt img src img user png class user dp alt gt lt p class username gt john lt p gt lt button class follow btn gt follow lt button gt lt div gt more user cards lt div gt lt div gt Okay se let s style it and finish the home page Style css right section user about section width height position relative user info width display flex align items center gap px user dp width px height px border radius name font size rem font weight margin bottom px info container p font size rem line height rem opacity suggestion heading font weight font size rem margin px text transform capitalize suggestion container width display flex flex wrap wrap gap px user card min width px background fff padding px border px solid user card user dp width px height px display block margin auto user card username text align center font size rem font weight margin px text transform capitalize follow btn display block margin auto width height px background afff color fff font size rem text transform capitalize border px solid d cursor pointer OutputSo I guess that was a lot for today guys to I am wrapping this here We are done with our Home page but if you wist to create post page and user profile page you can checkout the video tutorial Also if you want you can get its source from here Great work If you stuck somewhere or you have any doubt feel free to ask me in discussions Also if you don t want to miss this Full Stack Social Media Website make sure to subscribe my channel right now I am also making a Full stack Ecom WebsiteI really appreciate if you can subscribe my youtube channel I create awesome web contents Articles you may find UsefulBest CSS EffectInfinte CSS loaderDisney CloneYoutube API Youtube CloneTMDB Netflix CloneBuy me a coffeeYour donation really motivates me to do more amazing Thanks for watching |
2022-01-17 13:19:43 |
海外TECH |
DEV Community |
Automated Cross Browser Testing With Jasmine Framework & Selenium |
https://dev.to/kritika_murari/automated-cross-browser-testing-with-jasmine-framework-selenium-1kl4
|
Automated Cross Browser Testing With Jasmine Framework amp SeleniumIn today s fast paced world of software development we have new technologies and languages for development coming on very frequently With this comes several testing and automation tools and frameworks in the related market Choosing the right set of tools and frameworks becomes an absolute necessity because it impacts the accuracy and TTM Time to Market JavaScript is one of the widely used programming languages for web automation testing It also supports a number of Selenium test automation frameworks for web UI testing Of all the available ones Jasmine JavaScript testing framework turns out to be the best suited as it provides a stable and functional architecture It is easy to get started with Jasmine and is also easy to implement test scenarios with the same In this tutorial of Selenium automation testing with Jasmine we look into the nitty gritty of the Jasmine JavaScript testing framework from an automation testing standpoint We will also learn how to set it up followed by a sample code writing and execution In subsequent sections of this Selenium Jasmine tutorial we will also learn how to run Jasmine JavaScript tests at scale on a cloud based Selenium Grid like LambdaTest So let s get started Introduction to JasmineJasmine is an open source JavaScript testing framework It is a behavior driven BDD development inspired framework that is independent of any other frameworks It is used for unit testing of both synchronous and asynchronous JavaScript test scenarios In addition to its outstanding support for JS it also provides extensive support for Python Ruby and other JavaScript based languages Furthermore it is available for different versions like standalone node js etc An additional benefit of using Jasmine is that it is an independent framework with minimal to no dependency on language browser and platform Jasmine JavaScript testing framework does not require a DOM and is very easy to set up Also it provides an immaculate and easy to read syntax like below example describe A suite is just a function function var a it and so is a spec function a true expect a toBe true Why use Jasmine as a Testing Framework for JavaScript Tests Having understood what Jasmine is let us look at the key features or advantages of using JavaScript Selenium automation testing for Web UI testing Easy to set up and easy to write tests Very fast as it has almost zero overhead and no external dependencies for Jasmine core It comes with out of the box support to fulfill all the test needs Can run the browser and node js tests with the same framework An extensive amp active community and regularly updated documentation for support and development Support for usage of spies for test doubles implementation in the framework It even supports testing of front end code using the Jasmine jQuery extension It also supports test driven development in addition to behavior driven development Unlike other JavaScript testing frameworks the Jasmine testing framework has built in assertions It comes with an inbuilt test runner which can be used to run browser tests Provides a rich number of built in matchers that can be used to match expectations and add asserts to the test cases Some examples are toEqual toBe toBeTruthy toBeFalsy toContain toBeDefined toBeUndefined toBeNull toBeNaN etc Advantages of using Jasmine JavaScript Testing Framework with SeleniumJasmine and Selenium are popularly used for JavaScript automation testing and web UI automation testing respectively When working on a JavaScript based web UI project it is better to combine both the forces to take the advantage of both of them Jasmine JavaScript testing framework and Selenium automation testing complement each other in being open source easy to implement and scale Their capacity to work with almost all browsers and platforms is another added advantage By using a Selenium Grid Jasmine tests can be executed more quickly through parallel execution You can refer to our earlier blog on Importance of Parallel Testing in Selenium to get a detailed understanding about the advantages offered by parallel test execution Getting Started with JasmineHaving gathered some knowledge around the what amp why of the Jasmine testing framework in JavaScript let us now dig deeper and get our hands dirty with the implementation In this section of the Selenium Jasmine tutorial we will learn about the workflow of Jasmine and understand the basics of writing test scenarios Let us assume we need to test a file test js using Jasmine JavaScript testing framework SpecRunner html would be the output file that will run all test cases from spec js taking Lib as an input and then show the results in the browser Lib Consists of built in JavaScript files that help to test varied functions and other JS files within the project SpecRunner html A usual html file that will render the output of the test run in the browser test js This file comprises the actual functionalities code under test which is to be tested with the help of spec js and lib file spec js Also referenced as the test case file this contains all the testcases in a prescribed format for the file to be tested Here are the basic building blocks of Jasmine tests Suite BlockSuite forms the basic building block of the Jasmine JavaScript testing framework One suite is composed of test cases or specs written to test a particular file and is made up of two blocks the describe block and it block describe This is used to group related test cases written under it There is only one describe at the top level unless the test suite is a nested one In which case it takes a string parameter to name the collection of test cases in that particular describe block it contains specs test casesThis is used to define the specs or the test cases inside the describe block Like a describe it takes similar parameters one string for name and one function that is the test case we want to execute A spec without any assertions is of no use Each spec in Jasmine consists of at least one assertion which is referred to as expectation here If all expectations pass in a spec it is called a passing spec On the other hand if one or more expectations fails in a spec it is called a failing spec Note Since both it and describe blocks are JavaScript functions all the basic variable and scope rules apply to them as per js code Also they can contain any valid executable code This means variables at describing level are accessible to all and it level within the test suite describe A suite is just a function function var a it and so is a spec function a true expect a toBe true Expectations or MatchersExpectations or matchers are a way to implement assertions in the Jasmine JavaScript testing framework This is done with the help of expect function which takes the actual value produced by the test case as output It is then chained with a matcher function that takes expected results for that test case and then evaluates them to give a boolean result The returned value is true if the expectation matches else it is false Jasmine also provides the utility to check for negative assertions by adding not before the matcher for a required expect function All the expect functions come under it block and each it block can have one or more expect blocks Jasmine provides a wide range of in built matchers and lets you extend matchers via custom matchers describe This is a describe block for expectations function it this is a positive matcher function expect true toBe true it this is a negative matcher function expect false not toBe true Here is a small example to understand the usage and implementation of describe it and expect blocks We will be testing a file named Addition js having a corresponding spec file with test cases as AdditionSpec js function Addition initialValue add function num this initialValue num return this initialValue addAny function var sum this initialValue for var i i lt arguments length i sum arguments i this initialValue sum Return this initialValue describe to verify Addition js file function test case it Should have initial value function expect Addition initialValue toEqual test case it should add numbers function expect Addition add toEqual expect Addition add toEqual test case it Should add any number of numbers function expect Addition addAny toEqual Jasmine JavaScript testing framework also provides support for nested suites utilizing nested describe blocks Here is an example of a spec file with nesting for the same Addition js describe to verify Addition js file using nested suites function Starting of first suite block describe Retaining values function test case it Should have initial value function expect Addition currentVal toEqual end of first suite block second suite block describe Adding single number function test case it should add numbers function expect Addition add toEqual expect Addition add toEqual end of second suite block third suite block describe Adding Different Numbers function test case it Should add any number of numbers function expect Addition addAny toEqual end of third suite block Using Standalone Jasmine Distribution For Selenium Automation TestingTo get started with Jasmine follow the below mentioned steps to complete the system setup Step Download the latest version of Jasmine from the official website Step Download the standalone zip for the selected version from this page Step Create a new directory in your system and then add a sub directory to it Step Move the downloaded standalone zip inside this sub directory and unzip it here Once unzipped your directory structure should look something like this Step In order to verify the setup load the SpecRunner html in your web browser If you see an output something like below it means that you have completed the setup for Jasmine on your system Let s see how to modify this to run our test case for Addition js using AdditionSpec js and Nested AdditionSpec js Firstly we will remove all the existing files from src and spec folder and add the files for our example which we have understood already After doing this the folder structure would look something like this Having updated the files we need one more step to execute our specs which is to update references to files under spec and src folder as per our changes in SpecRunner html For this open the SpecRunner html and it would look like this lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf gt lt title gt Jasmine Spec Runner v lt title gt lt link rel shortcut icon type image png href lib jasmine jasmine favicon png gt lt link rel stylesheet href lib jasmine jasmine css gt lt script src lib jasmine jasmine js gt lt script gt lt script src lib jasmine jasmine html js gt lt script gt lt script src lib jasmine boot js gt lt script gt lt include source files here gt lt script src src Player js gt lt script gt lt script src src Song js gt lt script gt lt include spec files here gt lt script src spec SpecHelper js gt lt script gt lt script src spec PlayerSpec js gt lt script gt lt head gt lt body gt lt body gt lt html gt Just update the file name in the src and spec section and save it and you are ready to load the SpecRunner html again to see the results Setting Up Jasmine Environment using npm for Selenium Automation TestingIn order to get started with Selenium automation testing using Jasmine framework in JavaScript we need to have some prerequisite setup in our system Step Make sure the latest JavaScript version is installed on the system Also check for node js and npm on your system and upgrade to the newest version if required brew install nodenpm install npm latest gStep Navigate to the directory where you want to create your test case execute it and install Jasmine by triggering the npm command npm install g jasmineStep Once this is done we will install Chrome Driver and Selenium WebDriver in the same directory to execute Jasmine Selenium test cases on the local Selenium Grid npm install save chromedrivernpm install save selenium webdriverStep Once all this is done we are good to initialize our Jasmine project using the init command jasmine initYou should be able to see a spec folder which will be further used for adding test case files For this Selenium Jasmine JavaScript tutorial we will be using the following js file Require modules used in the logic belowconst Builder By Key until require selenium webdriver You can use a remote Selenium Hub but we are not doing that hererequire chromedriver const driver new Builder forBrowser chrome build Setting variables for our testcaseconst baseUrl function to check for login elements and do loginvar loginToLamdbatest async function let loginButton By xpath button navigate to the login page await driver get baseUrl wait for login page to be loaded await driver wait until elementLocated loginButton console log Login screen loaded to set jasmine default timeoutjasmine DEFAULT TIMEOUT INTERVAL Start to write the first test casedescribe Selenium test case for login page function it verify page elements async function console log lt Starting to execute test case gt to do login await loginToLamdbatest var welcomeMessage By xpath class form title verify welcome message on login page expect await driver findElement welcomeMessage getText toBe Welcome Back to quit the web driver at end of test case execution await driver quit console log lt Test case execution completed gt In this example file we have automated a scenario to navigate to the LambdaTest login page and then verify the welcome message on the page We have used a local Selenium WebDriver and running the tests on the Chrome browser To execute the test case use the following command if you are at the same directory level as the file jasmine exampleSeleniumSpec jsOnce triggered you will see a chrome browser tab open up on your system and get redirected to a given page and after successful verification the browser is closed and the terminal shows logs like below ⇒jasmine example spec jsRandomized with seed Started lt Starting to execute test case gt Login screen loaded lt Test case execution completed gt spec failuresFinished in secondsRandomized with seed jasmine random true seed Using Jasmine JavaScript Framework to run Selenium Tests on cloud based Selenium GridRunning tests on a local Selenium Grid is not a scalable and reliable approach You would need to invest significantly in building the test infrastructure if the tests have to be run across a number of browsers platforms and device combinations This is where cloud testing can be useful as it offers the much needed benefits of scalability reliability and parallel test execution We will run the Jasmine tests on Selenium Grid Cloud on LambdaTest You would need to have your LambdaTest username and access token handy to continue with the execution details are available in the LambdaTest profile section Set the following environment variables on your machine For Mac Linuxexport LT USERNAME YOUR USERNAME export LT ACCESS KEY YOUR ACCESS KEY For Windowsset LT USERNAME YOUR USERNAME set LT ACCESS KEY YOUR ACCESS KEY Once this is done we modify the spec file to have a remote web driver configuration for the LambdaTest Hub to execute test cases on the grid For this we will be adding the required browser capabilities for execution on the LambdaTest Grid and use a remote web driver on their grid Modified exampleSeleniumSpec js as per our requirements would look like this Require modules used in the logic belowselenium require selenium webdriver const Builder By Key until require selenium webdriver Setting variables for our testcaseconst baseUrl const username process env LT USERNAME lt Your lambdatest username gt const accessKey process env LT ACCESS KEY lt Your lambdatest accessKey gt var remoteHub https username accessKey hub lambdatest com wd hub const caps build Jasmine selenium javascript browserName chrome version platform Windows video true network true console true visual true const driver new selenium Builder usingServer remoteHub withCapabilities caps build function to check for login elements and do loginvar loginToLamdbatest async function let loginButton By xpath button navigate to the login page await driver get baseUrl wait for login page to be loaded await driver wait until elementLocated loginButton console log Login screen loaded to set jasmine default timeoutjasmine DEFAULT TIMEOUT INTERVAL jasmine getEnv defaultTimeoutInterval Start to write the first test casedescribe Selenium test case for login page function it verify page elements async function console log lt Starting to execute test case gt to do login await loginToLamdbatest var welcomeMessage By xpath class form title verify welcome message on login page expect await driver findElement welcomeMessage getText toBe Welcome Back to quit the web driver at end of test cae execution await driver quit console log lt Test case execution completed gt This would also have a similar command to execute and would give the same output as follows on the terminal ⇒jasmine lambdatest jsRandomized with seed Started lt Starting to execute test case gt Login screen loaded lt Test case execution completed gt spec failuresFinished in secondsRandomized with seed jasmine random true seed You can now navigate the LambdaTest dashboard for the user account and view the execution results and logs on various tabs Under Recent Tests on the left side you can see the latest execution on the Dashboard tab To analyze the complete timeline for your different test case runs we can navigate to Automation Tab On Automation Tab only go to the Automation Logs section to view the entire execution logs and the video of our test case This helps in debugging the issues by analyzing the run You can also navigate to other tabs and per the requirement to add view data for the execution With this we have completed our Jasmine JavaScript Selenium tutorial to understand the setup and execution with Jasmine on the local and LambdaTest Grid cloud Check out JavaScript video tutorials on LambdaTest YouTube channel to get a deeper understanding about test automation with JavaScript It s a WrapSo in this Jasmine JavaScript testing framework tutorial with Selenium we learned about the whats and whys of Jasmine and Selenium how they make a good combination for automation web UI based code using JavaScript and all advantages it provides Having done the setup and understanding the test case basics we have successfully executed our test case on local and Selenium Grid with the help of LambdaTest which provides us with browsers and OS combinations to fulfill all our testing needs So get started and write your first Selenium automation testing code with Jasmine and JavaScript Happy Testing |
2022-01-17 13:18:04 |
海外TECH |
DEV Community |
JavaScript Hoisting |
https://dev.to/ohdylan/javascript-hoisting-36p4
|
JavaScript HoistingIn this article we are going to discuss about hoisting in JavaScript Hoisting is a process that happens during the creation of execution context which will move the declarations of variables and functions up to the top of the context Let s start with an example hello function hello return Hello World If you are familiar with JavaScript you know that this is not going to throw an error What is happening when during the creation of global execution context is that the engine will move the variable declaration in this case the function hello up to the context when it sees function keyword Which also means before the code is executed it will look something like this function hello return Hello World hello It moves that declaration up Therefore memory is allocated to store this function declaration before the code execution How about variables that is not a function declaration console log text var text Hello World Let s say I have this piece of code that tries to print out variable text before it gets declared and defined What will it print out undefinedUndefined When the engine sees var it will know to leave a piece of memory for this variable but it doesn t know that what value has been assigned to this variable Therefore when the declaration of the variable is hoisted undefined gets assigned to this variable as default This is the reason why error was not thrown but printed out undefined instead You have also seen this way of defining a function hello var hello function return Hello World This is a function expression What if we do this Are we going to get the Hello World printed out correctly VM Uncaught TypeError hello is not a function at lt anonymous gt Hmm ok so the engine does not know that this is a function Remember When the engine sees var it is going to move the declaration of hello up and gives an undefined default value If you try to call it it is going to tell you that this is not a function Let s print out what hello is before assigning that function to it console log hello var hello function return Hello World undefinedJust now we mentioned that when the execution context is created the variables declaration get hoisted Let s try this function hello console log text var text Hello World console log text hello What can we expect here undefined Hello WorldAlright this is aligned with what we have just discussed Let s give a value to the text in global scope var text Am I printed function hello console log text var text Hello World console log text hello Again what will you expect it to print out undefined Hello WorldStill is undefined When hello is called a new execution context is created and text variable is hoisted to the top of that hello context therefore it is not aware of the assigned value from global execution context Let s try one more thing we remove the declaration of variable within hello var text Am I printed function hello console log text hello Am I printed Yes you are printed Scope chain right JavaScript Scoping Do you think all these will cause confusion when we are writing JavaScript code In order to make our code more predictable we can use let and const in ES They don t get hoisted hello const hello function return Hello World Uncaught ReferenceError hello is not defined at lt anonymous gt Yup this feels better There are some unexpected behaviours that might happen when you just started learning JavaScript like type coercion However understanding these concepts will definitely make you a better JavaScript developer Since we mentioned let and const I would also like to add on one more regarding block scope and function scope When we use other languages this is something that we would expect to throw error we use groovy here as example if someCondition def someVar Can you see me def newVar someVar I cannot see you This is because the variable is defined within the block scope What if we do this in JavaScript var someCondition trueif someCondition var hello Hello var helloWorld hello World console log helloWorld Hello WorldError will not be thrown in this case for JavaScript This is because var is only scoped by function and module If you do this in a function it will throw error function someFunction var hello Hello var helloWorld hello World console log helloWorld VM Uncaught ReferenceError hello is not defined at lt anonymous gt What if we also want to have block scope for Use let and const let someCondition trueif someCondition let hello Hello let helloWorld hello World console log helloWorld VM Uncaught ReferenceError hello is not defined at lt anonymous gt That s it for this article hope you enjoyed Do follow me for more future articles on web design programming and self improvement |
2022-01-17 13:14:35 |
海外TECH |
DEV Community |
Introduction to Data visualization |
https://dev.to/aws-builders/introduction-to-data-visualization-3l1f
|
Introduction to Data visualizationEvery day the people in your organization make decisions that affect your business When they have the right information at the right time they can make the choices that move your company in the right direction Giving the decision makers the opportunity to explore and interpret information in an interactive visual environment helps democratize data and accelerates data driven insights that are easy to understand and navigate Building a BI and data visualization service in the cloud allows you to take advantage of capabilities such as scalability availability redundancy and enterprise grade security It also lowers the barrier to data connectivity and allows access to far wider range of data sources ーboth traditional such as databases as well as non traditional such as SaaS sources An added advantage of a cloud based data visualization service is the elimination of undifferentiated heavy lifting related to managing server infrastructure Architecture Options for Building an Analytics Application on AWS is a Series containing different articles that cover the key scenarios that are common in many analytics applications and how they influence the design and architecture of your analytics environment in AWS These series present the assumptions made for each of these scenarios the common drivers for the design and a reference architecture for how these scenarios should be implemented Data visualization is the graphical representation of information and data By using visual elements like charts graphs and maps data visualization tools provide an accessible way to see and understand trends outliers and patterns in data In the world of Big Data data visualization tools and technologies are essential to analyze massive amounts of information and make data driven decisions CharacteristicsScalability Ensure that the underlying BI infrastructure is able to scale up vertically and horizontally both in terms of concurrent users as well as data volume For example on AES Amazon QuickSight SPICE and web application automatically scales up server capacity to accommodate a large number of concurrent users without any manual intervention in terms of provisioning additional capacity for data for load balance and others Connectivity BI applications must be able to not just connect with data platforms like traditional Data Warehouse and databases but also support connectivity to data lake and lake house architectures The application must also have the capacity to connect to non traditional sources such as SaaS applications Typically data stores are secured behind a private subnet and BI tools and applications must be able to connect in a secure mechanism using strategies such as VPC endpoints and secure firewalls Centralized security and compliance BI applications must allow for a layered approach for security This includes Securing at the perimeter using techniques such as IP allow lists security groups ENIs and IAM policies for cloud resource access securing the data in transit and data at rest using SSL and encryption and restricting varying levels of access through fine grained permissions for users to the underlying data and BI assets The application must also comply with the governmental and industry regulations for the country or region the company is bound by Sharing and collaboration BI applications must support data democratization They must have features that allow sharing of the dashboards with other users in the company as well as for multiple report authors to collaborate with one another by sharing access to the underlying dataset Not all BI tools have this capability Amazon QuickSight allows the sharing of assets such as DataSources DataSets Analyses Dashboards Themes and Templates Logging monitoring and auditing BI applications must provide adequate mechanisms to monitor and audit the usage of the application for security to prevent unwanted access to data assets and other resources and troubleshooting Amazon QuickSight can be used with Amazon CloudWatch AWS CloudTrail and IAM to track record of actions taken by a user user role or an AWS service This provides the who what when and where of every user action in QuickSight Reference architectureQuickSight dashboard end to end designData sources Supports connection with traditional Data Warehouse or databases and also have the capacity to connect to non traditional sources such as SaaS applications Supported datasources in QuickSight include Amazon S Amazon Redshift Amazon Aurora Oracle MySQL Microsoft SQL Server Snowflake Teradata Jira ServiceNow and many more Check here for the complete list of data sources supported in QuickSight These data sources could be secured behind a private subnet and QuickSight can connect in a secure mechanism using strategies such as VPC Endpoints Secure Firewalls and others Visualization Tool Amazon QuickSight Consumers Visual dashboard consumers accessing QuickSight console or embedded QuickSight analytics dashboard Configuration notesSecurity Implement the principle of least privilege throughout the visualization application stack Ensure data sources are connected using VPC and restricting security groups to only required protocols sources and destinations Enforce that the users as well as applications in every layer of the stack are given just the right level of access permissions to data and the underlying resources Ensure seamless integration with identity providers either industry supported or customized In the case of multi tenancy use namespaces for better isolation of principals and other assets across tenants For example QuickSight follows the least privilege principle and access to AWS resources such as Amazon Redshift Amazon S or Athena common services used in data warehouse data lake or lake House Architectures can be managed through the QuickSight user interface Additional security at the user or group level is supported using fine grained access control through a combination of IAM permissions Additionally QuickSight features such as row level security column level security and a range of asset governance capabilities that can be configured directly through QuickSight user interface Cost optimization Accurately identify the volume of dashboard consumers and embedding requirements to determine the optimal pricing model for the given visualization use case QuickSight offers two different pricing options capacity and user based which allows clients to implement cost effective BI solutions Capacity pricing allows large scale implementations and user based pricing allows clients to get started with minimal investment Note SPICE has a M records or GB volume per dataset limitation Low latency considerations Use in memory caching option such as Memcached Redis or the in memory caching engine in QuickSight called SPICE Super fast Parallel In memory Calculation Engine to prevent latency in dashboard rendering while accommodating any built in restrictions that the Caching technology might have Pre process data views Ensure that the data is cleansed standardized enhanced and pre processed to allow analysis within the BI layer If possible create pre processed pre combined pre aggregated data views for analysis purposes ETL tools such as Glue DataBrew or techniques such as materialized views can be employed to achieve this Hope this guide gives you an Introduction to Data visualization explains the Characteristics Reference Architecture and Configuration Notes for Data visualization Let me know your thoughts in the comment section And if you haven t yet make sure to follow me on below handles connect with me on LinkedInconnect with me on Twitterfollow me on github️Do Checkout my blogs Like share and follow me for more content ltag user id follow action button background color important color fac important border color important Adit ModiFollow Cloud Engineer AWS Community Builder x AWS Certified x Azure Certified Author of Cloud Tech DailyDevOps amp BigDataJournal DEV moderator Reference Guide |
2022-01-17 13:03:57 |
海外TECH |
DEV Community |
10 Visual Studio Code editing shortcuts |
https://dev.to/omeal/10-visual-studio-code-editing-shortcuts-4m0l
|
Visual Studio Code editing shortcutsVisual Studio Code is a powerful tool that developers like us use on a daily basis for hours It also is a favorite for a few of us as well As we spend most of the time typing code there are a few keyboard shortcuts that help in writing code faster In this article I will be sharing keyboard shortcuts that I use in Visual Studio Code to code faster and get by without using the mouse Cut Copy and PasteThere are a ton of times when we use Cut Copy and Paste while coding Cut Command or Cmd ⌘ XCopy Command or Cmd ⌘ CPaste Command or Cmd ⌘ V Cursor to Start End of lineUse this command when you want to move the cursor to the start end of the lineCursor to start of the line Command or Cmd ⌘ ←Cursor to end of the line Command or Cmd ⌘ → Move lineThis command is used to move the whole line up or down Move line up Option or Alt ⌥ ↑Move line down Option or Alt ⌥ ↓ Add line commentI have used this shortcut a lot of times With the press of just two keys I can cut down so much work Add line comment Command or Cmd ⌘ Select a lineThis command is used to select the complete line After the line is selected we can use other shortcuts like Copy Cut Select a line Command or Cmd ⌘ L Copy line up downUse this shortcut to copy the whole like and paste it up downCopy line up Shift ⇧ Option or Alt ⌥ ↑Copy line down Shift ⇧ Option or Alt ⌥ ↓ Move word by wordAt times to reach a point in between a word we find ourselves using to move to navigate to that point and placing our cursor We can avoid this by using a shortcut that moves the cursor word by word Move the cursor to right Option or Alt ⌥ →Move the cursor to left Option or Alt ⌥ ← Select a wordThis command is used to select a word Further this command can be combined with Cut Delete or any other commands Select a word Command or Cmd ⌘ D Multiline cursorThis is my favorite shortcut I was so glad when I figured out this shortcut existed it reduced my time to edit code considerably Using this shortcut you can place the cursor simultaneously at different places in the editor Here is how you use it Press the Option key and with the mouse click at various places where you want the cursor to be present Multiline cursor Option or Alt ⌥ click Insert cursor above belowThis is similar to the multiline cursor shortcut Here we do not use the mouse to click but we use the arrow keys Although this is not as flexible as the click because the cursor moves up down in a line Insert cursor above Option or Alt ⌥ Command or Cmd ⌘ ↑Insert cursor below Option or Alt ⌥ Command or Cmd ⌘ ↓Those are the shortcuts I usually use while I type away on my Visual Studio code editor When starting to use shortcuts you might feel confused or it might take a little time to get a hang of it But once you practice and are used to using shortcuts you will observe that editing code now takes much less time Tip Incase you forget the shortcut open the Command Palette and type in the operation you want to perform eg Copy move line Visual Studio Code shows the shortcut you can use on the righthand side in the dropdown Let me know the shortcuts you use in the comments below Also find me on Twitter |
2022-01-17 13:03:38 |
海外TECH |
DEV Community |
Functions in JS and it's use cases |
https://dev.to/pragmacoder/functions-in-js-and-its-use-cases-25aj
|
Functions in JS and it x s use cases Function typesFunction declarationFunction expressionArrow FunctionsImmediately Invoked Function expression Function Declarationfunction foo console log Do not use var Function declarations are loaded before the script is loaded This means that the function can be invoked before the function declaration foo Function will be invokedfunction foo console log Please use strict in JS This is because function declarations are hoisted Hoisting in JS refers to the process in which functions variables or classes are moved to the top of the scope for interpreting before the execution of the script Function declarations also have a block scope in use strict mode use strict if x gt foo Will be invoked function foo console log Pineapples on pizza should be illegal foo Will be invoked foo Line Line will throw a ReferenceError Consider the same case without use strict foo Will not be invokedif x gt foo Will be invoked function foo console log Pineapples in pizza should be illegal foo Will be invoked foo Will be invoked only when if block is executed The function foo declaration will not be hoisted in the global scope but within it s local scope within the if block Function declarations are preferred when we want the function to available throughout it s scope for invoking Function expressionslet foo function console log Elon Musk Function expressions basically means assigning a function to a variable The foo variable is referenced to an Anonymous function Unlike Function declarations Function expressions are not hoisted foo Will not be invokedlet foo function console log Elon Musk foo Will be invokedThe function is declared when the interpreter reads the right of the assignment operator Function expressions are preferred over function declarations when we want functions to have a limited scope instead of a global scope throughout the program They cannot be hoisted to prevent functions to be crowded in the global scope Arrow Functionsfoo gt console log Web The arrow functions are a shorthand to writing functions Let us understand it with the help of setTimeout setTimeout foo Calls foo after secondsfunction foo console log Mark is the watcher Now check this out setTimeout gt console log DC is underrated Both the code snippets have the same functionality but the latter has less lines of code and has better readability let mulTwo number gt number If the arrow function has only one line in the body there is no need for curly braces mulTwo this in Arrow FunctionsArrow functions do not have this If used they take the context of the outer scope const obj name Spiderman foo setTimeout gt console log this obj foo Output is object obj Here this refers to the this of foo For function expressions and function declarations the value of this is dynamic It s value depends upon where the function is being called const obj name Spiderman foo setTimeout function console log this obj foo Window object Output is the window object because the function is called in the global scope In order for the function to have the same context as it s scope it needs to be bound to it s current context Using bind function const obj name Spiderman foo setTimeout function console log this bind this obj foo Output is the object obj because the function is now bound to the current context Since the arrow functions do not have this it will use the value of this from it s parent scope Immediately Invoked Function expression IIFE An IIFE is called immediately after function is created It is self invoking function console log Daredevil Consider this scenario let sum function a b return a b console log sum console log sum ErrorIn the above scenario sum only stores the return value of the function assigned to it we cannot call the function elsewhere An IIFE can also be named even then it cannot be called function NWH console log I am a very good lawyer NWH NWH is not definedIIFEs can be used if you want a function to be used only once It is also used in closures Click here for a detailed article Hope this article helped I am new to programming and this is my first blog Let me know how I can improve in the comments below D |
2022-01-17 13:01:11 |
Apple |
AppleInsider - Frontpage News |
Apple Pay launches soon in Argentina and Peru |
https://appleinsider.com/articles/22/01/17/apple-pay-launches-soon-in-argentina-and-peru?utm_medium=rss
|
Apple Pay launches soon in Argentina and PeruApple has confirmed it will be expanding Apple Pay in Latin America in the near future with banks in Argentina and Peru set to join Apple s mobile payments platform soon On January Peru s Interbank briefly said it started to support Apple Pay before pulling down any mentions of the account feature One week later Apple has started to promote its arrival An update to the Apple Pay page on Apple s Latin America regional website includes text translating to Soon in Argentina and Peru Apple doesn t state when it will arrive but the Interbank misfire indicates it could be more imminent than Apple s website lets on Read more |
2022-01-17 13:42:02 |
Apple |
AppleInsider - Frontpage News |
Ridley Scott says script for '1984' ad was 'devastatingly effective' |
https://appleinsider.com/articles/22/01/17/ridley-scott-says-script-for-1984-ad-was-devastatingly-effective?utm_medium=rss
|
Ridley Scott says script for x x ad was x devastatingly effective x Famed film director Ridley Scott had no idea who Steve Jobs was when he was hired to direct Apple s ad for the launch of the Macintosh Some years after the release of the original Mac Ridley Scott is still known for directing the ad that launched it He has also gained fame for directing Callie Khouri s Thelma and Louise and Blade Runner by Hampton Fancher and David Peoples Read more |
2022-01-17 13:16:25 |
Apple |
AppleInsider - Frontpage News |
Best deals Jan. 17: $100 Soundcore ANC earbuds, $45 SteelSeries iOS controller, $29 Philips soundbar, more! |
https://appleinsider.com/articles/22/01/17/best-deals-jan-17-100-soundcore-anc-earbuds-45-steelseries-ios-controller-29-philips-soundbar-more?utm_medium=rss
|
Best deals Jan Soundcore ANC earbuds SteelSeries iOS controller Philips soundbar more Monday s best deals include the SteelSeries Nimbus iOS game controller for Soundcore noise cancelling earbuds for and several SSDs and hard drives for sale Best Deals for January As we do every day we ve collected some of the best deals we could find on Apple products tech accessories and other items for the AppleInsider audience If an item is out of stock it may still be able to be ordered for delivery at a later date Read more |
2022-01-17 13:13:26 |
海外TECH |
CodeProject Latest Articles |
C++/WinRT Runtime Component in Win32 Applications - Part 2 |
https://www.codeproject.com/Articles/5322217/Cplusplus-WinRT-Runtime-Component-in-Win32-Appli-2
|
variadic |
2022-01-17 13:09:00 |
海外科学 |
NYT > Science |
The C.D.C.’s New Challenge? Grappling With Imperfect Science |
https://www.nytimes.com/2022/01/17/health/cdc-tensions-omicron-isolation-guidance.html
|
The C D C s New Challenge Grappling With Imperfect ScienceThe Omicron coronavirus variant is moving much faster than researchers can worsening a longstanding problem The agency must make tough decisions with scant data |
2022-01-17 13:44:08 |
金融 |
RSS FILE - 日本証券業協会 |
J-IRISS |
https://www.jsda.or.jp/anshin/j-iriss/index.html
|
iriss |
2022-01-17 14:59:00 |
金融 |
金融庁ホームページ |
スチュワードシップ・コードの受入れを表明した機関投資家のリストを更新しました。 |
https://www.fsa.go.jp/singi/stewardship/list/20171225.html
|
機関投資家 |
2022-01-17 15:00:00 |
ニュース |
BBC News - Home |
Texas synagogue siege: Teens held in UK as Briton named as hostage-taker |
https://www.bbc.co.uk/news/uk-60019251?at_medium=RSS&at_campaign=KARANGA
|
akram |
2022-01-17 13:30:46 |
ニュース |
BBC News - Home |
Anne Frank betrayal suspect identified after 77 years |
https://www.bbc.co.uk/news/world-europe-60024228?at_medium=RSS&at_campaign=KARANGA
|
diarist |
2022-01-17 13:14:15 |
ニュース |
BBC News - Home |
ScotWind offshore auction raises £700m |
https://www.bbc.co.uk/news/uk-scotland-scotland-business-60002110?at_medium=RSS&at_campaign=KARANGA
|
estate |
2022-01-17 13:19:00 |
ニュース |
BBC News - Home |
Ashling Murphy: 'Only something powerful can come out of this' |
https://www.bbc.co.uk/news/world-europe-60024818?at_medium=RSS&at_campaign=KARANGA
|
funeral |
2022-01-17 13:39:08 |
LifeHuck |
ライフハッカー[日本版] |
使い勝手もコスパもいい!革靴用の小さなペネトレィトブラシ【今日のライフハックツール】 |
https://www.lifehacker.jp/article/247384lht-brush/
|
mmowbray |
2022-01-17 13:05:00 |
北海道 |
北海道新聞 |
18日、オホーツク海側で大雪 24時間降雪量40センチ JR91本運休 |
https://www.hokkaido-np.co.jp/article/634483/
|
降雪 |
2022-01-17 22:15:47 |
北海道 |
北海道新聞 |
UAE首都、無人機攻撃か 3人死亡、フーシ派が実行主張 |
https://www.hokkaido-np.co.jp/article/634494/
|
首都 |
2022-01-17 22:05:00 |
コメント
コメントを投稿