投稿時間:2022-12-02 23:19:31 RSSフィード2022-12-02 23:00 分まとめ(24件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… Microsoft、対象の「Surface Laptop Go 2」を10%オフで販売するセールを開催中 https://taisy0.com/2022/12/02/165683.html surfacelaptopgo 2022-12-02 13:16:43
python Pythonタグが付けられた新着投稿 - Qiita Pythonの文法 https://qiita.com/shimanuki-yu/items/dd5990d0c1e083112dd6 holloworldho 2022-12-02 22:23:42
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScript のスコープ、クロージャとは? & スコープと var 非推奨との関わり https://qiita.com/kotaro-caffeinism/items/b2593021f0d90ce82109 javascript 2022-12-02 22:27:56
js JavaScriptタグが付けられた新着投稿 - Qiita 【KDDI Engineer&Designer】AI にブラウザ用の JavaScript のプログラムをいくつか作ってもらった話 ⇒ OpenAI の ChatGPT で生成されたプログラムの解析も少々 https://qiita.com/youtoy/items/8eacb1af28ac18301b74 adventcalendar 2022-12-02 22:21:06
js JavaScriptタグが付けられた新着投稿 - Qiita 【ブックマークレット】スマホからでもソースが見たい! https://qiita.com/sora315/items/141d176a05cf9647d7ce ページ 2022-12-02 22:12:11
AWS AWSタグが付けられた新着投稿 - Qiita AWS SDK V3 for JavaScript を学び始めた人に捧ぐ "aws-sdk" 検索は罠です https://qiita.com/baku2san/items/d08e3f24ad2f8b1f9e6a awssdkvforjavascript 2022-12-02 22:26:54
AWS AWSタグが付けられた新着投稿 - Qiita Fargateタスクをスクリプトのように気軽に同期実行しよう https://qiita.com/NaotoFushimi/items/14a9e74d031af1d82583 adventcalendar 2022-12-02 22:09:13
Docker dockerタグが付けられた新着投稿 - Qiita Fargateタスクをスクリプトのように気軽に同期実行しよう https://qiita.com/NaotoFushimi/items/14a9e74d031af1d82583 adventcalendar 2022-12-02 22:09:13
技術ブログ Developers.IO 強くてニューゲームなふりかえりの方法 https://dev.classmethod.jp/articles/new-game-plus-retrospectives/ 強くてニューゲーム 2022-12-02 13:58:08
技術ブログ Developers.IO Slackのチャンネル参加時にメッセージ通知するようにしてみた https://dev.classmethod.jp/articles/slack-wf-communication/ slack 2022-12-02 13:44:25
技術ブログ Developers.IO [セッションレポート] 機械学習の学習や推論に適切なインスタンスを選択するには #reinvent #CMP207 https://dev.classmethod.jp/articles/session-report-cmp207/ osingtherightaccelerator 2022-12-02 13:10:44
海外TECH MakeUseOf DMG vs. PKG: What Is the Difference in These File Types? https://www.makeuseof.com/dmg-vs-pkg-what-is-the-difference-file-types/ apple 2022-12-02 13:15:15
海外TECH DEV Community How to Handle Errors in Rust: A Comprehensive Guide https://dev.to/nathan20/how-to-handle-errors-in-rust-a-comprehensive-guide-1cco How to Handle Errors in Rust A Comprehensive GuideRust community constantly discusses about error handling In this article I will try to explain what is it then why and how we should use it Purpose of Error HandlingError handling is a process that helps to identify debug and resolve errors that occur during the execution of a program It helps to ensure the smooth functioning of the program by preventing errors from occurring and allows the program to continue running in an optimal state Error handling also allows users to be informed of any problems that may arise and take corrective action to prevent the errors from happening again in the future What is a Result Result is a built in enum in the Rust standard library It has two variants Ok T and Err E Result should be used as a return type for a function that can encounter error situations Ok value is return in case of success or an Err value in case of an error Implementation of Result in a function What is Error HandlingSometimes we are using functions that can fail for example calling an endpoint from an API or searching a file These type of function can encounter errors in our case the API is not reachable or the file is not existing There are similar scenarios where we are using Error Handling Explained Step by StepA Result is the result of the read username from file function It follows that the function s returned value will either be an Ok that contains a String or an Err that contains an instance of io Error There is a call to File open inside of read username from file which returns a Result type It can return an OkIt can return an ErrThen the code calls a match to check the result of the function and return the value inside the ok in the case the function was successful or return the Error value In the second function read to string the same principle is applied but in this case we did not use the keyword return as you can see and we finally return either an OK or an Err So you may ask On every result type I have to write all these Match block So hopefully there is a shortcut What is the Question Mark Propagation Error According to the rust lang book The question mark operator unwraps valid values or returns erroneous values propagating them to the calling function It is a unary postfix operator that can only be applied to the types Result and Option Let s me explain it Question mark in Rust is used to indicate a Result type It is used to return an error value if the operation cannot be completed For example in our function that reads a file it can return a Result type where the question mark indicates that an error might be returned if the file cannot be read or in the other hand the final result In other words used to short circuit a chain of computations and return early if a condition is not met fn read username from file gt Result lt String io Error gt let mut f File open username txt let mut s String new f read to string amp mut s Ok s Every time you see a that s a possible early return from the function in case of Error else f will hold the file handle the Ok contained and execution of the function continues similary to unwrap function Why use crates for Handle errors Standard library does not provide all solutions for Error Handling In fact different errors may be returned by the same function making it increasingly difficult to handle them precisely Personal anecdote in our company we developed Cherrybomb an API security tool written in Rust and we need to re write a good part of it to have a better errors handling For example Or the same message error can be displayed multiples times This is why we need to define our own custom Error enum Then our function will look like Customize ErrorsThiserror focuses on creating structured errorsand has only one trait that can be used to define new errors Thiserror is an error handling library for Rust that provides a powerful yet concise syntax to create custom error types In the cargo toml dependencies thiserror It allows developers to create custom error types and handlers without having to write a lot of boilerplate code Thank to thiserror crate we can customize our error messages It also provides features to automatically convert between custom error types and the standard error type We will see it in the next Chapter with Dynamic Error Create new errors through derive Error Enums structs with named fields tuple structs and unit structs are all possible A Display impl is generated for your error if you provide error messages on the struct or each variant of your enum and support string interpolation Example taken from docs rs Dealing Dynamic Errors handlingIf you want to be able to use your Error type must implement the From trait for the error types of your dependencies Your program or library may use many dependencies each of which has its own error you have two different structs of custom error and we call a function that return one specific type For example So when we call our main function that return a ErrorA type we encounter the following error So one of the solution is to implement the trait From lt ErrorB gt for the struct ErrorA Our code looks like this now Another solution to this problem is to return dynamic errors To handle dynamic errors in Rust in the case of an Err value you can use the box operator to return the error as a Box a trait object of the Error trait This allows the error type to be determined at runtime rather than at compile time making it easier to work with errors of different types The Box can then be used to store any type of Error including those from external libraries or custom errors The Box can then be used to propagate the Error up the call stack allowing for appropriate handling of the error at each stage Thiserror crateIn order to have a code clearer and soft let s use thiserror crate The thiserror crate can help handle dynamic errors in Rust by allowing the user to define custom error types It does this through the derive thiserror Error macro This macro allows the user to define a custom error type with a specific set of parameters such as an error code a message and the source of the error The user can then use this error type to return an appropriate error value in the event of a dynamic error Additionally the thiserror crate also provides several helpful methods such as display chain which can be used to chain together multiple errors into a single error chain In the following we have created our error type ErrorB then we used the From trait to convert from ErrorB errors into our custom ErrorA error type If a dynamic error occurs you can create a new instance of your error type and return it to the caller See function returns error a in line Anyhow crateanyhow was written by the same author dtolnay and released in the same week as thiserror The anyhow can be used to return errors of any type that implement the std error Error trait and will display a nicely formatted error message if the program crashes The most common way to use the crate is to wrap your code in a Result type This type is an alias for the std result Result lt T E gt type and it allows you to handle success or failure cases separately When an error occurs for example you can use the context method to provide more information about the error or use the with chain method to chain multiple errors together The anyhow crate provides several convenient macros to simplify the process of constructing and handling errors These macros include the bail and try with context macros The former can be used to quickly construct an error value while the latter can be used to wrap a function call and automatically handle any errors that occur ComparisionThe main difference between anyhow and the Thiserror crate in Rust is the way in which errors are handled Anyhow allows for error handling using any type that implements the Error trait whereas Thiserror requires you to explicitly define the error types using macros Anyhow is an error handling library for Rust that provides an easy way to convert errors into a uniform type It allows to write concise and powerful error handling code by automatically converting many different types of errors into a single common type In conclusion in Cherrybomb we choose to combining the two in order to create a custom error type with thiserror and managed it by the anyhow crate 2022-12-02 13:18:39
海外TECH DEV Community Single Event Listener for all elements in JS https://dev.to/shubhamtiwari909/single-event-listener-for-all-elements-in-js-32o6 Single Event Listener for all elements in JSHello guys today i will be discussing an important topic called Event Delegation in Javascript What is Event Delegation Suppose you have a containers each having a button inside it and you want to attach an event listener to those buttons So you might do it by attaching the events separately to those buttons times and that s a lot of work to do when the number of containers increases so does the size of your code and repitition of code as well To fix this problem we will use event bubbling in which we will attacht the single event listener to the main containers having all the others containers and then using the event methods we can go down and up in the main container using some DOM methods Using this technique we can attach the event listeners to all the buttons in a one event and also it will be applicable to the buttons which may be added in future automatically You will understand this better with the example below lt div class main gt lt div class container gt lt button class btn gt Button lt button gt lt div gt lt div class container gt lt button class btn gt Button lt button gt lt div gt lt div class container gt lt button class btn gt Button lt button gt lt div gt lt p class text gt lt p gt lt div gt const mainContainer document querySelector main mainContainer addEventListener click e gt let buttonOnly e target closest button if buttonOnly null return let textNode buttonOnly closest main querySelector text if buttonOnly classList contains btn textNode innerText buttonOnly innerText So what i did is accessed the main container using querySelectorUsing the closest method i am searching for the buttons only if the element is not a button then don t do anything Then i have attached the click event listener to the main container it will also attach the click event on the child elements in the container which we can manipulate using the event methods I have created a textNode variable and accessed the element having text class what it is doing is using closest method i am finding the closest element having the main class which is the main container means going up in the DOM tree then using the querySelector to access that element with the class text With the if statement i am checking that whether the element we have clicked has a class named btn if it is true then set the textNode inner text to button inner text Example Codepen I have created multiple Dropdown with single event listenerYou can contact me on Instagram LinkedIn Email shubhmtiwri gmail com You can help me by some donation at the link below Thank you gt lt Also check these posts as well 2022-12-02 13:15:13
Apple AppleInsider - Frontpage News Daily deals Dec. 2: $500 off Pro Display XDR, 21% off Peloton Bike, 10.2-inch iPad for $299, more https://appleinsider.com/articles/22/12/02/daily-deals-dec-2-500-off-pro-display-xdr-21-off-peloton-bike-102-inch-ipad-for-299-more?utm_medium=rss Daily deals Dec off Pro Display XDR off Peloton Bike inch iPad for moreFriday s best deals include off LG inch K monitor off Sonos refurbished speakers off Razer Kishi iPhone controller and much more Best deals December Even though Cyber Monday is now past AppleInsider still checks online stores daily to uncover discounts and offers on hardware and other products including Apple devices smart TVs accessories and other items The best offers are compiled into our regular list for our readers to use and save money Read more 2022-12-02 13:59:05
Apple AppleInsider - Frontpage News iPhone 15 Ultra rumors, what's left for Apple in 2022, Mastodon and social networks https://appleinsider.com/articles/22/12/02/iphone-15-ultra-rumors-whats-left-for-apple-in-2022-mastodon-and-social-networks?utm_medium=rss iPhone Ultra rumors what x s left for Apple in Mastodon and social networksRumored iPhone Ultra design changes Apple Podcast and App Awards plus social network alternatives and waiting for iOS all on the AppleInsider podcast iPhone UltraThis week Apple released iOS with fixes for carriers and Crash Detection but we know there is much more to come There are still no signs for instance of Apple Music Classical or Apple Pay Later Unusually there are these and many other features promised for but perhaps waiting for an iOS update Read more 2022-12-02 13:30:00
海外TECH Engadget Engadget Podcast: Kindle Scribe review and the rise of Twitter clones https://www.engadget.com/engadget-podcast-kindle-scribe-twitter-clones-133056746.html?src=rss Engadget Podcast Kindle Scribe review and the rise of Twitter clonesFinally a Kindle you can write on This week we dive into Cherlynn s review of the Kindle Scribe Amazon s first e reader that can also capture handwritten notes The hardware is great but as usual Amazon s software feels half baked Also Devindra and Cherlynn discuss the rise of new Twitter alternatives like Hive Social and Post It looks like many communities are already splintering off to these services but unfortunately they can t yet replicate the magic of Twitter Listen below or subscribe on your podcast app of choice If you ve got suggestions or topics you d like covered on the show be sure to email us or drop a note in the comments And be sure to check out our other podcasts the Morning After and Engadget News Subscribe iTunesSpotifyPocket CastsStitcherGoogle PodcastsTopicsKindle Scribe review Rise of the Twitter clones Hive Social Post and Mastodon Amazon will lose billion on its Alexa division this year We ve got a new trailer for the Super Mario Bros animated movie Working on Pop culture picks LivestreamCreditsHosts Cherlynn Low and Devindra HardawarProducer Ben EllmanMusic Dale North and Terrence O BrienLivestream producers Julio BarrientosGraphic artists Luke Brooks and Brian Oh 2022-12-02 13:30:56
海外TECH Engadget Apple's upcoming mixed reality headset will reportedly run 'xrOS' https://www.engadget.com/apple-xros-mixed-reality-headset-130532613.html?src=rss Apple x s upcoming mixed reality headset will reportedly run x xrOS x Apple has internally changed the name of its upcoming mixed reality headset s accompanying software from realityOS to xrOS according to Bloomberg s Mark Gurman As the reporter notes the new name better represents the software s capabilities XR after all stands for extended reality and the headset is expected to have both augmented and virtual reality features nbsp In addition to the internal name change Gurman says a shell corporation named Deep Dive LLC has also filed a trademark for the brand xrOS in the US and in other countries including ones in the European Union and in Asia the UK Australia Mexico Ukraine Japan and Canada In its application Deep Dive wrote that it s applying for a trademark for head mounted displays and devices that provide virtual reality and augmented reality experiences Apple hasn t confirmed whether it s behind this filing nbsp Earlier this year though Vox Media product manager Parker Ortolanifound a patent application for realityOS filed by a shell company called Realityo Systems LLC Bloomberg also reported back in August that yet another shell company with a different name filed applications for Reality One Reality Pro and Reality Processor This recent name change could indicate that Apple is ironing out the details of the project for its approaching launch Gurman says Apple plans to debut the headset its dedicated operating system and its app store sometime next year According to previous reports the device will feature virtual versions of the company s apps including Messages FaceTime and Maps and will use iris scanning for app purchases and sign ins Apple s recent job listings also indicate that the tech giant is working on its own D mixed reality world which could become a rival to Facebook s vision of the metaverse nbsp 2022-12-02 13:05:32
ニュース BBC News - Home Ukraine war: Russia demands annexations recognised before talks https://www.bbc.co.uk/news/world-europe-63832151?at_medium=RSS&at_campaign=KARANGA ukrainian 2022-12-02 13:06:55
ニュース BBC News - Home Strep A: Why it can be dangerous and what to know https://www.bbc.co.uk/news/health-63836093?at_medium=RSS&at_campaign=KARANGA contagious 2022-12-02 13:35:18
ニュース BBC News - Home Chester by-election: Sunak fails first by-election test, says Rayner https://www.bbc.co.uk/news/uk-politics-63825130?at_medium=RSS&at_campaign=KARANGA share 2022-12-02 13:48:48
ニュース BBC News - Home Archbishop of Canterbury: Russian invasion must not succeed https://www.bbc.co.uk/news/uk-63833573?at_medium=RSS&at_campaign=KARANGA ukraine 2022-12-02 13:39:56
ニュース BBC News - Home Cyril Ramaphosa: South Africa's president considers future amid corruption scandal https://www.bbc.co.uk/news/world-africa-63834357?at_medium=RSS&at_campaign=KARANGA allegations 2022-12-02 13:55:58
ニュース BBC News - Home Eddie Jones: England head coach to learn fate by middle of next week https://www.bbc.co.uk/sport/rugby-union/63835466?at_medium=RSS&at_campaign=KARANGA england 2022-12-02 13:57:20

コメント

このブログの人気の投稿

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