投稿時間:2021-04-30 14:39:39 RSSフィード2021-04-30 14:00 分まとめ(44件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Engadget Japanese 新12.9インチiPad Proで旧Magic Keyboardは使用可能。ただし「きれいに閉まらない」かも https://japanese.engadget.com/129-ipadpro-compatible-magickeyboard-043019180.html ipadpro 2021-04-30 04:30:19
TECH Engadget Japanese サムスンがGalaxy Book Pro/Pro 360を海外発表 有機EL搭載の薄型ノート https://japanese.engadget.com/samsung-galaxy-book-pro-360-040056373.html galaxybookpro 2021-04-30 04:00:56
ROBOT ロボスタ SEQSENSE 自律移動型警備ロボット「SQ-2」商用化から約1年半の導入台数を公表 コロナ禍の非接触型警備、人手不足対策化を推進 https://robotstart.info/2021/04/30/seqsense-sq-2-10unit-introduction.html seqsense 2021-04-30 04:54:02
IT ITmedia 総合記事一覧 [ITmedia PC USER] MSI、Core i7-11700F&GeForce RTX 3070搭載PCを発売 https://www.itmedia.co.jp/pcuser/articles/2104/30/news099.html coreifgeforcertx 2021-04-30 13:28:00
IT ITmedia 総合記事一覧 [ITmedia エグゼクティブ] 「鬼滅」缶コーヒーが大ヒット ダイドー社長に「次」聞く https://mag.executive.itmedia.co.jp/executive/articles/2104/30/news100.html itmedia 2021-04-30 13:26:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] アップル売上高1.5倍 出そろったGAFA決算、懸念は? https://www.itmedia.co.jp/business/articles/2104/30/news076.html itmedia 2021-04-30 13:20:00
IT ITmedia 総合記事一覧 [ITmedia News] オンキヨー、ホームAV事業譲渡でシャープなど2社と協議 https://www.itmedia.co.jp/news/articles/2104/30/news097.html itmedia 2021-04-30 13:03:00
TECH Techable(テッカブル) 「思いがけない商品」に出会える! しまむらが人工知能型MAツールを導入へ https://techable.jp/archives/153915 人工知能 2021-04-30 04:30:45
python Pythonタグが付けられた新着投稿 - Qiita Spyder5 を日本語化する https://qiita.com/migihidari/items/4144ae0ffe27731359e8 advancedsettingsgtlangage 2021-04-30 13:24:12
python Pythonタグが付けられた新着投稿 - Qiita 環境構築1_音声合成 OpenJTalkのhello world まで https://qiita.com/magonotegaeru/items/cbfaa7ab8e3728609d32 この章を飛ばす場合は、生成したwavファイルを、windows側から指定して、再生させる必要がある。 2021-04-30 13:03:27
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) vue CLI : ページ内検索で平仮名をカタカナに変換したいです。 https://teratail.com/questions/335914?rss=all vueCLIページ内検索で平仮名をカタカナに変換したいです。 2021-04-30 13:55:37
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) GASでLINEbotを作成しようとしたらwebhookの応答が401エラーになってしまう https://teratail.com/questions/335913?rss=all GASでLINEbotを作成しようとしたらwebhookの応答がエラーになってしまう下記の記事を参考にGASを使ってLINEBotを作ろうとしました。 2021-04-30 13:51:52
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) excelでRC[-5]+R[-2]C[-5]の値を表示したいのだがどちらかが空白だと式が長いのですが仕様でしょうか? https://teratail.com/questions/335912?rss=all excelでRCRCの値を表示したいのだがどちらかが空白だと式が長いのですが仕様でしょうかお世話になっております。 2021-04-30 13:46:59
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) pythonのfor文を用いた和の求め方について https://teratail.com/questions/335911?rss=all pythonのfor文を用いた和の求め方について前提・実現したいことpythonでfor文を使ってからnまでの和を求めたいのですが、エラーが発生します。 2021-04-30 13:45:43
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) accessのテーブルから条件の抽出方法がわかりません。 https://teratail.com/questions/335910?rss=all accessのテーブルから条件の抽出方法がわかりません。 2021-04-30 13:40:09
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) raspberryPi Pico+micropythonで周期タイマ処理を行いたい https://teratail.com/questions/335909?rss=all 不可能の可能性もあると思いますが、教えていただけないでしょうか※msの精度がある程度欲しいので割り込みかなと思っていますが、他の方法でも構いません。 2021-04-30 13:22:36
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) react-hook-form バリデーションを行えない React https://teratail.com/questions/335908?rss=all reacthookformバリデーションを行えないReact前提・実現したいこと入力されたメールアドレスをバリデーションしてエラーを出す。 2021-04-30 13:19:26
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) unity C# ドットの重複を解決したい https://teratail.com/questions/335906?rss=all unityCドットの重複を解決したい前提・実現したいことunityでアプリを作りたくて独学で勉強しています。 2021-04-30 13:04:43
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) [PHP・Laravel・tinker]モデルからデータを取得できない https://teratail.com/questions/335905?rss=all PHP・Laravel・tinkerモデルからデータを取得できない前提・実現したいことtinkerを起動してユーザーモデルのデータを確認しようとしましたが、データを取得できません。 2021-04-30 13:01:47
Ruby Rubyタグが付けられた新着投稿 - Qiita tailscale + mqttでリモート間ファイル共有 https://qiita.com/github0013@github/items/423f65253f67da6a10f3 dropboxからmqttへRPi側ではDropboxUploaderを使ってプログラム的にdropboxへファイルを送っていたが、これを止めてmqttでデータを送るようにした。 2021-04-30 13:55:26
Ruby Rubyタグが付けられた新着投稿 - Qiita Rails初学者によるRailsチュートリアル学習記録⑥ 第4章 https://qiita.com/UtimoriNI/items/3d42f9126f52d3406882 つ目のクラスメソッドはRubyの特殊なメソッドで、Usernewを実行してインスタンスを作成すると自動的に実行されるメソッドです。 2021-04-30 13:17:53
html dotHTML5 HTML5/CSS3のニュースやTIPSなどのまとめ (2021年4月30日) http://feedproxy.google.com/~r/dotHTML5/~3/tJOg_pnKx1Y/20210430_clips.html 2021-04-30 15:00:00
Docker dockerタグが付けられた新着投稿 - Qiita DockerコンテナをつかったNodeJS開発・実行環境 https://qiita.com/aftercider/items/f11e17cfd59f41677134 npminstallをしたいので、dockercomposeexecを使い、bashdockercomposeexecappnpminstallで、さっき立てたコンテナ上でnpminstallすることができます。 2021-04-30 13:05:30
Ruby Railsタグが付けられた新着投稿 - Qiita [Rails]Stimulus Content Loaderを使ってあとからコンテンツを読み込む https://qiita.com/harayama2/items/b721a2f474f7d81ba880 railsnewするときにwebpackstimulusを指定したのでStimulusのcontrollerを読み込む設定が作成されています。 2021-04-30 13:41:28
Ruby Railsタグが付けられた新着投稿 - Qiita Rails初学者によるRailsチュートリアル学習記録⑥ 第4章 https://qiita.com/UtimoriNI/items/3d42f9126f52d3406882 つ目のクラスメソッドはRubyの特殊なメソッドで、Usernewを実行してインスタンスを作成すると自動的に実行されるメソッドです。 2021-04-30 13:17:53
技術ブログ Developers.IO [アップデート] Amazon RDS for PostgreSQLでpg_bigm拡張がサポートされました https://dev.classmethod.jp/articles/rds-for-postgresql-supports-pg-bigm/ amazonrdsforpostgresql 2021-04-30 04:44:41
海外TECH DEV Community Implement password-less authentication in your apps (magic sign in) https://dev.to/arnu515/implement-password-less-authentication-in-your-apps-magic-sign-in-14cn Implement password less authentication in your apps magic sign in In this post I ll show you how you can implement passwordless sign in or magic link sign in to your web app Tech stackSvelteJS with Vite and Typescript for the frontend with W CSS for the styling NodeJS typescript for the backend with ExpressJSMongoDBIf you don t know typescript feel free to use plain javascript Just remember you can t use some features I can Create the project FrontendCreating a svelte vite svite app is pretty easy All you have to do is enter this command into your terminalnpm init vitejs appI ll choose frontend for the project name svelte for the framework and the Typescript variant Next you can cd into your project and runyarn installs packagesyarn dev starts the DEV serverYou can now access your frontend app at http localhost Feel free to use npm or pnpm instead BackendThe backend setup has more steps however Create our project Create backend folder and cd into itmkdir backend amp amp cd backend Create a package jsonyarn init yes or npm init yI removed the main field in package json Install packages feel free to use npm pnpm insteadyarn add express cors morgan mongoose jsonwebtoken nodemailer TYPESCRIPT ONLY Install typedefs of packages and other dev dependencies feel free to use npm pnpm insteadyarn add D types express types cors types morgan types mongoose types jsonwebtoken types nodemailer types node ts node typescript nodemonAdd scripts in package json scripts build tsc p build watch tsc p w start node dist index js start watch nodemon dist index js dev npm run all p build watch start watch TYPESCRIPT ONLY Add a tsconfig jsonnpx tsconfig json select node from the optionsAdd this to compilerOptions in your tsconfig skipLibCheck trueI removed the baseUrl field in the configCreate folders and filesmkdir p src controllers src models src middlewares src utiltouch src index ts use js for javascript How it worksBefore we start with actual coding let s take a look at how passwordless authentication or magic link authentication works First we ask the user for their email This happens on the frontend Next the frontend sends the email to the backend The backend searches the database for a user with the provided email If a user is found the user is logging in Otherwise the user is registering The backend generates a code for the user and stores it in the database It sends the code to the user via email The email contains a link to get the user authenticated This link may maynot need a code Hence the term magic link The user enters the code the backend checks it and if the code is valid the user is successfully authenticated Backend codingLet s start with the backend so we know what to do in the frontend Main appStart with the main file src index tsimport express from express import cors from cors import morgan from morgan import mongoose from mongoose import createServer from http mongoose connect process env MONGODB URL mongodb localhost db useNewUrlParser true useUnifiedTopology true useCreateIndex true const app express app use cors app use morgan dev app use express json const PORT process env createServer app listen PORT gt console log Server started on port PORT Read environment variables from a fileUsing the NPM package dotenv we can read environment variables like MONGODB URL from a file First install the package yarn add D dotenv or use npm pnpmNext add this to the TOP even before all imports of src index ts if process env NODE ENV development development require dotenv config require path join dirname env I don t have mongodb If you don t have mongodb can t install it you can either use the Docker image or use MongoDB AtlasMake sure to add your MongoDB connection URI to your environment export MONGODB URL lt YOUR URL gt Or add the same thing to a file named env ModelsLet s work on our Mongoose models For this project we ll have two models the User model and the Code model User model src models User tsimport Schema model from mongoose export const UserSchema new Schema email String username String role type String default member const User model User UserSchema export default User Code model src models Code tsimport Schema model from mongoose export const CodeSchema new Schema code Number email String expiresAt Number Exists only if the user is logging in userId type String nullable true const Code model Code CodeSchema export default Code Auth routes src controllers auth tsimport Router from express const router Router router post send magic link req res gt Code to send the email router get token req res gt Code to generate a token from the code in the email router get user req res gt Code to fetch the user from the token export default router Let s register this controller src controllers index tsimport auth from auth import Router as ExpressRouter from express export interface Router router ExpressRouter path string export default router auth path api auth as Router src index ts import controllers from controllers app use express json controllers forEach c gt app use c path c router In this controller we ll have two API routes One to generate the code and send it by email and the other to validate the code and return a token First let s focus on the route to generate the code We ll be working with the POST method for send magic link Add some code to get the email from the request body const email req body if typeof email string email trim return res status json error Invalid email error description Please provide a valid email return res status json ok true Add some code to check if there s a user with that email const userId await User findOne email id Be sure to import User and make the function async Add code to generate a random digit code const code Math floor Math random Add code to add the generated code to the database Expire after minutes const c new Code code userId email expiresAt Date now await c save If we test our code you ll notice that we now have a new entry in our database codes collection id aeffeccfbd code email test email com expiresAt v Add code to send email const transport nodemailer createTransport host smtp mailtrap io port auth user xxxxxxx pass xxxxxxx transport verify e gt if e console error e const message from test example com to email text Enter this code code html lt p gt Enter this code lt b gt code lt b gt lt p gt transport sendMail message err gt if err console error An error occured while sending email err else console log Mail sent I m using MailTrap for a free mail server but you can use any other service You should now have a working mail sender Test the endpoint to make sure that mails do get sent If you followed all steps correctly you should get an email with this text Enter this code lt SOME CODE gt Now we can work on generating a token from the code Import sign and verify from jsonwebtokenimport sign verify from jsonwebtoken Add code to check the validity of the generated coderouter get token async req res gt const code codeFromQs req query if typeof codeFromQs string isNaN parseInt codeFromQs return res status json error Invalid code error description Please send a valid code in the querystring const code parseInt codeFromQs const c await Code findOne code if c return res status json error Invalid code error description Please send a valid code in the querystring return res status json ok true Add code to add user to database and generate a token const email userId c as any let user null if userId user await User findById userId exec if user return res status json error Invalid code error description Please send a valid code in the querystring else user new User email username email split await user save Exp in week const token sign id user id toString process env SECRET secret expiresIn return res status json ok true token user Now you should be able to send a request to the endpoint providing the code in the query This will return you a token and with the user Finally let s add an endpoint to get the user from the token router get user async req res gt const authHeader req headers authorization if authHeader typeof authHeader string authHeader split length authHeader split toLowerCase bearer return res status json error Invalid auth header const identity verify authHeader split process env SECRET secret as any if typeof identity string return res status json error Invalid token if typeof identity id string return res status json error Invalid token const user await User findById identity id if user return res status json error Invalid token return res status json ok true user This is what your final auth ts controller should look like FrontendWith the backend all done and complete we can start work on the frontend Let s add a CSS library to make our lives easier In the lt head gt tag of index html add lt link rel stylesheet href gt I ll add an Auth svelte component which will contain the auth form lt src lib components Auth svelte gt lt script lang ts gt async function requestCode lt script gt lt div class w border w border gray w padding w rounded gt lt h class w center gt Authenticate lt h gt lt form class w margin on submit requestCode gt lt p gt lt label for email gt Email lt label gt lt input type email id email class w input w border w border gray gt lt p gt lt p gt lt button class w button w black w hover black style width gt Get magic link lt button gt lt p gt lt form gt lt div gt Now it s time to add some functionality to our app I ll add a submit handler to the form which will ask our backend for the code lt script gt tag import createEventDispatcher from svelte const d createEventDispatcher async function requestCode const email document getElementById email as HTMLInputElement value if email trim return try const res await fetch http localhost api auth send magic link headers Content Type application json body JSON stringify email method POST const data await res json if res ok amp amp data ok d prompt code else console error data alert data error res statusText catch e console error e alert An unknown error occured Here s our Auth svelte file After we receive an email we need to be able to enter the code in it I ll create a new Code svelte component which will contain the following code Notice how these two files emit events We need to handle these events in App svelte lt src App svelte gt lt script lang ts gt import Auth from lib components Auth svelte import Code from lib components Code svelte let sentLink false let token localStorage getItem token lt script gt lt h class w center gt Welcome lt h gt if token lt div class w container gt if sentLink lt Auth on prompt code gt sentLink true gt else lt Code on authenticated detail token gt localStorage setItem token token window location reload gt if lt div gt else lt Add code to show user information gt if We should now have a working auth page But we re not done yet We still need to fetch the user from the server Here s the final code for that ConclusionAnd that s it We re done with a basic simple magic link sign in But do note that this method here isn t optimised for production or anything it is just an introduction to email sign in In a realworld app you should NEVER store the JWT in localStorage Always use cookies or use express session If you got stuck somewhere checkout the Github repo and feel free to give your thoughts in the comments 2021-04-30 04:35:38
金融 ニッセイ基礎研究所 新型コロナウイルスの感染拡大が保険会社に与える影響(2)-欧州大手保険Gの2020年決算発表による- https://www.nli-research.co.jp/topics_detail1/id=67690?site=nli 生命及びその他の事業を含むグループに対するCOVIDの全体的な影響は億百万米ドル」であると述べた。 2021-04-30 13:07:16
金融 ニュース - 保険市場TIMES 明治安田生命、家計に関するアンケート調査を実施 https://www.hokende.com/news/blog/entry/2021/04/30/140000 年収がダウンしたと回答した人はすでにダウンしたことが判明している人と将来的にダウンするであろう人の合計となり、職業によって影響に時間差があることがうかがえる。 2021-04-30 14:00:00
ニュース ジェトロ ビジネスニュース(通商弘報) バーなどへ最大50万香港ドルの一時金支給 https://www.jetro.go.jp/biznews/2021/04/b8fec49356f21453.html 香港ドル 2021-04-30 04:30:00
ニュース BBC News - Home Israel stampede: Dozens killed in crush at religious festival https://www.bbc.co.uk/news/world-middle-east-56938657 israel 2021-04-30 04:30:15
ニュース BBC News - Home Bafta suspends Noel Clarke over harassment claims https://www.bbc.co.uk/news/entertainment-arts-56937479 denies 2021-04-30 04:52:21
ニュース BBC News - Home Covid deaths: More than 20m living in areas with zero Covid deaths https://www.bbc.co.uk/news/health-56923757 phase 2021-04-30 04:24:17
ニュース BBC News - Home Covid vaccine offered to 40-year-olds in England https://www.bbc.co.uk/news/health-56933694 england 2021-04-30 04:04:57
ニュース BBC News - Home Boris Johnson's personal phone number available online for years https://www.bbc.co.uk/news/uk-politics-56937889 press 2021-04-30 04:39:59
GCP Google Cloud Platform Japan 公式ブログ ドキュメントの処理にかかる時間と費用を削減できる DocAI ソリューションの一般提供を開始 https://cloud.google.com/blog/ja/products/ai-machine-learning/get-more-value-from-your-documents-with-docai-and-industry-solutions/ DocumentAIはMLを使用してドキュメントからデータを抽出しますが、人間参加型AIと併用すると、人間の審査担当者がキャプチャされたデータを検証できます。 2021-04-30 05:00:00
北海道 北海道新聞 医療従事者の確保へ協力要請 総務相、日本医師会会長に https://www.hokkaido-np.co.jp/article/539202/ 中川俊男 2021-04-30 13:13:00
北海道 北海道新聞 政府、百貨店向け支援拡充 映画館も、協力金を増額 https://www.hokkaido-np.co.jp/article/539201/ 西村康稔 2021-04-30 13:06:00
北海道 北海道新聞 NBA、渡辺雄太は5得点 ラプターズは黒星 https://www.hokkaido-np.co.jp/article/539200/ 渡辺雄太 2021-04-30 13:02:00
IT 週刊アスキー 『ウマ娘 プリティーダービー』ウマ娘が登場する新CMシリーズを公開! https://weekly.ascii.jp/elem/000/004/053/4053484/ cygames 2021-04-30 13:50:00
IT 週刊アスキー 新作対戦格闘ゲーム『KOF XV』に参戦する「クリス」のキャラクタートレーラーが公開! https://weekly.ascii.jp/elem/000/004/053/4053477/ kofxv 2021-04-30 13:25:00
IT 週刊アスキー スマホアプリ『三國志 覇道』で第1回「スクリーンショットコンテスト」を開催中! https://weekly.ascii.jp/elem/000/004/053/4053480/ 戦略シミュレーションゲーム 2021-04-30 13:25:00
ニュース THE BRIDGE フィリピンのeスポーツスタートアップTier One Entertainment、カヤックなどからプレシリーズA調達 http://feedproxy.google.com/~r/SdJapan/~3/a-gJXyOV_O8/gobi-partners-warner-music-invest-philippine-esports-entertainment-firm フィリピンのeスポーツスタートアップTierOneEntertainment、カヤックなどからプレシリーズA調達TechinAsiaでは、有料購読サービスを提供。 2021-04-30 04:00:59
GCP Cloud Blog JA ドキュメントの処理にかかる時間と費用を削減できる DocAI ソリューションの一般提供を開始 https://cloud.google.com/blog/ja/products/ai-machine-learning/get-more-value-from-your-documents-with-docai-and-industry-solutions/ DocumentAIはMLを使用してドキュメントからデータを抽出しますが、人間参加型AIと併用すると、人間の審査担当者がキャプチャされたデータを検証できます。 2021-04-30 05:00:00

コメント

このブログの人気の投稿

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

投稿時間:2024-02-12 22:08:06 RSSフィード2024-02-12 22:00分まとめ(7件)