投稿時間:2022-01-16 03:17:37 RSSフィード2022-01-16 03:00 分まとめ(26件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS lambdaタグが付けられた新着投稿 - Qiita 【Cognito】カスタム認証チャレンジでトークン認証を実装して、SAMでデプロイしてみる。 https://qiita.com/ItsukiN32/items/4c19b14fc6cd07119c80 VerifyAuthChallengeここではユーザから返されたチャレンジに対する答えを処理し、チャレンジが通過したかどうかを判定します。 2022-01-16 02:27:24
js JavaScriptタグが付けられた新着投稿 - Qiita webview.hostObjects が async で失敗するのをなんとかする ver.2 https://qiita.com/MoyomonDQ/items/f86f7726973693c20c95 2022-01-16 02:12:51
AWS AWSタグが付けられた新着投稿 - Qiita 【Cognito】カスタム認証チャレンジでトークン認証を実装して、SAMでデプロイしてみる。 https://qiita.com/ItsukiN32/items/4c19b14fc6cd07119c80 VerifyAuthChallengeここではユーザから返されたチャレンジに対する答えを処理し、チャレンジが通過したかどうかを判定します。 2022-01-16 02:27:24
Docker dockerタグが付けられた新着投稿 - Qiita Docker(WSL2)でPleasanter(SQLServer)環境を作成 https://qiita.com/M_S/items/a864ea5ea69296bcab3b 2022-01-16 02:35:20
Docker dockerタグが付けられた新着投稿 - Qiita 【MySQL,Docker】MySQLの文字化けを解消する方法 https://qiita.com/kotobuki5991/items/9a7e0e9ed7ebf30ba01d まとめmysqlで文字化けが起こった際は、mysqletcmycnfファイルをローカルに作成mysqlコンテナ内のetcmycnfの内容をのファイルにコピーローカルのmysqletcmycnfに設定を追記dockercomposeymlを修正の手順で修正できます。 2022-01-16 02:32:44
golang Goタグが付けられた新着投稿 - Qiita goroutineで並行処理のメモ https://qiita.com/greenteabiscuit/items/316604294beaeb3f373a goroutineで並行処理のメモgoroutineを使ったときのメモです。 2022-01-16 02:26:25
海外TECH MakeUseOf The 6 Best Tips to Improve Your Relationship With Your Boss https://www.makeuseof.com/tips-to-improve-relationship-with-boss/ practical 2022-01-15 17:45:22
海外TECH MakeUseOf 15 Great Arduino Projects for Beginners https://www.makeuseof.com/tag/10-great-arduino-projects-for-beginners/ beginner 2022-01-15 17:36:37
海外TECH MakeUseOf A Beginner’s Guide to Setting Up and Using Siri https://www.makeuseof.com/how-to-set-up-and-use-siri-iphone/ beginner 2022-01-15 17:30:22
海外TECH MakeUseOf How to Enable Dark Mode on Asana https://www.makeuseof.com/how-to-enable-dark-mode-asana/ serious 2022-01-15 17:15:12
海外TECH DEV Community Create Your Own Live Browser Refresh In Deno https://dev.to/craigmorten/how-to-code-live-browser-refresh-in-deno-309o Create Your Own Live Browser Refresh In DenoIn modern web development we ve grown accustomed to rich developer experience features such as hot module replacement HMR from the likes of Webpack HMR and React Fast Refresh which allow us to iterate on our apps fast without the pain of slow server restarts Ever wondered how this tooling might work In this tutorial we will build a simple live browser refresh in Deno that demonstrates so of the basics Getting started To begin you will need to install Deno and create a new directory to work in e g refresh For this tutorial I am using Deno v but the code should work with future versions of Deno as it doesn t require any external dependencies provided there are no breaking changes to the Deno APIs e g for v In your new directory create a mod ts file This will act as the entrypoint for our Deno module and contain all of our server side code Watching files The first part of our live browser refresh module is a function to watch for file changes this will later allow us to tell the browser to refresh when we make and save changes to our application Watch files from current directory and trigger a refresh on change async function watch Create our file watcher const watcher Deno watchFs Wait for and loop over file events for await const event of watcher TODO trigger a browser refresh Here we define our initial watch function which makes use of the built in Deno watchFs method to watch for file system events anywhere within our current directory We then loop over the events picked up by the watcher where we will add code to trigger a browser refresh Before we move onto code for triggering browser refresh it s worth taking a look at different file system events that can fire Namely interface FsEvent flag FsEventFlag kind any access create modify remove other paths string It would be a bit annoying if our application reloaded every time a file was accessed but not necessarily changed Let s update our loop to filter out some of these events for await const event of watcher Skip the any and access events to reduce unnecessary refreshes if any access includes event kind continue TODO trigger a browser refresh WebSocket middleware In this tutorial we will be using WebSockets to communicate the need to trigger a browser refresh It is worth noting that you could also use Server Sent Events to achieve a similar result If you try it out do share in the comments below We will start with setting up the server side WebSocket behaviour For this we will create a small middleware function that will accept specific requests to the server and upgrade the connection to a WebSocket Upgrade a request connection to a WebSocket if the url ends with refresh function refreshMiddleware req Request Response null Only upgrade requests ending with refresh if req url endsWith refresh Upgrade the request to a WebSocket const response socket Deno upgradeWebSocket req TODO handle the newly created socket return response Leave all other requests alone return null Here our function first checks the request URL to see if it ends with refresh If not we leave the request alone When we get a match we use the built in Deno upgradeWebSocket method to upgrade our connection to a WebSocket This method returns an object including the response that must be returned to the client for the upgrade to be successful and a socket instance Given we will be using the socket instance as our means of instructing the client to refresh the browser let s add some code to store the WebSocket as well as handle when it closes In memory store of open WebSockets for triggering browser refresh const sockets Set lt WebSocket gt new Set Upgrade a request connection to a WebSocket if the url ends with refresh function refreshMiddleware req Request Response null if req url endsWith refresh const response socket Deno upgradeWebSocket req Add the new socket to our in memory store of WebSockets sockets add socket Remove the socket from our in memory store when the socket closes socket onclose gt sockets delete socket return response return null We ve now added an in memory store for created WebSockets When we upgrade the connection we add the new socket to our store as well as a handler for removing the socket from the store when it closes Triggering browser refresh We re now ready to update our file watching code to trigger a browser refresh We will do this by using the WebSockets created in our middleware to send a refresh event to the client Watch files from current directory and trigger a refresh on change async function watch const watcher Deno watchFs for await const event of watcher if any access includes event kind continue sockets forEach socket gt socket send refresh Here we loop over the sockets in memory store and for each WebSocket we send our custom refresh event Finishing our server module ‍To finish off our server module we just need to tie our file watching and server middleware together For this we create our refresh function module export which users can consume to their servers Constructs a refresh middleware for reloading the browser on file changes export function refresh req Request gt Response null watch return refreshMiddleware This final exported function ties our work together First it starts the file watcher and then returns the middleware that can be used to handle the refresh communications between the server and the browser Handling refresh events client side Now we re all sorted on the server let s hop over the some coding for the client First we need to create a client js file to host our code Let s just dive in with the full code gt let socket reconnectionTimerId Construct the WebSocket url from the current page origin const requestUrl window location origin replace http ws refresh Kick off the connection code on load connect Info message logger function log message console info refresh message Refresh the browser function refresh window location reload Create WebSocket connect to the server and listen for refresh events function connect callback Close any existing sockets if socket socket close Create a new WebSocket pointing to the server socket new WebSocket requestUrl When the connection opens execute the callback socket addEventListener open callback Add a listener for messages from the server socket addEventListener message event gt Check whether we should refresh the browser if event data refresh log refreshing refresh Handle when the WebSocket closes We log the loss of connection and set a timer to start the connection again after a second socket addEventListener close gt log connection lost reconnecting clearTimeout reconnectionTimerId reconnectionTimerId setTimeout gt Try to connect again and if successful trigger a browser refresh connect refresh A lot going on here First we create some variables for storing the current WebSocket and a reconnection timer id We then construct the url that will be used by the WebSocket for requests Notice how it ends in refresh just as we coded our server middleware function to detect and handle Then we kick off the connection with a call to the connect method The connect function is where the majority of the work takes place We ensure that any pre existing sockets are closed we want to avoid situations where there are more than one connection resulting in double refreshes The WebSocket is then constructed using the request url and a series of event listeners are setup to handle different WebSocket events The main event listener is for message events This receives messages from the server and if it receives our custom refresh event it fires a call to the refresh function which refreshes the browser The close event listener handles when we lose the connection from the server This can happen easily with network blips e g when you pass through a tunnel and lose signal so always good to handle Here we setup a timeout to try and restart the connection again by calling connect after a second delay This time we pass the refresh function as a callback to trigger a refresh once our connection is back Finally the open event listener fires when the connection opens and here we just execute the provided callback This is used in the aforementioned reconnection logic to trigger the browser refresh when we get our connection back Congratulations And we re done Between the server mod ts and the browser client js we ve now got all we need to successfully implement a live browser refresh on code change Don t believe me Let s try it out First we will need to write a simple server to consume our new refresh module Let s create a server ts import serve from import dirname fromFileUrl join from import refresh from mod ts Create useful file path variable for our code const dirname fromFileUrl dirname import meta url const clientFilePath join dirname client js const indexFilePath join dirname index html Construct the refresh middleware const refreshMiddleware refresh Start a server on port serve req Request gt Handle custom refresh middleware requests const res refreshMiddleware req if res return res Handle requests for the client side refresh code if req url endsWith client js const client Deno readTextFileSync clientFilePath return new Response client headers Content Type application javascript Handle requests for the page s HTML const index Deno readTextFileSync indexFilePath return new Response index headers Content Type text html console log Listening on http localhost This server code uses the Deno Standard Library for some server and path utilities It constructs some variables storing the path to files the server needs to return constructs the refresh middleware using the module that we ve created in this tutorial and then uses the standard library serve method to start a server on port We first call our refresh middleware with the request and if we get a non null response we return it this means the request was for a WebSocket connection Otherwise we handle requests for our client js code and otherwise fallback to returning an index html Let s create this index html file now lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset utf gt lt meta name viewport content width device width initial scale gt lt title gt Example Refresh App lt title gt lt style gt body background ce font family Verdana Geneva Tahoma sans serif color ddd text align center font size px lt style gt lt head gt lt body gt lt script src client js gt lt script gt lt h gt Hello Deno lt h gt lt body gt lt html gt And there we have it Let s run our new server deno run allow read allow net server tsIf we open a browser on http localhost we should see our simple Hello Deno webpage Now for the exciting part let s see if the live browser refresh works Head to your index html and try changing the text or some of the CSS Notice anything different about the page in the browser For an example of all this code working and more check out the finished version at Written any cool Deno code lately Perhaps you ve built your own live browser refresh or even HMR module that is worth a share Reach out on my twitter craigmorten or leave a comment below It would be great to hear from you 2022-01-15 17:39:07
海外TECH DEV Community What is the use of UseMemo https://dev.to/johnbabu021/what-is-the-use-of-usememo-4aee What is the use of UseMemouseMemo is a memorise hook that avoid rendering a Component if there is no change in props let s take an example when a parent child renders all of it s children component will render but we can avoid rendering of children if there is no change in the props by wrapping it with a React useMemo hook 2022-01-15 17:18:05
海外TECH DEV Community Quicksort Algorithm: Explained With Diagrams and Javascript https://dev.to/the_greatbonnie/quicksort-algorithm-explained-with-diagrams-and-javascript-fe9 Quicksort Algorithm Explained With Diagrams and JavascriptQuicksort is a method of sorting values in a list through a repeated procedure to successive lists In the Quicksort method a value is chosen from the main list and it is named the pivot value The remaining values are divided into two lists One list is of values that are less than or equal to the pivot value Those values go to the left of the pivot value The second list is of values that are greater than the pivot value Those values go to the right side of the pivot value The Quicksort method is repeated on all resulting lists until only a single or an empty value list remains After that you pick the last single value and if the value is on the left side of the pivot value it will stay that way until you get to the first pivot value at the top The same case remains for the values on the right side of the pivot value To make the Quicksort method clear let us use a diagram Let us say you have a list of values as shown in the diagram below What you want to do is to arrange the values from the smallest to largest How do you do that The first thing you are supposed to do is to pick one value and make it the pivot value Let say you pick and make it the pivot value The next thing you are supposed to do is place values that are less than or equal to on the left side Values that are greater than will go to the right Here is a diagram that explains it better We will now repeat the same process until only a single or empty list of values remains The next step is to start with the single value lists Then place the value on the left side of the pivot value if it is already on the left or place it on the right side if it is already on the right side Here is how the final results will look like As you can see from the results the values have been arranged from the smallest to the largest That s the power of the Quicksort method Quicksort Method In JavascriptThe first thing we will do here is to define our values variable using const const values Let us create a function that will be able to Quicksort our list values when we call it To do that we will first need to declare our function function QuickSort List Our function Quicksort takes one parameter called List The next thing we will do is to check the length of the List If it is then we will return the list as it is function QuickSort List if List length lt return List Let us now select a pivot value and create two empty lists We will name one list leftList and the other list rightList function QuickSort List if List length lt return List const pivot List List length const leftList const rightList As you can see from the code block above our pivot value will be the last value from our list of values that we defined in our first step The two empty lists we created will be used to store values as compared with the pivot value If a value is less than or equal to the pivot value it will be stored in the leftList If a value is greater than the pivot value it will be stored in the rightList To make that happen we will use a for loop as shown below function QuickSort List if List length lt return List const pivot List List length const leftList const rightList for let i i lt List length i if List i lt pivot leftList push List i else rightList push List i Let us call Quicksort on leftList and rightList to partition them so that they can get sorted completely To be able to do that we will use Javascript Spread Operator The Javascript Spread Operator will allow us to quickly copy all or part of an existing list into another list function QuickSort List if List length lt return List const pivot List List length const leftList const rightList for let i i lt List length i if List i lt pivot leftList push List i else rightList push List i return QuickSort leftList pivot QuickSort rightList To see if our code works let us call the Quicksort function on our list of values and see if they will be arranged from the smallest to the largest const values function QuickSort List if List length lt return List const pivot List List length const leftList const rightList for let i i lt List length i if List i lt pivot leftList push List i else rightList push List i return QuickSort leftList pivot QuickSort rightList console log QuickSort values To view the results you need to create a HTML file and link the Javascript file that you have written the code above lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset UTF gt lt meta http equiv X UA Compatible content IE edge gt lt meta name viewport content width device width initial scale gt lt title gt Document lt title gt lt head gt lt body gt lt script src assignment js gt lt script gt lt body gt lt html gt After that open the HTML file on your browser Then right click the web page and select Inspect at the bottom from the list of options Then navigate to the console and you should be able to see that our values are arranged from the smallest to the largest ConclusionQuicksort is a very efficient sorting method that provides O nlog n performance on average It is relatively easy to implement and these attributes make it a popular and useful sorting method 2022-01-15 17:03:13
Apple AppleInsider - Frontpage News Missing iPhone 13 Phone Noise Cancellation may not return https://appleinsider.com/articles/22/01/15/missing-iphone-13-phone-noise-cancelation-may-not-return?utm_medium=rss Missing iPhone Phone Noise Cancellation may not returnA noise cancelation Accessibility feature affecting phone calls is not available in the iPhone with Apple Support seemingly believing the removal of the option from the Settings app is a permanent change Apple pushes noise cancelation in its AirPods Pro line as well as others as a way to make audio clearer for others It seems that while iPhone has a similar feature built into it for regular phone calls it s not an item that all users can adjust Accessible through the Settings app under Accessibility then Audio Visual Phone Noise Cancellation is intended to reduce ambient noise on phone calls when you hold the headset to your ear It s meant to make it easier to hear the phone call itself despite any noise from your immediate surroundings Read more 2022-01-15 17:35:36
海外TECH Engadget The next iPad Pro will reportedly offer MagSafe charging and a 'brand new chip' https://www.engadget.com/apple-ipad-pro-2022-magsafe-leak-173643522.html?src=rss The next iPad Pro will reportedly offer MagSafe charging and a x brand new chip x The murmurs of an iPad Pro with wireless charging are growing louder toMacsources claim Apple is moving forward with an update to its pro tablet that would include MagSafe wireless charging but not necessarily how you d expect Rather than using a previously reported all glass back like most recent iPhones the new iPad Pro could instead charge through an enlarged glass Apple logo built into a metal back It would charge more quickly than an iPhone expected given the iPad s added power draw and carry stronger magnets to keep the charger in place The refreshed iPad Pro would include some more universal improvements including a larger battery and an iPhone style camera array There would also be a quot brand new chip quot to presumed would be the M also expected for a new MacBook Air Earlier rumors suggested the M would have eight cores like the M but would run them faster and tout more graphics cores There was no mention of a specific timeframe for the iPad Pro update While talk has circulated of a spring event there are no guarantees Apple will launch any new iPads in that time frame Don t be shocked if there is a new Pro though The M based iPad Pro was as much a chance for Apple to flex its silicon prowess as it was a functional upgrade ーan M sequel would keep that momentum going and MagSafe support would help tie the Pro into Apple s wider ecosystem 2022-01-15 17:36:43
海外ニュース Japan Times latest articles Japan on alert as tsunami waves reach coast following Tonga eruption https://www.japantimes.co.jp/news/2022/01/16/national/japan-tsunami-tonga-volcano/ tokara 2022-01-16 02:32:59
ニュース BBC News - Home Get away from shore: US and Japan warn on tsunami https://www.bbc.co.uk/news/world-asia-60007119?at_medium=RSS&at_campaign=KARANGA cross 2022-01-15 17:47:53
ニュース BBC News - Home Reported UK Covid cases at lowest level for a month https://www.bbc.co.uk/news/uk-59973659?at_medium=RSS&at_campaign=KARANGA figures 2022-01-15 17:39:01
ニュース BBC News - Home Marmite-owner Unilever makes three bids for GSK consumer goods arm https://www.bbc.co.uk/news/business-60009645?at_medium=RSS&at_campaign=KARANGA business 2022-01-15 17:10:48
ニュース BBC News - Home Ashling Murphy: Thousands gather at Ireland and UK vigils https://www.bbc.co.uk/news/world-europe-60009376?at_medium=RSS&at_campaign=KARANGA ashling 2022-01-15 17:25:02
ニュース BBC News - Home Watford snatch late draw at relegation rivals Newcastle https://www.bbc.co.uk/sport/football/59918928?at_medium=RSS&at_campaign=KARANGA Watford snatch late draw at relegation rivals NewcastleWatford earn a vital late point in their Premier League survival bid as Joao Pedro s headed equaliser keeps them clear of the bottom three and denies hosts Newcastle a much needed win 2022-01-15 17:47:16
ニュース BBC News - Home Norwich City 2-1 Everton: Canaries end losing streak to pile more pressure on Rafael Benitez https://www.bbc.co.uk/sport/football/59918925?at_medium=RSS&at_campaign=KARANGA Norwich City Everton Canaries end losing streak to pile more pressure on Rafael BenitezNorwich rediscover their scoring touch to end a six game losing run bolster their survival hopes and pile the pressure on Everton manager Rafael Benitez 2022-01-15 17:16:26
ニュース BBC News - Home Mark Williams hits 'impossible' shot in dramatic Masters loss to Neil Robertson https://www.bbc.co.uk/sport/av/snooker/60008693?at_medium=RSS&at_campaign=KARANGA Mark Williams hits x impossible x shot in dramatic Masters loss to Neil RobertsonMark Williams hits an impossible shot in a dramatic Masters semi final loss to Neil Robertson in which he came back from two snookers down to win the deciding frame 2022-01-15 17:43:32
ビジネス ダイヤモンド・オンライン - 新着記事 初対面の人と 必ず話が盛り上がる 話し方の「公式」とは? - ゴゴスマ石井のなぜか得する話し方 https://diamond.jp/articles/-/292867 2022-01-16 02:50:00
北海道 北海道新聞 北朝鮮、鉄道発射を威嚇の中心に 態勢の拡充予告、疑問の声も https://www.hokkaido-np.co.jp/article/633871/ 北朝鮮メディア 2022-01-16 02:20:06
北海道 北海道新聞 JR線路脇で男子高生死亡 広島市、制服姿で https://www.hokkaido-np.co.jp/article/633912/ 広島市安佐北区 2022-01-16 02:12:05

コメント

このブログの人気の投稿

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