投稿時間:2023-08-18 21:20:53 RSSフィード2023-08-18 21:00 分まとめ(28件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita ABC314復習 https://qiita.com/hide_take/items/6cefc3408be15c3a047d atcoder 2023-08-18 20:00:26
js JavaScriptタグが付けられた新着投稿 - Qiita Tailwind css で CSS カスタムプロパティ を用いた デザイントークンを設定する https://qiita.com/Spiral_sito/items/768f0560b91a45955d89 textgray 2023-08-18 20:23:54
AWS AWSタグが付けられた新着投稿 - Qiita AWS SAP-C02 合格体験記 https://qiita.com/toki_18/items/0d8c0319758e91e2134f awssapc 2023-08-18 20:35:41
技術ブログ Developers.IO AWS Transfer Family のプロトコルをFTPS 、ユーザー管理をカスタム ID プロバイダーで構築してみた https://dev.classmethod.jp/articles/aws-transfer-family-ftps-custom-provider/ awstransferfamily 2023-08-18 11:49:52
技術ブログ Developers.IO ImmutaデフォルトのSensitive Data Discoveryでどのようなデータが自動タグ付けされるか確かめてみた https://dev.classmethod.jp/articles/immuta-check-sensitive-data-discovery-spec/ sensitivedi 2023-08-18 11:40:41
技術ブログ Developers.IO ImmutaでSnowflakeをData Souceとして追加してみた https://dev.classmethod.jp/articles/immuta-add-snowflake-data-source/ datasouce 2023-08-18 11:40:33
技術ブログ Developers.IO Using Tableau’s Spatial Joins with Mixed Geometries https://dev.classmethod.jp/articles/spatial-joins-with-mixed-geometries-en/ atialdatasourcesintablea 2023-08-18 11:29:33
技術ブログ Developers.IO Tableau で混合ジオメトリの空間データの結合 https://dev.classmethod.jp/articles/spatial-joins-with-mixed-geometries-jp/ clickhereforenglish 2023-08-18 11:29:26
海外TECH Ars Technica NASA has repaired its mobile launcher, so let’s map out the path to Artemis II https://arstechnica.com/?p=1961382 artemis 2023-08-18 11:30:02
海外TECH Ars Technica Rocket Report: Russian rocket lands like an airplane; SpaceX steamroller rolls https://arstechnica.com/?p=1961496 onion 2023-08-18 11:00:58
海外TECH MakeUseOf What Is a VRM on a Motherboard, and Why Is It Important? https://www.makeuseof.com/what-is-vrm-motherboard/ power 2023-08-18 11:15:24
海外TECH DEV Community How to Process Scheduled Queue Jobs in Node.js with BullMQ and Redis on Heroku https://dev.to/lirantal/how-to-process-scheduled-queue-jobs-in-nodejs-with-bullmq-and-redis-on-heroku-3dl7 How to Process Scheduled Queue Jobs in Node js with BullMQ and Redis on HerokuBackground job processing is a technique for running tasks that can take a long time to complete in a separate process from the main application server This allows the main application server to continue to handle requests from users while the background jobs are running There are many reasons why you might want to use background job processing in your Node js server application For example you might use it to Process large files or imagesSend email or SMS messagesRun batch jobsPerform complex calculationsSchedule tasks to run at a later timeThere are a number of different ways to implement background job processing in Node js One popular approach is to use a message queue A message queue is a first in first out FIFO system that allows you to send messages between different processes When you want to run a background job you can add a message to the queue The message will then be processed by a separate worker process which is a process that is dedicated to running background jobs In this article I will share how to use the BullMQ npm package together with a Redis server to implement background job processing in Node js I ll also cover how to deploy your background job application to Heroku Requirements for this tutorialTo get started you will need to have the following installed Node jsRedisThe Bull and Redis librariesThe Heroku CLIOnce you have these installed you can follow the instructions in this article to create your background job application Quick introduction to HerokuYou re welcome to skip if you already know or use Heroku Heroku is a cloud platform that makes it easy to deploy and scale web applications It provides a number of features that make it ideal for deploying background job applications including Automatic scaling Heroku will automatically scale your application up or down based on demand so you don t have to worry about managing your own infrastructure Managed services Heroku provides a number of managed services such as Redis and Postgres so you don t have to worry about provisioning and managing these services yourself To get started with Heroku you will need to create an account and install the Heroku CLI Once you have done that you can create a new Heroku app and deploy your application to it The benefit of using Heroku for background job processing is that it is easily scalable naturally fits long running processes and makes it easy to colocate your background job application with your main application server Quick introduction to BullMQ and RedisBullMQ is a message queue library for Node js It allows you to send and receive messages between different processes Redis is an in memory data store that BullMQ uses as a message queue BullMQ and Redis work together to provide a reliable and scalable way to process background jobs BullMQ handles the queuing and routing of messages while Redis stores the messages and provides a high performance consistent way to access them Some key features of BullMQ include Supports multiple queue types including FIFO LIFO and priority queues Allows you to schedule jobs to run at a later time Supports retries for failed jobs Supports rate limiting for jobs Setting up a Heroku application with RedisTo set up a Heroku application with Redis you will need to Create a new Heroku app Provision a Redis instance Set up the Procfile for a new worker configuration Here are the commands you can use to do this heroku create my appheroku addons create heroku redis hobby devecho worker node worker js gt gt ProcfileThe first command creates a new Heroku app named my app The second command provisions a Redis instance on the Hobby Dev plan The third command creates the Heroku app infrastructure file Procfile which tells Heroku to provision a background job processing resource and to run the node worker js command for it The worker js file is where you will put your code for processing background jobs We re getting to it next The BullMQ workerThe worker is the process that will consume work from the queue and run the background jobs In Heroku and generally speaking it s a separate Node js runtime process and as such it is entirely unrelated in terms of deployment from that of your main web API Node js runtime if you have one It s also generally considered to be a long running process meaning it will run indefinitely until it is stopped If there s no work it simply idles It will connect to the Redis instance and listen for jobs to be added to the queue When a job is added to the queue the worker will process the job and then mark it as complete Setting up the BullMQ workerSetting up the BullMQ worker is as simple as creating a new file worker js and adding the following code import Worker from bullmq Redis connection details const workerConnectionOptions host import meta env hostname port import meta env port password import meta env password The following sets up the worker Connects to a queue named uploaded files queue Runs the workerJobHandler function when a job is added to the queue Creates a new worker instance that allows hooking to events in the worker lifecycleconst workerInstance new Worker uploaded files queue workerJobHandler connection workerConnectionOptions The workerJobHandler function is the function that will be called when a job is added to the queue It will receive the job as an argument The job will contain the data that was added to the queue when the job was created async function workerJobHandler job console log handling job job id console log jobName job name jobId job id data job data for example await processUploadedFile job data fileId return Acting on events in the worker lifecycleWe can hook into events in the worker lifecycle to perform actions when certain events occur For example we can hook into the completed event to perform an action when a job is completed We can also hook into the failed event to perform an action when a job fails Add the following to the worker js file workerInstance on completed async job gt console log job id entering job completion stage console log job id has completed workerInstance on failed job err gt console error job id has failed with err message console error err workerInstance on error err gt console error WorkerInstance has errored with err message Tip Avoid try catch for error handling You don t need to customize error handling within the worker handler function BullMQ automatically catches thrown errors from the function Next it retries failed jobs and moves them to a dead letter queue after a certain number of retries Utilizing CPU cores with BullMQNode js being a single threaded runtime can only utilize a single CPU core This means that if you have a multi core CPU host assigned to the worker process then you ll constantly under utilize your hardware resources Instead you can utilize all CPU cores by running multiple instances of the worker This is often referred to as clustering and it s a common pattern in Node js applications We can use a small wrapper for Node js s built in clustering capabilities with the throng npm package in order to launch a separate Node js runtime process for each CPU We will change the worker js file to accompany for throng import throng from throng throng worker wrap the worker code in a function called worker which will then be called by throng function worker the worker code from previous section Better BullMQ worker with Dependency InjectionYour background job workers while deployed separately from your main web APIs will still need to access your application s services and dependencies For example you may want to access your database or your file storage service to which you ll need to pass the necessary configuration credentials and potentially other domain logic In order to do this we can use a dependency injection container to inject dependencies into the worker We can use the Awilix npm package to do this The pattern I suggest is as follows The worker is co located with the Node js API service microservice source code it is related to This way it can easily access domain logic via high level abstraction APIs the services i e FileStorageService DatabaseService etc The worker is instantiated with a dependency injection layer that is allows the worker to request access to any of the necessary dependencies just as if it was another HTTP API route handler in the main service This will end up looking something like this import throng from throng import Config from services core Config js import DatabaseManager from services core db js import initDI from infra di js import WorkerFactory from workers fileUploadWorker js async function initDatabase config Initialize the database const database new DatabaseManager config Ensure database connection is ready await database ping Return the database instance return database Load configurationconst configManager new Config const config await configManager load Initialize the databaseconst database await initDatabase config Initialize DIconst diContainer await initDI config database const Logger diContainer resolve Logger Logger info Worker initialized const worker WorkerFactory container diContainer throng worker In the above code example we initialize configuration and database connection details then pass these to the dependency injection layer to make them available to DI consumers As you notice we wrap the worker code in a Factory Function to make the dependency injection container available to the worker The BullMQ producer clientTo make this guide complete we ll also review shortly the BullMQ client which is responsible to add jobs to the queue for the worker to consume It is in fact as simple as import Queue from bullmq Create a new queue instanceconst queue new Queue uploaded files queue connection workerConnectionOptions Schedule a new job on the queue with a name that is associated with this job any metadata this job should include a JSON object queue add jobName jobData Tip BullMQ will default to schedule jobs with a retry attempts value set to which means it won t retry failed jobs You can override this by setting the attempts value to a number greater than More on this jobs are retried immediately unless a delay is specified You can override this by setting the backoff value be an object with type exponential and a delay specified in milliseconds To accommodate for job retries and other queue house keeping configuration we can further customize the job queue configuration as follows for when we schedule jobs This configuration can be provided at either the queue level or the job level In this example it is set at the job level const jobQueueConfig attempts backoff type exponential delay removeOnComplete age removeOnFail age queue add jobName jobData jobQueueConfig Next stepsDon t forget you have to actually deploy your worker to Heroku You can do this by running the following command git push heroku mainIf you are interested in learning more about BullMQ and Redis I recommend checking out the following resources BullMQ documentation Redis documentation You d also want to look into alternative implementations for queue with RabbitMQ and the amqplib npm package 2023-08-18 11:19:45
海外TECH DEV Community Database Transactions in Laravel https://dev.to/jonhyknid/database-transactions-in-laravel-39b1 Database Transactions in LaravelIn Laravel database transactions are used to manage the integrity and consistency of the database when performing multiple database operations together A transaction is a set of database operations that are executed as a single unit of work If any part of the transaction fails all the changes made within that transaction are rolled back ensuring that the database remains in a consistent state DB beginTransaction try Perform database operations here User where age gt gt delete if User where status User DRAFT gt first Performing Database Operations Commit the transaction DB commit catch Exception e Something went wrong rollback the transaction report e DB rollback 2023-08-18 11:17:02
海外TECH DEV Community Why Consistency Matters the Most in Programming https://dev.to/akashpattnaik/why-consistency-matters-the-most-in-programming-43ie Why Consistency Matters the Most in ProgrammingIn the realm of programming an art that intertwines logic creativity and innovation one principle stands tall as an unwavering cornerstone consistency From the inception of a project to its culmination from lines of code to the grand architecture of software applications the essence of maintaining consistency reverberates with profound impact In this article we delve into the multifaceted significance of consistency in programming unravelling its pivotal role in crafting robust maintainable and effective software solutions Building a Solid FoundationConsistency serves as the bedrock upon which a programmer constructs their digital marvels Just as a well laid foundation is indispensable for a towering skyscraper consistent coding practices set the stage for the entire software development process When a team adheres to a standardized coding style uniform naming conventions and a consistent indentation structure the resulting codebase becomes comprehensible manageable and resilient Enhancing CollaborationIn the collaborative landscape of programming consistency acts as a lingua franca that bridges the gap between developers Imagine a scenario where a project involves multiple programmers working across various modules Without consistency deciphering each other s code becomes a labyrinthine task leading to inefficiencies misinterpretations and errors However when consistency prevails the code speaks with a unified voice enabling seamless collaboration effective code reviews and accelerated development cycles Sustaining MaintainabilitySoftware much like a living organism evolves over time New features are added bugs are fixed and optimizations are implemented In this dynamic environment consistency plays the role of a caretaker Consistent code is not only easier to understand but also simpler to modify When a developer revisits a codebase after months or years a consistent structure provides them with a navigational map reducing the chances of confusion and minimizing the time required to make changes Nurturing ReliabilityAt the heart of every software application lies a desire for reliability Consistency weaves this reliability into the fabric of code By adhering to consistent coding practices developers reduce the likelihood of hidden pitfalls undefined behavior and unexpected crashes Predictability emerges as a natural consequence assuring end users and stakeholders of a dependable software product that functions as intended Fostering InnovationThe symbiotic relationship between consistency and innovation might seem paradoxical at first glance However when a solid foundation of consistent code exists developers are freed from wrestling with incongruities and discrepancies This liberation grants them the mental bandwidth to focus on creative problem solving novel algorithms and groundbreaking features Thus consistency acts as a springboard that propels programmers toward the realms of innovation Mitigating Technical DebtIn the world of programming technical debt refers to the accumulated consequences of hasty or inconsistent coding practices Much like financial debt technical debt accrues interest over time manifesting as convoluted code fragile components and maintenance nightmares Consistency functions as an early payment against this debt By investing time and effort in adhering to uniform practices programmers prevent the proliferation of technical debt ensuring the long term sustainability of their projects A Virtuous CycleConsistency in programming engenders a virtuous cycle that amplifies its benefits As developers experience the ease of understanding the fluidity of collaboration and the efficiency of maintenance in a consistent codebase they naturally become advocates for these practices This advocacy perpetuates the cycle leading to an organizational culture where consistency is revered practiced and continuously refined ConclusionIn the intricate realm of programming consistency stands as a beacon guiding developers toward excellence From fostering collaboration and innovation to mitigating technical debt and ensuring reliability the impact of consistency reverberates through every facet of software development By embracing the principle of consistency programmers lay the groundwork for software solutions that transcend mere functionality and evolve into elegant sustainable works of digital art Connect with me Mail akashpattnaik github gamil comGithub iAkashPattnaikTwitter akash am 2023-08-18 11:04:38
Apple AppleInsider - Frontpage News Hands on with Apple Vision Pro in the wild https://appleinsider.com/articles/23/08/18/hands-on-with-apple-vision-pro-in-the-wild?utm_medium=rss Hands on with Apple Vision Pro in the wildThere are a few Apple Vision Pro headsets out in the wild and recently we got a chance to use one of them Here s what we thought Vision Pro at Apple ParkI ve known this day was coming for a long time Rumors have been floating around about this headset for about five years ARKit was a clear herald that something like the Apple Vision Pro was imminent Read more 2023-08-18 11:58:19
Apple AppleInsider - Frontpage News iPhone 15 may get faster charging speeds up to 35W https://appleinsider.com/articles/23/08/18/iphone-15-may-get-faster-charging-speeds-up-to-35w?utm_medium=rss iPhone may get faster charging speeds up to WWith the switch from Lightning to USB C charging all but certain a new rumor says that Apple will use it to enable W charging on some iPhone models cutting the time needed for a recharge There are now many leaks saying Apple will switch the iPhone to USB C charging and there s also the EU law requiring the change shortly There have also been claims about the switch meaning substantially faster data transfer speeds too Now a further rumor claims that at least the iPhone Pro models may be chargeable at W At present on a Lightning wired connection rather than Qi wireless charging the maximum is Read more 2023-08-18 11:09:12
海外TECH Engadget The Morning After: Fisker reveals more about its Alaska electric pickup https://www.engadget.com/the-morning-after-fisker-reveals-more-about-its-alaska-electric-pickup-111510076.html?src=rss The Morning After Fisker reveals more about its Alaska electric pickupFisker has shed some more light on its Alaska electric pickup which it says will have a base price of just The Alaska is a work friendly vehicle letting you run your business from the cockpit It has dedicated work glove and cowboy hat storage a slide out laptop tray and a cup holder big enough to hold a day s worth of water The default flatbed is feet but you can drop the partition to increase that to feet Lower the seats and the liftgate and you can push it to feet big enough to haul several sheets of plywood from one job to the next But much as Fisker may promise this will be one of the lightest and cheapest EVs in its class we ll wait to see how much it actually costs when it debuts in before making a judgment Dan CooperYou can get these reports delivered daily direct to your inbox Subscribe right here ​​​​The biggest stories you might have missedThe best wireless earbuds for The best budget laptops for Amazon sale slashes Fire TV streaming devices by up to percent Samsung s revamped Freestyle projector is now available to pre orderCall of Duty Modern Warfare III will include the series biggest zombies map everHomeworld Deserts of Kharak will be free on Epic Games Store this month Alan Wake II delayed by days will arrive on October How to take a screenshot on a Windows PCCan modeling microphones deliver on their copycat promise It s a Swiss Army microphone for audio pros on a budget Photo by James Trew EngadgetProfessional microphones are as unique as the instruments they re built to record each with their own voices The Sphere LX is a modeling microphone designed to alter its qualities to ape the voices of several extremely expensive studio microphones James Trew explores what it s like to use this chameleonic device comparing it to several of the pro microphones it s trying to impersonate I may not find the technical intricacies of audio engineering that gripping but James in depth report is a must read even for me Continue Reading The Xbox store will close in July Farewell old friend After nearly two decades of faithful service the Xbox store will close for good on July Microsoft s Movies amp TV app will stop working on the same day as the company pulls the last vestiges of support for its console The company has already promised games compatible with newer consoles will stay on the Xbox One and Series X S storefronts And media bought via the Xbox will stay in your library so you shouldn t lose too much of anything Continue Reading Lenovo s leaked Legion Go is part Steam Deck part Nintendo SwitchIt s got detachable controllers Windows ReportWith the Legion Go Lenovo may have its own rival to the Steam Deck Ayaneo and ASUS ROG Ally A leak including product renders suggests it s a PC gaming handheld equipped with AMD s new Phoenix processors and a pair of Switch like detachable controllers It looks very possible to prop this thing on a table addressing the issues of hand fatigue so common with other PC class handhelds Just a shame it won t be able to play Tears of the Kingdom Continue Reading Acura s ZDX EV has an estimated miles of range and starts around If those range claims are accurate it s pretty compelling MullenLoweThe Acura ZDX is the latest all electric vehicle from Honda s premium brand due to launch in early The ZDX boasts CarPlay Android Auto a Bang amp Olufsen audio setup and an as yet unofficial range of miles on a single charge The base model is likely to cost around and it s certainly a pretty looking way to get around Continue Reading This article originally appeared on Engadget at 2023-08-18 11:15:10
海外科学 NYT > Science Days on Mars Are Getting Shorter https://www.nytimes.com/2023/08/17/science/mars-days-rotation-insight.html planet 2023-08-18 11:52:53
海外科学 NYT > Science To Stop an Extinction, He’s Flying High, Followed by His Beloved Birds https://www.nytimes.com/2023/08/18/world/europe/johannes-fritz-ibises-migration.html To Stop an Extinction He s Flying High Followed by His Beloved BirdsUsing an ultralight aircraft Johannes Fritz once taught endangered ibises a migration path over the Alps Because of climate change he is now showing them a much longer route to a winter s refuge 2023-08-18 11:54:17
ニュース BBC News - Home Stephen Nolan 'deeply sorry' after explicit image allegations https://www.bbc.co.uk/news/uk-northern-ireland-66543167?at_medium=RSS&at_campaign=KARANGA guest 2023-08-18 11:37:22
ニュース BBC News - Home Melton Mowbray: Glider pilot killed in mid-air crash https://www.bbc.co.uk/news/uk-england-leicestershire-66544210?at_medium=RSS&at_campaign=KARANGA leicestershire 2023-08-18 11:23:59
ニュース BBC News - Home Ethiopia's Tigray crisis: Deaths from starvation after aid halted - official https://www.bbc.co.uk/news/world-africa-66540039?at_medium=RSS&at_campaign=KARANGA april 2023-08-18 11:19:11
ニュース BBC News - Home The Weeknd: Fans react to restricted view concert tickets https://www.bbc.co.uk/news/newsbeat-66449789?at_medium=RSS&at_campaign=KARANGA obstructions 2023-08-18 11:09:27
ニュース BBC News - Home Provide free access to cash or face fines, banks warned https://www.bbc.co.uk/news/business-66537642?at_medium=RSS&at_campaign=KARANGA areas 2023-08-18 11:18:54
ニュース BBC News - Home Liverpool sign Stuttgart and Japan defensive midfielder Wataru Endo https://www.bbc.co.uk/sport/football/66544075?at_medium=RSS&at_campaign=KARANGA Liverpool sign Stuttgart and Japan defensive midfielder Wataru EndoLiverpool sign midfielder Wataru Endo from Stuttgart for a fee of around m euros £m subject to a work permit and international clearance 2023-08-18 11:45:48
ニュース BBC News - Home World Athletics Championships: Adam Gemili says he turned to food for comfort after poor form https://www.bbc.co.uk/sport/athletics/66543273?at_medium=RSS&at_campaign=KARANGA World Athletics Championships Adam Gemili says he turned to food for comfort after poor formBritish sprinter Adam Gemili says he turned to food for comfort after a run of poor form last year left him struggling 2023-08-18 11:17:05
ニュース BBC News - Home Newcastle United agree to loan Lewis Hall from Chelsea before permanent deal next summer https://www.bbc.co.uk/sport/football/66544048?at_medium=RSS&at_campaign=KARANGA lewis 2023-08-18 11:36:27
ニュース BBC News - Home Sarina Wiegman: England manager 'has no plans to leave' role https://www.bbc.co.uk/sport/football/66543228?at_medium=RSS&at_campaign=KARANGA Sarina Wiegman England manager x has no plans to leave x roleSarina Wiegman says she has no plans to leave her job as England manager and intends to see out the rest of her contract which lasts until 2023-08-18 11:12:14

コメント

このブログの人気の投稿

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