投稿時間:2023-06-19 01:16:21 RSSフィード2023-06-19 01:00 分まとめ(20件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita Python初心者の備忘録 #02 https://qiita.com/Yushin-Tati/items/52a590d5000fe7b90185 深層学習 2023-06-19 00:22:33
python Pythonタグが付けられた新着投稿 - Qiita 【pyinstaller】boxsdkを使用したpythonアプリの実行ファイル作成の際の注意点 https://qiita.com/kamaryo/items/27ffe8d3dc9223d7a2e9 boxsdk 2023-06-19 00:01:51
js JavaScriptタグが付けられた新着投稿 - Qiita 人文出身の私が、やっとfor文と配列と仲良くなった話 https://qiita.com/guolam/items/7540d132717ac04dbb8d javascript 2023-06-19 00:26:19
Docker dockerタグが付けられた新着投稿 - Qiita メモ:Dockerビルドステップの「apt-get update」で「executor failed running」エラー https://qiita.com/MasatoEmata/items/e69f80ae49a861e90ad5 dockersyste 2023-06-19 00:52:58
Docker dockerタグが付けられた新着投稿 - Qiita DockerでRails/MySQLの環境構築 https://qiita.com/sotanaka/items/b2e969511822930f42ab docker 2023-06-19 00:01:23
Docker dockerタグが付けられた新着投稿 - Qiita 【Docker初心者】Docker Composeについて https://qiita.com/gon0821/items/77369def082745d19c38 dockercompose 2023-06-19 00:01:18
Ruby Railsタグが付けられた新着投稿 - Qiita DockerでRails/MySQLの環境構築 https://qiita.com/sotanaka/items/b2e969511822930f42ab docker 2023-06-19 00:01:23
技術ブログ Developers.IO SDDC Import/Export for VMware Cloud on AWS Tool で構成をリストアしてみた https://dev.classmethod.jp/articles/sddc-import-tool-for-vmc/ forvmwarecloudonawstool 2023-06-18 15:38:32
海外TECH MakeUseOf The Best Headphones for Travel https://www.makeuseof.com/best-headphones-for-travel/ flight 2023-06-18 15:15:20
海外TECH MakeUseOf How to Fix the Discord Game Detection Feature Not Working on Windows https://www.makeuseof.com/windows-discord-game-detection-not-working/ windows 2023-06-18 15:15:20
海外TECH DEV Community Integrate Nodemailer with React.js https://dev.to/scofieldidehen/integrate-nodemailer-with-reactjs-4ioi Integrate Nodemailer with React jsSending emails from a React js application is a common requirement in many web projects Nodemailer a powerful and flexible email sending library for Node js can be seamlessly integrated with React js to handle email functionality efficiently This comprehensive guide will walk you through integrating Nodemailer with React js allowing you to send emails directly from your React js applications By the end of this article you ll have a solid understanding of how to incorporate Nodemailer into your React js projects and enhance your communication capabilities Nodemailer Basics Overview of Nodemailer Nodemailer is a popular Node js module that provides an easy to use email API It offers comprehensive support for various email service providers like SMTP Sendmail and more With Nodemailer you can send plain text emails HTML emails and attachments and even use email templates for personalized content Installation and Setup Before we dive into integrating Nodemailer with React js let s start by installing and setting up Nodemailer in a Node js project Open your terminal and navigate to your project directory Use the following command to install Nodemailer as a dependency npm install nodemailerOnce installed you can require Nodemailer in your server side code and start configuring it to send emails Setting Up a React js Application To integrate Nodemailer with React js we must first set up a basic React js application Create a React js Project To create a new React js project open your terminal and run the following command npx create react app nodemailer react appThis command will create a new directory named nodemailer react app with the necessary files and folders for a React js application Set Up Email Form ComponentIn your React js project create a new component called EmailForm js This component will contain a form where users can enter their email details The above code has a basic form with inputs for the recipient s email subject and message The form submission will trigger the handleSubmit function where we will implement the email sending logic using Nodemailer Sending Emails from React js using Nodemailer Now that we have the email form component let s integrate Nodemailer to handle the email sending functionality Configure Nodemailer in the React js Application To use Nodemailer in your React js application you must set up a server side API endpoint to handle the email sending process This API endpoint will communicate with Nodemailer to send emails based on the form data submitted by the user Create a new file called sendEmail js on the server side of your project This file will contain the code to send emails using Nodemailer Install the necessary dependencies for your server side code npm install express nodemailerIn the sendEmail js file import the required modules const express require express const nodemailer require nodemailer Set up an Express js route to handle email sending In the code above we set up a POST route send email that expects the email details in the request body It uses Nodemailer s createTransport method to configure the email service provider details The email options including the recipient subject and message are defined in the mailOptions object Finally the email is sent using transporter sendMail Connect the React js Frontend to the Backend API Now that the server side API endpoint is set up to handle email sending let s connect the React js frontend to this endpoint In your EmailForm js component import the axios library to make HTTP requests to the backend API import axios from axios Update the handleSubmit function to make a POST request to the backend API In the code above we make a POST request to the send email route of our backend API passing the emailData object as the request body If the email is sent successfully you can handle the UI updates accordingly If an error occurs you can handle it as well Advanced Features and Best PracticesTo further enhance your email functionality consider exploring the following advanced features and best practices Handling Email Templates Nodemailer supports email templates allowing you to create dynamic and personalized emails You can use template engines like Handlebars or EJS in combination with Nodemailer to generate HTML email templates with dynamic content Error Handling and LoggingImplement proper error handling and logging mechanisms in your server side code to handle errors that may occur during the email sending process This ensures that you can identify and address any issues effectively Consider implementing error logging to track and analyze email sending failures Testing and DeploymentBefore deploying your application to a production environment it s essential to test the email functionality thoroughly Use testing frameworks like Jest or Mocha to write unit tests for your server side code that involves email sending When deploying your application to different environments consider using environment variables to store sensitive information such as email service credentials ConclusionCongratulations You have learned how to integrate Nodemailer with React js to enable email functionality in your applications By following the steps outlined in this guide you can create a React js form component to collect email details and send emails using Nodemailer via a server side API endpoint Remember to handle errors effectively utilize email templates for personalized content and thoroughly test your code before deployment Now you can leverage Nodemailer to enhance communication capabilities in your React js projects If you find this post exciting find more exciting posts like this on Learnhub Blog we write everything tech from Cloud computing to Frontend Dev Cybersecurity AI and Blockchain Resource Beginners Guide to NodeMailer  How to send an email with NodeMailer Javascript Email Framework Node Documentation 2023-06-18 15:20:40
海外TECH DEV Community 💻ES6 tutorial: template literal in javascript https://dev.to/rafikadir/es6-tutorial-template-literal-in-javascript-84p ES tutorial template literal in javascriptBefore ES we use single quotes or double quotes to wrap a string literally And the strings have very limited functionality In ES we can create a template literal by wrapping text in backticks Example let simple This is a template literal Here are some key features of template literals Multiline Strings With template literals you can create multiline strings without the need for escape characters or concatenation const multiline This is a multiline string Variable Interpolation We can simply include the variable or expression within const name Javascript const greeting Hello name console log greeting Output Hello Alice Tagged templates Tagged template is written like a function definition However you do not pass parentheses   when calling the literal const name JS const greet true function tag strings nameValue let str strings Hello let str strings How are you if greet return str nameValue str passing argument nameconst result tag Hello name How are you console log result 2023-06-18 15:19:39
海外TECH DEV Community React Server Model (RSM) v0.3.0 is released! https://dev.to/jason89521/react-server-model-rsm-v030-is-released-4pk8 React Server Model RSM v is released Previous ArticlesI m developing a new server state management library for ReactIntroducing React Server Model RSM The Design Philosophy TL DR RSM is a new server state management library for React It allow developer to customize the data like using Redux while also provide an easy to use api like React Query s useQuery Try it out Hi everyone it feels like it s been a while since we last talked even though it s only been a little over a week Since my last article I ve been fully immersed in developing RSM Today I m excited to announce the release of RSM version along with the basic API documentation I want to express my gratitude for all the encouragement I ve received from you whether it s the interactions on social media or the stars on the RSM repository on GitHub Your support has been a great motivation for me thank you Especially the stars they really get me excited Now let s dive into the specific features that RSM provides Fully Customizable DataThis is where RSM differs the most from React Query RSM allows developers to define their desired data structures similar to using Redux Developers can tailor the data structures to their specific needs However this feature also comes with some trade offs Since the data is managed by the developers RSM is not aware of how to update the cache after fetching data Therefore when using RSM you need to inform it about how you want to update the cache If fully customizable data is not your primary concern using React Query to manage the server state may be more suitable AdapterWhen using RSM I recommend developers create an adapter for the models This adapter provides the initial state values and various operations for the state such as read and write Creating an adapter can be cumbersome so RSM currently includes support for a pagination adapter inspired by our company s approach This adapter should suffice for most pagination scenarios Since my initial goal was to address pagination RSM currently only supports the pagination adapter However in the future additional adapters will be added to meet other requirements I also welcome any ideas you may have DeduplicationIn Redux deduplication can also be achieved In my company we write code like this export const listAchievementBadge createAsyncThunk lt items BasicAchievementBadge ListAchievementBadgePayload gt ACHIEVEMENT BADGE list ctx lang gt const res await listAchievementBadgeApi lang return items res items modifiers throttle keySelector lang gt lang throttle means that the same action won t be dispatched within seconds and keySelector is used to determine whether the actions are the same Usually most APIs require deduplication so adding throttle to each new action can be quite cumbersome Moreover it s important not to forget to define the keySelector otherwise every dispatch of the action will be considered unique I once forgot to add keySelector and ended up with excessive API calls after the product went live RSM automatically handles deduplication so you don t have to worry about repeated requests being continuously dispatched Revalidate On Focus ReconnectJust like React Query s refetchOnWindowFocus and refetchOnReconnect RSM also provides these features to enhance the user experience My company hasn t implemented this feature with Redux but I think it would be quite troublesome PollingIf you want to fetch data from the backend at regular intervals RSM also offers polling functionality You just need to tell RSM how often to fetch data and it will handle it automatically for you Error retryWhen encountering an error while fetching an API you can simply throw an error and RSM will automatically retry until the defined number of attempts is reached before throwing the error Of course you can also disable this feature so that a single API failure is considered a failure and shown to the user Invalidate dataCurrently RSM only supports invalidating a single piece of data and doesn t have the ability to invalidate multiple data entries at once like React Query For example if you have query keys like the following posts list all posts get Using queryClient invalidateQueries queryKey post will mark all the mentioned data as stale This is a great feature and RSM is expected to support similar functionality in the future Written in TypeScriptUsing TypeScript has become a standard practice for packages nowadays Writing code with TypeScript provides a more pleasant development experience Getting StartedAfter discussing all of that I believe many of you may still be unsure about how to use RSM since there was no related code mentioned above Now let s dive into how to actually utilize RSM Create ModelUnlike Redux where data is centralized in the store RSM requires developers to categorize data and create different models for different data types For example in our company we have data types like posts comments and forums so we need to create separate models for them The reason behind this is that different data types may require different data structures For example posts may be suited for a pagination data structure but user settings may not be import createPaginationAdapter createModel from react server model const postAdapter createPaginationAdapter lt Post gt const postModel createModel postAdapter initialState Accessor with useAccessor hookOnce the model is created you can start defining accessors Accessors play a crucial role in RSM They fetch data from the server and synchronize it with your model After your model is updated it notifies the components that use the corresponding model to check if a rerender is needed const getPostById postModel defineAccessor lt number Post gt normal fetchData async id gt const data await getPostApi id return data syncState draft payload gt postAdapter upsertOne draft payload data The first argument of the defineAccessor method accepts only normal or infinite Usually you only need to use infinite when implementing infinite loading In most cases using normal is sufficient The second argument is the accessor s action fetchData tells the accessor how to fetch data from the server and syncState specifies how to sync the received data with the model s state The defineAccessor method returns an accessor creator function If you pass the same arguments it will return the same accessor Now let s use the accessor created by defineAccessor with the useAccessor hook function usePost id number const accessor getPostById id const data error isFetching useAccessor accessor state gt postAdapter tryReadOne state id return post data error isFetching revalidate gt accessor revalidate The second argument of useAccessor determines the shape of data You can think of it as a selector function in Redux In RSM we call this parameter getSnapshot because it provides a snapshot of the model s state If you only want to retrieve the title of a specific post you can write it like this function usePostTitle id number const accessor getPostById id const data useAccessor accessor state gt postAdapter tryReadOne state id title return data Although both hooks subscribe to the same accessor they will rerender at different times due to the difference in the second argument usePost will rerender when the corresponding post data for the given id changes while usePostTitle will only rerender when the title of the corresponding post with the given id changes It s important to note that getSnapshot is tied to the accessor You must ensure that the props and state used in getSnapshot are the necessary parameters for the accessor creator Otherwise you may encounter unexpected behavior In the above example only id affects the accessor so only id can be included in getSnapshot You can think of this limitation as similar to the dependencies array in useEffect In addition to being used with useAccessor accessors themselves have some methods that can be used such as accessor revalidate used in usePost If there is no ongoing revalidation process for the accessor calling this method will fetch data and synchronize it with the model Benefits of Customized DataNow let s explore how RSM addresses the issues mentioned in my previous article Readers who are not familiar can refer to this article First let s define getPostList const getPostList postModel defineAccessor lt string Post gt infinite fetchData async filter previousData gt if previousData length return null const data await getPostListApi filter return data syncState draft payload gt postAdapter appendPagination draft payload filter payload data getPostList fetches different post lists based on different filter values and stores these lists in the model s state Suppose we individually fetched paginations with filter values of latest and popular and both lists contain a post with the ID of Now if a user leaves a comment on this post and we execute the following code postModel mutate draft gt postAdapter readOne draft totalCommentCount When the user switches to the popular list they will see that the total comment count of the post with ID has been updated If they then switch to the latest list they will also see the same result All of this is possible thanks to the customized data structure in RSM In the pagination adapter all entities are managed centrally and pagination claims data based on IDs Therefore whenever an entity is updated any pagination that includes that entity will be updated as well This perfectly solves the problem mentioned earlier ConclusionAlthough RSM is not yet a mature package I will continue to improve it In addition I have managed to persuade senior members in our company to apply it to our products I hope it can help us completely eliminate Redux Finally I want to express my gratitude once again to the community Without your encouragement and practical support the senior members of our company might not have agreed to let me do this It s thanks to your recognition of RSM that I was able to seize this opportunity Thank you very much I also hope that RSM can help readers who are looking for alternative solutions Have a wonderful day 2023-06-18 15:15:05
海外TECH Engadget Biden administration announces $930 million in grants to expand rural internet access https://www.engadget.com/biden-administration-announces-930-million-in-grants-to-expand-rural-internet-access-153708056.html?src=rss Biden administration announces million in grants to expand rural internet accessThe Biden administration on Friday announced million in grants designed to expand rural access to broadband internet Part of the Department of Commerce s “Enabling Middle Mile Broadband Infrastructure Program the grants will fund the deployment of more than miles of new fiber optic cable across states and Puerto Rico The administration said Friday it expects grant recipients to invest an additional million a commitment that should double the program s impact “Much like how the interstate highway system connected every community in America to regional and national systems of highways this program will help us connect communities across the country to regional and national networks that provide quality affordable high speed internet access Commerce Secretary Gina Raimondo said High speed internet is no longer a luxury it s a necessity That s why my Administration is investing in expanding access to affordable high speed internet to close the digital divide ーPresident Biden POTUS June According to the Commerce Department it received over applications for the Middle Mile Grant Program totaling billion in funding requests The agency primarily awarded grants to telecom and utility companies though it also set aside funding for tribal governments and nonprofits Per Gizmodo the largest grant valued at million went to a telecommunications company in Alaska that will build a fiber optic network in a part of the state where percent of residents have no internet access On average the Commerce Department awarded million to most applicants Grant recipients now have five years to complete work on their projects though the administration hopes many of the buildouts will be completed sooner In addition to creating new economic opportunities in traditionally underserved communities the government says the projects should improve safety in those areas too “They can improve network resilience in the face of the climate crisis and increasing natural disasters like wildfires floods and storms creating multiple routes for the internet traffic to use instead of just one like a detour on the freeway White House infrastructure coordinator Mitch Landrieu told Bloomberg The funding is just one of many recent efforts by the government to close the rural digital divide At the start of last year the Federal Communications Commission announced an accountability program designed to ensure recipients of the Rural Digital Opportunity Fund properly spend the money they receive from the public purse This article originally appeared on Engadget at 2023-06-18 15:37:08
海外TECH Engadget Hitting the Books: Why AI won't be taking our cosmology jobs https://www.engadget.com/hitting-the-books-universe-in-a-box-andrew-pontzen-riverhead-books-153005483.html?src=rss Hitting the Books Why AI won x t be taking our cosmology jobsThe problem with studying the universe around us is that it is simply too big The stars overhead remain too far away to interact with directly so we are relegated to testing our theories on the formation of the galaxies based on observable data nbsp Simulating these celestial bodies on computers has proven an immensely useful aid in wrapping our heads around the nature of reality and as Andrew Pontzen explains in his new book The Universe in a Box Simulations and the Quest to Code the Cosmos recent advances in supercomputing technology are further revolutionizing our capability to model the complexities of the cosmos not to mention myriad Earth based challenges on a smaller scale In the excerpt below Pontzen looks at the recent emergence of astronomy focused AI systems what they re capable of accomplishing in the field and why he s not too worried about losing his job to one nbsp nbsp Riverhead BooksAdapted from THE UNIVERSE IN A BOX Simulations and the Quest to Code the Cosmos by Andrew Pontzen published on June by Riverhead an imprint of Penguin Publishing Group a division of Penguin Random House LLC Copyright Andrew Pontzen As a cosmologist I spend a large fraction of my time working with supercomputers generating simulations of the universe to compare with data from real telescopes The goal is to understand the effect of mysterious substances like dark matter but no human can digest all the data held on the universe nor all the results from simulations For that reason artificial intelligence and machine learning is a key part of cosmologists work Consider the Vera Rubin Observatory a giant telescope built atop a Chilean mountain and designed to repeatedly photograph the sky over the coming decade It will not just build a static picture it will particularly be searching for objects that move asteroids and comets or change brightness flickering stars quasars and supernovae as part of our ongoing campaign to understand the ever changing cosmos Machine learning can be trained to spot these objects allowing them to be studied with other more specialized telescopes Similar techniques can even help sift through the changing brightness of vast numbers of stars to find telltale signs of which host planets contributing to the search for life in the universe Beyond astronomy there are no shortage of scientific applications Google s artificial intelligence subsidiary DeepMind for instance has built a network that can outperform all known techniques for predicting the shapes of proteins starting from their molecular structure a crucial and difficult step in understanding many biological processes These examples illustrate why scientific excitement around machine learning has built during this century and there have been strong claims that we are witnessing a scientific revolution As far back as Chris Anderson wrote an article for Wired magazine that declared the scientific method in which humans propose and test specific hypotheses obsolete We can stop looking for models We can analyze the data without hypotheses about what it might show We can throw the numbers into the biggest computing clusters the world has ever seen and let statistical algorithms find patterns where science cannot I think this is taking things too far Machine learning can simplify and improve certain aspects of traditional scientific approaches especially where processing of complex information is required Or it can digest text and answer factual questions as illustrated by systems like ChatGPT But it cannot entirely supplant scientific reasoning because that is about the search for an improved understanding of the universe around us Finding new patterns in data or restating existing facts are only narrow aspects of that search There is a long way to go before machines can do meaningful science without any human oversight To understand the importance of context and understanding in science consider the case of the OPERA experiment which in seemingly determined that neutrinos travel faster than the speed of light The claim is close to a physics blasphemy because relativity would have to be rewritten the speed limit is integral to its formulation Given the enormous weight of experimental evidence that supports relativity casting doubt on its foundations is not a step to be taken lightly Knowing this theoretical physicists queued up to dismiss the result suspecting the neutrinos must actually be traveling slower than the measurements indicated Yet no problem with the measurement could be found until six months later OPERA announced that a cable had been loose during their experiment accounting for the discrepancy Neutrinos travelled no faster than light the data suggesting otherwise had been wrong Surprising data can lead to revelations under the right circumstances The planet Neptune was discovered when astronomers noticed something awry with the orbits of the other planets But where a claim is discrepant with existing theories it is much more likely that there is a fault with the data this was the gut feeling that physicists trusted when seeing the OPERA results It is hard to formalize such a reaction into a simple rule for programming into a computer intelligence because it is midway between the knowledge recall and pattern searching worlds The human elements of science will not be replicated by machines unless they can integrate their flexible data processing with a broader corpus of knowledge There is an explosion of different approaches toward this goal driven in part by the commercial need for computer intelligences to explain their decisions In Europe if a machine makes a decision that impacts you personally declining your application for a mortgage maybe or increasing your insurance premiums or pulling you aside at an airport you have a legal right to ask for an explanation That explanation must necessarily reach outside the narrow world of data in order to connect to a human sense of what is reasonable or unreasonable Problematically it is often not possible to generate a full account of how machine learning systems reach a particular decision They use many different pieces of information combining them in complex ways the only truly accurate description is to write down the computer code and show the way the machine was trained That is accurate but not very explanatory At the other extreme one might point to an obvious factor that dominated a machine s decision you are a lifelong smoker perhaps and other lifelong smokers died young so you have been declined for life insurance That is a more useful explanation but might not be very accurate other smokers with a different employment history and medical record have been accepted so what precisely is the difference Explaining decisions in a fruitful way requires a balance between accuracy and comprehensibility In the case of physics using machines to create digestible accurate explanations which are anchored in existing laws and frameworks is an approach in its infancy It starts with the same demands as commercial artificial intelligence the machine must not just point to its decision that it has found a new supernova say but also give a small digestible amount of information about why it has reached that decision That way you can start to understand what it is in the data that has prompted a particular conclusion and see whether it agrees with your existing ideas and theories of cause and effect This approach has started to bear fruit producing simple but useful insights into quantum mechanics string theory and from my own collaborations cosmology These applications are still all framed and interpreted by humans Could we imagine instead having the computer framing its own scientific hypotheses balancing new data with the weight of existing theories and going on to explain its discoveries by writing a scholarly paper without any human assistance This is not Anderson s vision of the theory free future of science but a more exciting more disruptive and much harder goal for machines to build and test new theories atop hundreds of years of human insight This article originally appeared on Engadget at 2023-06-18 15:30:05
ニュース BBC News - Home Thunderstorms and rain sweep across UK https://www.bbc.co.uk/news/business-65938095?at_medium=RSS&at_campaign=KARANGA month 2023-06-18 15:50:30
ニュース BBC News - Home Antony Blinken hails 'candid' talks on high stakes China trip https://www.bbc.co.uk/news/world-us-canada-65941659?at_medium=RSS&at_campaign=KARANGA china 2023-06-18 15:34:08
ニュース BBC News - Home Nottingham Open 2023 results: Katie Boulter beats Jodie Burrage to win first WTA title https://www.bbc.co.uk/sport/tennis/65943414?at_medium=RSS&at_campaign=KARANGA Nottingham Open results Katie Boulter beats Jodie Burrage to win first WTA titleKatie Boulter wins her first WTA title with a dominant victory in Nottingham over Jodie Burrage in the first all British tour level final in years 2023-06-18 15:19:21
ニュース BBC News - Home England v North Macedonia: Players tapping up team-mates, jokes Gareth Southgate https://www.bbc.co.uk/sport/football/65874634?at_medium=RSS&at_campaign=KARANGA international 2023-06-18 15:44:45
ニュース BBC News - Home Nottingham Open: Katie Boulter beats Jodie Burrage to win first WTA title https://www.bbc.co.uk/sport/av/tennis/65944411?at_medium=RSS&at_campaign=KARANGA nottingham 2023-06-18 15:09:33

コメント

このブログの人気の投稿

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