投稿時間:2022-04-17 07:08:50 RSSフィード2022-04-17 07:00 分まとめ(10件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
Google カグア!Google Analytics 活用塾:事例や使い方 音声配信はバズらないからイイ https://www.kagua.biz/marke/podcast/20220417a1.html 音声配信はバズらないからイイYouTubeでもTwitterでも、SNSであればバズりを期待したいと思う人は多いのではないでしょうか。 2022-04-16 21:00:53
Docker dockerタグが付けられた新着投稿 - Qiita 初心者がLaravelでWebサービスを作るまで https://qiita.com/YumaProgram/items/6a635d406b0a957803cf portsarenotavailable 2022-04-17 06:46:11
海外TECH DEV Community Multi-Step Form with React & Formik https://dev.to/sinhapiyush/multi-step-form-with-react-formik-2i52 Multi Step Form with React amp FormikNowadays multi step form is the way to go if one needs to collect detailed user data Why because allowing users to complete their information in smaller chunks is less intimidating for them In this tutorial we ll learn how to build a multi step form with React amp Formik Getting StartedClone the starter code cra w needed dependencies to code along with me Building StepperA stepper is an important component to show the progress How about a design like this Let s begin with creating a component Stepper js amp later import in our App js As we can see in the image above we need circular divs connected to each other amp positioned horizontally The code goes like this Stepper jsimport React useContext useEffect from react function Stepper return lt div className w flex flex row items center justify center px py gt lt div className stepper item w h text center font medium border rounded full gt lt div gt lt div className flex auto border t gt lt div gt lt div className stepper item w h text center font medium border rounded full gt lt div gt lt div className flex auto border t gt lt div gt lt div className stepper item w h text center font medium border rounded full gt lt div gt lt div gt export default Stepper w flex flex row items center justify center px py flex layout w children at center amp positioned horizontally will take up rd of App s width amp has some padding w h text center font medium border rounded full equal width amp height center aligned text sets border radius to a very high value px to produce perfect circle corners border width as px flex auto border t sizes based on initial width height properties but makes it fully flexible so that it absorb any extra space along the main axis border top width as px Importing in App js App jsimport Stepper from components Stepper function App return lt div className w screen h screen flex flex col items center justify start gt lt Stepper gt lt div gt export default App w screen h screen flex flex col items center justify start flex layout w children centered horizontally amp positioned vertically at top will take up vw as width amp vh as height At this moment this is how it looks Now we know that stepper need to indicate the progress of the flow We can think of having an index which will be passed to stepper amp stepper will appear accordingly As the index will be updated by the steps as the flow moves forward we can make use of Context here FYI Context provides a way to pass data through the component tree without having to pass props down manually at every level Source Let s create a context in App js which passes down the information of active step App jsimport createContext useState from react import Stepper from components Stepper export const FormContext createContext function App const activeStepIndex setActiveStepIndex useState return lt FormContext Provider value activeStepIndex gt lt div className w screen h screen flex flex col items center justify start gt lt Stepper gt lt div gt lt FormContext Provider gt export default App export const FormContext createContext creating a context object const activeStepIndex setActiveStepIndex useState having a state variable which holds the information of the active step lt FormContext Provider value activeStepIndex gt using the provider to pass the values down the tree Now let s consume this context in our consumer component i e Stepper js and use that value to render stepper accordingly Stepper jsimport React useContext useEffect from react import FormContext from App function Stepper const activeStepIndex useContext FormContext useEffect gt const stepperItems document querySelectorAll stepper item stepperItems forEach step i gt if i lt activeStepIndex step classList add bg indigo text white else step classList remove bg indigo text white activeStepIndex return lt div className w flex flex row items center justify center px py gt lt div className stepper item w h text center font medium border rounded full gt lt div gt lt div className flex auto border t gt lt div gt lt div className stepper item w h text center font medium border rounded full gt lt div gt lt div className flex auto border t gt lt div gt lt div className stepper item w h text center font medium border rounded full gt lt div gt lt div gt export default Stepper const activeStepIndex useContext FormContext accepts the context object and returns the current context value useEffect gt const stepperItems document querySelectorAll stepper item stepperItems forEach step i gt if i lt activeStepIndex step classList add bg indigo text white else step classList remove bg indigo text white activeStepIndex Here we will loop through all the stepper items and add styles to the divs representing current amp completed steps As the dependency array in useEffect is the current context value activeStepIndex the code inside the hook is triggered the moment step is changed So this is how it looks say the nd step is active Building Multi Step FormWe will have a Step component which will render the content as per the index Think of it like a container Let s code it Step jsimport React useContext from react import FormContext from App import Basic Success Workspace from Forms function Step const activeStepIndex useContext FormContext let stepContent switch activeStepIndex case stepContent lt Basic gt break case stepContent lt Workspace gt break case stepContent lt Success gt break default break return stepContent export default Step I think the code is pretty clear what it s trying to do It takes the current context value and renders the specific form So now let s build the forms which were imported in our Step component Let s start with the first one Basic Basic jsimport ErrorMessage Field Form Formik from formik import React useContext from react import FormContext from App import as yup from yup function Basic const activeStepIndex setActiveStepIndex formData setFormData useContext FormContext const renderError message gt lt p className italic text red gt message lt p gt const ValidationSchema yup object shape name yup string required email yup string email required return lt Formik initialValues name email validationSchema ValidationSchema onSubmit values gt const data formData values setFormData data setActiveStepIndex activeStepIndex gt lt Form className flex flex col justify center items center gt lt div className text xl font medium self center mb gt Welcome lt div gt lt div className flex flex col items start mb gt lt label className font medium text gray gt Name lt label gt lt Field name name className rounded md border p placeholder John Doe gt lt div gt lt ErrorMessage name name render renderError gt lt div className flex flex col items start mb gt lt label className font medium text gray gt Email lt label gt lt Field name email className rounded md border p placeholder john doe gmail com gt lt div gt lt ErrorMessage name email render renderError gt lt button className rounded md bg indigo font medium text white my p type submit gt Continue lt button gt lt Form gt lt Formik gt export default Basic Let s walkthrough the code above We re using a Formik component as the root component of our Basic component This component takes props a set of initial values a validation schema and a callback function to be triggered when the form is submitted In addition to the Formik component Formik provides the Form Field and ErrorMessage components which all work together to handle form state events validation based on the object schema provided by Yup and display of validation errors This allows us to focus on the structure of the form and the submission process When form is submitted we first update the formData state variable with the input values and then increment the activeStepIndex by The Step component will receive the current value of activeStepIndex i e and render the nd form Also Stepper gets updated Remember to update App js to render the Step component and also pass some needed values down the tree setActiveStepIndex function to update the activeStepIndex formData a state variable to hold the submitted answers and setFormData a function to update the formData App jsimport createContext useState from react import Step from components Step Step import Stepper from components Stepper export const FormContext createContext function App const activeStepIndex setActiveStepIndex useState const formData setFormData useState return lt FormContext Provider value activeStepIndex setActiveStepIndex formData setFormData gt lt div className w screen h screen flex flex col items center justify start gt lt Stepper gt lt Step gt lt div gt lt FormContext Provider gt export default App At this moment this is how it looks On successful submission of basic form we moved to the nd form In similar way we can build the nd form Workspace jsimport ErrorMessage Field Form Formik from formik import React useContext from react import FormContext from App import as yup from yup function Workspace const activeStepIndex setActiveStepIndex formData setFormData useContext FormContext const renderError message gt lt p className italic text red gt message lt p gt const ValidationSchema yup object shape workspaceName yup string required workspaceURL yup string url required return lt Formik initialValues workspaceName workspaceURL validationSchema ValidationSchema onSubmit values gt const data formData values setFormData data setActiveStepIndex activeStepIndex gt lt Form className flex flex col justify center items center gt lt div className flex flex col items start mb gt lt label className font medium text gray gt Workspace Name lt label gt lt Field name workspaceName className rounded md border p placeholder My Workspace gt lt div gt lt ErrorMessage name workspaceName render renderError gt lt div className flex flex col items start mb gt lt label className font medium text gray gt Workspace URL lt label gt lt Field name workspaceURL className rounded md border p placeholder gt lt div gt lt ErrorMessage name workspaceURL render renderError gt lt button className rounded md bg indigo font medium text white my p type submit gt Continue lt button gt lt Form gt lt Formik gt export default Workspace The third amp last one is Success here we will just show success message Success jsimport React from react function Success return lt div className font medium gt Workspace successfully created lt div gt export default Success Finally this how it looks ConclusionNow we have a basic understanding on how to build a multi step form If you have any questions you can leave them in the comments section and I ll be happy to answer them Also the complete code is linked for reference Github 2022-04-16 21:15:40
海外TECH DEV Community How To Start Your Next Data Engineering Project https://dev.to/seattledataguy/how-to-start-your-next-data-engineering-project-p7c How To Start Your Next Data Engineering ProjectPhoto by Sigmund on UnsplashMany programmers who are just starting out struggle with starting new data engineering projects In our recent poll on YouTube most viewers admitted that they have the most difficulty with even starting a data engineering project The most common reasons noted in the poll were Finding the right data sets for my project Which tools should you use What do I do with the data once I have it Let s talk about each of these points starting with the array of tools you have at your disposal Picking the Right Tools and SkillsFor the first part of this project I am going to borrow from Thu Vu s advice for starting a data analytics project Why not look at a data engineering job description on a head hunting site and figure out what tools people are asking for Nothing could be easier We pulled up a job description from Smart Sheets Data Engineering It is easy to see the exact tools and skills they are looking for and match them to the skills you can offer Below are several key tools that you will want to include Cloud PlatformsOne of the first things you ll need for your data engineering project a cloud platform like Amazon Web Services AWS We always recommend that beginning programmers learn cloud platforms early A lot of a data engineer s work is not completed on premise anymore We do almost all work in the cloud So pick a platform you prefer Google Cloud Platform GCP AWS or Microsoft Azure It s not that important what platform you pick out of these three it s important that you pick one of these three because people understand that if you have used one it is likely you can easily pick up another Workflow Management Platforms And Data Storage Analytic SystemsIn addition to picking a cloud provider you will want to pick a tool to manage your automated workflows and a tool to manage the data itself From the job description Airflow and Snowflake were both referenced Airflow  It also would be a great idea to pick a cloud managed service like MWAA or Cloud Composer Snowflake  Of course BigQuery is another solid choiceThese are not the only choices by any stretch of the imagination Other popular options for orchestration are Dagster   and Prefect We actually recommend starting with  Airflow and then looking to others as you get more familiar with the processes Don t be concerned with learning all these tools at first keep it simple Just concentrate on one or two since this is not our primary focus Picking Data SetsData sets come in every color of the rainbow Your focus shouldn t be to work with already processed data your attention should center on developing a data pipeline and finding raw data sources As the data engineer  you will need to know how to set up a data pipeline and pull the data you need from a raw source Some great sources of raw data sets are OpenSky provides information on where flights currently are and where they are going and much much more Spacetrack is a tracking system that will track identify and catalog all artificial satellites orbiting the Earth Other data sets  New York Times Annotated Corpus  The Library of Congress Dataset Repository the U S government data sets and these free public data sets at Tableau Pulling data involves a lot of work so when you are picking your data sets you will probably find an API to help you extract the data into a comma separated value CSV or parquet file to load into your data warehouse Now you know how to find your data sets and manipulate them So what do you do with all this raw data that you ve got Visualize Your DataAn easy way to display your data engineering work is to create dashboards with metrics Even if you won t be building too many dashboards in the future you will want to create some type of final project Dashboards are an easy way to do so Here are a few tools you can look into Tableau PowerBI D jsWith your data visualization tool selected you can now start to pick some metrics and questions you would like to track Maybe you would like to know how many flights occur in a single day To build on that you may want to know destinations by flight time or length and distance of travel Discern some basic metrics and compile a graph Anything basic like this will help you get comfortable figuring out your question of why This question needs to be answered before you begin your real project Consider it a warm up to get the juices flowing Now let s go over a fe w project ideas that you could try out Data Engineering Projects IdeasBeginning Data Engineering Projects Example Consider using tools like Cloud Composer or Amazon Managed Workflows for Apache Airflow MWAA These tools let you circumvent setting up Airflow from scratch which allows you more time to learn the functions of Airflow without the hassle of figuring out how to set it up From there use an API such as PredictIt to scrape the data and return it in eXtensible markup language XML Maybe you are looking for data on massive swings in trading over a day You could create a model where you identify certain patterns or swings over the day If you created a Twitter bot and posted about these swings day after day some traders would definitely see the value in your posts and data If you wanted to upgrade that idea track down articles relating to that swing for discussion and post those There is definite value in that data and it is a pretty simple thing to do You are just using a Cloud Composer to ingest the data and storing it in a data warehouse like BigQuery or Snowflake creating a Twitter bot to post outputs to Twitter using something like Airflow It is a fun and simple project because you do not have to reinvent the wheel or invest time in setting up infrastructure Intermediate Example This data engineering project is brought to us by Start Data Engineering SDE While they seem to reference just a basic CSV file about movie reviews a better option might be to go to the New York Times Developers Portal and use their API to pull live movie reviews Use SDE s framework and customize it for your own needs SDE has done a superior job of breaking this project down like a recipe They tell you exactly what tools you need and when they are going to be required for your project They list out the prerequisites you need Docker Amazon Web Services AWS account AirflowIn this example SDE shows you how to set up Apache Airflow from scratch rather than using the presets You will also be exposed to tools such as Amazon S Amazon Redshift IAMThere are many components offered so when you are out there catching the attention of potential future employers this project will help you detail the in demand skills employers are looking for Advanced Example For our advanced example we will use mostly open source tools  Sspaeti s website gives a lot of inspiration for fantastic projects For this project they use a kitchen sink variety of every open source tool imaginable such as Amazon S Apache Spark Delta Lake Apache Druid DagsterIn this project you will scrape real estate data from the actual site so it s going to be a marriage between an API and a website You will scrape the website for data and clean up the HTML You will implement a change data capture CDC data science and visualizations with supersets This can be a basic framework from which you can expand your idea These are challenges to make you push and stretch yourself and your boundaries But if you decide to build this just pick a few tools and try it Your project doesn t have to be exactly the same Now It s Your TurnIf you are struggling to begin a project hopefully we ve inspired you and given you the tools and direction in which to take that first step Don t let hesitation or a lack of a clear premise keep you from starting The first step is to commit to an idea then execute it without delay even if it is something as simple as a Twitter bot That Twitter bot could be the inspiration for bigger and better ideas 2022-04-16 21:08:30
海外TECH DEV Community How to resolve a Cross-Origin Resource Sharing (CORS) error? https://dev.to/samantafluture/how-to-resolve-a-cross-origin-resource-sharing-cors-error-29he How to resolve a Cross Origin Resource Sharing CORS error You must have already been through the situation of trying to log in to some application type your data click send and nothing happens on the page The first thing a developer does is inspect the page and then open the browser console by clicking the F button or pressing the right mouse button then Inspect You get the error blocked by CORS policy Cross origin requests are only supported for protocol schemes http data chrome extension edge https chrome untrusted or similar But do you know what causes it Same origin policyThe same origin policy is a security mechanism that restricts the way a document or script from one origin interacts with a resource from another origin And what is it for Helps to prevent malicious attacks Two URLs share the same origin if the protocol port if specified and host are the same how do we handle situations where our frontend needs to consume an API with different url without having issues with CORS As in case we want to connect an API running on port with a React application running on port When sending a request to a different origin API the server needs to return a header called Access Control Allow Origin Inside it it is necessary to inform the different origins that will be allowed such as Access Control Allow Origin http localhost It is possible to allow access from any origin using the asterisk symbol Access Control Allow Origin This is not a recommended measure as it allows unknown origins to access the server unless it is intentional as in case of a public API After all what is CORS CORS Cross origin Resource Sharing is a mechanism used to add HTTP headers that tell browsers to allow a web application to run on one origin and access resources from a different origin This type of action is called a cross origin HTTP request It is used to enable cross site requests for XMLHttpRequest or FetchAPI calls cross different origins web fonts font from CSS WebGL textures and drawing frames using drawImage 2022-04-16 21:02:26
Apple AppleInsider - Frontpage News Grovemade wood & leather wrist rest review: A comfortable and elegant addition to your desk https://appleinsider.com/articles/22/04/16/grovemade-wood-leather-wrist-rest-review-a-comfortable-and-elegant-addition-to-your-desk?utm_medium=rss Grovemade wood amp leather wrist rest review A comfortable and elegant addition to your deskThe Grovemade Wrist Rest has been updated to perfectly match Apple s latest Magic Keyboard with Touch ID Available in multiple wood finishes they will easily class up your desk setup If you haven t seen any of Grovemade s gear before the company focuses on natural materials and old world craftsmanship May products are finished or created by hand instead of being mass produced overseas Many of its products focus on Apple users with a custom kit created to be paired with Apple s gear There is a stand for MagSafe docks for iPhone and trays for the Magic Keyboard and Magic Trackpad Read more 2022-04-16 21:37:48
ニュース BBC News - Home UK's Rwanda refugee plan against nature of God, says archbishop https://www.bbc.co.uk/news/uk-61130841?at_medium=RSS&at_campaign=KARANGA canterbury 2022-04-16 21:50:27
ニュース BBC News - Home Conor Benn v Chris van Heerden: British welterweight secures second-round knockout in Manchester https://www.bbc.co.uk/sport/boxing/61130950?at_medium=RSS&at_campaign=KARANGA Conor Benn v Chris van Heerden British welterweight secures second round knockout in ManchesterConor Benn makes short work of South Africa s Chris van Heerden as the British welterweight continues his charge towards a world title shot 2022-04-16 21:39:28
北海道 北海道新聞 新卒採用「増やす」42% コロナで抑制から3年ぶり転換 https://www.hokkaido-np.co.jp/article/670506/ 共同通信社 2022-04-17 06:02:00
ビジネス 東洋経済オンライン ウクライナ侵攻による世界経済への深刻度は? 歴史的な大事件でも現時点では「限定的」か | インフレが日本を救う | 東洋経済オンライン https://toyokeizai.net/articles/-/581946?utm_source=rss&utm_medium=http&utm_campaign=link_back 世界経済 2022-04-17 06:30:00

コメント

このブログの人気の投稿

投稿時間: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件)