投稿時間:2021-05-03 22:41:23 RSSフィード2021-05-03 22:00 分まとめ(45件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
Google Official Google Blog Hear educators' stories this Teacher Appreciation Week http://feedproxy.google.com/~r/blogspot/MKuf/~3/u4R9lDWop3Q/ Hear educators x stories this Teacher Appreciation WeekEditor s note In honor of Teacher Appreciation Week   National Teacher of the Year Tabatha Rosproy is sharing her story as well as some of the ways Google is supporting teachers this year   Every year Teacher Appreciation Week falls near the end of the school year which is an emotional time for many teachers Saying goodbye to our students is always tough and after a year of educating during a pandemic those emotions are more prominent than ever As National Teacher of the Year I ve had the honor of hearing hundreds of teachers stories over the past months I can say with confidence that this year educators have truly given everything they have There are the things people see like teaching lessons holding meetings and keeping kids on track academically But there is also work most people don t see like the hour days or the extra mile we go to comfort children who are not our own Those invisible moments are a critical piece of every teacher s story  So this week I hope that you ll join us in listening to teachers stories to uncover some of these invisible moments ーand celebrating the teachers who have shaped your own story Sharing teachers stories with StoryCorpsIn addition to today s Doodle which includes five teacher stories from the StoryCorps archives Google and the Council of Chief State School Officers CCSSO are teaming up to support StoryCorps new Thank an Educator campaign Anyone can use StoryCorps self directed recording tools to record their stories so you can grab a friend or family member and start reflecting upon the ways in which your favorite teacher changed your life In the midst of one of the most challenging school years to date the campaign hopes to spark a moment of gratitude for teachers everywhere Be sure to check out their website to hear my recording and those from other State Teachers of the Year Expanding access to inclusive stories with The Conscious KidBooks and reading materials are crucial practical tools that enable teachers to bring more of the world to their kids and help them develop kindness and empathy for the people around them Google and The Conscious Kid are building upon their work together to provide educators with recommended titles and evaluation criteria for bringing new materials into their classrooms  In honor of Teacher Appreciation Week their free inclusive reading guide ーwith book recommendations spanning Pre K through th grade ーhas been updated to include more than new titles And as part of their broader efforts to honor Asian Pacific American Heritage Month APAHM Google and The Conscious Kid are sending a free set of curated books by Asian authors featuring AAPI protagonists to classrooms across the country starting with eligible teachers at Title I schools Teachers can request these titles for their classrooms and anyone can contribute to the fund here  In addition The Conscious Kid has collaborated with Wong Fu Productions to bring four of the books to life in a series of read alongs on Asian American heritage and culture Rolling out with Harry Shum Jr reading Grandpa Grumps by Katrina Moore the videos will be released weekly onThe Conscious Kid s YouTube channel and in theYouTube Kids app s learning category throughout the month of May Supporting more inclusive classrooms with DonorsChoose Since Google org has committed more than million directly to teacher focused organizations and initiatives Starting Wednesday Google org will match donations up to ーdollar for dollar ーfor projects created by teachers of color as well as projects from all teachers requesting culturally responsive and antiracist resources such as books posters and more for their classrooms as part of their continued support of the DonorsChoose ISeeMe campaign And every dollar donated to projects created by male educators of color ーa group historically underrepresented in the field ーwill receive a two dollar match from Google org Learn more about ISeeMe setting up a campaign or supporting a classroom on the DonorsChoose website Introducing the new National Teacher of the YearThe new National Teacher of the Year will be announced soon and I ll be joining them for a conversation through Google s Education OnAir series on Friday May  Be sure to tune in to hear their incredible stories ーI can t wait for you to meet them As an early childhood educator it s especially important to me that every one of my students knows from a young age that they belong and sees themselves reflected in the stories we tell in our classrooms Thank you to every educator putting in the work to ensure every student feels included and valued Finally as you re thinking about ways you can appreciate the educators in your life beyond Teacher Appreciation Week remember that one of the best ways to support teachers is to listen to their stories elevate their voices and advocate for their jobs and their livelihood Together we can continue to do the work of supporting our children who will author our future 2021-05-03 14:00:00
Google Official Google Blog Escucha las historias de los educadores en esta Semana de Apreciación del Profesor http://feedproxy.google.com/~r/blogspot/MKuf/~3/p-ULD3WU-rQ/ Escucha las historias de los educadores en esta Semana de Apreciación del ProfesorNota En honor a la Semana de Apreciación al Profesor  la Profesora Nacional del Año Tabatha Rosproy nos comparte su historia asícomo algunas de las formas en que las que estamos apoyando a los maestros este año   Cada año la Semana de Apreciación al Profesor llega en un momento emotivo para muchos maestros alrededor del final del ciclo escolar Decir adiós a nuestros estudiantes siempre es difícil y después de un año de educar durante una pandemia esas emociones se vuelven más intensas que nunca Como Profesor Nacional del Año he tenido el honor de escuchar cientos de historias de maestros durante los últimos meses Puedo decir con confianza que este año los educadores realmente han dado todo lo que tienen Hay cosas que la gente ve cómo se dan las clases se hacen reuniones y cómo mantienen a los niños en su recorrido académico Pero también hay un trabajo que la mayoría de la gente no ve las jornadas de trabajo de horas o los esfuerzos extras que realizamos para consolar a los niños que no son nuestros Esos momentos invisibles son una pieza fundamental de la historia de todo maestro  Asíque esta semana espero que se unan a nosotros para escuchar las historias de los maestros descubran algunos de estos momentos invisibles y celebren a los maestros que han dado forma a su propia historia Compartiendo historias de profesores con StoryCorpsAdemás del Doodle de hoy que incluye cinco historias de maestros de los archivos de StoryCorps Google y el Consejo de Jefes Estatales de Educación CCSSO se están uniendo para apoyar la nueva campaña de StoryCorps Agradece a un Educador Cualquiera puede usar las herramientas de grabación autodirigidas de StoryCorps para grabar sus historias Asíque llama a un amigo o familiar y comienza a reflexionar sobre las formas en las que tu profesor favorito cambiótu vida En uno de los años escolares más desafiantes hasta la fecha la campaña espera generar un momento de agradecimiento para los maestros de todo el mundo Asegúrate de visitar el sitio web para escuchar mi grabación y las de otros ganadores del título de Profesor del Año Ampliar el acceso a historias inclusivas con The Conscious KidLos libros y materiales de lectura son herramientas prácticas y cruciales que permiten a los maestros llevar más del mundo a sus alumnos ayudándoles a desarrollar amabilidad y empatía por las personas que los rodean Google y The Conscious Kid están trabajando conjuntamente para proporcionar a los educadores obras recomendadas y criterios de evaluación para llevar nuevos materiales a sus aulas  En honor a la Semana de Apreciación del Profesor su guía de lectura inclusiva y gratuita con recomendaciones de libros que abarcan desde el jardín de niños hasta el grado se ha actualizado para incluir más de obras nuevas También como parte de sus esfuerzos más amplios para honrar el Mes de la Herencia Estadounidense de Asia Pacífico APAHM Google y The Conscious Kid están enviando un conjunto gratuito de libros curados por autores asiáticos con protagonistas de AAPI a las aulas de todo el país comenzando con los profesores elegibles en el Título I escuelas Puedes solicitar estas obras para tu salón de clases o contribuir al fondo aquí  Además The Conscious Kid ha colaborado con Wong Fu Productions para dar vida a cuatro de los libros con lecturas en voz alta sobre la herencia y la cultura asiático americana Se estrenarácon Harry Shum Jr leyendo Grandpa Grumps de Katrina Moore los videos se publicarán semanalmente elEl canal de YouTube de Conscious Kid y en la app de YouTube Kids bajo la categoría de aprendizaje durante el mes de mayo Apoyando aulas más inclusivas con DonorsChoose Desde Google org ha otorgado más de millones de dólares a organizaciones e iniciativas centradas en los maestros A partir del miércoles la organización igualarálas donaciones de hasta dólar por dólar para proyectos creados por maestros de color asícomo proyectos de todos los maestros que soliciten recursos de consideración y diversidad cultural y antidiscriminatorios ej libros posters y más para sus aulas como parte de su continuo apoyo a la campaña DonorsChoose ISeeMe Cada dólar donado a proyectos creados por educadores hombres de color un grupo históricamente subrepresentado en el campo recibiráuna contribución de dos dólares de Google org Obtén más información sobre ISeeMe cómo configurar una campaña o apoyar un aula en el sitio web de DonorsChoose Presentamos al nuevo Profesor Nacional del Año El nuevo Profesor Nacional del año se anunciarápronto y me uniréa ellos para una conversación a través de la transmisión de la serie de Google for Education On Air el viernes de mayo  Asegúrate de sintonizarnos para escuchar sus increíbles historias ¡No puedo esperar a que los conozcas Como educadora de primera infancia es especialmente importante para míque cada uno de mis estudiantes sepa desde una edad temprana que pertenece y se vea reflejado en las historias que contamos en nuestras aulas Gracias a todos los educadores que se esfuerzan por garantizar que todos los estudiantes se sientan incluidos y valorados Finalmente mientras piensas en las formas en las que podemos apreciar a nuestros educadores más alláde la Semana de Apreciación al Maestro recuerda que una de las mejores formas de apoyar a los maestros es escuchar sus historias ampliar sus voces y defender su trabajo y su bienestar Juntos podemos continuar haciendo el trabajo de apoyar a nuestros niños que serán los autores de nuestro futuro 2021-05-03 14:00:00
python Pythonタグが付けられた新着投稿 - Qiita はちみーのうたオートマトン書いてみた https://qiita.com/roadricefield/items/c24b4d534abd61b8e153 2021-05-03 21:49:06
python Pythonタグが付けられた新着投稿 - Qiita やりがちなif文でのエラーに気をつけよう! (今日のPython Day3) https://qiita.com/mitsu4310/items/910ef2c8e62c8bb4afee まとめ・if文ではコロンの打ち忘れに気をつけようおまけトークGW中、何もやることなくYouTubeでダラダラ動画を見続けているそこの大学生とは自分のことです。 2021-05-03 21:15:47
js JavaScriptタグが付けられた新着投稿 - Qiita ガウス過程をJavaScriptで実装して描画までしてみる https://qiita.com/kanagii_codes/items/e777547ecefdaed9950b 2021-05-03 21:32:27
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) DjangoのListViewでテンプレートに画像が表示されなく、困っております。 https://teratail.com/questions/336465?rss=all DjangoのListViewでテンプレートに画像が表示されなく、困っております。 2021-05-03 21:57:58
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) このコードに入る答えの流れが知りたいです https://teratail.com/questions/336464?rss=all 2021-05-03 21:48:17
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) SSH終了後もngrokのトンネルセッションを維持したい https://teratail.com/questions/336463?rss=all SSH終了後もngrokのトンネルセッションを維持したいRaspberrynbspPinbspModelnbspBをWin機からコマンドプロンプトでSSHリモート接続し、ngrokを立ち上げたあと、コマンドプロンプトを落とすと、ngrokのトンネルまで落ちてしまうのを防ぐにはどうしたらよいでしょうか。 2021-05-03 21:44:42
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) プラグインscfのループ文で一部分だけcssが効かないので解決してほしい https://teratail.com/questions/336462?rss=all プラグインscfのループ文で一部分だけcssが効かないので解決してほしい前提・実現したいことここに質問の内容を詳しく書いてください。 2021-05-03 21:44:17
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) なぜパスワードのバリデーションエラーが発生するのか解決したい https://teratail.com/questions/336461?rss=all 2021-05-03 21:40:58
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Pythonのtweepyを使ってtwitterのトレンドを取得してpandasでエクセルファイルに書き出したいけど取得できない。 https://teratail.com/questions/336460?rss=all 現在、tweepyを使ってトレンドを取得してpandasでエクセルで表示させようとしていて、エラーは特にでていないのですが、うまくエクセルにTwitterのトレンドがはいってくれません。 2021-05-03 21:37:20
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ターミナルpythonのdisplayに関して https://teratail.com/questions/336459?rss=all 2021-05-03 21:35:58
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Rails6のSJRでエラーメッセージを作成したらmissing a template for this request format and variant.と怒られる https://teratail.com/questions/336458?rss=all 2021-05-03 21:33:12
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Qiitaで文字に背景色を付ける方法 https://teratail.com/questions/336457?rss=all Qiitaで文字に背景色を付ける方法実現したいことQiitaで文字を強調するために色に背景色をつけたいのですが、やり方がわかりません。 2021-05-03 21:32:35
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Pythonでリストの要素が参照できない。 https://teratail.com/questions/336456?rss=all csvapos 2021-05-03 21:30:36
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 外部ライブラリ(GoogleMobileAds)のエラー再現方法について https://teratail.com/questions/336455?rss=all 外部ライブラリGoogleMobileAdsのエラー再現方法について外部ライブラリGoogleMobileAdsのエラー再現方法について下記公式サイトを参照しながらSwiftでGoogleMobileAdsを利用したインタースティシャル広告を実装しています。 2021-05-03 21:27:12
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) M1に変わってhomebrewがinstallできない https://teratail.com/questions/336454?rss=all Mに変わってhomebrewがinstallできないhomebrewは以前より使っていましたが、Mに変わって使えなくなってしまったため、こちらのコマンドでhomebrewのインストールを開始するとbinbashccurlfsSL永遠に以下が出てきてしまい、インストールができません。 2021-05-03 21:24:09
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) coroutineのディスパッチャをDispacher.IOに指定するとどこのスレッドで実行されますか? https://teratail.com/questions/336453?rss=all coroutineのディスパッチャをDispacherIOに指定するとどこのスレッドで実行されますか質問内容coroutineについて学んでいるのですが、仕組みがよくわからなかったので質問です。 2021-05-03 21:19:10
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) WordPressにて、「AddQuicktag」が表示されない為、解決策を知りたいです。 https://teratail.com/questions/336452?rss=all WordPressにて、「AddQuicktag」が表示されない為、解決策を知りたいです。 2021-05-03 21:14:58
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) CodeRunnerの実行コマンドが勝手に置き換わる https://teratail.com/questions/336451?rss=all CodeRunnerの実行コマンドが勝手に置き換わるVSCodeにてCodenbspRunnerを使い、PowerShell以外のターミナルで実行したいのですがうまく実行出来ませんCodenbspRunnerの実行コマンド設定settingjsonのcoderunnerexecutorMapではquotampampquotが書いてあり、複数コマンドの実行をしたいはずなんですが、実際に実行すると、勝手にif文が挿入されますPowerShellでは動作するのですが、他のターミナルでもこのif文が出るため動作しません。 2021-05-03 21:07:51
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Bootstrapでのcssについて https://teratail.com/questions/336450?rss=all Bootstrapでのcssについて現状画像のcontainerfluidcontainersmcontainermdcontainerlgcontainerxlwidthpaddingrightpxpaddingleftpxmarginrightautomarginleftautopaddingの部分の適用を外したいのですが、外し方がわからない状態でございます。 2021-05-03 21:01:44
Ruby Railsタグが付けられた新着投稿 - Qiita 【rails】seed.rbを作成する https://qiita.com/dogabon20/items/6c77d3ec07376c91b373 【rails】seedrbを作成するseedrbを書いてみる。 2021-05-03 21:10:34
海外TECH DEV Community JavaScript Interview Question #37: What's the type of a single argument provided to the split function? https://dev.to/coderslang/javascript-interview-question-37-what-s-the-type-of-a-single-argument-provided-to-the-split-function-5fg9 JavaScript Interview Question What x s the type of a single argument provided to the split function What s the output In this code snipped all the arguments provided to the function split will be collected and placed in a single array args The fact that we provide a single argument hello doesn t change the expected behavior As all arrays are objects in JavaScript we ll see the string object printed to the console ANSWER the output will be object Learn Full Stack JavaScript 2021-05-03 12:49:53
海外TECH DEV Community How to count objects on an image with Python https://dev.to/stokry/how-to-count-objects-on-an-image-with-python-142h How to count objects on an image with PythonIn this tutorial you will learn how you can count the number of objects on an image with Python using CV This is our test image Let s jump to the code First we need to import our dependencies import cvimport numpy as npFirst we need to read our image img cv imread test jpg then we will be converting it into grayscaleimg cv cvtColor img cv COLOR BGRGRAY after that we doing thresholding on image thresh cv threshold img cv THRESH BINARY INV kernal np ones np uint then we are doing dilation process removing black distortion dilation cv dilate thresh kernal iterations next step is finding contour shapes contours hierarchy cv findContours dilation cv RETR EXTERNAL cv CHAIN APPROX SIMPLE Then we are getting number of contours objects found objects str len contours We can now print number of objects on an imagetext Obj str objects cv putText dilation text cv FONT HERSHEY SIMPLEX For the lasr step we can show original threshold and dilation image cv imshow Original img cv imshow Thresh thresh cv imshow Dilation dilation cv waitKey cv destroyAllWindows This is our final result Thank you all 2021-05-03 12:31:17
海外TECH DEV Community 20+ Ultimate CSS Tricks and SASS Shorthands for code efficiency https://dev.to/devwriteups/20-ultimate-css-tricks-and-sass-shorthands-for-code-efficiency-j09 Ultimate CSS Tricks and SASS Shorthands for code efficiencyCSS may look exhausting and not very many individuals can dominate it the correct way So in this post we ve written about CSS tricks and tips you should know also SASS mixins shorthand you should know Notwithstanding it is an expertise that can give you an incredible upper hand over different designers On the off chance that you like addressing puzzles you will discover bliss recorded as a hard copy CSS by viewing at it as a riddle to settle Let s look into some amazing CSS tricks Smooth ScrollingWhen you visit some websites and try to got to different sections it scrolls smoothly to that section You can achieve this feature on your website by using one line CSS html scroll behavior smooth Prevent lt textarea gt resizeYou can use the resize property to prevent lt textarea gt element form being resized or limit it to one axis textarea no resize resize none textarea horizontal resize resize horizontal textarea vertical resize resize vertical Drop capYou can add a drop cap to a paragraph by using the first letter pseudo element first letter font size Input range pseudo classesThe lesser known in range and out of range pseudo classes can help you validate an lt input gt element by its min and max properties input in range background rgba input out of range background rgba Thank you For ReadingSubscribe to our newsletter we send it occasionally with amazing news resources and many thing Useful CSS Pseudo elements selectorsPseudo elements are a way to select and style a specific part of an element You can think of them as a sub element that are created as part of standard HTML elements How is it different pseudo class A pseudo class is used to select an element in a specific state like hover or focus A pseudo element is used to select a specific part of an element like first letter Pseudo element selectors begin with two colons as a way to differentiate them from pseudo classes This was only introduced in CSS therefore some selectors are backwards compatible and work with a single color before and afterCreates a pseudo element that is the child of the selected element The before pseudo element is assigned as the first child and after is the last main text font style italic main text before main text after content color wheat SUPPORTED IN ALL MODERN BROWSERS first lineApplies styles of the first line of a block level element Keep in mind that the length of the first line will depend on the width of the element or viewport p first line color wheat text decoration underline placeholderRepresents the placeholder text in an lt input gt and lt textarea gt element Only a subset of CSS properties can be used with the pseudo element input placeholder color wheat font size em font style italic selectionApplies styles to the part of a document that has been highlighted by the user Can be applied globally or to specific elements only selection color ffffff background color fa Only apply to selected text withing a paragraph element p selection color lightblue background color wheat CSS Short hands for propertiesCSS Short hands properties allow you to set the values of multiple CSS properties simultaneously They are useful to know as they make your code more concise and easier to read Edge propertiesProperties related to edges of the elements box model e g margin or padding follow to syntax values syntax Same value on all edgespadding rem values syntax First value for top and bottom and second value for left and rightpadding rem rem values syntax First value for top Second value for left and right Third value for bottompadding rem rem rem values syntax Separate value for each edge in clockwise order top right bottom left padding rem rem rem rem Corner propertiesSimilarly properties related to the corners of an elements box model eg borde radius also follow a to value syntax values syntax Same value on all cornerborder radius rem values syntax First value for top and bottom and second value for left and rightborder radius rem rem values syntax First value for top Second value for left and right Third value for bottomborder radius rem rem rem values syntax Separate value for each corner in clockwise order top right bottom left border radius rem rem rem rem Border properties You can also condense border properties into one line In this case though the order of the values doesn t matter css LONG blue border border width px border style solid border color blue SHORTHAND blue border border px solid blue Font propertiesSame applies to the font properties Although in this case the values can get long individual properties can be easier to read sometime css LONG heading font style italic font weight bold font size rem line height font family Arial sans serif SHORTHAND heading font italix bold rem Arial sans serif Background propertiesAnd of course background properties can be condensed as well css LONG background background color wheat background image url images bg cool png background repeat no repeat background position left top Shorthand background background what url images bg cool png no repeat left top SASS time saving mixinsUsing SASS makes your CSS codes very efficient SASS is a CSS preprocessor and we have used it in almost every project Here I am sharing some SASS mixins you can use to make your code efficient Center BlocksWe always find our self needing to center a block element so this mixin saves me a little typing css mixin center block margin left auto right auto Use case wrapper include center block Output wrapper margin left auto margin right auto PseudoWhen using pseudo element you always need these properties so why not put them in a mixin css mixin pseudo display block pos absolute content conent content display display position pos css Use case default element before include pseudo output element before content display block position absolute css Use case with args element befire include pseudo inline block relative output element before content display inline block position relative RatioA ratio mixin to create scalable elements usually images Since aspect ratio isn t very well supported yet this alternative is useful css mixin responsive ratio x y padding top unquote y x use case wide image include responsive ratio output wide image padding top TruncateTruncating text is another useful mixin have since it can be easy to forget the syntax css mixin truncate width limit max width width limit white space nowrap overflow hidden text overflow hidden text overflow ellipsis Use case excerpt include truncate rem output excerpt max width rem white space nowrap overflow hidden text overflow ellipsis Cover backgroundIf you re working a lot with cover background images this one can save a lot of typing css mixin cover background image src background image url image src background repeat no repeat background size cover background position center use case hero include cover background image main png output hero background image url image main png background repeat no repeat background size cover background position center OrganizingKeep you SCSS files organized by keeping you mixing in a separate file Since mixins don t generate any output until they are used it s easier to keep them in a separate file and import whenever you need to use one css keep all mixins together import mixin scss Separate files for mixins import center block scss import pseudo scss import responsive ratio scss import truncate scss import cover background scss Thank you For ReadingSubscribe to our newsletter we send it occasionally with amazing news resources and many thing Also if you find something useful share to world 2021-05-03 12:25:04
海外TECH DEV Community Build a Reddit Clone with React and Dgraph Cloud https://dev.to/thawkin3/build-a-reddit-clone-with-react-and-dgraph-cloud-4do1 Build a Reddit Clone with React and Dgraph CloudSocial media apps are perfect candidates for using graph databases and GraphQL APIs The combinations of complex data queries and relationships are endless Take Reddit for example The app consists of “subreddits or topics Users can create posts in these subreddits which means that there is a many to one relationship between posts and subreddits Each post belongs to exactly one subreddit and each subreddit can contain many posts Users can comment on posts leading to another many to one relationship between posts and comments Each comment belongs to exactly one post and each post can have many comments There is also a many to one relationship between users and posts and between users and comments Each comment and post is made by a single user and a single user can have many comments and posts In an app like Reddit each page of the app requires different subsets of this data Using traditional REST API endpoints could mean developing several unique endpoints each tailored to meet the needs of a specific use case GraphQL APIs however are based around the idea of having a single API endpoint that developers can use to pick and choose the relevant pieces of data they need for any given page This article will highlight the flexibility of GraphQL and how easy using a hosted backend from Dgraph Cloud makes it for frontend developers to get exactly the data they need for each page of their app Demo App ーReaditThe demo app we ll be using throughout the rest of the article is Readit a Reddit clone but for book lovers …get it The app is built using React for the UIReact Router for the client side routingDgraph Cloud for the GraphQL backend and databaseApollo Client for facilitating the communication between the frontend and the backendAs noted above the basic data types in the app are subreddits “subreadits ha… posts comments and users A diagram may be helpful to visually highlight the relationships between each of these nodes that make up our graph Node relationships in the graphThe app contains routes for viewing the home page viewing a single subreadit viewing a specific post and viewing an individual user Here we see the home page Readit home pageIf you d like to follow along at home or try this out on your machine all of the code for this app can be found on GitHub You can also view the demo app here Configuring the Dgraph Cloud BackendNow that we have an overview of the app let s get started First we ll create a backend with Dgraph Cloud For those not familiar with this service Dgraph is a native GraphQL graph database built for the cloud With a little configuration you get a graph database as well as an API endpoint for working with your database Dgraph s free tier is great for learning and getting started so that s what I used More advanced features like shared and dedicated clusters are available on additional paid tiers if you need to make your backend production ready After signing in to our account we click the “Launch a new backend button which will bring up the following setup page Configuring a new Dgraph Cloud backendSince this is a demo app we can choose the Starter option for the product type Production apps should use a higher tier with a shared or dedicated instance though I left my region as “us west since that s the region closest to me I used “reddit clone for the name but feel free to use whatever you like After filling out all the options we can click “Launch to spin up the new backend Once the backend has been created we ll see an overview page with the new backend API endpoint New backend API endpointNow it s time to build a schema This schema declares the various types of data that we ll be working with in our app and storing in our database We can either enter our schema info directly in the Schema Editor or for a more interactive experience use UI Mode Let s use UI Mode to create our schema The GUI helps us configure our types their fields and even the relationship between various types and fields Creating a schema in UI ModeAfter creating the schema we can click the “Deploy button to make it official If we now look at the Schema Editor view we ll see the resulting GraphQL snippet type Comment id ID commentContent String user User hasInverse field comments post Post hasInverse field comments voteCount Int type Post id ID title String subreadit Subreadit hasInverse field posts user User hasInverse field posts voteCount Int comments Comment hasInverse field post type Subreadit id ID name String search by exact description String posts Post hasInverse field subreadit type User id ID userName String search by exact bio String comments Comment hasInverse field user posts Post hasInverse field user As you can see each field has an associated type For instance the Comment type we created has an id field that contains a unique identifier generated by Dgraph Cloud It has a commentContent field which contains the string text entered by the user It has a voteCount field which is an integer representing the number of votes the comment has received Finally the user field references the user that wrote the comment and the post field references the post on which the comment was made The relationship between the comment and the user is designated by the hasInverse directive which tells Dgraph Cloud that the Comment type is linked to the User type by the comments field on the User type The same is true for the relationship between the comment and the post You ll also notice that a few of our fields include the search directive This allows us to filter our queries by these searchable fields For instance we can find a specific subreddit by filtering our query results by a specific string of text for the name field The same is true when filtering user results by their userName field The next step is to populate the database with some seed data which we can do using the API Explorer We won t go through all the mutations necessary to populate the data in this article but you can view the GraphQL snippets here These snippets are used to create the subreadits users posts and comments For example here s what I used to create a few subreadits mutation AddSubreadits addSubreadit input name description A dystopian social science fiction novel by English novelist George Orwell name fahrenheit description A future American society where books are outlawed and firemen burn any that are found name thecatcherintherye description Holden Caulfield an angry depressed year old lives in an unspecified institution in California after the end of World War II subreadit id name description Configuring the FrontendNow that we have the backend created we can move along to building the frontend We ll use create react app to generate a skeleton app as a starting point and then continue to build upon the app from there yarn create react app reddit clonecd reddit cloneNext we ll install react router dom so that we can do client side routing in the single page app with React Router yarn add react router domUsing React Router we can create routes for each of our pages home subreadit post and user Below is the App component with each of its routes import React from react import BrowserRouter as Router Switch Route Redirect from react router dom import Nav from components Nav import HomePage from pages HomePage import PostPageWithRouter from pages PostPage import SubreaditPageWithRouter from pages SubreaditPage import UserPageWithRouter from pages UserPage import App css export function App return lt Router basename reddit clone build gt lt div gt lt Nav gt lt main gt lt Switch gt lt Route path subreadit id gt lt SubreaditPageWithRouter gt lt Route gt lt Route path post id gt lt PostPageWithRouter gt lt Route gt lt Route path user id gt lt UserPageWithRouter gt lt Route gt lt Route path gt lt HomePage gt lt Route gt lt Route path gt lt Redirect to gt lt Route gt lt Switch gt lt main gt lt div gt lt Router gt Then we ll install a couple of packages for Apollo Client which is a JavaScript state management library for working with GraphQL While it s possible to make requests to a GraphQL API endpoint directly using something like the fetch API Apollo Client makes this process even simpler yarn add apollo client graphql You ll note that we ve installed the graphql package as well as the apollo client package even though we never directly use the graphql package in our code This is because graphql is a peerDependency of apollo client and is used internally to facilitate working with GraphQL in JavaScript Now that we have Apollo Client installed we can easily query data from the GraphQL backend and consume it in our React components We can first create the Apollo client like so import ApolloClient InMemoryCache from apollo client export const apolloClient new ApolloClient uri cache new InMemoryCache And then we can wrap our main App component in the ApolloProvider in the index js file import React from react import ReactDOM from react dom import ApolloProvider from apollo client import index css import App from App import apolloClient from apolloClient ReactDOM render lt React StrictMode gt lt ApolloProvider client apolloClient gt lt App gt lt ApolloProvider gt lt React StrictMode gt document getElementById root Home PageNow that we have our routing set up and Apollo ready to go we can begin building the pages for each of our routes The home page shows a list of popular subreadits and a list of popular users Readit home pageWe can query our endpoint for that information and then use Apollo to declaratively handle the loading error and response data states The code for the HomePage component is reproduced in full below import React from react import useQuery gql from apollo client import Subreadit from components Subreadit import User from components User import LoadingSpinner from components LoadingSpinner import ErrorMessage from components ErrorMessage import HomePage css const FETCH SUBREADITS AND USERS gql query FetchSubreaditsAndUsers querySubreadit name description queryUser userName bio postsAggregate count commentsAggregate count export const HomePage gt const loading data error useQuery FETCH SUBREADITS AND USERS return lt div className homePage gt lt h className srOnly gt Home lt h gt lt p gt Welcome to Readit a community of bookworms discussing their favorite books Find a subreadit to browse or a user to follow below lt p gt lt h gt Popular Subreadits lt h gt loading amp amp lt LoadingSpinner gt error amp amp lt ErrorMessage gt data amp amp lt div className subreaditsSection gt data querySubreadit map subreadit gt lt Subreadit key subreadit name isPreview title subreadit name description subreadit description gt lt div gt lt h gt Popular Users lt h gt loading amp amp lt LoadingSpinner gt error amp amp lt ErrorMessage gt data amp amp lt div className usersSection gt data queryUser map user gt lt User key user userName isPreview userName user userName bio user bio postCount user postsAggregate count commentCount user commentsAggregate count gt lt div gt lt div gt Note how when retrieving the user info we don t need to fetch all of the user s posts and comments The only thing we re interested in for the home page is how many posts and how many comments each user has We can use the count field from postsAggregate and commentsAggregate to find the relevant numbers Subreadit PageIf we click on one of the subreadits from the home page we ll be taken to that particular subreadit s page where we can see all the posts under that topic Readit subreadit page for the subreaditOn this page we need the data for the subreadit name and description just like we did on the home page We now also need to fetch all of the posts that are part of this subreadit For each post we need the post title the number of votes and comments and the username of the user who posted it We don t need the actual comments yet though since they re not displayed on this page Here s the code for the SubreaditPage component import React from react import useQuery gql from apollo client import withRouter from react router dom import Subreadit from components Subreadit import Post from components Post import LoadingSpinner from components LoadingSpinner import ErrorMessage from components ErrorMessage import SubreaditPage css export const SubreaditPage match gt const FETCH SUBREADIT WITH POSTS gql query FetchSubreaditWithPosts querySubreadit filter name eq match params id name description posts id title user userName voteCount commentsAggregate count const loading data error useQuery FETCH SUBREADIT WITH POSTS return lt div className subreaditPage gt loading amp amp lt LoadingSpinner gt error amp amp lt ErrorMessage gt data amp amp data querySubreadit length lt gt lt Subreadit title data querySubreadit name description data querySubreadit description gt lt h gt Posts lt h gt lt div className postsSection gt data querySubreadit posts length data querySubreadit posts map post gt lt Post key post id isPreview isOnSubreaditPage id post id title post title voteCount post voteCount commentCount post commentsAggregate count subreaditName data querySubreadit name userName post user userName gt lt p gt No posts yet lt p gt lt div gt lt gt lt ErrorMessage gt lt div gt export const SubreaditPageWithRouter withRouter SubreaditPage Post PageOnce we ve found an interesting post we d like to view we can click on the link to view the individual post page This page shows us the original post as well as all of the comments on the post Readit post page for Oscar s postHere we need all the same post data that we did on the subreadit page but now we also need to know the subreadit it was posted on and we need all of the comments on the post For each comment we need to know the username for the user who posted it what the actual comment content was and how many votes it has The code for the PostPage looks like this import React from react import useQuery gql from apollo client import withRouter from react router dom import Post from components Post import Comment from components Comment import LoadingSpinner from components LoadingSpinner import ErrorMessage from components ErrorMessage import PostPage css export const PostPage match gt const FETCH POST WITH COMMENTS gql query FetchPostWithComments getPost id match params id title user userName subreadit name voteCount commentsAggregate count comments commentContent voteCount user userName const loading data error useQuery FETCH POST WITH COMMENTS return lt div className postPage gt loading amp amp lt LoadingSpinner gt error amp amp lt ErrorMessage gt data amp amp data getPost lt gt lt Post title data getPost title voteCount data getPost voteCount commentCount data getPost commentsAggregate count subreaditName data getPost subreadit name userName data getPost user userName gt lt h gt Comments lt h gt lt div className commentsSection gt data getPost comments length data getPost comments map comment gt lt Comment key comment commentContent isOnPostPage commentContent comment commentContent voteCount comment voteCount userName comment user userName gt lt p gt No comments yet lt p gt lt div gt lt gt lt ErrorMessage gt lt div gt export const PostPageWithRouter withRouter PostPage User PageFinally if we decide to view a user s profile we can see all of their posts and comments they ve made Readit user page for Oscar MartinezThis page should show the user s username bio number of posts and number of comments We also need all of their posts and all of their comments On each post we need to know the subreadit it was posted on the post title as well as the number of votes and comments For each comment we need to know which post it was a comment on what the comment content was and the number of votes it s received The code for the UserPage is below import React from react import useQuery gql from apollo client import withRouter from react router dom import User from components User import Post from components Post import Comment from components Comment import LoadingSpinner from components LoadingSpinner import ErrorMessage from components ErrorMessage import UserPage css export const UserPage match gt const FETCH USER gql query FetchUser queryUser filter userName eq match params id userName bio posts id title user userName subreadit name voteCount commentsAggregate count postsAggregate count comments id commentContent voteCount user userName post title id commentsAggregate count const loading data error useQuery FETCH USER return lt div className userPage gt loading amp amp lt LoadingSpinner gt error amp amp lt ErrorMessage gt data amp amp data queryUser length lt gt lt User userName data queryUser userName bio data queryUser bio postCount data queryUser postsAggregate count commentCount data queryUser commentsAggregate count gt lt h gt Posts lt h gt lt div className postsSection gt data queryUser posts length data queryUser posts map post gt lt Post key post id isPreview isOnUserPage id post id title post title voteCount post voteCount commentCount post commentsAggregate count subreaditName post subreadit name userName post user userName gt lt p gt No posts yet lt p gt lt div gt lt h gt Comments lt h gt lt div className commentsSection gt data queryUser comments length data queryUser comments map comment gt lt Comment key comment id isOnUserPage postTitle comment post title postId comment post id commentContent comment commentContent voteCount comment voteCount userName comment user userName gt lt p gt No comments yet lt p gt lt div gt lt gt lt ErrorMessage gt lt div gt export const UserPageWithRouter withRouter UserPage This page is by far the most complex as we need to query more than just summary data or aggregate count data ConclusionAs we ve seen each page in our app requires unique portions of data Some pages need only high level summaries like the number of comments or posts a user has made Other pages need more in depth results like the actual comments and actual posts Depending on the page you may need more or less information The benefit of using GraphQL and Dgraph Cloud is the flexibility in querying exactly the data we need for each page ーno more and no less For each request we used the same single API endpoint but requested different fields This greatly simplifies the development work as we don t need to create a new backend endpoint for each page Or worse create a single endpoint that retrieves a monstrous payload of data we then have to sift through to find the minor subset of data that we need GraphQL makes it easy to quickly and painlessly request exactly the right data exactly when you need it 2021-05-03 12:21:22
Apple AppleInsider - Frontpage News Spectre comes back from the dead to haunt Intel chips https://appleinsider.com/articles/21/05/03/spectre-comes-back-from-the-dead-to-haunt-intel-chips?utm_medium=rss Spectre comes back from the dead to haunt Intel chipsSecurity researchers have found new versions of chip flaws affecting Intel and AMD processors that get around existing mitigations for Spectre attacks resurrecting vulnerabilities that may affect Intel based Macs In an Intel chip kernel flaw was found that allowed attackers to gain access to protected data which could include passwords and application keys While patches and mitigations were put in place to block the so called Spectre attacks from happening researchers have determined the efforts aren t enough to prevent the attacks entirely In a paper published by researchers from the University of Virginia and the University of California at least three new versions of Spectre attacks have been found affecting micro op caches in Intel and AMD processors Read more 2021-05-03 12:55:49
Apple AppleInsider - Frontpage News Verizon sells AOL, Yahoo media brands to private equity firm for $5 billion https://appleinsider.com/articles/21/05/03/verizon-sells-aol-yahoo-media-brands-to-private-equity-firm-for-5-billion?utm_medium=rss Verizon sells AOL Yahoo media brands to private equity firm for billionVerizon has given up on its attempt to transform s internet giants Yahoo and AOL into a content and advertising behemoth as it has agreed to sell the brands to private equity firm Apollo Global Management for billion Verizon has agreed to sell AOL and Yahoo for billionSix years after it bought AOL and five after it took over Yahoo Verizon Communications has sold off both according to releases from both Verizon and Apollo Global Management The wireless carrier which spent more than billion on the brands is now selling them for just over half of that Read more 2021-05-03 12:54:31
Apple AppleInsider - Frontpage News How to change the AirTag battery https://appleinsider.com/articles/21/05/03/how-to-change-the-battery-in-airtag?utm_medium=rss How to change the AirTag batteryHere s how to replace the battery in your AirTag and how you ll know when you need to do it The battery is a commonly available CR one An AirTag battery will last for about a year and your iPhone will warn you when that battery is low But if that notification is all you rely on you can see there might be problems Read more 2021-05-03 12:25:15
Apple AppleInsider - Frontpage News Compared: Apple's second-generation Siri Remote versus its predecessors https://appleinsider.com/articles/21/05/03/compared-apples-second-generation-siri-remote-versus-its-predecessors?utm_medium=rss Compared Apple x s second generation Siri Remote versus its predecessorsApple has evolved the design of its remote control over time with each iteration introducing physical improvements and better features After launching the second generation Siri Remote has Apple created its best controller Apple s history of remote controlsAs part of its Spring Loaded special event Apple updated the Apple TV K with some new specifications but the biggest news about it wasn t the Apple TV itself but its controller Apple refined the design of the Siri Remote updating it to answer numerous complaints it had about the first generation Read more 2021-05-03 12:27:38
海外TECH Engadget Box adds Dolby's automated audio editing to its cloud-based collaboration tools https://www.engadget.com/box-dolby-io-automated-audio-editing-tools-123048788.html audio 2021-05-03 12:30:48
海外TECH Engadget Verizon is selling its media business for $5 billion after splurging on AOL and Yahoo https://www.engadget.com/verizon-media-sale-yahoo-apollo-funds-122155517.html Verizon is selling its media business for billion after splurging on AOL and YahooVerizon has agreed a deal to sell its Verizon Media unit ーincluding Engadget ーto the investment firm Apollo Global Management for billion 2021-05-03 12:21:55
Cisco Cisco Blog A More Engaging and Inclusive Meeting Experience, Powered by Cisco + Slido https://blogs.cisco.com/collaboration/a-more-engaging-and-inclusive-meeting-experience-powered-by-cisco-slido A More Engaging and Inclusive Meeting Experience Powered by Cisco SlidoToday with the completion of our acquisition of Slido we have taken another step forward in delivering on our promise of creating Webex experiences that are x better than in person interactions 2021-05-03 12:30:01
海外TECH CodeProject Latest Articles Using an F# DSL to Generate C# code https://www.codeproject.com/Articles/5301612/Using-an-Fsharp-DSL-to-generate-Csharp-code Using an F DSL to Generate C codeIn the efact file there over different record formats all with a fixed length of bytes Fields in a record are positional To describe this I created a more readable Domain Specific Language in F 2021-05-03 12:33:00
海外科学 NYT > Science E.P.A. to Announce Sharp Limits on Powerful Greenhouse Gases https://www.nytimes.com/2021/05/03/climate/EPA-HFCs-hydrofluorocarbons.html E P A to Announce Sharp Limits on Powerful Greenhouse GasesThe Biden administration is moving quickly to limit hydrofluorocarbons which are Earth warming chemicals used in air conditioning and refrigeration 2021-05-03 12:47:03
海外科学 NYT > Science Faith, Freedom, Fear: Rural America’s Covid Vaccine Skeptics https://www.nytimes.com/2021/04/30/health/covid-vaccine-hesitancy-white-republican.html Faith Freedom Fear Rural America s Covid Vaccine SkepticsResistance is widespread in white Republican communities like this one in Appalachia But it s far more complicated than just a partisan divide 2021-05-03 12:26:01
海外ニュース Japan Times latest articles Modi experiences setback after loss in key India state poll https://www.japantimes.co.jp/news/2021/05/03/asia-pacific/politics-diplomacy-asia-pacific/modi-setback-key-poll/ campaign 2021-05-03 21:03:49
ニュース BBC News - Home Covid: Some foreign travel opening on 17 May - Boris Johnson https://www.bbc.co.uk/news/uk-56970260 johnson 2021-05-03 12:48:24
ニュース BBC News - Home Asian hate crime in UK increases during pandemic https://www.bbc.co.uk/news/uk-56937299 asian 2021-05-03 12:06:05
ニュース BBC News - Home Man Utd supporters group urges Glazers to engage with fans https://www.bbc.co.uk/sport/football/56969755 protests 2021-05-03 12:28:27
LifeHuck ライフハッカー[日本版] 革の質感とエクスペリエンスが育まれるミニマム財布「Saku」を使ってみた! https://www.lifehacker.jp/2021/05/233832-machi-ya-saku-review3.html 経年変化 2021-05-03 22:00:00
北海道 北海道新聞 ヴォレアス、4、5日入れ替え戦 連係プレーを確認 https://www.hokkaido-np.co.jp/article/540182/ 入れ替え戦 2021-05-03 21:09:00
北海道 北海道新聞 親子で憲法に親しむ 音更市民有志がイベント https://www.hokkaido-np.co.jp/article/540183/ 記念日の日 2021-05-03 21:09:00
北海道 北海道新聞 台湾、インドからの入境禁止 新型コロナ急拡大で https://www.hokkaido-np.co.jp/article/540181/ 衛生福利部 2021-05-03 21:05:00
GCP Cloud Blog Take the 2021 State of DevOps survey: Shape the future of DevOps https://cloud.google.com/blog/products/devops-sre/take-2021-state-devops-survey-shape-future-devops/ Take the State of DevOps survey Shape the future of DevOpsToday Google Cloud and the DORA research team are excited to announce the launch of the State of DevOps survey The survey takes approximately minutes to complete and we d love to hear from you Your answers will allow us to better understand the practices that teams are employing to improve software delivery performance and inturn generate powerful business outcomes The State of DevOps report by Google Cloud and the DORA research team is the largest and longest running research of its kind It provides an independent view into the practices and capabilities that organizations irrespective of their size industry and region can employ to drive better performance   Like the past six research reports our goal this year is to perform detailed analysis to help various teams benchmark their performance against the industry as elite high medium or low performers We also look to show specific strategies that teams can employ to improve their performance  The table below highlights elite high medium and low performers at a glance from the last report Achieving elite performance is a team endeavor and diverse inclusive teams drive the best performance The research program benefits from the participation of a diverse group of people Please help us encourage more voices by sharing this survey with your network especially with your colleagues from underrepresented parts of our industry  The survey is for everyone regardless of where you are on your DevOps journey the size of your organization or your organization s industry There are no right or wrong answers in fact we often hear feedback that questions in the survey prompt ideas for improvement Many of these ideas can be put into practice immediately  Some of the key topics we look to deep dive into this year include Metrics and Measurement Practices employed by high performing teams SRE and DevOps How do they fit together and how they impact performanceHow to best integrate security amp compliance as a part of your app development The impact of cloud monitoring amp observability open source and documentation on performanceDistributed teams Practices to improve work life balance and reduce burnoutThe state of multi cloud computing Help us shape the future of DevOps and make your voice heard by completing the survey now  The survey will remain open until midnight PST on June We look forward to hearing from you 2021-05-03 13:50:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)