投稿時間:2021-04-15 22:43:37 RSSフィード2021-04-15 22:00 分まとめ(49件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Engadget Japanese 米Amazon、第2世代のEcho Budsを米国発表。ANC搭載で約120ドル https://japanese.engadget.com/amazon-echo-buds-2nd-gen-120031664.html amazon 2021-04-15 12:00:31
AWS lambdaタグが付けられた新着投稿 - Qiita SpeedPizzaのインフラ https://qiita.com/hiroyuki-kasuga/items/0b9a63f2e5d1bb284ac6 2021-04-15 21:13:08
python Pythonタグが付けられた新着投稿 - Qiita スパコン ITO フロントエンド で PyTorch https://qiita.com/jsasaki/items/4b6d1af954cdb8c9692d 2021-04-15 21:33:19
python Pythonタグが付けられた新着投稿 - Qiita エラー:TypeError: 'module' object is not iterableの対処方法 https://qiita.com/9bo0218/items/6e89a9a110feea7434c1 ※※原因プロジェクト内のurlpyで、アプリを呼び出そうとしたのですが、呼び出し先が誤っていたためエラーが発生しました。 2021-04-15 21:28:29
python Pythonタグが付けられた新着投稿 - Qiita Python+Seleniumで楽天カードの明細をCSVダウンロードする https://qiita.com/yoshi2045/items/45c240cf34a8f0fdaa1a 対象画面まで遷移させるまず、楽天カード楽天eNAVIのログイン後TOP画面から明細ダウンロード画面までどういう経路で遷移できるかを確認してみます。 2021-04-15 21:18:33
js JavaScriptタグが付けられた新着投稿 - Qiita 復習 Javascript きほんの 「き」 初心者 変数編  1 https://qiita.com/Hoshi10Lighthouse/items/46d2b3b690d91fe79102 復習Javascriptきほんの「き」初心者変数編変数の宣言と代入Javascriptの変数は、利用する前に宣言をする必要があります。 2021-04-15 21:39:35
js JavaScriptタグが付けられた新着投稿 - Qiita js domから要素を取得して、必要な値のみ取得する https://qiita.com/dossy/items/6ee52e3a424f21306124 その時、foreachで回すことが可能filterを使う際にはArrayに一度変換しなければならないようです。 2021-04-15 21:36:56
js JavaScriptタグが付けられた新着投稿 - Qiita TypeScript まとめ2(ユーティリティ型) https://qiita.com/hiro-hiro/items/0f0201a8a49db06e0032 ユーティリティ型早見表書き方変換結果PartialltTgt任意型に変換ReadonlyltTgt読み取り専用に変換RequiredltTgt必須型に変換RecordltKTgt指定の型を持つプロパティ群を生成PickltTKgt既存の型から特定のプロパティだけを抽出OmitltTKgtPickと同じExcludeltTUgt既存の型から特定の型を除外ExtractltTUgtExcludeと同じNonNullableltTgtnullundefinedを除外ParametersltTgt関数型の引数を元にタプル型を生成ReturnTypeltTgt関数型の戻り値型を生成ConstructorParametersltTgtコンストラクターの引数型を元にタプル型を生成ThisTypeltTgt関数の中で使用されるthisの型を指定ThisParameterTypeltTgt関数型のthis引数の型を抽出OmitThisParameterltTgt関数型のthis引数の型を除外した型UppercaseltStringtypegt大文字に変換LowercaseltStringtypegt小文字に変換CapitalizeltStringtypegt文字目を大文字に変換UncapitalizeltStringtypegt文字目を小文字に変換ユーティリティ型サンプルコードPartialltTgt型Tのプロパティを任意型省略可能に変換typescriptインターフェイスを定義interfacesamplenamestringagenumbersampleの全プロパティを任意型に変換typesampleOpPartialltsamplegtこれと同義interfacesampleOpnamestringagenumberReadonlyltTgt型Tのプロパティを読み取り専用に変換typescriptReadonlyインターフェイスを定義interfacesamplenamestringagenumbersampleの全プロパティを読み取り専用に変換typesampleOpReadonlyltsamplegtこれと同義interfacesampleOpreadonlynamestringreadonlyagenumberRequiredltTgt型Tのプロパティを必須プロパティに変換するtypescriptRequiredインターフェイスを定義interfacesamplenamestringagenumbersampleの全プロパティを必須プロパティに変換typesampleOpRequiredltsamplegtRecordltKTgt型Kのプロパティ名で、型は型Tのプロパティ群を生成する。 2021-04-15 21:16:19
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 【Unity】GetFilesができない https://teratail.com/questions/333463?rss=all 【Unity】GetFilesができないやりたいことAndroid端末内の任意のディレクトリ内にあるファイル名の一覧を取得したい。 2021-04-15 21:45:54
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) シューティングゲームの斜め移動の移動量を修正プログラムで正しく修正されているかどうか知りたい。 https://teratail.com/questions/333462?rss=all シューティングゲームの斜め移動の移動量を修正プログラムで正しく修正されているかどうか知りたい。 2021-04-15 21:40:36
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) javascriptの出力結果を一つの配列にしたい https://teratail.com/questions/333461?rss=all javascriptの出力結果を一つの配列にしたいjavascriptで複数の出力結果を一つにまとめたいのですが、やり方がわかりません。 2021-04-15 21:26:52
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) linux 間のリモートデスクトップ https://teratail.com/questions/333460?rss=all linux間のリモートデスクトップ前提・実現したいことlinuxnbspmintnbspnbspからネットワーク上のnbspubuntunbspnbspdesktopnbspにリモートデスクトップを設定したいと思っています。 2021-04-15 21:14:42
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 単語テストの表示方法 https://teratail.com/questions/333459?rss=all 単語テストの表示方法問題文を表示するところがうまくいきません。 2021-04-15 21:12:52
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) rspecテスト時に投稿が2回される https://teratail.com/questions/333458?rss=all rspecテスト時に投稿が回される現在、アプリケーションを作成する中で、テストコードを実行しております。 2021-04-15 21:10:45
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ["不明",2021,2020,...(略),1950]という配列を作りたい。 https://teratail.com/questions/333457?rss=all quot不明quot略という配列を作りたい。 2021-04-15 21:03:55
AWS AWSタグが付けられた新着投稿 - Qiita SpeedPizzaのインフラ https://qiita.com/hiroyuki-kasuga/items/0b9a63f2e5d1bb284ac6 2021-04-15 21:13:08
AWS AWSタグが付けられた新着投稿 - Qiita 【AWS】マネーシド型とアンマネーシド型 https://qiita.com/mzmz__02/items/152b8de7d2a19f8b2310 マネーシド型スケーリング・耐障害性・可用性がサービスに組み込まれて、AWS側で管理されている。 2021-04-15 21:13:32
Docker dockerタグが付けられた新着投稿 - Qiita ローカル環境にDockerを使用しLaravelをgitからclone後、php artisan migrateのエラーでハマった件 https://qiita.com/tko0928/items/39dd12ca5c0533c9fbeb ローカル環境にDockerを使用しLaravelをgitからclone後、phpartisanmigrateのエラーでハマった件どうも、初心者プログラマーTKOです。 2021-04-15 21:58:08
Docker dockerタグが付けられた新着投稿 - Qiita dockerのノート https://qiita.com/ymd65536/items/8d956727a1a63944a9be dockerrundetachpnamenginxnginx作動中のコンテナ一覧を表示ListdockerpsWebページをcurlを使って取得curllocalhostshでコンテナに乗り込むdockerexecitnginxshファイルを探索するfindtypednamenginxxargsgreprhtml格納先されているデフォルトのWebページを表示catusrsharenginxhtmlindexhtmlHelloWorldで上書きechoHelloWorldgtusrsharenginxhtmlindexhtmlshから抜けるexitWebページをcurlを使って取得「HelloWorld」と表示されていればOKcurllocalhostnginxコンテナを停止dockerstopnginx停止中のコンテナも全て一覧表示dockerpsallnginxコンテナを削除dockerrmnginx停止中のコンテナも全て一覧表示dockerpsalldockerrmiとdockerrmの違いdockerイメージを削除するのはrmidockerコンテナを削除するのはrm他、コンテナのデバッグに使えそうなコマンドコンテナのログを表示Logコンテナ内の実行ログを確認できる。 2021-04-15 21:43:20
GCP gcpタグが付けられた新着投稿 - Qiita Google Cloud アップデート (4/8-4/14 2021) https://qiita.com/kenzkenz/items/00ca16e06e4312ff3800 AnsibleとTerraformでGCEのVMにインストールできるよOperationsSuiteApr今後作成する通知が、デフォルトでインシデントが作成されたときにのみ通知が飛ぶようになったよこれまでみたいに解決したときに通知したい場合は明示的に変更する必要があるので注意CloudComposerAprAirflowが使えるようになったよ新しいバージョンcomposerairflowcomposerairflowcomposerairflowcomposerairflowのお知らせデフォルトcomposerairflowにPythonのバージョンやEnvironments削除の動作修正TrafficDirectorAprTCPベースのサポートがGAになったよHTTP以外のリソースでサービスディスカバリやグローバルLB、ファイルオーバ等のTrafficDirectorの機能が使えるようにBigQueryAprReservationを利用しているユーザがスロットの使用率やジョブの並行度、実行時間等がみれるAdminResourceChartsPreviewがプレビューになったよCloudFunctionsApreuropecentralで使えるようになったよOperationsSuiteAprLoggingSharedクエリがGAになったよMonitoringダッシュボードに最後に保存した日付と時間が表示されるようになったよ自動保存はオンオフできるよComputeEngineAprVMのパッチやインベントリ状況を確認できるVMManagerのVPCServiceControl対応がGAになったよManagedInstanceGroupsをスケジュールベースでオートスケールする機能がGAになったよCloudSpannerAprトランザクションの統計情報がコミットのリトライを含むようになったよAnthosConfigManagementAprアップデートでResourceのチェックが厳しくなったのでConfigSyncを利用している場合はKNVエラーが出力されるようになった可能性があるよワークアラウンドはリソースを全てstringsとして定義CloudFirestoreApreuropecentralで使えるようになったよDatastoreモードも同様AppEngineApreuropecentralで使えるようにTrafficDirectorAprClientStatusDiscoveryServiceCSDSAPIがプレビューになったよTrafficDirectorに接続しているクライアントや設定を確認できるように詳細はここDialogflowAprDialogflowCXでVoximplant、FacebookMessenger、LINEがプレビューサポートになったよディスクレーマアップデートの内容はあくまでも個人の理解していることを書いています。 2021-04-15 21:21:50
Azure Azureタグが付けられた新着投稿 - Qiita Azure Functions(Java)を利用するための準備運動 https://qiita.com/torifukukaiou/items/b6557ce35e18e1502e23 AzureFunctionsJavaを利用するための準備運動はじめにJava楽しんでいますかこの記事では以下のことを書いていますJavaおよびツールのインストールonmacOS雛形プロジェクトの動かし方AzureFunctionsへのデプロイ「Java開発者のためのAzure入門」というキャンペーンへの投稿記事です私はElixirというプログラミング言語を使って、「【毎日自動更新】Java開発者のためのAzure入門LGTMランキング」という記事を自動更新しています当初は、これと同じことをJavaでやってみようと考えていましたただそれだとただキャンペーンに参加するためだけの記事になってしまう気がしました自分にとっても面白くはないので、別のことはないかと模索しました自分の役に立つことはないかとそこでおもいついたのが、Seventyになんなんとする母がスマートフォンに最近、買い替えまして、その操作の練習支援になるようなことをしたいとおもいましたみうらじゅんさんの「親孝行プレイ」に通じるものがあるかもしれませんごめんなさい、まだ読んでいないです「「ない仕事」の作り方」は読んでいますところが最近、Javaに触れる機会が少なかったのでさてどこから手をつけようかと逡巡してしまいましたそれで次にとった行動は、「AzureJava」で検索してたどり着いたAzureの公式ドキュメントをそのままやってみるということです以下のドキュメントをみていくとよさそうですAzureFunctionsのドキュメントAzureFunctionsの概要AzureFunctionsの概要JavaクイックスタートVisualStudioCodeを使用してAzureにJava関数を作成するここが一番、私にとってはためになりましたMavenを使用してAzureでJavaサーバーレス機能を開発するこの記事を書いている人Javaは使ったことがありますが、ここ年くらいはほとんど触っていません個人開発でリリースしているandroidアプリはメンテナンスを続けていますオートレースオンデマンド再生読書日記ご利用のみなさま、ありがとうございます最近はElixirというプログラミング言語が大のお気に入りでございます①環境構築macOSCatalinaOracleJDK、JREを以前インストールしていたまずは、環境を構成するを丁寧にやってみませふOracleJDK、JREのアンインストールmacOSでのJDKのアンインストールmacOSでのJREのアンインストール上記に従ってすすめましたなんかこわいおっかなびっくりだけど公式の手順なので迷わず行けよ、行けばわかるさ、ありがとうなぜアンインストールしたのかについては、環境を構成するというところで、AzulZuluforAzureEnterpriseEditionJDKbuildsのインストールがすすめられていて、なんとなく同じようなものがつあるのはよくないのかなあとおもったからです共存できたのかもしれませんし、詳しくはよくわかっていないのですが、JDKの新しいリリース・モデおよび提供ライセンスについてが関係しているようにおもいますJavaのインストールここからdmgをダウンロードしてダブルクリック画面の指示通りすすめればこわくないインストーラーの画面はなんだか楽しそうzshenvexportJAVAHOMEusrlibexecjavahomeと書いていましたいつ書いたのかはとんと思い出せないのですsourcezshenvechoJAVAHOMELibraryJavaJavaVirtualMachineszulujdkContentsHomejavaversionopenjdkversionLTSOpenJDKRuntimeEnvironmentZulumacosxxMicrosoftAzurerestrictedbuildLTSOpenJDKBitServerVMZulumacosxxMicrosoftAzurerestrictedbuildLTSmixedmodeApacheMavenのインストール昔インストールしたような記憶がありますが、mvnでcommandnotfoundと言われてしまいました公式の手順は面倒そうにみえたので、HomebrewでインストールしましたbrewinstallmavenmvnvApacheMavenccbdfedfafadabdaccdMavenhomeusrlocalCellarmavenlibexecJavaversionvendorAzulSystemsIncruntimeLibraryJavaJavaVirtualMachineszulujdkContentsHomejreDefaultlocalejaJPplatformencodingUTFOSnamemacosxversionarchxfamilymacVisualStudioCode私はすでにインストール済みでした重宝しておりますありがとうございますJavaExtensionPackリンク先に飛んで、Installボタンを押すVisualStudioCode用AzureFunctions拡張機能リンク先に飛んで、Installボタンを押すVisualStudioCodeが立ち上がって、そちらでInstallボタンを押す②ローカルプロジェクトを作成するリンク先の通りにやればいいのですが、最初のフォルダ選択は、中身が空のmyFunctionディレクトリを選択すると吉ですディレクトリ作ってくれるだろうと高を括ってすすめるとぶちまけられますなんのことだかわからない方は何事も経験なのでDesktopでも選んでやってみるとわかりますが後始末が面倒なのでおすすめしませんもしやっちまったら、lslaとかして日付をみて、ぶちまけてしまったファイルやフォルダを消していくとよいでしょう「provideanappnameアプリ名を指定してくださいmyFunction」のところのという数字は、VisualStudioCodeが表示していた値を変更せずにそのままエンターを押しました③関数をローカルで実行するFを押しますと、azurefunctionscoretoolsのインストールがはじまりましたAzureFunctionsCoreToolsのインストールに書いてあるようなことですイゴいた、イゴいたここまでポチポチやっただけで、自らはJavaのコードを一切書いていませんデフォルトで以下のコードが生成されていますnameをキーとするクエリパラメータの値を、Hellonameして返すプログラムですHttpTriggerのところはなにやらごちゃごちゃしていますが、とりあえず景色だとおもって関数本体に目を通してみるとそんなに難しいことは書いてありませんsrcmainjavacomfunctionFunctionjavapackagecomfunctionimportcommicrosoftazurefunctionsExecutionContextimportcommicrosoftazurefunctionsHttpMethodimportcommicrosoftazurefunctionsHttpRequestMessageimportcommicrosoftazurefunctionsHttpResponseMessageimportcommicrosoftazurefunctionsHttpStatusimportcommicrosoftazurefunctionsannotationAuthorizationLevelimportcommicrosoftazurefunctionsannotationFunctionNameimportcommicrosoftazurefunctionsannotationHttpTriggerimportjavautilOptionalAzureFunctionswithHTTPTriggerpublicclassFunctionThisfunctionlistensatendpointapiHttpExampleTwowaystoinvokeitusingcurlcommandinbashcurldHTTPBodyyourhostapiHttpExamplecurlyourhostapiHttpExamplenameHTTPQueryFunctionNameHttpExamplepublicHttpResponseMessagerunHttpTriggernamereqmethodsHttpMethodGETHttpMethodPOSTauthLevelAuthorizationLevelANONYMOUSHttpRequestMessageltOptionalltStringgtgtrequestfinalExecutionContextcontextcontextgetLoggerinfoJavaHTTPtriggerprocessedarequestParsequeryparameterfinalStringqueryrequestgetQueryParametersgetnamefinalStringnamerequestgetBodyorElsequeryifnamenullreturnrequestcreateResponseBuilderHttpStatusBADREQUESTbodyPleasepassanameonthequerystringorintherequestbodybuildelsereturnrequestcreateResponseBuilderHttpStatusOKbodyHellonamebuild④Azureへのサインインリンクの通りに進めますすでにAzureのアカウントは持っていましたし、すんなりいきましたまだもっていないよという方は、Azureクラウドコト始めlまずはAzureに登録してみようl初心者向けにて詳しく丁寧に解説されていますのでご参照くださいそうそう、なにせ私には日本マイクロソフト賞④の受賞実績がありますから、Azureのアカウントは持っているのでありますよもう一度言いますhuge日本マイクロソフト賞④を受賞したことがありますその原動力となったのはElixirが好きだというただ一点ですその話はまた別の機会に⑤Azureにプロジェクトを発行するリンクの通りに進めますawesometestと、Enteragloballyuniquenameforthefunctionappに対して今回は入力してみました⑥Azureで関数を実行するリンクの通りに進めますイゴいた、イゴいた⑦リソースをクリーンアップする私の場合ですとリソースグループawesometestを削除しましたまとめポチポチしただけですが、AzureFunctionsにJavaのプログラムをデプロイできました次は、本題のタイマをトリガとしてAzureFunctionsでJavaのプログラムをイゴかす方法を書きたいとおもいますあわせて読みたいオススメ記事statemachineさんの「JavaでAzureFunctionsの関数を実装する」最後の最後にElixirって何よという方へちょいちょいElixirを散りばめました時点くらいのスクリーンショットElixirについてもっと知りたい方は下記の本をオススメしますプログラミングElixir第版Elixir実践ガイドelixirjpSlackのautoracexというところに私は入り浸っておりますのでお気軽にお声がけください勉強会が頻繁に行われています私がよく参加している勉強会ですautoracex【毎週月曜】主催Sapporobeam【毎週水曜】OkazaKirinbeam【毎週木曜】fukuokaexkokuraex【毎月回】NervesJP【毎月回】piacerexさん作どうしてAzureFunctionsにすぐ飛びつけたのかというと、AWSの話で申し訳ありませんが、Lambdaっぽいものを探そうとしてたどり着きました。 2021-04-15 21:49:45
Ruby Railsタグが付けられた新着投稿 - Qiita ImageMagickインストールエラーについて https://qiita.com/takuo_maeda/items/f2b277ba01825454927e ImageMagickインストールエラーについてimagemagickinstallエラー発生月日深夜時ごろbrewinstallimagemagickUpdatingHomebrewgtAutoupdatedHomebrewUpdatedtapsherokubrewhomebrewcoreandhomebrewcaskgtNewFormulaebrookgoboringmotophpbrewcadenceworkflowharuhidlmultitimepurecrackpkcskickstartmxsmuduaclileafproxynettoolsspaceshipenkitsmapcidrorganizetoolsystemdeprminisatpcpzshvimodegtUpdatedFormulaeUpdatedformulaegtRenamedFormulaefcctgtbutanegtDeletedFormulaeatlassiancligtNewCasksaudacityfabfiltersimplonaudiusfabfiltertimelessbatterybuddyfabfiltertwinchatterinofabfiltervolcanocommandpadiconscoutdingtalklitekatrainfabfiltermicronordlockerfabfilteronenordpassfabfilterprocnorthernspysoftwarecolorpickerfabfilterprodsoffsetexplorerfabfilterprogoldschoolrunescapefabfilterprolpopfabfilterprombrunelitefabfilterproqsonobusfabfilterprorutterlyfabfiltersaturnwxmacmolpltgtUpdatedCasksUpdatedcasksgtDeletedCasksbatteryguardianflashplayerdebuggernpapibeatportproflashplayerdebuggerppapicraftflashppapiflashnpapiimazingminiflashplayerkafkatoolflashplayerdebuggerscreengtDownloadingOcurlTherequestedURLreturnederrorNotFoundTryingamirrorgtDownloadinggtDownloadingfromcurlTherequestedURLreturnederrorErrorFailedtodownloadresourcesqliteDownloadfailedエラー文ErrorFailedtodownloadresourcesqlite本日もさらにエラーgtDownloadinggtDownloadingdceagtDownloadingfromErrorpythonthebottleneedstheAppleCommandLineToolstobeinstalledYoucaninstallthemifdesiredwithxcodeselectinstallXcodeのインストールが求められたので解決手順①XcodeCommandLineToolsのアンインストールsudormrfLibraryDeveloperCommandLineToolsをTerminalに入力して行ってください。 2021-04-15 21:58:29
Ruby Railsタグが付けられた新着投稿 - Qiita 【Rails6】エラー対処法|Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: https://qiita.com/yuta-38/items/118496c9919ec9bd4790 つまり、マイグレーションファイルでクラスを継承する場合は、バージョンの指定が必須ということ。 2021-04-15 21:11:02
技術ブログ Developers.IO react-slick で矢印ボタンを良い感じに表示する https://dev.classmethod.jp/articles/display-react-slick-arrow/ reactslickreactslick 2021-04-15 12:42:25
海外TECH DEV Community Using the WordPress in_category() function https://dev.to/andystitt829/using-the-wordpress-incategory-function-2cji Using the WordPress in category functionMy biggest project at work is the Delaware COVID information website It is built in WordPress I recently had a problem to solve where I wanted alert boxes to automatically display in the language that the page was translated into We have pages in the three most spoken languages in Delaware English Spanish and Haitian Creole I decided to approach it by assigning specific categories to the Spanish and Haitian Creole pages I was then able to use the WordPress in category function to identify which categories that page belonged to This applied to single pages so in page php my code looked something like this lt php if in category spanish include includes spanish file php elseif in category haitian creole include includes haitian creole file php else include english file php gt This if statement first looks to see if the category assigned to the page is spanish and if it is then the PHP include function displays the content within spanish file php If the category is not spanish then it looks to see if it is haitian creole and if it is then it displays the contents of haitian creole file php If the category doesn t match either of those then it displays english file php The majority of pages on the website are in English so I didn t feel the need to assign an English category and simply included it in the else condition for all pages that had neither spanish or haitian creole assigned to it I wrote this function in the page php file I m sure there are arguments against doing that If you wanted to you could also define it as a function in the functions php file and then call the function in page php If you did it that way it would look something like this In functions php lt php function multi language page files if in category spanish include includes spanish file php elseif in category haitian creole include includes haitian creole file php else include english file php No closing PHP gt tag needed in the functions php file Then you would call the function in page php lt php multi language page files gt I hope this helps I was not previously aware of the in category function before I found it yesterday It is extremely helpful in this case 2021-04-15 12:28:26
海外TECH DEV Community Getting Started With Your First three.js Project: Part One — The Setup https://dev.to/waldowred5/getting-started-with-your-first-three-js-project-part-one-the-setup-147k Getting Started With Your First three js Project Part One ーThe SetupPress Run Pen to see a live demo of what we will be building What is three js three js is a powerful JavaScript library and API allowing developers to create incredible D and D graphics that are animated in the browser without plugins using WebGL To check out some of the amazing projects created by talented developers you can check them out at the three js homepage as well as many advanced guides on getting the most out of the library What are we building In the header above after clicking Run Pen you can see a live demo of the animation we will be building in this tutorial It is a cube that spins slowly with four small spheres orbiting it at a much faster pace each on its own orbital path It is also brightly coloured because monochrome is drab Users also have the ability to spin the cube and spheres in any direction they want Getting StartedBefore we start lets get our project setup first Create a project directory somewhere that is easy to reach with your terminal The way I ve structured my directory looks like this important so the import paths work properly first threejs project css main css js main js index htmlType the following commands in your terminal to get your project directory setup correctly don t forget to press the Enter key between each line mkdir first threejs projectcd first threejs projectmkdir css jstouch index htmlcd csstouch main csscd jstouch main jsYour directory should now look something like thisYou can setup your HTML and CSS any way you prefer or you can use the following code as templates to work from index html 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 My First three js Project lt title gt lt link rel stylesheet href css main css gt lt head gt lt body gt This line imports our javascript code from our js directory lt script type module src js main js gt lt script gt lt body gt lt html gt main cssbody margin px height vh canvas display block Now that we have our initial files ready to go we need to import the three js library into our project There are a few ways to do this all of which can be found in the three js installation guide but the best way takes a few steps but the best way takes a few steps Open your terminal and navigate to your main project directoryIf you are using node package manager npm enter the following into your terminal npm install save threeAlternatively if you are using yarn enter yarn add three If neither of these commands work or make sense to you you will probably need to download npm or yarn here This should have added a series of directories to your main project directory Inside the node modules directory is the three directory If you open this you will see the build directory which includes the core library files you need to import into your code The core library files include only the most important parts of the library so to include other useful three js features we will need to import them from another directory which has already been downloaded for us during installation These can be found in the sub directory examples jsm which includes controls loaders and some post processing effects Only one step left to finalise before creating our first scene Head to your favourite code editor and open up the main js file At the top of the file you will want to write the following two lines of code main jsimport as THREE from node modules three build three module js import TrackballControls from node modules three examples jsm controls TrackballControls js These two import statements above give our main jss file access to the three js core libraryTrackball controls module which will allow us to use our mouse to click and drag to spin our animation in any direction Creating Your First SceneEverything is now set up and ready to go for our first lines of three js code Every animation or scene we create needs three crucial objects Scene A parent object where we place all of our rendered objects lights and camerasCamera An object that allows us to see our other objects There are a few types of cameras but the one that we want for standard perspective rendering is the PerspectiveCameraRenderer An object that renders our scene for us with the WebGL APIThe code for these three objects looks like this const scene new THREE Scene const camera new THREE PerspectiveCamera window innerWidth window innerHeight const renderer new THREE WebGLRenderer antialias true Now let s take a deeper dive into these three lines of code so we can understand what is going on under the hood Scene Pretty simple we are creating a new three js scene object to place everythingCamera As mentioned before we have created a PerspectiveCamera which takes four parameters in order Source ResearchGateField of View FOV This is a number in degrees which represents the vertical FOV see diagram left Aspect Ratio This is the ratio between the width and height of the scene width divided by height Most of the time we want to set this to the width and height of our window so we don t squish the objects in our scene In this case we use the innerWidth and innerHeight properties of the window object the window that contains the main DOM document element of our HTML Near Clipping Plane The boundary plane closest to the camera Anything closer to the camera than this value won t be renderedFar Clipping Plane The boundary plane furthest from the camera Anything further from the camera than this value won t be renderedTip If you set the Far Clipping Plane to be equal or less than the Near Clipping Plane nothing will be rendered Don t be that dev Renderer Here we create a WebGL renderer object to render our objects While this function can be called without any arguments we can also pass an object with any settings we want to change from the default behaviour Source dPrint comIn our case we have changed the antialias property from false to true See diagram left for an example of what our scene will look like with or without anti aliasingThe last three lines of code we need for the initial scene creation are renderer setClearColor renderer setSize window innerWidth window innerHeight document body appendChild renderer domElement setClearColor Our first line sets the colour of the scene background in this case a HEX value passed as a string You can optionally pass a float between and to the second parameter known as the alpha to set the opacity setSize This sets the size of our app in our case we want to fill the whole window so we set the width and height to the innerWidth and innerHeight properties of the window object again You can use smaller values if you only want your app to take up part of the window For example renderer setSize window innerWidth window innerHeight would display our app at of the size of our window appendChild This line adds the renderer to our HTML document as a lt canvas gt element which is responsible for drawing our objects and animations with the WebGL API A note on responsive design When creating web applications it is important to develop for all devices from smartphones to tablets and K desktop monitors This is already taken care of for us by the setSize function for the native screen size of the device What if the user changes the size of their window on a desktop or laptop Our cube gets cut off when the window size changesOur render will be stuck in the center of the screen and become covered instead of matching the new size of the window To solve this problem we need to add an event listener to the window for resizing so that we can recalculate the window size for our canvas if a user changes the size of their window We can get around this problem with the following code window addEventListener resize gt renderer setSize window innerWidth window innerHeight camera aspect window innerWidth window innerHeight camera updateProjectionMatrix Here we change the size of the canvas back to the size of the window as well as resetting the aspect ratio to match Finally we call the updateProjectionMatrix function to apply the new changes With all of the code we have added so far you should have something like this main jsimport as THREE from node modules three build three module js import TrackballControls from node modules three examples jsm controls TrackballControls js Sceneconst scene new THREE Scene Cameraconst camera new THREE PerspectiveCamera window innerWidth window innerHeight Rendererconst renderer new THREE WebGLRenderer antialias true renderer setClearColor renderer setSize window innerWidth window innerHeight document body appendChild renderer domElement Make Canvas Responsivewindow addEventListener resize gt renderer setSize window innerWidth window innerHeight camera aspect window innerWidth window innerHeight camera updateProjectionMatrix We now have our environment completely set up including a scene a camera and a renderer to draw everything for us Don t panic if you can t see anything we haven t built anything to be rendered yet To see how we go about building the rest of the animation head over to the second part of this tutorial See you there We will be building these objects very soon 2021-04-15 12:15:38
Apple AppleInsider - Frontpage News 'AirPods 3' and 'Apple Pencil 3' nearly ready for release, says leaker https://appleinsider.com/articles/21/04/15/airpods-3-and-apple-pencil-3-nearly-ready-for-release-says-leaker?utm_medium=rss x AirPods x and x Apple Pencil x nearly ready for release says leakerA leak on Chinese social media suggests that AirPods and Apple Pencil are both ready for release or will be soon Image of the supposed AirPods The leak originates from a new source called Uncle Pan Pan on Chinese social media website Weibo Though the leaker has no history the image shared resembles other images of the so called AirPods Read more 2021-04-15 12:33:43
海外TECH Engadget Samsung's Galaxy Buds Pro hit all-time low of $165 at Woot https://www.engadget.com/samsung-galaxy-buds-plus-deal-amazon-best-buy-122014961.html galaxy 2021-04-15 12:20:14
ラズパイ Raspberry Pi Our new SIGCSE Special Project on culturally relevant resources for computing https://www.raspberrypi.org/blog/sigcse-special-project-culturally-relevant-teaching-resources-computing/ Our new SIGCSE Special Project on culturally relevant resources for computingOver the last years researchers and educators have increasingly aimed to develop computing curricula that are culturally responsive and relevant Designing equitable and authentic learning experiences in computing requires conscious effort to take into account the characteristics of learners and their social environments in order to address topics that are relevant to a diverse The post Our new SIGCSE Special Project on culturally relevant resources for computing appeared first on Raspberry Pi 2021-04-15 12:18:33
Cisco Cisco Blog Why Adding My Pronouns Matters https://blogs.cisco.com/wearecisco/why-adding-my-pronouns-matters matters 2021-04-15 12:00:57
海外科学 NYT > Science In Coinbase’s Rise, a Reminder: Cryptocurrencies Use Lots of Energy https://www.nytimes.com/2021/04/14/climate/coinbase-cryptocurrency-energy.html In Coinbase s Rise a Reminder Cryptocurrencies Use Lots of EnergyThe company s stock market arrival establishes Bitcoin and other digital currencies in the traditional financial landscape It also elevates a technology with astonishing environmental costs 2021-04-15 12:41:43
海外科学 NYT > Science Executives Call for Deep Emission Cuts to Combat Climate Change https://www.nytimes.com/2021/04/13/climate/business-executives-climate-change.html Executives Call for Deep Emission Cuts to Combat Climate ChangeMore than corporate leaders are asking the Biden administration to nearly double the emission reduction targets set by the Obama administration 2021-04-15 12:46:30
海外ニュース Japan Times latest articles Biden pulls the plug on Afghan War despite risk of turmoil ahead https://www.japantimes.co.jp/news/2021/04/15/world/biden-us-afghanistan/ Biden pulls the plug on Afghan War despite risk of turmoil aheadFor the U S President withdrawing the remaining American troops from Afghanistan is a recognition of the inevitable after years of war with no clear 2021-04-15 22:33:53
海外ニュース Japan Times latest articles How China fell behind after passing up a vaccine opportunity https://www.japantimes.co.jp/news/2021/04/15/asia-pacific/china-missed-vaccine-chance/ breakout 2021-04-15 21:42:36
海外ニュース Japan Times latest articles Japan-U.S. alliance should provide an alternative to China https://www.japantimes.co.jp/opinion/2021/04/15/commentary/japan-commentary/china-u-s-quad-indo-pacific-development-aid/ Japan U S alliance should provide an alternative to ChinaA Japan U S alliance should provide an alternative to China s Belt and Road Initiative while strengthening the ability of smaller states to defend their territorial integrity 2021-04-15 22:42:20
ニュース BBC News - Home 4.7 million waiting for operations in England https://www.bbc.co.uk/news/health-56752599 englandthe 2021-04-15 12:40:45
ニュース BBC News - Home M&S begins legal action against Aldi over Colin the Caterpillar cake https://www.bbc.co.uk/news/business-56756731 caterpillar 2021-04-15 12:26:02
ニュース BBC News - Home Man admits harassing BBC reporter Sima Kotecha https://www.bbc.co.uk/news/uk-england-leicestershire-56750152 centre 2021-04-15 12:27:28
ニュース BBC News - Home Gnome shortage: Lockdown and Suez canal blockage blamed https://www.bbc.co.uk/news/uk-england-gloucestershire-56748561 chain 2021-04-15 12:03:19
ビジネス ダイヤモンド・オンライン - 新着記事 ふるさと納税の8大サイトの特徴やメリットを比較! 最も便利なサイトはどこ?取扱い自治体数や特典は? ザイがおすすめする「ふるさと納税サイト」を紹介! - ふるさと納税おすすめ特産品情報 https://diamond.jp/articles/-/108715 ふるさと納税の大サイトの特徴やメリットを比較最も便利なサイトはどこ取扱い自治体数や特典はザイがおすすめする「ふるさと納税サイト」を紹介ふるさと納税おすすめ特産品情報【年月日更新】おすすめの「ふるさと納税」サイトはココだマネー誌・ダイヤモンドZAi編集部が、掲載している自治体の数やお得なサービスなどを比較して、おすすめの「ふるさと納税サイト」を紹介「ふるさと納税」をすると決めたら、どの自治体に寄附をするのがいいのかを探すのが、一番楽しい作業だろう。 2021-04-15 21:40:00
LifeHuck ライフハッカー[日本版] 超軽&タッチパッドとして使える! iPadをメイン機にするなら、キーボードは「mokibo」がいいかも https://www.lifehacker.jp/2021/04/232846-machi-ya-mokibo-review.html android 2021-04-15 22:00:00
北海道 北海道新聞 札幌市施設の利用制限へ 外出・往来自粛要請1カ月延長、区民センターや児童会館など https://www.hokkaido-np.co.jp/article/533729/ 利用制限 2021-04-15 21:16:41
北海道 北海道新聞 道内景気を引き下げ 4月日銀報告 個人消費低調 https://www.hokkaido-np.co.jp/article/533722/ 個人消費 2021-04-15 21:10:15
北海道 北海道新聞 聖火リレー、徳島内陸から鳴門へ マラソンの市橋有里さんが走る https://www.hokkaido-np.co.jp/article/533726/ 市橋有里 2021-04-15 21:05:00
北海道 北海道新聞 学習支援のカコタムが東京支部立ち上げ 転勤しても講師可能に https://www.hokkaido-np.co.jp/article/533552/ 転勤 2021-04-15 21:05:19
北海道 北海道新聞 総務省、法制局見解など文書開示 フジ外資規制違反 野党、根拠なお不透明と批判 https://www.hokkaido-np.co.jp/article/533725/ 外資規制 2021-04-15 21:04:00
北海道 北海道新聞 エゾシカ油脂で肌ツルリ 道科学大と化粧品会社がハンドクリーム共同開発 https://www.hokkaido-np.co.jp/article/533554/ 共同開発 2021-04-15 21:02:45
ビジネス 東洋経済オンライン 半導体チップ「供給不足」に続いて「値上げ」の波 需給逼迫は2021年末まで解消せずとの見方も | 「財新」中国Biz&Tech | 東洋経済オンライン https://toyokeizai.net/articles/-/422161?utm_source=rss&utm_medium=http&utm_campaign=link_back biztech 2021-04-15 21:30:00
IT 週刊アスキー KRIPTONが「KX-0.5II」を発表、いまや貴重な存在になった中級クラス密閉型ブックシェルフ https://weekly.ascii.jp/elem/000/004/051/4051752/ kripton 2021-04-15 21:47: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件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)