投稿時間:2021-10-14 01:39:11 RSSフィード2021-10-14 01:00 分まとめ(43件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS lambdaタグが付けられた新着投稿 - Qiita AWS SAM+Lambda+Goではじめるサーバーレスアプリケーション開発 https://qiita.com/sakeafterbeer/items/3dcd1800ae7f774931b8 HelloWorldアプリケーションについてWSLの設定Dockerの設定AWSCLIの設定SessionManagerプラグインの設定SAMとGoのインストールUbuntuの環境変数設定の自動化VSCodeの設定SAMプロジェクトの新規作成SAMプロジェクトのデプロイAWSコンソールから各サービスを確認HelloWorldアプリケーションについてHelloWorldアプリケーションは、SAMプロジェクトを新規作成するときに便利なサンプルプロジェクトです。 2021-10-14 00:01:07
python Pythonタグが付けられた新着投稿 - Qiita 線形回帰を実装する際は正規方程式を書かずにムーアペンローズの擬似逆行列を利用する https://qiita.com/yoichi_t/items/75bfa4cb5feda186ba20 線形回帰を実装する際は正規方程式を書かずにムーアペンローズの擬似逆行列を利用する概要線形回帰モデルの最尤推定を実装する場合に、正規方程式を書くと思いますPRML章など正規方程式を実装した場合に、たぶん逆行列の精度が悪く、推定結果の精度が悪い場合があるそこで、ムーアペンローズの擬似逆行列を使うと良いよという話正直なところ、何が原因かはっきりと理解できていないので、詳しい方教えてください。 2021-10-14 00:15:00
python Pythonタグが付けられた新着投稿 - Qiita FastAPI 色々なレスポンスまとめ https://qiita.com/aKuad/items/d213dc1f7075ab2dd69a デフォルトのレスポンスクラスの指定デフォルトではJSONがレスポンスされるようになっていますが、FastAPIをインスタンス化する際に、デフォルトのレスポンスクラスを指定することができます。 2021-10-14 00:11:09
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 正規表現である条件の場合は抽出したくない時の表現方法 https://teratail.com/questions/364281?rss=all その中につ以上の文字の英数字が含まれています。 2021-10-14 00:29:14
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) unity 2D のゲーム制作について https://teratail.com/questions/364280?rss=all unity 2021-10-14 00:10:25
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ハンバーガーメニューをヘッダーの中に入れたい https://teratail.com/questions/364279?rss=all ハンバーガーメニューをヘッダーの中に入れたいハンバーガーメニューを作ってます。 2021-10-14 00:06:04
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) DataFrameにおいて, ハッシュタグのみを抽出 https://teratail.com/questions/364278?rss=all Pandasで以下のようなデータフレームがあります。 2021-10-14 00:05:31
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ウィンドウ間でのやりとり https://teratail.com/questions/364277?rss=all ウィンドウ間でのやりとり前提・実現したいことCでToDoアプリ的な物を作ろうとしているのですが、メインウィンドウから呼び出したサブウィンドウに入力したテキストをメインウィンドウのlistboxに渡して、サブウィンドウを閉じればメインウィンドウのlistboxにテキストが表示されているという状態を想像していたのですが何も表示されません。 2021-10-14 00:03:51
AWS AWSタグが付けられた新着投稿 - Qiita AWS SAM+Lambda+Goではじめるサーバーレスアプリケーション開発 https://qiita.com/sakeafterbeer/items/3dcd1800ae7f774931b8 HelloWorldアプリケーションについてWSLの設定Dockerの設定AWSCLIの設定SessionManagerプラグインの設定SAMとGoのインストールUbuntuの環境変数設定の自動化VSCodeの設定SAMプロジェクトの新規作成SAMプロジェクトのデプロイAWSコンソールから各サービスを確認HelloWorldアプリケーションについてHelloWorldアプリケーションは、SAMプロジェクトを新規作成するときに便利なサンプルプロジェクトです。 2021-10-14 00:01:07
Docker dockerタグが付けられた新着投稿 - Qiita docker-compose で TLSV1_ALERT_PROTOCOL_VERSION エラー 他多数 https://qiita.com/tommarute/items/9cc630cf7d99d3f8ffe6 sudosystemctlrestartdockerOptionalCOMPOSETLSVERSIONがsetされている場合はunset私はTLSVALERTPROTOCOLVERSIONが出たあとに設定していたので、unsetが必要でした。 2021-10-14 00:44:30
golang Goタグが付けられた新着投稿 - Qiita AWS SAM+Lambda+Goではじめるサーバーレスアプリケーション開発 https://qiita.com/sakeafterbeer/items/3dcd1800ae7f774931b8 HelloWorldアプリケーションについてWSLの設定Dockerの設定AWSCLIの設定SessionManagerプラグインの設定SAMとGoのインストールUbuntuの環境変数設定の自動化VSCodeの設定SAMプロジェクトの新規作成SAMプロジェクトのデプロイAWSコンソールから各サービスを確認HelloWorldアプリケーションについてHelloWorldアプリケーションは、SAMプロジェクトを新規作成するときに便利なサンプルプロジェクトです。 2021-10-14 00:01:07
Azure Azureタグが付けられた新着投稿 - Qiita AzureのVMで自身がVMで動いているかVMScaleSetで動いているか判断するにはIMDSが使える https://qiita.com/fukasawah/items/a8ff0322881307228077 次にVMSSでないときは起動してほしくないサービスのUnitファイルをいじります。 2021-10-14 00:01:18
海外TECH DEV Community How to Create a Single Page Application with React and Sanity https://dev.to/sanity-io/how-to-create-a-single-page-application-with-react-and-sanity-2ggl How to Create a Single Page Application with React and Sanity IntroductionHave you ever thought of building a single page application SPA with react amp Sanity In this guide I will take you on an exciting journey to build your first SPA with react and Sanity We will create a Food Catalog app that will contain various food items and categories to organize them by themselves All these categories and foods will be fetched from Sanity Here is the project GitHub repository you can clone or download the complete project You can also see the deployed app here Note This is a follow along kind of article You ll definitely have a good result if you build along Requirements PrerequisitesTo understand this guide and code along you should have Basic understanding of HTML CSS and JavaScriptAt least a little experience or knowledge of React and some of its hooks Node and npm or yarn installed on your computerBasic understanding of how the terminal works What is React React is an open source JavaScript library created for building fast and interactive user interfaces for web and mobile applications It is maintained by Facebook and a community of individual developers and companies React can be used for the development of single page or mobile applications React is a component based framework which means we ll be writing our code in small reusable pieces and putting them all together to make our website Understanding SPASPA stands for Single Page Application It is a web application or website that interacts with the user by dynamically rewriting the current page rather than loading entire new pages from the server In simpler terms it is an app that works inside a browser and does not require page reloading during use We ll also touch on how routing works in React and learn how to map different parts of our website to different views Setting up a React appFor this guide we will make use of create react app ーthe React recommended way to create a single page application To make use of create react app You ll need to have Node gt and npm gt on your machine To install run the following command npx create react app food catalog appAfter the installation you can move into the project s root directory to start the development server cd food catalog appnpm startWhen the dev server is ready you can view your project in the browser at http localhost Your project directory should look like this once the setup is complete Let s clean up the app by deleting files we don t need so we can get started building our app You can delete the following highlighted files Note This might throw an error so ensure you delete the logo svg import from App css and the index css reportWebVitals js import from index js To be sure your files look like mine exactly I pushed my setup files to this GitHub repository and you can clone it or cross check Using Tailwind CSSTailwindCSS is a utility first CSS framework used to build frontend applications Rather than adding obscure CSS classes to your code with TailwindCSS you use utility classes to create your components with as much control over every single styling as you want All without having to ever write a single line of CSS There are so many ways to make use of Tailwind CSS in React and other frameworks generally but for this guide we will be making use of the CDN In the src folder add the following CDN import to the App css file import url dist tailwind min css Once this is done we can now proceed to set up our sanity studio What is Sanity Sanity is a content platform that treats your structured content as data It comes bundled with an open source real time headless CMS that can be customized with JavaScript We ll be using the Sanity studio to manage our content and accessing it in our frontend through Sanity s out of the box API One of the key benefits of Sanity is that the content management interface or studio is open source and built to be built upon If you know React you can extend and customize it to your heart s content Getting started with Sanity setupTo start a new project with Sanity we ll install the Sanity CLI globally To do this you will need to have Node and npm installed npm install g sanity cliAs soon as the CLI finishes installing you ll be able to create a new project using it Run the following in the directory of the React project you just created i e food catalog app sanity initIf this is your first time this will log you into Sanity and then you will be able to create a project set up a dataset and generate files that are necessary to run the editing environment locally Note If you don t have an account Sanity will direct you on how to get one Or you could visit Sanity s website and create an account Once that is done you will be prompted to create a new project tap Enter Name your project food catalog studio and choose the default dataset configuration by typing Y Finally confirm the project path and choose a schema for your studio For this demo you ll need to start with the Clean project with no predefined schemas option To start the studio move to the folder by running the following command in the terminal cd studioNow you can start the studio with the following command sanity startAfter compiling the studio will open on http localhost and we will have something like this displayed because we choose clean project with no predefined schemas when setting up our studio Sanity studioThe Sanity Studio is an open source CMS built with React js that allows users to use toolkits and plugins to create the workflow that optimizes for how you want to work with content It offers rapid configuration and free form customization Creating a food catalog schema from scratchA schema describes the different field types in a document There are different types of schema you can choose from For this guide we will be creating two schemas one for the food categories and the other for food items The food schema will have properties such as food name food description food image and its category while the category schema will have the name image description and then a hex code field for creating dynamic styling When the studio starts up it looks for the schema js file in the schemas folder of your project For now since we don t have any schema you will find something like this in your schema js file First we must import the schema creatorimport createSchema from part sanity base schema creator Then import schema types from any plugins that might expose themimport schemaTypes from all part sanity base schema type Then we give our schema to the builder and provide the result to Sanityexport default createSchema We name our schema name default Then proceed to concatenate our document type to the ones provided by any plugins that are installed types schemaTypes concat Your types here All your schemas go into the types array by defining the schemas title name type and finally the fields For our foods schema we will be having something like this types schemaTypes concat Your types here title Foods name foods type document fields title Food Name name foodName type string validation Rule gt Rule required title A little description name foodDesc type text options maxLength validation Rule gt Rule required title Food Image name foodImage type image options hotspot true Category schema goes here Once you have done this save and now let s take a deeper look at the code above each object represents a field and must have a title name and type Title The display name for this fieldName The identifier for this field used in the API sType The type of this field e g string image e t c You can find the complete list of built in types here The second schema to create is the category schema which we ll add just below the foods schema object name category title Category type document fields title Title name title type string title Slug name slug type slug options source title maxLength title Description name description type text title Image name image type image options hotspot true title Hex Code name hexCode type string Save the file and you will see something like this One last thing to do will be to include a category in our foods schema It displays the category fetched from the category schema for you when filling in your foods To do that we will create a new field wherever in the array we want this field to be name category title Category type reference to type category Once you save your code and create a new document of type food in your studio you should see the categories field show up as expected Organizing our schemaLet s organize our schemas before loading them with foods and categories Having all our schemas in just one file will always work but can become very difficult to maintain when you have more schemas It is recommended to describe each document type in a separate file and import them into schema js like this First we must import the schema creatorimport createSchema from part sanity base schema creator Then import schema types from any plugins that might expose themimport schemaTypes from all part sanity base schema type import foods from foods import category from category Then we give our schema to the builder and provide the result to Sanityexport default createSchema We name our schema name default Then proceed to concatenate our document type to the ones provided by any plugins that are installed types schemaTypes concat foods category Looking deeper at the code above we imported two files that export the schemas and called them in the types array At this point your directory will look like this One last thing will be for us to load our studio with content which we will be fetching into the app This is totally up to you you can get lovely images from Unsplash Connecting Sanity with React AppLet s allow our frontend to query for and receive data from Sanity Connecting React to SanityThis is done by installing the sanity client package in our React project Then run this command npm install sanity client sanity image url sanity client ーSanity Client is the official JavaScript client by Sanity and can be used both in Node js and modern browsers sanity image url ーA helper library used to generate image URLs and perform helpful image transformations through the Sanity asset pipeline Read more on the official docs here Once these packages have been installed we ll create a new file named client js inside the src directory and add the following code to the client js file import sanityClient from sanity client export default sanityClient projectId Your Project ID Here find this at manage sanity io or in your sanity json dataset production this is from those question during sanity init Note To get your project ID visit click on the project so it displays full info about the project including the Project ID Ensure you save the file Connecting Sanity to ReactFinally You will also need to add the port where the React development server is running to the CORS origins of your Sanity project Visit and click on your Sanity project On your project s dashboard click on Settings →API settings and then add http localhost to the CORS origins field if it was not added automatically Once you save that will be all for our sanity studio we can now start building the front end of our app to consume the data from the sanity studio Building a food catalog applicationThe first thing to handle would be routing and this is usually handled in the App js file We ll be implementing this using react router dom and the Switch and Route components We will create a new folder in the src directory to put all our routes in this app We will have four routes views Home js The main index is where we will list all the categories fetched from the Sanity studio views Foods js This will contain a random list of all foods fetched from the Sanity studio views About js This is the about page of the application views FilteredFoods js This is an individual page containing foods related to a particular category Let s create the above files and our file directory will now look like this Let s now handle routing in the App js file In this file we will handle routing using React router This enables the navigation among views of various components in a React Application The first thing will be to install the React Router package using the command below npm install react router dom saveAfter installing react router dom add its components BrowserRouter Route Switch to the App js file You can now proceed to define your routes In the code below you will notice all the routes are wrapped in the Switch and BrowserRouter components The Switch component is used to render only the first route that matches the location rather than rendering all matching routes and the BrowserRouter is a router implementation that uses the HTML history API to keep your UI in sync with the URL It is the parent component that is used to store all the other components Learn more about routing in react here import BrowserRouter Route Switch from react router dom viewsimport Home from views Home import About from views About import Foods from views Foods import FilteredFoods from views FilteredFoods stylesimport App css function App return lt BrowserRouter gt lt Switch gt lt Route component Home exact path gt lt Route component About path About gt lt Route component Foods path Foods gt lt Route component FilteredFoods path FilteredFoods slug gt lt Switch gt lt BrowserRouter gt export default App You can confirm if the routes are working visiting the paths Now the next thing would be to work on the NavBar of our application Let s now create a folder and name its components in the src directory to house all our reusable components This would help organize our application In this folder we have about five different components but let s start with the Header section of our application Building the Header and footer SectionThe header section is going to house the application s logo and nav links while the footer section will contain footer text We mentioned earlier that React is all about components so let s make some components Header js This would be the overall container housing the Navbar import React from react import NavBar from NavBar const Header gt return lt header gt lt div className bg gray gt lt NavBar gt lt div gt lt header gt export default Header In the above code we created a functional component and then imported Navbar js components NavBar js This will contain the logo and all the navigation links import React from react import NavLink from react router dom const Header gt return lt nav className container lg px px py lg py lg w w full mx auto flex flex col lg flex row justify between h items center font bold gt lt NavLink to gt lt p className text xl lg text xl gt Yummy Food s lt p gt lt NavLink gt lt div className lg block gt lt ul className flex gap x gt lt li gt lt NavLink to exact className nav link activeClassName active link gt Home lt NavLink gt lt li gt lt li gt lt NavLink to foods className nav link activeClassName active link gt Foods lt NavLink gt lt li gt lt li gt lt NavLink to about className nav link activeClassName active link gt About lt NavLink gt lt li gt lt ul gt lt div gt lt nav gt export default Header For the links which we declared in App js to work we need to import NavLink from react router dom and then made use of NavLink in the navbar components Footer js This will contain the footer text which is very simple import React from react const Footer gt return lt div className bg gray flex justify center font bold p gt lt p gt Sanity Tutorial Guide by lt a href style color FEC gt amp nbsp Joel Olawanle lt a gt lt p gt lt div gt export default Footer The last thing will be to add Header js and Footer js files to our App js file making the app js file to now look like thisimport BrowserRouter Route Switch from react router dom viewsimport Home from views Home import About from views About import Foods from views Foods import FilteredFoods from views FilteredFoods componentsimport Header from components Header import Footer from components Footer stylesimport App css function App return lt BrowserRouter gt Header Area lt div className max w full gt lt Header gt lt div gt Route Area lt Switch gt lt Route component Home exact path gt lt Route component About path About gt lt Route component Foods path Foods gt lt Route component FilteredFoods path FilteredFoods slug gt lt Switch gt Footer Area lt div className max w full gt lt Footer gt lt div gt lt BrowserRouter gt export default App At this stage when you save the application will look like this You ll notice we have a Header and a Footer but no content Let s now work on the index page so it displays all our categories from Sanity Display all food categories on the Homepageimport React from react import Categories from components Categories const Home gt return lt section className container w full lg px px lg w mx auto gt lt div className flex lg flex row flex col my justify between gt lt div className gt lt h className text xl lg text xl font bold gt Hello lt h gt lt p className text xl lg text xl gt What do you want lt p gt lt div gt lt div className flex items center lg mt mt gap lg flex row flex col gt lt input type text className w full lg w p border border gray rounded focus outline none gt lt button style backgroundColor FEC className rounded w full lg w auto px py text white gt Search lt button gt lt div gt lt div gt lt hr className my gt lt Categories gt lt section gt export default Home In the code above we have a div containing welcome information and a search bar and then after that we imported a component called categories from the components folder To continue you will have to create a component and name it Categories js in the components folder This is where we will fetch all our food categories from Sanity either using GROQ or GraphQL For this guide we will make use of GROQ Please paste the following code in the Categories js file import React useState useEffect from react import sanityClient from Client import Category from Category const Categories gt const categories setCategories useState null useEffect gt sanityClient fetch type category title slug description image asset gt id url hexCode then data gt setCategories data catch console error return lt div className gt lt h className text xl font bold text center my lg my gt All Categories lt h gt lt div className flex flex col lg flex row lg justify center flex wrap w full gap my gt categories amp amp categories map category gt lt Category key category id category category gt lt div gt lt div gt export default Categories The above code might seem tricky since we are now fetching data from our Sanity but I will explain Let s first understand what GROQ is all about GROQ Graph Relational Object Queries is a declarative language designed to query collections of largely schema less JSON documents Note If you re not yet familiar with GROQ which is used to query Sanity for data check the official docs here Explaining the code The first thing we did was to import Sanity Client which we installed earlier import sanityClient from Client In react we make use of some hooks to query for data For this guide we will make use of useState and useEffect The useState is a Hook that allows you to have state variables in functional components while useEffect lets you perform side effects in function components To make use of these two hooks you have to import them from react and that s what we did in the first line alongside react which is necessary import React useState useEffect from react We can now set our statesconst categories setCategories useState null Note This follows a common pattern where categories is where we access the current value of that particular piece of state while setCategories is our method for setting or changing it To fetch data information from Sanity studio you can make use of GROQ let s now explore our Groq Query useEffect gt sanityClient fetch type category title slug description image asset gt id url hexCode then data gt setCategories data catch console error This query is searching through your Sanity data store or Content Lake for a schema that has a type of category this is the name of the schema and then gets the title slug description e t c Reading further through our code you ll notice that we are looping through our categories array and mapping each item to an instance of our Category component categories amp amp categories map category gt lt Category key category id category category gt In the category js file paste the code below and saveimport React from react import Link from react router dom import sanityClient from Client import imageUrlBuilder from sanity image url const builder imageUrlBuilder sanityClient function urlFor source return builder image source const Category category gt return lt div className bg gray rounded xl p w full lg w style backgroundColor category hexCode gt lt img src urlFor category image url alt category title className w gt lt h className text xl py font bold capitalize gt category title lt h gt lt p gt category description lt p gt lt Link to filteredfoods category slug current gt lt button style backgroundColor FEC className rounded mt px py text white gt View lt button gt lt Link gt lt div gt export default Category In the above code we imported imageUrlBuilder from sanity image url which we use to generate image URLs for our images by creating a method called UrlFor and making use of it inside the template This helps us get thumbnail sized images compared to the regular size of images uploaded to Sanity Note A lot of things can be done with imageUrlBuilder such as specifying width and height You can read more about imageUrlBuilder here Once you save you will notice the homepage index page now looks like this depending on the data you entered into your studio Display all foods on Food s pageJust as we were able to display all categories on the home page we will also use the same approach to display all foods on the foods page In the views Foods js paste the code below import React useState useEffect from react import Link from react router dom import sanityClient from Client import imageUrlBuilder from sanity image url const builder imageUrlBuilder sanityClient function urlFor source return builder image source import foodImage from images protein jpg const Foods gt const foods setFoods useState null useEffect gt sanityClient fetch type foods id foodName foodDesc foodImage asset gt id url category gt title then data gt setFoods data catch console error return lt section className container w full lg px px lg w mx auto min h screen gt lt div className flex lg flex row flex col my justify center gt lt div className flex items center lg mt mt gap lg flex row flex col gt lt input type text className w full lg w p border border gray rounded focus outline none gt lt button style backgroundColor FEC className rounded w full lg w auto px py text white gt Search lt button gt lt div gt lt div gt lt hr className my gt lt div className my gt lt h className text xl font bold text center my lg my gt All Foods lt h gt lt div className grid grid cols lg grid cols gap gt foods amp amp foods map food gt lt div className bg gray rounded shadow xl p std border key food foodName gt lt div className flex flex col items center gt lt img src urlFor food foodImage width url alt food title className rounded full object cover w h border shadow inner std border gt lt h className text xl pt font bold capitalize gt food foodName lt h gt lt Link to filteredfoods food category title gt lt small className uppercase text gray font semibold gt food category title lt small gt lt Link gt lt div gt lt p className mt gt food foodDesc lt p gt lt div gt lt div gt lt div gt lt section gt export default Foods In the code above We are simply fetching all the foods from the foods schema of our sanity studio Once you save you will get something like this depending on what you have in your sanity studio Finally let s take a look at something very important you will notice some links in the foods page and home page which are supposed to take us to a dynamic route Let s now see how it works Create dynamic routes for each categoryTo create a dynamic route we will be making use of a component We will be making use of the FilteredFoods js page and if you recall when we were declaring routes we added a slug to the route of this page lt Route component FilteredFoods path FilteredFoods slug gt We will get that slug via useParams which we would import into this component In the FilteredFoods js component paste the code below import React useState useEffect from react import useParams Link from react router dom import sanityClient from Client import imageUrlBuilder from sanity image url const builder imageUrlBuilder sanityClient function urlFor source return builder image source const Foods gt const filteredFoods setFilteredFoods useState null const slug useParams useEffect gt sanityClient fetch type foods amp amp category ref in type category amp amp title slug id id foodName foodDesc foodImage asset gt id url category gt title then data gt setFilteredFoods data catch console error slug return lt section className container w full lg px px lg w mx auto min h screen gt lt div className flex lg flex row flex col my justify center gt lt div className flex items center lg mt mt gap lg flex row flex col gt lt input type text className w full lg w p border border gray rounded focus outline none gt lt button style backgroundColor FEC className rounded w full lg w auto px py text white gt Search lt button gt lt div gt lt div gt lt hr className my gt lt div className my gt lt h className text xl font bold text center my lg my gt All Foods lt h gt lt div className grid grid cols lg grid cols gap gt filteredFoods amp amp filteredFoods map food gt lt div className bg gray rounded shadow xl p std border key food foodName gt lt div className flex flex col items center gt lt img src urlFor food foodImage asset url width url alt className rounded full object cover w h border shadow inner std border gt lt h className text xl pt font bold capitalize gt food foodName lt h gt lt Link to filteredfoods food category title gt lt small className uppercase text gray font semibold gt food category title lt small gt lt Link gt lt div gt lt p className mt gt food foodDesc lt p gt lt div gt lt div gt lt div gt lt section gt export default Foods The code above can be quite tricky but I will explain everything in plain words The first thing we did was to import useParams which would enable us to get the slugconst slug useParams Once that is successful we can now query our sanity studio but this time around the query is quite different To get a feeling for queries in GROQ you can check their cheat sheet here Once you save this code you will now be able to access dynamic routes via the Link declared either in the home page or foods page lt Link to filteredfoods category slug current gt lt button style backgroundColor FEC className rounded mt px py text white gt View lt button gt lt Link gt By now the whole application should be working fine and fast without reloading the browser we have not yet added any information to the About page you can paste the code below so we are sure everything is complete import React from react import foodsAboutImg from images foods abt img jpg const About gt return lt section className container w full lg px px lg w mx auto min h screen gt lt div className mt gt lt h className text xl font bold text center my lg my gt About Us lt h gt lt div className flex gap justify center items center flex col lg flex row mt gt lt div className gt lt img src foodsAboutImg className w rounded xl lg rounded l xl alt gt lt div gt lt div className w full lg w flex gap mb lg mb flex col gt lt p gt A healthy diet rich in fruits vegetables whole grains and low fat dairy can help to reduce your risk of heart disease by maintaining blood pressure and cholesterol levels High blood pressure and cholesterol can be a symptom of too much salt and saturated fats in your diet lt p gt lt p gt Many healthful foods including vegetables fruits and beans are lower in calories than most processed foods lt p gt lt p gt Children learn most health related behaviors from the adults around them and parents who model healthful eating and exercise habits tend to pass these on lt p gt lt div gt lt div gt lt div gt lt section gt export default About This might throw an error due to the image imported Feel free to use another image or get the image from this GitHub repository Congratulations We now have our application running smoothly offline You can decide to deploy your application online so that others can access it easily ConclusionIn this guide we built a single page application with React Tailwind CSS and Sanity This guide will help you set up your own version of this project You can also improve on it by adding implementing certain features and functionalities Here are a few ideas to get you started Add Search functionality to the search field making use of foods Style the app using UI libraries like Vuetify BootstrapVue or standard CSS Make certain fields of the schema required and play with other field types Useful resourcesHeadless CMS explained in minutesMake a Progressive Web App with ReactBuild a Portfolio Website With React amp Sanity ioSanity io Crash Course Headless CMSHappy coding 2021-10-13 15:38:52
海外TECH DEV Community How to receive Slack notification when somebody sends a Contact form (or any form) — No code — No Backend with ActionForms.io https://dev.to/magarrent-org/how-to-receive-slack-notification-when-somebody-sends-a-contact-form-or-any-form-no-code-no-backend-with-actionformsio-4cn9 How to receive Slack notification when somebody sends a Contact form or any form ーNo code ーNo Backend with ActionForms ioAs a developer or web designer when you create a web form you need to specify some action The action is a URL or endpoint that your form will be sent Meaning that you need a backend code that receives your form and send you email notifications saves the data and something else But what happens if I don t know how to create a backend Or what happens if I don t wanna create backend for a simple form For that reason I ve created ActionForms io ActionForms io is a No code ー No backend Form sender for developers With ActionForms io you can easily send your contact forms surveys questions any form or request that you can imagine without coding or configuring a backend How can I get Slack notifications from my Contact Forms First of all you need an ActionForms io account it s really simple and there is a free plan if you want to try it Then you have to create an “Endpoint An Endpoint is a URL where your requests will be sent to the ActionForms io platform When you log in to your account you ll see a button that you can create Unlimited Endpoints Let s begin writing the basic information for the Endpoint we need a Name What you want Ex Contact form ー Website and the URL slug Good Now we have an active endpoint ready to receive form requests If we look into our Endpoint Edit page we ll see the Slack Notifications menu let s click it How to configure Slack Notifications Webhook in ActionForms ioWe are at the Slack Notifications configuration page We only need one thing Webhook Url How can I get the Slack Webhook Url We have three steps tutorial inside the same configuration page but let me show you how to do it First of all we need to click on this link This link will redirect us to a Slack page that will ask us to install an App to our Slack workspace This app is called Incoming Webhooks and allows you to receive notifications via Slack from external sources like ActionForms io If you are already logged in to your Slack workspace then click Add to Slack button to install Incoming Webhooks in your workspace Select the channel to receive notificationsAfter installing Incoming Webhooks in just one click you need to choose the Channel that you will receive the incoming notifications You can create a channel specifically to receive notifications or just select what you want Good just one more step Once you selected the channel you ll see the Webhook URL right there Just copy this Webhook URL into ActionForms io page that we opened before Endpoint gt Slack notifications And that s it Save it and you can test your notifications using the button “Send test Request that just appears at the top of the page And…how much it will cost me Right now we have to different plans Free and Premium Our free plan is completely functional and you can use it in all your projects Our Premium plan has a lot of potential features you ll have unlimited power and perform incredible web flows throw your form requests Stop HERE If you are here you ll have a huge discount use this code to have a lifetime discount “MEDIUMMAGARRENT Thank you for reading this post I m Marc founder of ActionForms io follow me on Twitter magarrentAlso we have a Discord server available for our users that we share suggestions and questions about the platform feel free to Join us here Marc ActionForms io 2021-10-13 15:34:56
海外TECH DEV Community Image Processing is Easier than you Thought! (Getting started with Python Pillow) https://dev.to/saharshlaud/image-processing-is-easier-than-you-thought-getting-started-with-python-pillow-329k Image Processing is Easier than you Thought Getting started with Python Pillow We live in a digital world today with data flowing all around us We come across lots of digital images which has made digital image processing very beneficial for us since it allows us to enhance an image and helps in the extraction of useful information from these images Python is a general purpose programming language that provides many image processing libraries for adding image processing capabilities to digital images Some of the most common image processing libraries in Python are OpenCV Python Imaging Library PIL Scikit image etc The Python Imaging Library PIL is also known as Pillow in the newer versions although Pillow has forked the PIL repository and added Python x Support The following steps are generally followed while processing an image Importing the image via image acquisition tools Analyzing and manipulating the image Output can be an altered image or a report based on that image PIL is the best option for performing simple image processing such as resizing scaling rotation trimming partial cutout and applying various filters to an image since it is simpler and easier to understand than other libraries such as OpenCV It comes with support for a wide variety of image formats such as “jpeg “png “gif “ppm “tiff etc which makes image processing relatively easier Today we shall take a deep dive into Python PIL and its features along with the code implementation Installation Windows We can install pillow using pip on Windows systems Just run the below command in your command prompt window ​pip install pillow or easy install Pillow MacOS To install Pillow on MacOS run the following code on your Bash terminal sudo pip install Pillow Linux To install Pillow on Linux machines simply use sudo pip install Pillow Loading an image For loading an image firstly we need to import the Image from PIL and then call the Image open function passing the image path A value of the Image object data type is returned by the Image open function and this image object can be used to perform various image manipulations with the help of other methods All the modifications made to the image object can be saved to an image file with the save method The show method displays the image that has been loaded in the image object importing the modulefrom PIL import Image opening the image stored in the local path im Image open D Image Kingfisher jpg im show Output Basic Image Properties We can find the basic properties of the image such as size width height format and mode using different functions in the Image module importing the modulefrom PIL import Image im Image open D Image Kingfisher jpg Find image dimensions i e width and heightprint Image size im size Find the image formatprint Image format im format Find the image mode i e RGB RGBA HSV etc print Image mode im mode Output Image size Image format JPEGImage mode RGB Converting image into other formats ​​We can easily convert one image into other format using the save method in Image module This method takes two arguments first the name of the new file and second the format into which we want to convert the image importing the modulefrom PIL import Image im Image open D Image Kingfisher jpg Changing image format and saving the new imageim save Kingfisher png png Output The following is the image with changed format Cropping images The Image crop method helps in cropping the image and we can specify the dimensions of the crop The crop method takes a valued tuple defining the left upper right and lower pixel coordinates importing the modulefrom PIL import Image im Image open D Image Kingfisher jpg Cropping the loaded image using crop img crop im crop img crop show Output Rotating images The Image rotate function can be used to rotate an image It takes the rotation degree value as a parameter and returns a rotated copy of the image from PIL import Imageim Image open D Image Kingfisher jpg Rotating image using rotate function by degrees img rotate im rotate img rotate save Kingfisher Rotated jpg Output Resizing images The Image resize function can be used to resize an image to required height and width The function takes width and height as a tuple and returns an image object of resized format from PIL import Imageim Image open D Image Kingfisher jpg Resizing an image using resize function img resize im resize img resize show Output Blur an image The ImageFilter module consists of definitions for a pre defined set of filters These filters can be used with the filter method and we can even blur an image by applying ImageFilter BLUR on the original image The filter function then returns an image object that contains the blurred copy of the original image importing Image and ImageFilter modulesfrom PIL import Image ImageFilter im Image open D Image Kingfisher jpg Applying blur operation on the imageimg blur im filter ImageFilter BLUR img blur show Output Grayscale Image The Image convert method allows us to convert colored images into grayscale images black and white importing Image and ImageFilter modulesfrom PIL import Image ImageFilter im Image open D Image Kingfisher jpg grayscale im convert L grayscale show Output Image enhancement filters The ImageFilter module contains various filters that can be used for image enhancement such as CONTOUR DETAIL EDGE ENHANCE EMBOSS SMOOTH SHARPEN etc Some of these filters are displayed below importing modulesfrom PIL import Image ImageFilterim Image open D Image Kingfisher jpg Applying filtersimg im filter ImageFilter CONTOUR img im filter ImageFilter EMBOSS img show img show Output Contour filter Emboss filter Drawing on image Using the ImageDraw module we can easily draw simple D graphics on top of existing Image objects After importing the ImageDraw module we simply create an ImageDraw Draw object passing the Image object as the parameter Then we can we can draw various objects such as line rectangle circle triangle etc using the inbuilt functions Here we have drawn a rectangle on the existing image The rectangle function takes three parameters the position of the four corner points the outline color and the fill color values importing required modulesfrom PIL import Image ImageDrawim Image open D Image Kingfisher jpg draw ImageDraw Draw im Drawing a rectangle using rectangle method draw rectangle fill red outline blue im show Output Getting RGB values The ImageColor module consists of functions relating to RGB manipulation ImageColor getrgb method converts a color value passed as a string into the equivalent RGB format It takes the color string as an input and returns a tuple of RGB values importing ImageColor modulefrom PIL import ImageColorim ImageColor getrgb ff print im im ImageColor getrgb yellow print im Output We can even create a new image consisting of given RGB color value using the new and getrgb method importing required modulesfrom PIL import Image ImageColorimg Image new RGB ImageColor getrgb FF img show Output Last words This was all about the Python Imaging Library and its basic functionalities The PIL library makes it relatively easy to adjust and process images according to our requirements with just a few lines of code Now what are you waiting for Go ahead and get started with your image processing journey Hope you enjoyed my blog Thanks for reading Feel free to comment share and reach out to me on Dev to Twitter or LinkedIn 2021-10-13 15:14:56
海外TECH DEV Community Five Laws of Software Everyone Should Know https://dev.to/scottshipp/five-laws-of-software-everyone-should-know-5041 Five Laws of Software Everyone Should KnowIn no particular order here are five Laws of Software everyone should know The Law of Software EntropyThe Law of Software Entropy is a metaphorical corollary to the Second Law of Thermodynamics In a nutshell it tells us that software rots over time Even a stable piece of software that has few bugs will eventually deteriorate into a bug ridden money pit if left alone It could be due to security vulnerabilities found in dependencies or incompatibilities with new hardware but entropy is an unavoidable property of software Conway s LawAny organization that designs a system defined broadly will produce a design whose structure is a copy of the organization s communication structure Melvin Conway Conway s Law is the fascinating observation that how a software organization splits out into teams is eventually mirrored in how the resulting software is structured This has widespread implications for companies and open source communities who need to tackle problems at scale but want to avoid duplicate work Cross functional software teams are one attempt to offset Conway s Law A cross functional team incorporates all necessary skillsets within one team and therefore causes loose coupling of the resulting application or service to the rest of the platform Brooks s LawBrooks s Law is Fred Brooks s famous observation that late software projects are only further delayed by adding additional developers There is a relationship with Conway s Law here since both laws are true from the same underlying cause adding more people or teams to a software project always multiplies the amount of communication necessary to achieve each task If you have n teams n communication paths exist And since communication is the engine of product delivery it is a case of less is more Hofstadter s LawOf course another related law is Hofstadter s Law It always takes longer than you expect even when you take into account Hofstadter s Law I can t remember where I first read or heard it but I was given the following formula for making estimates when I was a young programmer Take the amount of time you think it will take say two weeks Double it two four weeks Increase the unit of measure four weeks months I believe this formula is an attempt to incorporate Hofstadter s Law into estimations The Law of DemeterThe Law of Demeter is concerned with classic software engineering ideas like encapsulation loose coupling and high cohesion It consists of three guidelines Each unit of code should have only limited knowledge about other units only units closely related to the current unit Each unit should only talk to its friends don t talk to strangers Only talk to your immediate friends A common example of a Law of Demeter violation is as follows Suppose you are at the store checking out Does the clerk ask for your wallet or your money If the clerk asked for your wallet and then took the money out for you user getWallet getMoney amount then it s a classic violation of the Law of Demeter In a nutshell this works out to the loose guideline that you should be wary any time there is more than one dot in any statement involving an object Notice the two dots in user getWallet getMoney amount Some have proposed that the Law of Demeter is really only a heuristic you can use to detect a code smell rather than being an actual law Nevertheless it is commonly known as the Law of Demeter anyway And that s five of the more well known laws of software Photo by Taylor Wilcox on Unsplash 2021-10-13 15:05:27
Apple AppleInsider - Frontpage News Get up to $1,500 for your used Apple device ahead of new MacBook Pros https://appleinsider.com/articles/21/10/13/get-up-to-1500-for-your-used-apple-device-ahead-of-new-macbook-pros?utm_medium=rss Get up to for your used Apple device ahead of new MacBook ProsWith new MacBook Pro models expected to debut during the Oct Apple Event now is the time to lock in a quote for your used Mac iPad Apple Watch or iPhone at Adorama Adorama s trade in program offers competitive values for pre owned Apple devices freeing up cash that can be used to upgrade to a new computer at the Apple Authorized Reseller With new MacBook Pros expected to debut this month there s no time like the present to get an instant quote for your Mac iPad Apple Watch or iPhone And since Adorama s trade in program is powered by Phobio one of Apple s official trade in partners you can rest assured your used device will be handled in a secure and environmentally friendly manner Read more 2021-10-13 15:16:06
海外TECH Engadget Anker's audio glasses pair swappable frames with 'surround' sound for $200 https://www.engadget.com/anker-soundcore-frames-audio-glasses-154554875.html?src=rss Anker x s audio glasses pair swappable frames with x surround x sound for Anker is jumping into the increasingly crowded world of audio eyewear The company s Soundcore brand has introduced Soundcore Frames glasses that promise stealthy music playback and calls The hook in this case is style ーSoundcore is offering your pick of ten reasonably fashionable frames you can swap in and out depending on your mood or lens needs including prescription polarized and blue light filtering lenses You ll also get quot surround quot sound with speakers in front of and behind the ears noise reduction including an anti leak private listening mode and a mix of touch and voice based controls You won t use these all day with hours of music listening although a minute charge is enough to provide another hours They re IPX water resistant so you at least won t have to worry about a the rain The Soundcore Frames will be available in November for Extra frames will cost another each That s not a spectacular price for audio glasses but the style is sharp enough that you might not mind the outlay ーespecially if you aren t looking for smart glasses 2021-10-13 15:45:54
海外TECH Engadget Reddit's new 'predictions' feature turns polls into a game https://www.engadget.com/reddit-predictions-150040687.html?src=rss Reddit x s new x predictions x feature turns polls into a gameReddit has launched a new feature called Predictions which can make polls more fun by giving you tokens to bet with The website has been testing the feature for a year and now that it s widely available community mods and mod approved users will be able to create Predictions Tournaments with a series of questions that challenges you to predict the outcome of an event or conversation nbsp You ll get tokens for free when you join a tournament which can consist of as many questions as a moderator wants ーthey can add more even after the tournament has started When you vote for the prediction you want you ll have to bet some of the tokens you get after you joined How to distribute those tokens is totally up to you and you will win more on top of the ones you used for every correct prediction The larger the number of tokens you put in the more you can win However you ll have to make your tokens last throughout the tournament and there s no way to get more if it turns out that your prediction game is weak It s a totally user driven experience since the tournament s creator will also be in charge of resolving the outcome and making sure you get your winnings So what do you get for correct predictions aside from winning tokens Mostly recognition in the form of a leaderboard Tokens are only for use in the Prediction experience so you can t really do anything with them on the website Reddit will start rolling out the feature today and it will be available for all communities with at least members nbsp Reddit 2021-10-13 15:00:40
Cisco Cisco Blog Between meeting human needs and building a sustainable future, there is a bridge. https://blogs.cisco.com/networking/between-meeting-human-needs-and-building-a-sustainable-future-there-is-a-bridge Between meeting human needs and building a sustainable future there is a bridge Greenbuild gave Cisco the ability to connect with thousands of green building and proptech professionals giving us insight into the technologies that will help guide us all into the future 2021-10-13 15:39:23
Cisco Cisco Blog 6 Things Partners Can Do Now to Prepare for 5G Tomorrow https://blogs.cisco.com/partner/6-things-partners-can-do-now-to-prepare-for-5g-tomorrow Things Partners Can Do Now to Prepare for G TomorrowToday G is largely focused on consumer applications but over the next few years it s expected to become much more prevalent by enabling enterprise and IOT driven use cases Here are six actions that you and your company can start working on today to be well positioned to deliver G enabled outcomes 2021-10-13 15:00:59
海外科学 NYT > Science Live Updates: William Shatner Completes Trip to Space Aboard Blue Origin Rocket https://www.nytimes.com/live/2021/10/13/science/blue-origin-william-shatner Live Updates William Shatner Completes Trip to Space Aboard Blue Origin RocketThe actor who played Captain Kirk and three others went to the edge of space in a tourist spacecraft built by Jeff Bezos company 2021-10-13 16:00:24
海外科学 NYT > Science W.H.O Names Advisory Group to Study Origin of Covid Pandemic https://www.nytimes.com/2021/10/13/science/who-coronavirus-origins.html international 2021-10-13 15:45:06
海外科学 NYT > Science How Much Does it Cost to Fly to Space with Blue Origin? https://www.nytimes.com/2021/10/13/science/space/blue-origin-ticket-cost.html origin 2021-10-13 15:12:04
海外科学 NYT > Science William Shatner Becomes the Oldest Person to Reach Space https://www.nytimes.com/2021/10/13/science/william-shatner-space.html becomes 2021-10-13 15:18:33
海外科学 NYT > Science Many 'Star Trek' Fans Are Eager to See William Shatner Go to Space https://www.nytimes.com/2021/10/13/science/star-trek-captain-kirk-william-shatner.html Many x Star Trek x Fans Are Eager to See William Shatner Go to SpaceThe series longtime viewers said they were excited to see the man who played Captain Kirk make science fiction seem a bit more real 2021-10-13 15:35:13
海外科学 NYT > Science Who Are William Shatner's Crewmates Aboard the Blue Origin Launch? https://www.nytimes.com/2021/10/13/science/space/blue-origin-crew-new-shephard.html launch 2021-10-13 15:36:01
海外科学 BBC News - Science & Environment Star Trek's William Shatner blasts into space on Blue Origin rocket https://www.bbc.co.uk/news/science-environment-58885555?at_medium=RSS&at_campaign=KARANGA classic 2021-10-13 15:22:13
金融 RSS FILE - 日本証券業協会 株主コミュニティの統計情報・取扱状況 https://www.jsda.or.jp/shiryoshitsu/toukei/kabucommunity/index.html 株主コミュニティ 2021-10-13 15:30:00
金融 金融庁ホームページ 金融審議会「資金決済ワーキング・グループ」(第1回)議事次第について公表しました。 https://www.fsa.go.jp/singi/singi_kinyu/shikinkessai_wg/shiryou/shikinkessai_wg1.html 金融審議会 2021-10-13 17:00:00
金融 金融庁ホームページ 金融安定理事会によるG20財務大臣・中央銀行総裁へのレターについて掲載しました。 https://www.fsa.go.jp/inter/fsf/20211013_1/20211013.html 中央銀行 2021-10-13 17:00:00
ニュース ジェトロ ビジネスニュース(通商弘報) 9月の自動車市場、電力制限や半導体不足で前年同月比減少続く https://www.jetro.go.jp/biznews/2021/10/75a642fe1c893d3e.html 電力 2021-10-13 15:30:00
ニュース ジェトロ ビジネスニュース(通商弘報) 中央準備銀行、インフレ率上昇に伴い政策金利を1.50%に引き上げ https://www.jetro.go.jp/biznews/2021/10/bd221612a4ddfb94.html 引き上げ 2021-10-13 15:20:00
ニュース ジェトロ ビジネスニュース(通商弘報) 2050年に水素輸出50億ドル目指す、政府がロードマップ発表 https://www.jetro.go.jp/biznews/2021/10/b872510c3ab96e37.html 輸出 2021-10-13 15:10:00
ニュース BBC News - Home Brexit: Most NI checks on British goods to be scrapped https://www.bbc.co.uk/news/uk-northern-ireland-58871221?at_medium=RSS&at_campaign=KARANGA foreign 2021-10-13 15:10:27
ニュース BBC News - Home Toy shops warn of Christmas shortages amid port delays https://www.bbc.co.uk/news/business-58895246?at_medium=RSS&at_campaign=KARANGA right 2021-10-13 15:53:30
ニュース BBC News - Home Star Trek's William Shatner blasts into space on Blue Origin rocket https://www.bbc.co.uk/news/science-environment-58885555?at_medium=RSS&at_campaign=KARANGA classic 2021-10-13 15:22:13
ニュース BBC News - Home Russia denies weaponising energy amid Europe gas crisis https://www.bbc.co.uk/news/world-europe-58896847?at_medium=RSS&at_campaign=KARANGA europe 2021-10-13 15:06:28
ニュース BBC News - Home David Brooks: Wales and Bournemouth midfielder diagnosed with cancer https://www.bbc.co.uk/sport/football/58903956?at_medium=RSS&at_campaign=KARANGA cancer 2021-10-13 15:35:56
ニュース BBC News - Home NHS Covid Pass: Vaccine records access restored after outage https://www.bbc.co.uk/news/technology-58901435?at_medium=RSS&at_campaign=KARANGA status 2021-10-13 15:22:34
ニュース BBC News - Home Covid-19 in the UK: How many coronavirus cases are there in my area? https://www.bbc.co.uk/news/uk-51768274?at_medium=RSS&at_campaign=KARANGA cases 2021-10-13 15:41:29
サブカルネタ ラーブロ 葛西「麺屋永吉」踊るマハラジャまぜそば http://feedproxy.google.com/~r/rablo/~3/Wzz0DQBX_do/single_feed.php 東京都江戸川区 2021-10-13 16:00:49
北海道 北海道新聞 立憲・共産、道内3選挙区も一本化で合意 衆院選 https://www.hokkaido-np.co.jp/article/599738/ 市民団体 2021-10-14 00:08:18

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

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

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