投稿時間:2022-05-23 01:15:43 RSSフィード2022-05-23 01:00 分まとめ(19件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWS Management Tools Blog Best practices: AWS Outposts in a multi-account AWS environment: Part 2 https://aws.amazon.com/blogs/mt/best-practices-aws-outposts-in-a-multi-account-aws-environment-part-2/ Best practices AWS Outposts in a multi account AWS environment Part This post is written by Karl Schween Principal Solutions Architect at AWS This post is part two of two part series Sharing AWS Outposts in a multi account AWS environment providing you guidance and considerations for sharing AWS Outposts and Amazon S on Outposts in a multiple AWS Account environment AWS Outposts is a fully … 2022-05-22 15:10:35
AWS AWS Management Tools Blog Best practices: AWS Outposts in a multi-account AWS environment: Part 1 https://aws.amazon.com/blogs/mt/best-practices-aws-outposts-in-a-multi-account-aws-environment-part-1/ Best practices AWS Outposts in a multi account AWS environment Part This post is written by Karl Schween Principal Solutions Architect at AWS This post is part one of two part series Sharing AWS Outposts in a multi account AWS environment providing you guidance and considerations for sharing AWS Outposts and Amazon S on Outposts in a multiple AWS Account environment AWS Outposts is a fully … 2022-05-22 15:10:05
python Pythonタグが付けられた新着投稿 - Qiita LSGAN(Pytorch) https://qiita.com/PingpongChopper/items/7a619702b237084542c5 lsgan 2022-05-23 00:59:20
Ruby Rubyタグが付けられた新着投稿 - Qiita Rails データベースの更新 https://qiita.com/kigure/items/4578d46aeedb5d6ec4ff railsdbmigrate 2022-05-23 00:38:48
Ruby Railsタグが付けられた新着投稿 - Qiita Rails データベースの更新 https://qiita.com/kigure/items/4578d46aeedb5d6ec4ff railsdbmigrate 2022-05-23 00:38:48
海外TECH MakeUseOf How to Fix Blurry Pictures: 3 Ways https://www.makeuseof.com/how-to-fix-blurry-pictures/ fixes 2022-05-22 15:30:14
海外TECH MakeUseOf External Drive Not Showing Up or Detected? 6 Fixes to Try https://www.makeuseof.com/tag/external-drive-not-recognized-this-is-how-to-fix-it-in-windows/ learn 2022-05-22 15:15:14
海外TECH MakeUseOf What Is the “Power Surge on the USB Port” Error, and How Do You Fix It? https://www.makeuseof.com/windows-power-surge-usb-port-error-fix/ message 2022-05-22 15:15:14
海外TECH DEV Community Implementing an Azure IoT Hub https://dev.to/toluehi/implementing-an-azure-iot-hub-22d6 Implementing an Azure IoT HubThe Internet of Things IoT is a network of physical devices that connect to and exchange data with other devices and services over the internet or other network Azure IoT Hub is a managed service hosted in the cloud that acts as a central message hub for communication between an IoT application and its attached devices Here we will be configuring an Azure IoT Hub in Azure portal and authenticating a connection to an IoT device using online Raspberry Pi device simulator If you have time you can read more about the Raspberry Pi simulator Creating an IoT HubSign in to Azure portalFrom the search box type IoT Hub and select IoT Hub under ServicesOn the IoT hub page select CreateOn the Basics tab of the IoT hub fill in the with the following detailsGo to the Management tab and use the dropdown to set the Pricing and scale tier to S Standard tierClick the Review Create button and select the Create button when validation passes to begin creating your new Azure IoT Hub instanceWait until the Azure IoT Hub instance is deployed Add an IoT deviceWhen deployment is completed Click Go to resource from the deployment bladeTo add a new IoT device scroll down to the Device Management section and select Devices Then Click Add deviceProvide a name for your new IoT device myRaspberryPi and click Save This will create a new IoT device identity in your Azure IoT HubIf you do not see the new device Refresh the IoT devices page Select myRaspberryPi and copy the Primary Connection String value The key will be needed to authenticate a connection to the Raspberry Pi simulator Testing the device using a Raspberry Pi SumulatorOpen a new tab in the web browser and type or copy this shortcut link It will take you to a Raspberry Pi Simulator site When done select X to close the pop up window In the code area on the right side locate the line with const connectionString Replace it with the connection string copied from the Azure portal Note that the connection sting includes the DeviceId myRaspberryPi and SharedAccessKey entries Click Run to run the application The console output should show the sensor data and messages that are sent from the Raspberry Pi simulator to the Azure IoT Hub Data and messages are sent each time the Raspberry Pi simulator LED flashes Select Stop to stop sending data and return to the Azure portalSwitch to the IoT Hub Overview blade and scroll down to the IoT Hub Usage information to view usage Change your timeframe in the show data for last to see data in the last hourAwesome We just set up Azure IoT Hub to collect sensor data from an IoT device Note To avoid additional costs you can optionally remove the resource group Search for resource groups in the search box select your resource group and click Delete resource group 2022-05-22 15:17:01
海外TECH DEV Community Form Validation In Remix Using Zod https://dev.to/ishanme/form-validation-in-remix-using-zod-4h3b Form Validation In Remix Using ZodRemix is an awesome React framework for building modern SSR Sever Side Rendering web experience Which means we can work with both backend and frontend in a single Remix app Remix is really unique loaded with full of great features One of the most distinct ones is when working in forms Remix brings back the traditional method of handling forms Remix provides functions called action and loaders that we can use to perform server side operations and access a form s data With these functions we no longer need to serve JavaScript to the frontend to submit a form thereby reducing the browser s javascript chunks When we are doing validation one of my personal choice of library is Zod Zod is a TypeScript first schema declaration and validation library With Zod we declare a validator once and Zod will automatically infer the static TypeScript type It s easy to compose simpler types into complex data structures Why need a validation We want the data submitted by the users are safe and as expected There are three main reason we need a validation login in building our application We want to get the right data in the right format Our applications won t work properly if our users data is stored in the wrong format is incorrect or is omitted altogether We want to protect our users data Forcing our users to enter secure passwords makes it easier to protect their account information We want to protect ourselves There are many ways that malicious users can misuse unprotected forms to damage the application What are we buildingWe are building a form validation from scratch in Remix using Zod There are often times we need to validate our data in the server side This is a killer combination we can have so that our data we receive from our API will be fully typed and we only get valid data we need We will enforce users just to submit data we intend to receive to validate user input in the route before data gets saved regardless of where we want to store the data Form in RemixRemix provides a custom Form component we can work identically to the native HTML element When working with React we needed to listen to the onChange event in all the form fields and update our state But instead Remix uses form data from the web s formData API Form is a Remix aware and enhanced HTML form component which behaves like a normal form except that the interaction with the server is with fetch instead of new document requests Form will do a POST request to the current page route automatically However we can configure it for PUT and DELETE and change as per our need alongside with the action method needed to handle the form requests import Form useActionData from remix run react export async function action request handle logic with form data and return a value export default function Index const actionData useActionData we access the return value of the action with this hook return lt Form method post gt add our form fields here lt button type submit gt Create Account lt button gt lt Form gt We are using the built in Remix form component and making the use of useActionData hook This is a special hook which will help us in send the request POST in this case with the form data to the server using the fetchAPI This returns the JSON parsed data from a route s action It is most commonly used when handling form validation errors later Adding our formWe can make the use of the Form imported from Remix and use it in our Form Look at the snippet below how simple it is lt div className min h full flex items center justify center py px sm px lg px gt lt div className max w lg w full space y gt lt div gt lt h className mt text center text xl font extrabold text gray gt Remix Form Validation with Zod lt h gt lt div gt lt Form method post noValidate true gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray pb gt Full name lt label gt lt input name name type text className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder gt lt span className text sm text red gt print errors here lt span gt lt div gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor Email className block text sm font medium text gray pb gt Email lt label gt lt input name email type text className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder gt lt span className text sm text red gt print errors here lt span gt lt div gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor omfirm Email className block text sm font medium text gray pb gt Comfirm Email lt label gt lt input name confirmEmail type email className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder gt lt div gt lt span className text sm text red gt print errors here lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor Expertise className block text sm font medium text gray gt Expertise lt label gt lt select name expertise className mt block w full py px border border gray bg white rounded md shadow sm focus outline none focus ring indigo focus border indigo sm text sm gt lt option gt lt option gt lt option gt Product Designer lt option gt lt option gt Frontend Developer lt option gt lt option gt Backend Developer lt option gt lt option gt Fullstack Developer lt option gt lt select gt lt div gt lt span className text sm text red gt print errors here lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray pb gt Github URL lt label gt lt input name url type text className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder gt lt div gt lt span className text sm text red gt print errors here lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray gt Currently Available lt label gt lt select name availability className mt block w full py px border border gray bg white rounded md shadow sm focus outline none focus ring indigo focus border indigo sm text sm gt lt option gt lt option gt lt option gt Full time lt option gt lt option gt Part time lt option gt lt option gt Contract lt option gt lt option gt Freelance lt option gt lt select gt lt div gt lt span className text sm text red gt print errors here lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray pb gt Description lt label gt lt textarea name description className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder gt lt div gt lt span className text sm text red gt print errors here lt span gt lt div gt lt div gt lt button type submit className group relative w full flex justify center py px border border transparent text sm font medium rounded md text white bg indigo hover bg indigo focus outline none focus ring focus ring offset focus ring indigo gt Submit lt button gt lt div gt lt Form gt lt div gt lt div gt We have a basic structure of the form in place We also have hooked in the button for submit which uses native submit formData API Adding validation logic with Zod When user clicks on the submit button The action function gets invoked This is the place where we will add all the logic needed to do the validation needed Lets install our library before we can use it withnpm i zodimport ActionFunction from remix run node import z from zod export const action ActionFunction async request gt const formPayload Object fromEntries await request formData const validationSchema z object name z string min email z string email confirmEmail z string email expertise z enum Product Designer Frontend Developer Backend Developer Fullstack Developer url z string url optional availability z enum Full time Part time Contract Freelance description z string nullable refine data gt data email data confirmEmail message Email and confirmEmail should be same email path confirmEmail try const validatedSchema validationSchema parse formPayload console log Form data is valid for submission validatedSchema API call can be made here catch error return formPayload error return as any There are couple of things thats going on in the validation logic We have defined our schema here with z object method provided to us by Zod In the given keys we are adding the validation logic as per we desire You may have noticed we have covered a wide range of validation which incorporates just string validation email minimum character using enum url optional field or nullable Later we have also used refine schema method which helps us in adding custom validation logic via refinements refine validator data T gt any params RefineParams With this we can define a custom validation check in any of the Zod schema Where we have checked the both email fields needs to match each other You can find more about this method in Zod documentation here We will go ahead and add additional attributes like key and defaultValue in our form fields Using key in the form fields This is a gotcha to force React to re render the component Otherwise your data might not be updated This happens because when defaultValue is used creating an uncontrolled component React will assume that data is immutable and will not re render the component when the value changes Now our form markup would look something like thisexport default function Index const actionData useActionData return lt div gt lt div className min h full flex items center justify center py px sm px lg px gt lt div className max w lg w full space y gt lt div gt lt h className mt text center text xl font extrabold text gray gt Remix Form Validation with Zod lt h gt lt div gt lt Form method post noValidate true gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray pb gt Full name lt label gt lt input name name type text defaultValue actionData formPayload name key actionData formPayload name className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder gt lt span className text sm text red gt actionData error issues message lt span gt lt div gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor Email className block text sm font medium text gray pb gt Email lt label gt lt input name email type text defaultValue actionData formPayload email key actionData formPayload email className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder gt lt span className text sm text red gt actionData error issues message lt span gt lt div gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor Confirm Email className block text sm font medium text gray pb gt Comfirm Email lt label gt lt input name confirmEmail type email className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder defaultValue actionData formPayload confirmEmail key actionData formPayload confirmEmail gt lt div gt lt span className text sm text red gt actionData error issues message lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor Expertise className block text sm font medium text gray gt Expertise lt label gt lt select name expertise className mt block w full py px border border gray bg white rounded md shadow sm focus outline none focus ring indigo focus border indigo sm text sm defaultValue actionData formPayload expertise key actionData formPayload expertise gt lt option gt lt option gt lt option gt Product Designer lt option gt lt option gt Frontend Developer lt option gt lt option gt Backend Developer lt option gt lt option gt Fullstack Developer lt option gt lt select gt lt div gt lt span className text sm text red gt actionData error issues message lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray pb gt Github URL lt label gt lt input name url type text className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder defaultValue actionData formPayload url key actionData formPayload url gt lt div gt lt span className text sm text red gt actionData error issues message lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray gt Currently Available lt label gt lt select name availability className mt block w full py px border border gray bg white rounded md shadow sm focus outline none focus ring indigo focus border indigo sm text sm defaultValue actionData formPayload availability key actionData formPayload availability gt lt option gt lt option gt lt option gt Full time lt option gt lt option gt Part time lt option gt lt option gt Contract lt option gt lt option gt Freelance lt option gt lt select gt lt div gt lt span className text sm text red gt actionData error issues message lt span gt lt div gt lt div className rounded md shadow sm space y px gt lt div className mb gt lt label htmlFor company website className block text sm font medium text gray pb gt Description lt label gt lt textarea name description className appearance none rounded none relative block w full px py border border gray placeholder gray text gray rounded t md focus outline none focus ring indigo focus border indigo focus z sm text sm placeholder defaultValue actionData formPayload description key actionData formPayload description gt lt div gt lt span className text sm text red gt actionData error issues message lt span gt lt div gt lt div gt lt button type submit className group relative w full flex justify center py px border border transparent text sm font medium rounded md text white bg indigo hover bg indigo focus outline none focus ring focus ring offset focus ring indigo gt Submit lt button gt lt div gt lt Form gt lt div gt lt div gt lt div gt ConclusionWe have successfully achieved our form validation But thing to be noted is we have just done a server side validation but client side still remains Its best recommended to do the validation in both client and the server so get the data just like we expect from the users We will set this to our next article You can find the source code used in this article in my Github repo here Happy Coding 2022-05-22 15:05:31
Apple AppleInsider - Frontpage News Woman claims $40,000 credit card fraud occurred after losing Apple Watch https://appleinsider.com/articles/22/05/22/woman-claims-40000-credit-card-fraud-occurred-after-losing-apple-watch?utm_medium=rss Woman claims credit card fraud occurred after losing Apple WatchA visitor to Disney World dubiously claims she is the victim of credit card fraud valued at over after dropping her Apple Watch on a ride at Disney World While stories of lost or misplaced Apple devices are a regular occurrence it is rare for device owners to lose significant sums from the loss In one report about an April trip to Disney World in California an Apple Watch owner claims just that According to a report from the Orange County Sheriff s Office seen by WDW News Today a park guest lost her Apple Watch on The Seas with Nemo Friends at Epcot At a point when the ride was at an elevated position the guest dropped the Hermes edition Apple Watch through a grated floor on the ride Read more 2022-05-22 15:57:43
海外TECH Engadget YouTube removed 70,000 videos in Ukraine-related enforcement action https://www.engadget.com/youtube-ukraine-enforcement-action-153731598.html?src=rss YouTube removed videos in Ukraine related enforcement actionSince Russia invaded Ukraine in late February YouTube has taken down more than videos to date related to the conflict The Guardian reported on Sunday The company told The Guardian it removed many of the videos for breaking its major violent events policy which prohibits content creators from denying or trivializing events like the invasion YouTube did not breakdown the enforcement action but noted that it suspended approximately channels in the sweep including one tied to pro Kremlin journalist Vladimir Solovyov Some of the videos YouTube took down broke the company s guidelines by referring to the invasion as a “liberation mission “We have a major violent events policy and that applies to things like denial of major violent events everything from the Holocaust to Sandy Hook And of course what s happening in Ukraine is a major violent event Neal Mohan YouTube s chief product officer told The Guardian “And so we ve used that policy to take unprecedented action Partly resulting from its actions YouTube has seen a significant increase in the number of people in Ukraine Poland and Russia consuming “authoritative content on the conflict In Ukraine for instance news content on the invasion has generated more than million views “The first and probably most paramount responsibility is making sure that people who are looking for information about this event can get accurate high quality credible information on YouTube Mohan told The Guardian The move underscores the critical role services like YouTube play in preventing misinformation from spreading online In Russia alone YouTube has more than million users making it the single largest video sharing platform in the country The company s actions against state sponsored networks like RT and Sputnik had a dramatic impact on the ability of those organizations to disseminate the Kremlin s message 2022-05-22 15:37:31
ニュース @日本経済新聞 電子版 米主導の経済秩序「IPEF」発足へ 脱中国なるか https://t.co/Le8jHM6nmK https://twitter.com/nikkei/statuses/1528402716636381186 経済 2022-05-22 15:49:38
ニュース @日本経済新聞 電子版 照ノ富士が3場所ぶりV 大混戦、綱の権威守った https://t.co/2PvlUEghe3 https://twitter.com/nikkei/statuses/1528398968547610624 照ノ富士 2022-05-22 15:34:45
ニュース @日本経済新聞 電子版 後を絶たないスパイ・盗聴(FT) https://t.co/iqJqOwXvxf https://twitter.com/nikkei/statuses/1528396182783143939 盗聴 2022-05-22 15:23:40
ニュース @日本経済新聞 電子版 知床観光船事故1カ月 なぜ沈没、究明本格化へ https://t.co/Lzg5Ib11Yi https://twitter.com/nikkei/statuses/1528393903648690178 観光 2022-05-22 15:14:37
ニュース BBC News - Home Manchester Arena attack: Runners and events mark fifth anniversary https://www.bbc.co.uk/news/uk-england-manchester-61522046?at_medium=RSS&at_campaign=KARANGA manchester 2022-05-22 15:14:45
ニュース BBC News - Home Potters Bar: Buses catch fire at town centre transport depot https://www.bbc.co.uk/news/uk-england-beds-bucks-herts-61543634?at_medium=RSS&at_campaign=KARANGA noise 2022-05-22 15:51:58
ニュース BBC News - Home Rail unions vow to fight government strike threat https://www.bbc.co.uk/news/business-61541303?at_medium=RSS&at_campaign=KARANGA government 2022-05-22 15:07:50

コメント

このブログの人気の投稿

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

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

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