IT |
InfoQ |
How to Lead and Manage in This Brave New Remote and Hybrid World |
https://www.infoq.com/news/2023/02/lead-remote-hybrid/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global
|
How to Lead and Manage in This Brave New Remote and Hybrid WorldHybrid working is a mindset of trusting people and providing opportunities to get the best from everyone regardless of place and time Managers have the opportunity to make people feel empowered motivated and productive Alternatively they can squash creativity fun and psychological safety By Ben Linders |
2023-02-23 10:17:00 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Zabbix6.0でAPIを利用してグラフ画像を取得する際の注意点 |
https://qiita.com/Daled/items/6b3335b6cbbf37064499
|
zabbix |
2023-02-23 19:55:54 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
新卒エンジニアが【Pythonエンジニア認定基礎試験】の模試を受けてみたら、、、④ |
https://qiita.com/asukitt/items/f875335a52e8923b36a5
|
認定 |
2023-02-23 19:10:25 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
ransackで"Ransack needs attributes explicitly allowlisted..."のエラー解消法 |
https://qiita.com/Yamashita-Taiki/items/764be62a8c20485ece54
|
eexplictallowlistingofatt |
2023-02-23 19:12:08 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
Ruby配列系のメソッド(追加・挿入・削除編) |
https://qiita.com/kanounba77/items/9cbbd065c2d93a876a98
|
leetcode |
2023-02-23 19:04:13 |
golang |
Goタグが付けられた新着投稿 - Qiita |
メールアドレスマスク化CLIツールを作ったのでメモ |
https://qiita.com/o-ga/items/fe6e50affca4488de3ae
|
関係者 |
2023-02-23 19:36:55 |
golang |
Goタグが付けられた新着投稿 - Qiita |
リフレクションについて |
https://qiita.com/sugar_king777/items/25438aa47ca4ff89db66
|
javago |
2023-02-23 19:33:27 |
golang |
Goタグが付けられた新着投稿 - Qiita |
[Go]REST APIのお勉強 |
https://qiita.com/otamaninja/items/d722e5b444160fd86fed
|
gorestapi |
2023-02-23 19:27:34 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
ransackで"Ransack needs attributes explicitly allowlisted..."のエラー解消法 |
https://qiita.com/Yamashita-Taiki/items/764be62a8c20485ece54
|
eexplictallowlistingofatt |
2023-02-23 19:12:08 |
海外TECH |
MakeUseOf |
Forget SMS: 3 Other Ways to Secure Your Twitter Account With 2FA |
https://www.makeuseof.com/ways-to-add-2fa-twitter-account-without-sms/
|
alternative |
2023-02-23 10:22:49 |
海外TECH |
DEV Community |
All about Promises in JavaScript |
https://dev.to/codeofrelevancy/all-about-promises-in-javascript-39lj
|
All about Promises in JavaScriptIn JavaScript a Promise is an object that represents a value that may not be available yet but will be resolved in the future Promises are used to handle asynchronous operations such as making network requests or accessing databases where the result is not immediately available I d like to kick off our adventure if you re ready How Promises Work A Promise is a proxy for a value not necessarily known when the promise is created It allows you to associate handlers with an asynchronous action s eventual success value or failure reason This lets asynchronous methods return values like synchronous methods instead of immediately returning the final value the asynchronous method returns a promise to supply the value at some point in the future A Promise has three possible states Pending The initial state of a Promise The Promise is neither fulfilled nor rejected Fulfilled The Promise has been resolved and the resulting value is available Rejected The Promise has been rejected and an error occurred Once a Promise is settled it cannot be resettled The resolve or reject function can only be called once and any subsequent calls to these functions will have no effect The immutability of a settled Promise is an important feature because it ensures that the Promise s value remains consistent and predictable Once a Promise is settled its value cannot be changed which helps prevent unexpected behavior and makes it easier to reason about the code How to Create Promises A Promise is created using the Promise constructor which takes a single argument a function called the executor The executor function takes two arguments resolve and reject These are functions that are called when the Promise is either fulfilled or rejected To show you what I mean The Promise in above example will resolve after one second and the value of the resolved Promise will be the array of users Once a Promise is created you can use the then method to attach a callback function that will be called when the Promise is fulfilled The then method takes two arguments a callback function for the resolved value and a callback function for the rejected value To show you what I mean Moving forward on our adventure let s take a look at an example of a Promise that has been rejected To show you what I mean Chained PromisesBelow methods are used to associate further action with a promise that becomes settled As these methods return promises they can be chainedPromise prototype then Promise prototype catch Promise prototype finally Chaining promises in JavaScript involves creating a sequence of promises that are executed one after the other Each promise in the chain depends on the successful completion of the previous promise so if any promise in the chain fails the entire chain fails Let s see how we can chain promises in JavaScript Here the fetchData function is used to fetch data from a remote API and perform some operation on it The fetchData function returns a Promise that resolves with the result of the operation The Promise chain begins by fetching user data from the API then using the first user s ID to fetch their posts and finally using the ID of the first post to fetch the comments for that post Each then method in the chain handles the resolved value of the previous Promise and the final catch method handles any errors that occur during the chain We can create many chains with then method as per the requirements Like synchronous code chaining will result in a sequence that runs in serial Let s see a simple instance Benefits of PromisesPromises provide several benefits over traditional callback based approaches to handling asynchronous operations in JavaScript Some of the key benefits include Better readability Promises allow you to write code that is more readable and easier to understand than traditional callback based approaches With Promises you can chain together asynchronous operations in a sequence which makes it clear what order the operations are executed in Improved error handling Promises make it easier to handle errors that occur during asynchronous operations With Promises you can use the catch method to handle errors that occur during any step in the chain rather than having to handle errors separately for each step Avoiding callback hell Promises can help you avoid callback hell a situation where you have a chain of nested callbacks that can become difficult to manage and debug With Promises you can chain together asynchronous operations without having to nest multiple levels of callbacks Ability to return a value Promises allow you to return a value from an asynchronous operation which makes it easier to pass the result of one operation to another operation in a sequence This is particularly useful when you need to perform multiple asynchronous operations in a sequence and need to use the result of each operation in the next operation Better compatibility Promises are a standardized feature in modern JavaScript and are supported by all modern browsers and Node js This means that Promises can be used across different environments without requiring different code for each environment How Do I Cancel a Promise In modern JavaScript No you cannot cancel a Promise once it has been created It will execute its code and either resolve or reject and there is no built in way to cancel the operation There are some techniques you can use to simulate cancellation Timeout You can use a timeout to reject the Promise if it takes too long to resolve This technique is useful if you are making a network request and want to limit the amount of time it takes Aborting a network request You can use an abort controller to abort a network request The Fetch API provides an AbortController API that allows you to cancel a network request before it completes Using a flag You can use a flag in your code to simulate cancellation You can set the flag to true to indicate that the operation should be canceled and then check the flag in your Promise code to determine whether to continue or reject the Promise It s worth noting that none of these techniques truly cancel a Promise they simply reject it early If you need true cancellation you may need to use a library that provides cancellation support such as rxjs or bluebird Bluebird Promise CancellationBluebird is a popular Promise library for JavaScript that provides advanced features including Promise cancellation Promise cancellation is the ability to cancel a Promise which is useful for canceling ongoing or long running asynchronous operations With the help of Bluebird Promise cancellation is achieved using the Promise cancel method This method is not part of the standard Promise API and is specific to Bluebird To use Promise cancellation in Bluebird you need to create a cancellable Promise using the new Promise constructor and passing a cancel function as an argument The cancel function will be called when the Promise is canceled ConclusionThe Fetch API is a modern replacement for the older XMLHttpRequest object and it is based on Promises When you make a request with the Fetch API you get back a Promise that resolves to the response object This allows you to use the then method to handle the response in a clean and readable way Async Functions are a newer addition to JavaScript and they are built on top of Promises Async Functions allow you to write asynchronous code that looks like synchronous code making it easier to read and write Async Functions use the await keyword to wait for Promises to resolve before continuing making it possible to write asynchronous code that looks like a sequence of synchronous statements In both of these idioms Promises are used to handle asynchronous operations in a clean and readable way By using Promises you can avoid callback hell and write asynchronous code that is easy to reason about MotivationReminder You re awesome no matter what others say and think SupportPlease consider following and supporting us by subscribing to our channel Your support is greatly appreciated and will help us continue creating content for you to enjoy Thank you in advance for your support YouTubeGitHubTwitter |
2023-02-23 10:20:01 |
海外TECH |
Engadget |
James Webb telescope captures ancient galaxies that theoretically shouldn't exist |
https://www.engadget.com/james-webb-telescope-ancient-galaxies-theoretically-should-not-exist-102034475.html?src=rss
|
James Webb telescope captures ancient galaxies that theoretically shouldn x t existThe James Webb Telescope has been giving us clearer views of celestial objects and exposing hidden features since it became operational last year Now according to a study conducted by an international team of astrophysicists it may also completely change our understanding of the cosmos nbsp Upon looking at images taken by the telescope near the Big Dipper the scientists found six potential galaxies that formed just to million years after the Big Bang That they could be almost billion years old wasn t what makes them odd though it s that they could have as many stars as the Milky Way according to the team s calculations The scientists explained that they should not exist under current cosmological theory because there shouldn t be enough matter at the time for the galaxies to form as many stars as ours has nbsp What the scientists saw in the images is a few fuzzy but very bright dots of light that look red to our instruments indicating that they re old Joel Leja one of the authors of the study told Space that scientists typically expect to see young and small galaxies that glow blue when peering into the ancient universe since they appear to us as objects which have just recently formed out of the primordial cosmic soup Don t forget that it takes time for light to reach Earth so we re essentially looking back in time when we view telescopic images nbsp We looked into the very early universe for the first time and had no idea what we were going to find It turns out we found something so unexpected it actually creates problems for science It calls the whole picture of early galaxy formation into question Leja said James Webb previously captured images of even older galaxies that formed around million years after the Big Bang But they re tiny and don t challenge our knowledge of astrophysics nbsp For these six galaxies to appear old and massive means they were forming hundreds of stars a year shortly after the Big Bang In comparison the Milky Way only forms around one to two new stars every year Further these potential galaxies are about times more compact in size than ours despite having as many stars nbsp The scientists admit that there s a possibility that the fuzzy red dots they saw are something else such as faint quasars or supermassive black holes They could also be smaller in reality compared to the projected size the scientists got from their calculations The team needs more data and to verify their findings through spectroscopy but they think they could have official confirmation sometime next year nbsp |
2023-02-23 10:20:34 |
ラズパイ |
Raspberry Pi |
Inspiring young people to code with the Astro Pi Challenge and astronaut Matthias Maurer |
https://www.raspberrypi.org/blog/young-people-code-astro-pi-challenge-matthias-maurer-life-on-iss/
|
Inspiring young people to code with the Astro Pi Challenge and astronaut Matthias MaurerThe European Astro Pi Challenge offers young people the opportunity to write computer programs that run on Raspberry Pi computers on board the International Space Station ISS There are two free annual missions to participate in Mission Zero and Mission Space Lab Sending your computer program to space is amazing already and to inspire even The post Inspiring young people to code with the Astro Pi Challenge and astronaut Matthias Maurer appeared first on Raspberry Pi |
2023-02-23 10:38:52 |
ニュース |
BBC News - Home |
John Motson: Legendary commentator dies aged 77 |
https://www.bbc.co.uk/sport/football/64742833?at_medium=RSS&at_campaign=KARANGA
|
career |
2023-02-23 10:56:31 |
ニュース |
BBC News - Home |
Keir Starmer unveils Labour's five missions for the country |
https://www.bbc.co.uk/news/uk-politics-64739371?at_medium=RSS&at_campaign=KARANGA
|
labour |
2023-02-23 10:42:48 |
ニュース |
BBC News - Home |
Oscars 2023: Crisis team in place for ceremony, after the Will Smith slap |
https://www.bbc.co.uk/news/entertainment-arts-64742329?at_medium=RSS&at_campaign=KARANGA
|
chris |
2023-02-23 10:41:33 |
ニュース |
BBC News - Home |
Police Scotland chief constable to retire in summer |
https://www.bbc.co.uk/news/uk-scotland-64743930?at_medium=RSS&at_campaign=KARANGA
|
officer |
2023-02-23 10:56:18 |
ニュース |
BBC News - Home |
10-page form to replace interview for 12,000 asylum seekers |
https://www.bbc.co.uk/news/uk-64736123?at_medium=RSS&at_campaign=KARANGA
|
seekers |
2023-02-23 10:28:35 |
ニュース |
BBC News - Home |
F1 Academy: Is Formula 1 finally taking women seriously? |
https://www.bbc.co.uk/news/newsbeat-64709037?at_medium=RSS&at_campaign=KARANGA
|
academy |
2023-02-23 10:05:57 |
ニュース |
BBC News - Home |
Why is there a shortage of tomatoes and other fruit and veg? |
https://www.bbc.co.uk/news/business-64718826?at_medium=RSS&at_campaign=KARANGA
|
limit |
2023-02-23 10:22:29 |
ニュース |
BBC News - Home |
John Motson reminisces about his career as a football commentator |
https://www.bbc.co.uk/sport/av/football/15136091?at_medium=RSS&at_campaign=KARANGA
|
commentator |
2023-02-23 10:38:39 |
コメント
コメントを投稿