投稿時間:2021-11-18 11:38:14 RSSフィード2021-11-18 11:00 分まとめ(46件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] ニトリ、インテリア用品に続き“家具”も限定値下げ 「セット購入」で買い替え需要を喚起 https://www.itmedia.co.jp/business/articles/2111/18/news081.html itmedia 2021-11-18 10:50:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] ハロウィンイベントが嫌いな人は47%――ハロウィンの実態調査で判明 仮装経験者も2割にとどまる https://www.itmedia.co.jp/business/articles/2111/16/news077.html itmedia 2021-11-18 10:41:00
IT ITmedia 総合記事一覧 [ITmedia News] 東京ディズニーシーの新エリア、ドローン撮影した建設中の動画を初公開 https://www.itmedia.co.jp/news/articles/2111/18/news079.html itmedia 2021-11-18 10:31:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] やっぱり紙で保存も可能に? 電子帳簿保存法、国税庁が懸念解消 https://www.itmedia.co.jp/business/articles/2111/18/news074.html ITmediaビジネスオンラインやっぱり紙で保存も可能に電子帳簿保存法、国税庁が懸念解消年月から施行される電子帳簿保存法。 2021-11-18 10:31:00
IT ITmedia 総合記事一覧 [ITmedia News] iPhoneやMacを自分で修理、Appleが公式プログラム提供 「Self Service Repair」、米国で2022年スタート https://www.itmedia.co.jp/news/articles/2111/18/news078.html 提供開始 2021-11-18 10:27:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] 年収が1000万円あったらお金をかけたいこと 2位は「旅行/レジャー」、1位は? https://www.itmedia.co.jp/business/articles/2111/18/news080.html itmedia 2021-11-18 10:25:00
IT ITmedia 総合記事一覧 [ITmedia Mobile] iPhone 12/13向け「iOS 15.1.1」配信 通話時の不具合を改善 https://www.itmedia.co.jp/mobile/articles/2111/18/news077.html apple 2021-11-18 10:10:00
TECH Techable(テッカブル) 128億8000万光年離れた銀河で水の兆候を発見! 米国立電波天文台の研究チームが発表 https://techable.jp/archives/166787 一酸化炭素 2021-11-18 01:00:50
Google Google Developer Japan Blog Google Dev Library のご紹介––デベロッパーのための新しいオープンソース プラットフォーム http://developers-jp.googleblog.com/feeds/6733329192925630874/comments/default DevLibraryがほかと異なる点は何ですか皆さんが申請したすべての記事やプロジェクトがサイトに掲載されるとは限りません。 2021-11-18 11:00:00
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Swift: Launch Screenの表示時間の設定のやり方 https://teratail.com/questions/369859?rss=all SwiftLaunchScreenの表示時間の設定のやり方前提・実現したいことSwiftUIを使ったアプリケーションで起動時のスプラッシュ画面を設定したいと考えております。 2021-11-18 10:54:32
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) XamarinでClearPackagePersistentPreferredActivitiesがAndroid10で動作しません。 https://teratail.com/questions/369858?rss=all XamarinでClearPackagePersistentPreferredActivitiesがAndroidで動作しません。 2021-11-18 10:53:22
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) DB更新の際のSQL失敗について https://teratail.com/questions/369857?rss=all DB更新の際のSQL失敗について前提・実現したいことPHPで会員機能付きのサービスを作っています。 2021-11-18 10:53:10
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) VBA 名前が連番になっているオブジェクトを繰り返し処理で順番に指定したい https://teratail.com/questions/369856?rss=all VBA名前が連番になっているオブジェクトを繰り返し処理で順番に指定したいユーザーフォームにコマンドボタンと、個のコンボボックスが設置されています。 2021-11-18 10:46:30
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) .bagファイルのサイズを圧縮し再生する方法について https://teratail.com/questions/369855?rss=all bagファイルのサイズを圧縮し再生する方法について前提・実現したいこと上記のサイトをみて、realsenseを使い動画を保存し再生しました。 2021-11-18 10:44:15
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) シート保護で入力規則でオートフィルするには https://teratail.com/questions/369854?rss=all シートに図形と入力規則のあるセルが存在します。 2021-11-18 10:44:04
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Textboxからデータ読込が出来ない https://teratail.com/questions/369853?rss=all Textboxからデータ読込が出来ない前提・実現したいことTextBoxに数値を入力し、入力データを読み込もうとしましたがエラーになり読み込めません。 2021-11-18 10:42:44
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Cloudformationのyamlの値を現在時刻から30日を足したい https://teratail.com/questions/369852?rss=all Cloudformationのyamlの値を現在時刻から日を足したいCloudformationのyamlを作成しています。 2021-11-18 10:41:57
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) C# if文やfor文を使わずにお釣りの硬貨の枚数を計算したい。 https://teratail.com/questions/369851?rss=all Cif文やfor文を使わずにお釣りの硬貨の枚数を計算したい。 2021-11-18 10:40:45
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) プレビュー機能を実装したい。 https://teratail.com/questions/369850?rss=all プレビュー機能を実装したい。 2021-11-18 10:37:15
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) file_get_contentsで全てのデータを拾わず特定の個所を拾うことはできないのか https://teratail.com/questions/369849?rss=all 2021-11-18 10:33:49
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) gitlab タグを作成できるブランチを制限したい https://teratail.com/questions/369848?rss=all developブランチで開発を行い、コミットにバージョンタグを振ってバージョンを管理しています。 2021-11-18 10:30:47
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Weight Decayについて https://teratail.com/questions/369847?rss=all weightdecay 2021-11-18 10:30:11
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Oracle 検索について 間違えました https://teratail.com/questions/369846?rss=all oracle 2021-11-18 10:26:27
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) もぐら叩きゲームでゲームストップ後にもクリックできてしまう https://teratail.com/questions/369845?rss=all もぐら叩きゲームでゲームストップ後にもクリックできてしまうJavaScriptでもぐら叩きゲームを作成しています。 2021-11-18 10:22:15
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Sourcetreeでクローンリポジトリができず困っています。Git LFSでエラーが発生しています。 https://teratail.com/questions/369844?rss=all Sourcetreeでクローンリポジトリができず困っています。 2021-11-18 10:17:10
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) PHP 50MBのテキストファイルを読み込むのと1kbのテキストファイル https://teratail.com/questions/369843?rss=all 2021-11-18 10:16:16
技術ブログ Developers.IO Gremlinのカオスエンジニアリングを効果的に実践するための基礎コースで学んだことまとめ3 ~ 状態攻撃のユースケースとビジネスイニシアティブ ~ https://dev.classmethod.jp/articles/gremlin-chaos-course-summary3/ gremlin 2021-11-18 01:44:02
技術ブログ Developers.IO Aqua EnterpriseからCloudWatch Logsにログ出力してみた https://dev.classmethod.jp/articles/aqua_cloudwatchlog/ cloudwatchlogs 2021-11-18 01:22:21
技術ブログ Developers.IO 【小ネタ】Slack のサイドバーを非表示にして作業に集中できるようにする https://dev.classmethod.jp/articles/hide-slack-sidebar/ slack 2021-11-18 01:08:26
海外TECH DEV Community Creating an Async API using Postgres - Building a Chess Analysis App (Part 3) https://dev.to/propelauth/creating-an-async-api-using-postgres-building-a-chess-analysis-app-part-3-11ke Creating an Async API using Postgres Building a Chess Analysis App Part In our last post we built a synchronous API that validates and analyzes a chess position We noted that performing a CPU intensive task synchronously in the web server seems like a bad idea In this post we ll turn that synchronous API into an asynchronous one using Postgres Analyzing the requests asynchronouslyWe cannot have our webserver waiting on an analysis We also ideally want to be resilient to a large number of analyses requested at the same time overloading us This looks like a good time to use a queue What is a queue The basic idea behind a queue is that instead of analyzing the request immediately we store it somewhere to be analyzed later alongside an ID The user can use the ID to check if the analysis is ready Separately some other service is running It will read a chess position from the queue analyze the position and store the result somewhere Services that read from queues and process them are typically called workers One of the many nice things about this approach is that you can scale up or down the number of workers depending on demand How do we make a queue There are a lot of ways to actually implement queues There are products like Kafka or RabbitMQ There are managed services like AWS SQS or AWS Kinesis There are libraries like Celery which can be used with Redis or RabbitMQ For the workers you can use serverless functions like AWS Lambda or you can have a pool of servers waiting for work In our case we are going to use Postgres as a queue for two main reasons We re going to need a database anyway so using Postgres as both a queue and a DB means less stuff to manage I personally like debugging queues via SQL We can get a ton of insight into what s going on in a familiar language Using Postgres as a queueTo make a simple queue we ultimately only need three functions add request to queue request adds the request the queue so it can be processed laterclaim unprocessed request returns any request that hasn t been processed yet No one else should be able to claim this request until we are done finish processing request request result saves the result of processing a request It s important that when a worker claims a request no other worker can also claim it Otherwise we are just wasting time having multiple workers doing the same task Imagine we have a table named queue add request to queue for Postgres can be a simple SQL query INSERT INTO queue id request status created at VALUES gen random uuid request unprocessed now where request is whatever information the worker needs to process the request In our case that s the chess position that we want to analyze and any arguments A first pass at claim unprocessed request could be a simple select statement SELECT id request FROM queue WHERE status unprocessed ORDER BY created atLIMIT However this doesn t stop anyone else from claiming the same request Luckily for us Postgres has two clauses that can help us out SELECT id request FROM queue WHERE status unprocessed ORDER BY created atFOR UPDATE SKIP LOCKEDLIMIT FOR UPDATE locks the row because we are planning to update it SKIP LOCKED will skip over any rows that are currently locked With this no two workers will ever grab the same row finish processing request can be as simple as updating the row with the result of the analysis We need to do this in the same transaction as our select statement that is why we are using FOR UPDATE so the overall flow becomes Begin a transactionSelect a request with FOR UPDATE SKIP LOCKEDProcess the requestSave the result and make the status no longer unprocessed Commit the transaction SQLAlchemyNow that we know what we need to do let s translate it to python We ll use the ORM SQLAlchemy to interact with our database and psycopg as our Postgres adapter this is a library which adds some flask specific features to sqlalchemy venv pip install flask sqlalchemy venv pip install psycopg binaryYou ll want to set up and install Postgres which you can do either with Docker or with their installers Afterwards we can set up our database table In the earlier example we had a status column In this example we are going to just use a nullable analysis result column This is a little less general since it doesn t allow for error statues but should be easy to extend We ll put our models in a new file models py from datetime import datetimeimport sqlalchemyfrom flask sqlalchemy import SQLAlchemyfrom sqlalchemy dialects postgresql import UUID JSONdb SQLAlchemy class Analysis db Model Let the DB generate a UUID for us id db Column UUID as uuid True primary key True server default sqlalchemy text gen random uuid The parameters to our request fen db Column db String nullable False num moves to return db Column db INT nullable False time limit db Column db FLOAT nullable False depth limit db Column db INT The result of an analysis Null means we haven t processed it yet analysis result db Column JSON created at db Column db TIMESTAMP default datetime utcnow nullable False updated at db Column db TIMESTAMP default datetime utcnow onupdate datetime utcnow nullable False A conditional index on created at whenever analysis result is null table args db Index ordered by created at created at postgresql where analysis result is None We can then create this table from the python console venv python gt gt gt from models import db gt gt gt db create all Finishing the APIWe re almost done with the API Let s look at the remaining code in app py in sections First make sure we set any SQLALCHEMY config values and call db init app app same as beforefrom models import db Analysisapp Flask name This is the default URI for postgresapp config SQLALCHEMY DATABASE URI postgresql postgres postgres localhost postgres app config SQLALCHEMY TRACK MODIFICATIONS Falsedb init app app Next we ll update our analyze function to no longer analyze synchronously but instead store the analysis to the database for later processing The database will return an autogenerated UUID that we will return to the user app route analyze methods POST def analyze Validate the request same as before parsed request parse request request get json Save an analysis object to the database analysis Analysis fen parsed request get fen num moves to return parsed request get num moves to return time limit parsed request get time limit depth limit parsed request get depth limit db session add analysis db session commit The id is automatically populated after commiting return id analysis id Finally we need some way for our users to get their analysis We ll create a new endpoint that accepts a UUID validate that they pass in a UUID and then fetch that UUID from the database If the database object has analysis result set we know that it has been analyzed Otherwise we can say that it s still pending analysis Can move this to our parsers file Make sure the UUID we are provided is validdef parse uuid possible uuid try return uuid UUID possible uuid except ValueError return None app route analysis methods GET def get analysis if the ID is invalid or not in our database id parse uuid request args get id if id is None return abort analysis Analysis query get or id if analysis analysis result is None return status pending else return status done result analysis analysis result And that s it for the API We can submit chess positions to be analyzed and we get back an ID We can then poll the ID which will return pending until the analysis is ready We can view this in action by running our server and using curl curl X POST H Content Type application json d fen P R k r K b localhost analyze id cbad c bda eafe curl localhost analysis id cbad c bda eafe status pending The only problem now is that there s no worker to actually analyze the chess position We re going to get back pending forever Let s fix that now Creating chess analysis workersIn addition to being a webserver Flask also supports a CLI We can make a command which loops infinitely reading from the database and processing what it finds In production we can use something like systemd to keep the worker alive and we can control how many processes we spawn to control how many positions can be analyzed in parallel per machine Let s start from the top by making a worker command in app py app cli command worker def worker with app app context run worker Then we ll go implement run worker in a new file worker py import timefrom chessengine import analyze positionfrom models import Analysis db Runs foreverdef run worker while True try did work fetch and analyze If there was nothing to analyze sleep for a bit to not overload the DB if not did work time sleep except Exception as err print f Unexpected err type err def fetch and analyze This is the SQL query we saw before We are looking for rows with no result yet and we order by created at to take older requests first to be analyzed Analysis query filter Analysis analysis result is None order by Analysis created at with for update skip locked True limit first if to be analyzed is not None Use the function we created in our first post in this series to be analyzed analysis result analyze position fen to be analyzed fen num moves to return to be analyzed num moves to return depth limit to be analyzed depth limit time limit to be analyzed time limit print Analyzed format to be analyzed id else print Nothing to analyze Do not forget to commit the transaction db session commit return to be analyzed is not NoneAnd that s the full worker Most of the heavy lifting is done by analyze position and you can use this same structure to turn any synchronous API into an asynchronous one Let s test it by running our worker in a new terminal source venv bin activate venv flask workerAnalyzed cbad c bda eafeNothing to analyzeNothing to analyzeIt found the request we made earlier and analyzed it Let s verify that by hitting our webserver with curl curl localhost analysis id cbad c bda eafe result centipawn score null mate score pv cc ee ce status done And we see the status is done and our result is analysis that we expect Wrapping upWe were able to take a clunky synchronous API and make it asynchronous using Postgres as a work queue Our users can now submit bursts of chess positions and our servers won t get overloaded In our next post we ll use NextJS to build a UI for our application See you then 2021-11-18 01:41:50
金融 ニッセイ基礎研究所 米住宅着工・許可件数(21年10月)-着工件数は前月から減少、市場予想も下回る一方、許可件数は前月、市場予想を上回る https://www.nli-research.co.jp/topics_detail1/id=69394?site=nli 住宅着工件数の伸びは前月比前月とヵ月連続のマイナスとなった図表。 2021-11-18 10:22:35
金融 article ? The Finance 保険業界のこれからを、世界のInsurTechやスタートアップのトレンドに学ぶ https://thefinance.jp/insurtech/211118 insurtechinsur 2021-11-18 01:18:40
海外ニュース Japan Times latest articles Japan looks to administer COVID-19 vaccines to children age 5-11 in February https://www.japantimes.co.jp/news/2021/11/18/national/science-health/children-vaccines-february/ Japan looks to administer COVID vaccines to children age in FebruarySome health experts have expressed concern however amid uncertainty over the efficacy and safety of the vaccine in children aged under 2021-11-18 10:49:10
ニュース BBC News - Home The Papers: PM's sleaze row 'car crash' and Queen back on duty https://www.bbc.co.uk/news/blogs-the-papers-59328061?at_medium=RSS&at_campaign=KARANGA crash 2021-11-18 01:47:02
ビジネス ダイヤモンド・オンライン - 新着記事 米MBA初任給、過去最高に 男女格差は根強く - WSJ発 https://diamond.jp/articles/-/288136 男女格差 2021-11-18 10:26:00
ビジネス ダイヤモンド・オンライン - 新着記事 米EV優遇税制案、環境より労組優先とテスラやトヨタ反発 - WSJ発 https://diamond.jp/articles/-/288137 税制 2021-11-18 10:13:00
LifeHuck ライフハッカー[日本版] 【Amazonタイムセール中!】5,399円のA5ランク黒毛和牛・赤身モモ肉800gや15%オフのモニターアームなど https://www.lifehacker.jp/2021/11/amazon-timesale-1118-1.html amazon 2021-11-18 10:30:00
GCP Google Cloud Platform Japan 公式ブログ Apache Beam と Cloud Dataflow 用の Firestore コネクタの発表 https://cloud.google.com/blog/ja/products/databases/apache-beam-firestore-connector-released/ この度、ApacheBeam用のネイティブモードのFirestoreコネクタをリリースしました。 2021-11-18 03:00:00
GCP Google Cloud Platform Japan 公式ブログ Looker のユニバーサル セマンティック モデルがすべてのユーザーにガバナンスと信頼を提供 https://cloud.google.com/blog/ja/products/data-analytics/lookers-universal-semantic-model/ ガバナンス対象のデータをエンドユーザーが、すでに使い慣れているツールから直接使用可能にすることで、組織全体で信頼できるデータにアクセス可能になり、データアクセスが民主化されます。 2021-11-18 03:00:00
北海道 北海道新聞 札幌で観測史上最も遅い初氷 函館も並ぶ https://www.hokkaido-np.co.jp/article/612871/ 冷え込み 2021-11-18 10:19:51
北海道 北海道新聞 【道スポ】根本 勝流チェンジアップ習得だ 今季2軍で存在感 https://www.hokkaido-np.co.jp/article/612900/ 日本ハム 2021-11-18 10:10:00
Azure Azure の更新情報 Azure VMware Solution now generally available in the France Central Azure Region https://azure.microsoft.com/ja-jp/updates/azure-vmware-solution-now-generally-available-in-the-france-central-azure-region/ Azure VMware Solution now generally available in the France Central Azure RegionAzure VMware Solution has now expanded availability to France Central this update is in addition to the existing availability multiple Azure regions in US Europe Australia Japan UK Canada Brazil and Southeast Asia Singapore 2021-11-18 01:16:02
マーケティング AdverTimes アングル:内燃機関で脱炭素、トヨタが挑む水素エンジンの現実味 https://www.advertimes.com/20211118/article368804/ 内燃機関 2021-11-18 01:12:36
マーケティング AdverTimes 欧州議会、主要政党が巨大テック規制手法で合意=FT https://www.advertimes.com/20211118/article368799/ 欧州議会 2021-11-18 01:03:28
GCP Cloud Blog JA Apache Beam と Cloud Dataflow 用の Firestore コネクタの発表 https://cloud.google.com/blog/ja/products/databases/apache-beam-firestore-connector-released/ この度、ApacheBeam用のネイティブモードのFirestoreコネクタをリリースしました。 2021-11-18 03:00:00
GCP Cloud Blog JA Looker のユニバーサル セマンティック モデルがすべてのユーザーにガバナンスと信頼を提供 https://cloud.google.com/blog/ja/products/data-analytics/lookers-universal-semantic-model/ ガバナンス対象のデータをエンドユーザーが、すでに使い慣れているツールから直接使用可能にすることで、組織全体で信頼できるデータにアクセス可能になり、データアクセスが民主化されます。 2021-11-18 03:00:00

コメント

このブログの人気の投稿

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