投稿時間:2022-01-22 00:30:15 RSSフィード2022-01-22 00:00 分まとめ(32件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita Kaggle振り返り NFL Health & Safety - Helmet Assignment https://qiita.com/tt20210824/items/7386e06285ec2b2e7a01 ヘルメットを検出するYOLOvの学習BaselineCSVとのアンサンブル過検知ヘルメットの除外ヘルメットを識別するモデルを作成し、ヘルメット以外を削除サイドラインヘルメットを特定し削除見逃したヘルメットの補完Wearabledeviceの情報と検出したヘルメットを紐づける検出したヘルメットと位置情報の距離によるID割り当てDeepSortアルゴリズムによるReID自作ReIDによる選手IDの上書き詳細上記に記載した中には、精度向上に繋がったものと、繋がらなかったものの両方があります。 2022-01-21 23:36:26
Git Gitタグが付けられた新着投稿 - Qiita git初歩メモ - テキストファイルをローカルリポジトリに登録 https://qiita.com/manaboru/items/f8e174db7b670f4394a7 趣味でプログラミングをやっていた私はそうした慣習が無かったので、gitを使ったオペレーションには慣れておくべきと考え、gitを使うことにしました。 2022-01-21 23:02:39
技術ブログ Mercari Engineering Blog 高い堅牢性と可用性を支えるメルペイコード決済チームの取り組みと工夫 #TeamInterview https://engineering.mercari.com/blog/entry/20220121-9e083be116/ hellip 2022-01-21 15:35:44
技術ブログ Developers.IO [Trello] 前日の日付のタイトルのカードのチェックリストをコピーしたカードを自動作成する(Butler変数のプレフィクス) https://dev.classmethod.jp/articles/trello-automatically-create-a-card-with-a-copy-of-the-checklist-of-the-card-with-the-title-of-the-previous-days-date-butler-variable/ butler 2022-01-21 14:47:48
海外TECH MakeUseOf The Podcastle iOS App Is Here, and It Does Not Disappoint https://www.makeuseof.com/podcastle-ios-app/ disappointpodcastle 2022-01-21 14:56:19
海外TECH MakeUseOf Yeelight Screen Light Bar Pro Review: Just More RGB Bragging Rights? https://www.makeuseof.com/yeelight-screen-light-bar-pro-review/ Yeelight Screen Light Bar Pro Review Just More RGB Bragging Rights As a lamp the Yeelight Screen Bar Pro works flawlessly but the immersive game lighting relies on fiddly third party apps that don t always work 2022-01-21 14:55:12
海外TECH MakeUseOf How to Automatically Forward Emails From Outlook to Gmail (and Vice-Versa) https://www.makeuseof.com/tag/automatically-forward-emails-outlook-gmail/ How to Automatically Forward Emails From Outlook to Gmail and Vice Versa Want to forward Outlook email to Gmail or forward your Gmail to Outlook Both Outlook and Gmail can automate the forwarding process for you 2022-01-21 14:45:12
海外TECH MakeUseOf The Top 10 Client Proofing Sites for Photographers https://www.makeuseof.com/best-client-proofing-sites-photographers/ business 2022-01-21 14:45:11
海外TECH MakeUseOf The Quick Guide to Staking Solana (SOL) https://www.makeuseof.com/quick-guide-to-staking-solana/ solana 2022-01-21 14:32:08
海外TECH MakeUseOf 7 Ways to Optimize Your Smart Projector Home Theater https://www.makeuseof.com/portable-projectors/ theater 2022-01-21 14:15:11
海外TECH MakeUseOf How to Get NVIDIA GeForce Now for Free for 6 Months https://www.makeuseof.com/how-to-get-nvidia-geforce-now-free/ nvidia 2022-01-21 14:02:18
海外TECH DEV Community 5 old Programming Languages you should know about https://dev.to/blag/5-old-programming-languages-you-should-know-about-3ofe old Programming Languages you should know aboutThis post was originally posted on LinkedIn For some people old programming languages are ugly obsolete old fashioned and useless For me they re the complete opposite gems waiting to be rediscovered An old programming language can teach you a lot and can make you for sure a better developer People today are getting used to have everything provided by the language and that s bad because it doesn t force you to think Old programming language lack a lot of things that you find in modern languages but that doesn t mean they re not as powerful as they provide you all the tools to implement things yourself To illustrate how those programming work we re to use a very basic app called Fibonacci List which will simply output a list of requested Fibonacci numbers for example if we ask for it should return Let s start with the oldest programming language I know FORTRAN Formula Translator A general purpose imperative programming language that is essentially suited to numeric computations and scientific computing program fibonacci implicit none integer a b num write a advance no Enter a number read num write trim fib num a b containsrecursive function fib num a b result fibo integer intent in num a b integer ab character a s b s ab s character fibo if a gt and num gt then ab a b write ab s I ab fibo trim ab s fib num ab a else if a then ab a b write a s I a write b s I b write ab s I ab fibo trim a s trim b s trim ab s trim fib num ab b else fibo end if returnend function fibend program fibonacciLet s see A program must be enclosed between program and end program tag Variables need a type when they are declared A recursive function must be labeled as recursive String variables are fixed in length is used to concatenate Integers and Character can be concatenated together without further transformations We need to trim a lot to avoid extra space due to the really long fixed size Functions can return zero one or multiple values To compile this I used GFORTRAN which come with Linux but can be simply installed by doing sudo apt get install gfortran Being a GNU App this is not a real Fortran compiler it s written in C GFORTRAN WALL C NAME OF FILE F GFORTRAN WALL O NAME OF EXEC NAME OF FILE F You can read my FORTRAN Introduction here Cobol Common Object Business Oriented Language A compiled English like computer programming language designed for business use It s imperative procedural and since Object Oriented IDENTIFICATION DIVISION PROGRAM ID fibonacci ENVIRONMENT DIVISION DATA DIVISION WORKING STORAGE SECTION USER NUMBER PIC A PIC B PIC AB PIC COUNTER PIC COUNTER SPACES PIC PROCEDURE DIVISION PROGRAM BEGIN MOVE TO A MOVE TO B DISPLAY Enter a number ACCEPT USER NUMBER PERFORM GET FIBO WITH TEST AFTER UNTIL USER NUMBER DISPLAY PROGRAM DONE STOP RUN GET FIBO IF A COMPUTE AB A B INSPECT AB TALLYING COUNTER FOR CHARACTERS INSPECT AB TALLYING COUNTER SPACES FOR LEADING ZEROS COMPUTE COUNTER SPACES COUNTER SPACES COUNTER DISPLAY AB COUNTER COUNTER SPACES WITH NO ADVANCING COMPUTE USER NUMBER USER NUMBER MOVE AB TO A ELSE MOVE TO COUNTER MOVE TO COUNTER SPACES COMPUTE AB A B INSPECT AB TALLYING COUNTER FOR CHARACTERS INSPECT AB TALLYING COUNTER SPACES FOR LEADING ZEROS IF COUNTER SPACES DISPLAY AB WITH NO ADVANCING END IF IF COUNTER SPACES COMPUTE COUNTER COUNTER COUNTER SPACES DISPLAY AB COUNTER COUNTER WITH NO ADVANCING END IF IF COUNTER SPACES COMPUTE COUNTER SPACES COUNTER SPACES COUNTER DISPLAY AB COUNTER COUNTER SPACES WITH NO ADVANCING END IF COMPUTE USER NUMBER USER NUMBER MOVE A TO B MOVE AB TO A END IF As we can see Cobol is very strict it has divisions and sections Variables need to be declared first and cannot be declared anywhere else outside it s section Moving a value into a variable is not the same as assigning a value to a variable There is no such thing as IF ELSE You can inspect a variable to get its length or amount of zeros I know you re wondering what the heck PIC means well is for numeric values X for alphanumeric S for sign and V for decimals To compile this I used Open Cobol that can be simply installed by doing sudo apt get install open cobol Being a GNU App this is not a real Cobol compiler it s written in C COBC X FREE O NAME OF FILE NAME OF FILE COB You can read my Cobol Introduction here Simula Simulation Programming Language Superset of Algol Consired the first Object Oriented programming language begin integer num text result procedure fib num a b integer num a b begin if a gt and num gt then begin OutInt a b fib num a b a end if a then begin OutInt a OutInt b OutInt a b fib num a b b end end OutText Enter a number OutImage num InInt fib num OutImage endEvery program start with a Begin End Variables need a type We can have global and local variables OutInt is used to print Integers on the screen while OutText is for strings OutImage is used to print an empty line Integer variables are assigned using while String variables use To compile I used GNU CIM which is a transpiler from Simula to C You can install it from here cim NAME OF FILE cim You can read my Simula Introduction here Snobol String Oriented and Symbolic Language Imperative and Unstructured programming Language Also it s goal oriented Fibonacci Sequence define fibo num a b temp fib fibo end fib fibo eq a a b a b num num a a b s fib fib gt num s fib f return fib fibo gt a fibo a b num num temp a a a b b temp s fib f return fibo end output Enter a number num input output fibo num end Variables doesn t need a data type it s type depend on the assigned value When defining a method we need to specify what to call when it ends or fails For each section we need to determine if it works or not and depending on that move to another section An If condition needs to be by itself and move to other section depending on the result In this example gt num is an If statement To compile we need to first build the compiler which is by the way a C app WGET FTP FTP ULTIMATE COM SNOBOL SNOBOL TAR GZTAR ZXVF SNOBOL TAR GZ amp amp CD SNOBOL SUDO APT GET INSTALL MSUDO MAKE INSTALLTo run we need to do snobol NAME OF FILE sno You can read my Snobol Introduction here Algol Algorithmic Language Part of the Algol family of imperative programming Languages Algol Algol and Algol One of the most influential languages of all time giving rise to Simula B Pascal and C amongst many others BEGIN print Enter a number INT num read int PROC fib INT num a b VOID IF a gt THEN IF num gt THEN printf g x a b fib num a b a FI ELIF a THEN printf g x a b fib num a b b FI printf g x fib num print newline ENDAll applications start with a BEGIN END Variables need a type Procedures can have zero or more parameters The last value is returned and a value must be always returned When printing a number the sign will be displayed that s why we need to format its output This one most likely the first programming language to use ELIF and also FI to close an IF statement is used to end a line To compile we need to first install AlgolGenieSUDO APT GET INSTALL Y ALGOLGThen we can simply do ag NAME OF FILE ag You can read my Algol Introduction here Bonus SectionI know five is not enough so why not include a bonus language one that always interested me as the name seems kind of weird for a programming language Smalltalk An object oriented dynamically typed reflective programming language Smalltalk had influenced many languages like Objective C Java Python Ruby and many more number fib result result fib num a b a gt amp num asNumber gt ifTrue result result a b asString fib value num asNumber value a b value a ifFalse a ifTrue result a asString b asString a b asString fib value num asNumber value a b value b Transcript show Enter a number num stdin nextLine Transcript show fib value num value value cr Variables are declared between Values are assigned using IF statements are special as they are defined as ifTrue and ifFalse and are used to enclosed blocks We use Transcript show because otherwise a text will be printed enclosed like this This is a text instead of This is a text If you wonder about value that s used to call a parameter To compile we re going to use GNU Smalltalk that can be installed like thissudo apt get install gnu smalltalkand them simply gst NAME OF FILE st You can read my Smalltalk Introduction here That s it Hope you had some fun I had a lot of fun learning them and they surely made me a better developer and yes I frustrated me plenty of times but that s the fun of programming Blag 2022-01-21 14:32:11
海外TECH DEV Community 🚀10 Trending projects on GitHub for web developers - 21st January 2022 https://dev.to/iainfreestone/10-trending-projects-on-github-for-web-developers-21st-january-2022-1727 Trending projects on GitHub for web developers st January Trending Projects is available as a weekly newsletter please sign up at Stargazing dev to ensure you never miss an issue React Text transitionAnimate your text changes WinterCore react text transition Animate your text changes React Text transitionAnimate your text changesInstallationnpm install S react text transitionUsing the demonpm run devHow to useExampleimport React from react import TextTransition presets from react text transition const TEXTS Forest Building Tree Color const App gt const index setIndex React useState React useEffect gt const intervalId setInterval gt setIndex index gt index every seconds return gt clearTimeout intervalId return lt h gt lt TextTransition text TEXTS index TEXTS length springConfig presets wobbly gt lt h gt … View on GitHub SunCalcA tiny JavaScript library for calculating sun moon positions and phases mourner suncalc A tiny JavaScript library for calculating sun moon positions and phases SunCalcSunCalc is a tiny BSD licensed JavaScript library for calculating sun positionsunlight phases times for sunrise sunset dusk etc moon position and lunar phase for the given location and timecreated by Vladimir Agafonkin mourner as a part of the SunCalc net project Most calculations are based on the formulas given in the excellent Astronomy Answers articlesabout position of the sunand the planets You can read about different twilight phases calculated by SunCalcin the Twilight article on Wikipedia Usage example get today s sunlight times for Londonvar times SunCalc getTimes new Date format sunrise time from the Date objectvar sunriseStr times sunrise getHours times sunrise getMinutes get position of the sun azimuth and… View on GitHub Simple cssSimple css is a classless CSS template that allows you to make a good looking website really quickly kevquirk simple css Simple css is a classless CSS template that allows you to make a good looking website really quickly Simple css Simple css is a classless CSS template that allows you to make a good looking website really quickly Find out more at Supported BrowsersAny evergreen browser gt IE why is IE still a thing View on GitHub Danfo jsDanfo js is an open source JavaScript library providing high performance intuitive and easy to use data structures for manipulating and processing structured data javascriptdata danfojs Danfo js is an open source JavaScript library providing high performance intuitive and easy to use data structures for manipulating and processing structured data Danfojs powerful javascript data analysis toolkitWhat is it Danfo js is a javascript package that provides fast flexible and expressive datastructures designed to make working with relational or labeled data botheasy and intuitive It is heavily inspired by Pandas library and provides a similar API This means that users familiar with Pandas can easily pick up danfo js Main FeaturesDanfo js is fast and supports Tensorflow js tensors out of the box This means you can convert Danfo data structure to Tensors Easy handling of missing data represented asNaN in floating point as well as non floating point dataSize mutability columns can be inserted deleted from DataFrameAutomatic and explicit alignment objects canbe explicitly aligned to a set of labels or the user can simplyignore the labels and let Series DataFrame etc automaticallyalign the data for you in computationsPowerful flexible groupby functionality… View on GitHub canvas datagridCanvas based data grid web component Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading on a single canvas element TonyGermaneri canvas datagrid Canvas based data grid web component Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading on a single canvas element canvas datagridDemo City of Chicago government employee list Thanks to data gov Works with Firefox Edge Safari and Chrome Native support for touch devices phones and tablets Rich documentation tutorials and slack support Single canvas element drawn in immediate mode data size does not impact performance Support for unlimited rows and columns without paging or loading Rich API of events methods and properties using the familiar WC DOM interface Extensible styling filtering formatting resizing selecting and ordering Support for hierarchal drill in style row level inner grids as well grids in cells Customizable hierarchal context menu Built in and custom styles WC Web Component Works in all frameworks Per user styles column sizes row sizes view preferences and settings using localStorage Small file sizeDocumentationTutorialsSlack Support message author for invite Style BuilderDownload latest version minified TestsSource CodeLatest Test CoverageInstallationWith npm… View on GitHub VestVest is a form validation framework inspired by unit testing libraries like Mocha or Jest It is designed to be easy to use and easy to learn by introducing their declarative syntax ealush vest Vest Declarative validations framework Vest Declarative validations frameworkVest Documentation Vest is a form validation framework inspired by unit testing libraries like Mocha or Jest It is designed to be easy to use and easy to learn by introducing their declarative syntax The idea behind Vest is that your validations can be described as a suite a contract that reflects your form or feature structure Vest is framework agnostic meaning it can be used with any UI framework or without any framework at all Using Vest for form validation can reduce bloat improve feature readability and maintainability test username Username is required gt enforce data username isNotBlank test username Username must be at least chars gt enforce data username longerThanOrEquals … View on GitHub Vanta JSAnimated D backgrounds for your website tengbao vanta Animated D backgrounds for your website Vanta JSView demo gallery amp customize effects at www vantajs com →What is Vanta FAQsAdd D animated digital art to any webpage with just a few lines of code How it works Vanta inserts an animated effect as a background into any HTML element Works with vanilla JS React Angular Vue etc Effects are rendered by three js using WebGL or p js Effects can interact with mouse touch inputs Effect parameters e g color can be easily modified to match your brand Total additional file size is kb minified and gzipped mostly three js which is smaller than comparable background images videos Vanta includes many predefined effects to try out More effects will be added soon View demo gallery amp customize effects at www vantajs com →Basic usage with script tags lt script src gt lt script gt lt script src dist vanta waves min js gt lt script gt lt script… View on GitHub GestA sensible GraphQL testing tool test your GraphQL schema locally and in the cloud mfix gest ‍A sensible GraphQL testing tool test your GraphQL schema locally and in the cloud A sensible GraphQL testing tool Usage npm install g gestthen send queries with gest pronounced guest ɡest gest options query pathToFileWithQuery Examples gest test or gest test graphql with test graphql containing test or multiple gest test graphql test introspection graphql will run all three queries REPLIf you run gest with no arguments it will open a REPL for you to run queries in gestQuery test data test success HTTPIf you specify a baseURL in your config gest will send an POST request with your query correctly encoded in the body Your baseURL must be a valid URL You can specify HTTP headers by using H key value flags This is especially convenient if you are using a Now workflow Example … View on GitHub FalsoCreate massive amounts of fake data in the browser and NodeJS Tree Shakeable amp Fully Typed ngneat falso All the Fake Data for All Your Real Needs All the Fake Data for All Your Real Needs Create massive amounts of fake data in the browser and NodeJS Tree Shakeable amp Fully Typed   Functions Tree Shakable Fully Typed Entity Functions Single and Array ResultLearn about it on the docs site Run it on StackblitzInstallationnpm i ngneat falsoyarn add ngneat falsoUsageimport randEmail randFullName from ngneat falso const user email randEmail name randFullName const emails randEmail length Setting a Randomness SeedYou can set your own seed if you want consistent results import rand seed from ngneat falso seed some constant seed Always returns rand … View on GitHub Lazy LoadVanilla JavaScript plugin for lazy loading images Delays loading of images in long web pages Images outside of viewport will not be loaded before user scrolls to them This is opposite of image preloading tuupola lazyload Vanilla JavaScript plugin for lazyloading images Lazy Load RemasteredLazy Load delays loading of images in long web pages Images outside of viewport will not be loaded before user scrolls to them This is opposite of image preloading This is a modern vanilla JavaScript version of the original Lazy Load plugin It uses Intersection Observer API to observe when the image enters the browsers viewport Original code was inspired by YUI ImageLoader utility by Matt Mlinac New version loans heavily from a blog post by Dean Hume Basic UsageBy default Lazy Load assumes the URL of the original high resolution image can be found in data src attribute You can also include an optional low resolution placeholder in the src attribute lt script src rc lazyload js gt lt script gt lt img class lazyload data src img example jpg width height amp gt lt img class lazyload … View on GitHub Stargazing Top risers over last daysPublic APIs starsTauri starsFree for Dev starsCyberChef starsAwesome stars Top growth over last daysp Node Intergration Tests React Preview riju Vitest Top risers over last daysAwesome starsAwesome Self Hosted starsPublic APIs starsTabby stars Days of JavaScript stars Top growth over last daysIconoir Vitest Basic Computer Games Fuite TinySpy For all for the latest rankings please checkout Stargazing devTrending Projects is available as a weekly newsletter please sign up at Stargazing dev to ensure you never miss an issue If you enjoyed this article you can follow me on Twitter where I regularly post about HTML CSS and JavaScript 2022-01-21 14:30:30
海外TECH DEV Community Nucleoid: State-based data storage with Vanilla JS https://dev.to/nucleoid/nucleoid-state-based-data-storage-with-vanilla-js-87m Nucleoid State based data storage with Vanilla JS What is the state based data storage The state based data storage runs as a runtime that is embedded inside Node js and as writing just any other codes in Node js it rerenders the same JavaScript codes and makes the necessary adjustments in the state as well as stores on the disk so that your application doesn t require external database but why Even simple applications today require lots of coding libraries tuning etc and majority of them are technical codes rather than business logic Declarative runtimes like Nucleoid can organically reduce numbers of code lines needed InstallingOnce you include in your project this is pretty much it npm install nucleoidjshere is the hello world const nucleoid require nucleoidjs const app nucleoid class User nucleoid register User app post users gt new User app listen Just a quick reminder it doesn t require external database in order to save the object Let s add a little bit coloring with CRUD Createapp post users req gt new User req body name Readapp get users id req gt User req params id Updateapp post users id req gt let user User req params id if user user name req body name return user Deleteapp delete users id req gt delete User req params id As you may realize it comes with Express js you can also reach out original Express js APIs const nucleoid require nucleoidjs const app nucleoid const express app express express get test req res gt res send Hello Star us for the support 2022-01-21 14:25:19
海外TECH DEV Community Creating a GraphQL API. A Code Tutorial for complete beginners. https://dev.to/thatfreakcoder/creating-a-graphql-api-a-code-tutorial-for-complete-beginners-3l53 Creating a GraphQL API A Code Tutorial for complete beginners Recently GraphQL has made a lot of buzz among the developers community and it has been seeing a lot of attention because of the dynamicness and lot less redundant data fetching capabilities it packs under its hood In this Code Tutorial we will get to learn about what GraphQL really is why has it created such a hype amongst new age developers How is it different from the REST approach and finally We will be building our own API with GraphQL along with Code Tutorials So let s get into it ‍ What is GraphQL A quick primerBefore understanding what GraphQL is let s first understand what Query Languages are Query Languages are languages that request the data from a database called queries to a client side application through a server A well known example is Structured Query Language or SQL Coming to GraphQL by definition “GraphQL is an open source data query and manipulation language for APIs and a runtime for fulfilling queries with existing data source wiki But the question remains the same What exactly is GraphQL Simply put GraphQL is a new age Query Language developed by Facebook that helps Application Programming Interfaces APIs fetch only that data which is request by the client and nothing else thus enormously reducing the redundant data at the API endpoint and making the requests blazing fast and developer friendly But wasn t that already being done by RESTful APIs The answer is yes but GraphQL is different and also advantageous than REST in a lot of ways GraphQL is Client Driven whereas REST is Server Driven Queries are organized in terms of Schema and strict typecasting in GraphQL whereas REST has Endpoints for that task GraphQL calls Specific data with single call REST calls Fixed data with multiple calls Instead of the GET POST PUT DELETE operations in REST GraphQL has Query Mutation and Subscription for data manipulation Now that we know the “What s and “Where s of GraphQL let s dive straight into our favorite part The Development Let s Play with GraphQLIn this section we will learn about a step by step procedure of building an API using GraphQL and Express on top of Node js In the next section we will be implementing these prerequisites into code and start our development for the API Prerequisites Understanding of GraphQLNode Package Manager or NPM with version Knowledge of basic querying and server side programming We will be needing a Database to store the user data and everything else that a client side application can request for For this we will be using LowDB which is a simple file based JSON database for small projects in the localhost Then we will be needing a middleware to connect our database system to the requesting frontend application For this we will be using the Express middleware with the GraphQL implementation of Express the graphql express library Finally we will be making a client side application using React which can request all the data from the local database and can perform operations on the database like Read Write and Delete So our roadmap is pretty simple and straightforward ️ Create a Database Schema gt Use a middleware server to query the database gt Create a frontend application to use the data If this is too much at once for you do not worry as this is article is being written kept in mind that the reader is a first timer for GraphQL and basic querying as usual With that being done let s dive into the CODE Setting up Express GraphQLLet s begin with the basic project structure of a Node js application Begin a new project in a new folder mkdir graphql example cd graphql exampleUse NPM to intiialize a project npm init yInstall the required dependencies for Express MongoDB Mongoose and some additional dependencies required for the function of Express npm install express mongoose body parser cors saveApollo Server is a community maintained open source GraphQL server that works with all Node js HTTP server frameworks so next we are going to download and save that npm install apollo server express saveThis should ve created a package json and a package lock json file within your folder These files contains the information regarding our environment the dependencies and the specific versions to run those dependencies This means our environment is ready and we can now start developing the integrated server and API We are going to write the Schema inside the index js file In the index js file start off by writing this code const express require express const mongoose require mongoose const schema require schema const bodyParser require body parser const cors require cors const ApolloServer require apollo server express const url mongodb localhost moviesdb const connect mongoose connect url useNewUrlParser true connect then db gt console log Connected correctly to server err gt console log err const server new ApolloServer typeDefs schema typeDefs resolvers schema resolvers const app express app use bodyParser json app use cors server applyMiddleware app app listen port gt console log Server ready at http localhost server graphqlPath In line number to we re implementing the necessary modules Note that here we have imported the schema but we haven t created that yet We will be doing this in the next step In line number to we are connecting the project to the mongoDB database and logging any error we face to the console In line number to we re creating a new Apollo Server with typeDefsand Resolver We ll be defining those in the schema later in this tutorial In line to we re firing up the Express Server at port when we can actually be able to interact with what we re building GraphQL has two main principles in order to work types and resolvers We defined them in Apollo Server We ll import them from the file we ll create later For the time being let s create the file models movie js that ll contain the movie Mongoose model const mongoose require mongoose const Schema mongoose Schema const movieSchema new Schema name type String required true rating type Number required true producer type String required true timestamps true var Movies mongoose model Movie movieSchema module exports Movies movieSchema We re going to build a simple movie app where we can show add edit and delete movies That way we ll get through the basics of GraphQL which is the main goal of this article In lines to we re basically determining the schema of the database that is going to hold the data of movies Every movie is going to have a Name and a Producer of type String and a Rating of type Number Designing the SchemaSo now let s move on to the schema js file where we re going to build our GraphQL API Create a new file in the root of the folder by the name of schema js and add the following code const gql require apollo server express const Movie require models movie Movies const typeDefs gql type Movie id ID name String producer String rating Float type Query getMovies Movie getMovie id ID Movie type Mutation addMovie name String producer String rating Float Movie updateMovie id ID name String producer String rating Float Movie deleteMovie id ID Movie In this we re building the schema We defined the Movie type which will have an ID name of the movie and the producer and a rating of type Float The “ after the types shows that these field are necessary Unlike REST approach of getting different tasks done at different endpoint URLs GraphQL can create operations in a single endpoint That is what we have done in line line onwards The type Query determines the GET operations and type Mutation determines the modification operations like POST DELETE etc In getMovies we re returning a list of all available movies in our database and in getMovie we re getting the specific movie by the ID of that movie Now we re going to link these with the Mongoose Database queries that are going to perform the actions in the database And this is done by Resolvers Resolvers are functions that connects schema fields and types to various backends It can read write and delete data from and to anywhere in the database be it SQL NoSQL or Graph based database Here s how we re going to implement Resolvers in our code const resolvers Query getMovies parent args gt return Movie find getMovie parent args gt return Movie findById args id Mutation addMovie parent args gt let movie new Movie name args name producer args producer rating args rating return movie save updateMovie parent args gt if args id return return Movie findOneAndUpdate id args id set name args name producer args producer rating args rating new true err Movie gt if err console log Something went wrong when updating the movie else continue module exports typeDefs resolvers This is the basic logic of MongoDB and CRUD application and is not in the scope of explanation of this article since it is majorly focussed on GraphQL Although the logics are pretty simple and straightforward for anyone to understand so do skim through it once With this we re done with a basic Movie API which can perform all the CRUD Operations on a database of movies To test this out we re going to fire up our node server and open the browser in http localhost graphql which will open up the GraphQL Playground node index jsServer ready at http localhost graphql http localhost graphql Once the Playground UI opens up we re first going to create a Movie Record for the database since it would be empty initially And now let s list out all the movies in the databaseSo we have successfully created a Movie API where we can perform all the CRUD operations on a single endpoint as well as ask for just the data that we want resulting in blazing fast API response and a developer friendly return object that makes development fast and super easy In the next part we will be using this API in a React Project along with a brief summary of what we did Till then you can SUPPORT MY WORK here hope you enjoyed Stay Safe y all 2022-01-21 14:09:01
海外TECH DEV Community 4 Best Back-end Frameworks for 2022 https://dev.to/kane_jason/4-best-back-end-frameworks-for-2022-3m84 Best Back end Frameworks for Selecting an appropriate back end technology requires vital consideration of the variables like speed reliability and scalability Know the features of the best back end frameworks to select an appropriate one for your project Best Framework for Laravel Net Zend CodeigniterThus to comprehend why backend frameworks are essential for web app development and detailed analysis of best backend frameworks read our latest blog post here 2022-01-21 14:02:17
Apple AppleInsider - Frontpage News Best deals Jan. 21: 2020 1TB 11-inch iPad Pro for $860, Xbox Series X for $280, more! https://appleinsider.com/articles/22/01/21/best-deals-jan-21-2020-1tb-11-inch-ipad-pro-for-860-xbox-series-x-for-280-more?utm_medium=rss Best deals Jan TB inch iPad Pro for Xbox Series X for more In addition to the massive iPad Pro discount Friday s best deals include off a K Hz inch monitor off Apple s MagSafe Battery Pack and a inch K HDR TV Best deals 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-21 14:57:40
Apple AppleInsider - Frontpage News Apple executive discusses inspiration behind 'Time to Run' on Apple Fitness+ https://appleinsider.com/articles/22/01/21/apple-executive-discusses-inspiration-behind-time-to-run-on-apple-fitness?utm_medium=rss Apple executive discusses inspiration behind x Time to Run x on Apple Fitness Apple Fitness executive says the idea behind Time to Run was to motivate existing runners move beyond their everyday neighborhood run Apple launched the new Time to Run feature on Apple Fitness on January Apple has now been talking with Runners World magazine about the feature ーand Tim Cook has been promoting that interview Fitness has helped people live a better life and reach their wellness goals ーmyself included Here s to motivating and inspiring many more in ーTim Cook tim cook January Read more 2022-01-21 14:36:03
海外TECH Engadget Samsung's 1TB T7 Touch SSD is $50 off at Amazon https://www.engadget.com/samsungs-1tb-t7-touch-ssd-is-50-off-at-amazon-140553582.html?src=rss Samsung x s TB T Touch SSD is off at AmazonSamsung s handy T Touch portable SSD is cheaper right now than it was during the holiday shopping season just a couple of months ago The TB black model is down to a new low of which is off and the best price we ve seen it Most other versions are also discounted including the GB model for but you ll get the best deal if you go for the black TB drive Buy T Touch TB at Amazon Storage gadgets are some that are useful to keep around but often expensive to get your hands on That s why we recommend waiting for a sale like this one to pick up an extra drive SD card and the like while you can get them for less Samsung s T Touch is a palm sized portable SSD with read speeds up to MB s and write speeds up to MB s plus features like Dynamic Thermal Guard to control heat levels While the drive supports optional password protection the kicker here is its built in fingerprint reader that you can use as an extra layer of security The T Touch s compact design helps it fit into nearly any bag you may be carrying plus its shock and drop resistant aluminum unibody should protect it from too much damage if it accidentally takes a tumble We also appreciate that it comes with both USB C to C and USB C to A cables allowing you to use the drive with most laptops smartphones tablets and even some game consoles Follow EngadgetDeals on Twitter for the latest tech deals and buying advice 2022-01-21 14:05:53
金融 金融庁ホームページ 審判期日の予定を更新しました。 https://www.fsa.go.jp/policy/kachoukin/06.html 期日 2022-01-21 16:00:00
金融 金融庁ホームページ (株)梅の花における有価証券報告書の虚偽記載に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r3/shouken/20220121-02.html 有価証券報告書 2022-01-21 16:00:00
金融 金融庁ホームページ 前田建設工業(株)役員による内部者取引に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r3/shouken/20220121-01.html 内部者取引 2022-01-21 16:00:00
金融 金融庁ホームページ つみたてNISA対象商品届出一覧及び取扱金融機関一覧について更新しました。 https://www.fsa.go.jp/policy/nisa2/about/tsumitate/target/index.html 対象商品 2022-01-21 15:00:00
金融 金融庁ホームページ スチュワードシップ・コードの受入れを表明した機関投資家のリストを更新しました。 https://www.fsa.go.jp/singi/stewardship/list/20171225.html 機関投資家 2022-01-21 15:00:00
ニュース BBC News - Home Met Police detective Neil Corbel jailed for three years for voyeurism https://www.bbc.co.uk/news/uk-england-london-59131036?at_medium=RSS&at_campaign=KARANGA hotel 2022-01-21 14:25:14
ニュース BBC News - Home ‘A Met police officer secretly filmed me naked’ https://www.bbc.co.uk/news/uk-59078574?at_medium=RSS&at_campaign=KARANGA boxes 2022-01-21 14:36:16
ニュース BBC News - Home Football arrests in England 'highest in years' as disorder on the rise https://www.bbc.co.uk/sport/60056492?at_medium=RSS&at_campaign=KARANGA Football arrests in England x highest in years x as disorder on the riseWith fans back into full capacity stadiums this season BBC Sport has seen figures showing record levels of arrests and increasing disorder 2022-01-21 14:15:40
ニュース BBC News - Home Australian Open: Watch the key moments as defending champion Naomi Osaka is beaten https://www.bbc.co.uk/sport/av/tennis/60086727?at_medium=RSS&at_campaign=KARANGA Australian Open Watch the key moments as defending champion Naomi Osaka is beatenWatch the key moments as defending champion Naomi Osaka is knocked out of the Australian Open in the third round by American Amanda Anisimova who survived two match points 2022-01-21 14:32:25
LifeHuck ライフハッカー[日本版] Ankerからオンライン会議特化のワイヤレスヘッドセット「Anker PowerConf H700」登場 https://www.lifehacker.jp/article/amazon-anker-powerconf-h700/ anker 2022-01-21 14:30:00
北海道 北海道新聞 1管航空機が流氷観測 宗谷─サロマ湖間 接岸確認 https://www.hokkaido-np.co.jp/article/636376/ 管区海上保安本部 2022-01-21 23:02:36
北海道 北海道新聞 オリックス、宮内オーナー退任へ 今季限り、リーグ優勝「区切り」 https://www.hokkaido-np.co.jp/article/636325/ 今季限り 2022-01-21 23:06:10
北海道 北海道新聞 NY円、113円後半 https://www.hokkaido-np.co.jp/article/636445/ 外国為替市場 2022-01-21 23:04: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件)