投稿時間:2022-02-15 19:32:20 RSSフィード2022-02-15 19:00 分まとめ(33件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia News] パワポの図形1万3000個でできたアイドルグループ、フリー素材デビュー サントリーが配布 https://www.itmedia.co.jp/news/articles/2202/15/news167.html itmedia 2022-02-15 18:42:00
IT ITmedia 総合記事一覧 [ITmedia News] 「ボカロPの一般認知が広がってきた」 VOCALOID声優オーディション開催の背景 https://www.itmedia.co.jp/news/articles/2202/15/news165.html itmedia 2022-02-15 18:30:00
TECH Techable(テッカブル) 【コラム】1GBわずか290円! 日本通信の格安SIM「合理的シンプル290」が超安い理由 https://techable.jp/archives/173074 日本通信 2022-02-15 09:00:08
js JavaScriptタグが付けられた新着投稿 - Qiita Webの勉強はじめてみた その32 〜AJAXとWebSocket〜 https://qiita.com/mybrother_jake/items/6e864c8c4a0de481e0b4 サーバーを閉じて接続を切断した時にもクライアントが延々と情報を送り続けようとするのをみても、単純にどっちがいいってこともなさそう。 2022-02-15 18:40:45
js JavaScriptタグが付けられた新着投稿 - Qiita Githubがmermaid.jsに対応したので早速使ってみました。 https://qiita.com/nakagami5963/items/8d2fbafb2510db354a93 Githubがmermaidjsに対応したので早速使ってみました。 2022-02-15 18:31:16
golang Goタグが付けられた新着投稿 - Qiita DDDを意識したgolangでの実装 https://qiita.com/goshushunsuke/items/179d77c323bdd4e31bc6 Taskクラスの属性が全てpublicである為ドメイン知識を把握していないメンバーが開発するとこういうことがいくらでも起きてしまいます。 2022-02-15 18:13:38
技術ブログ Developers.IO AppRunnerをCDKで構築してみた https://dev.classmethod.jp/articles/cdk-app-runner/ apprunner 2022-02-15 09:11:50
海外TECH MakeUseOf 6 Free Tools to Improve YouTube Playlists and Create Playlists Without an Account https://www.makeuseof.com/free-tools-improve-youtube-playlists/ Free Tools to Improve YouTube Playlists and Create Playlists Without an AccountFrom finding missing videos to turning all open YouTube tabs into a custom playlist these free tools supercharge YouTube playlists 2022-02-15 09:30:12
海外TECH MakeUseOf Which Marvel Shows Are Leaving Netflix and Why https://www.makeuseof.com/marvel-shows-leaving-netflix/ original 2022-02-15 09:00:42
海外TECH DEV Community A simple global styling method with styled component. https://dev.to/marizoo/a-simple-global-styling-method-with-styled-component-1if6 A simple global styling method with styled component Using Styled components I have tried several ways to apply global styling amp media queries to my React App I m here to share my preferred method this far until I find another better way of course For this article I am using React version and styled component version Here it is in step by step format Step Install styled componentsyarn add styled components ornpm install styled components Step Inside the src folder create a file and call it globalStyle jsHere is a screenshot of my folder structureInside globalStyle js add these codes import css from styled components Create global colorexport const ctaColor gt return css palevioletred Create media queriesexport const mobile props gt return css media min width px props as you can see we are simply creating functions that return CSS for us Step To use these CSS functions in our components just import it then apply it to our styling It works just like the usual JavaScript functions Refer to the codes below for some examples import styled from styled components import mobile ctaColor from globalStyle const Navbar styled div display flex flex direction column align items center background ctaColor mobile flexDirection row Voila That is it short and simple I hope it is useful for your projects Cheers Your friend Marizoo 2022-02-15 09:46:38
海外TECH DEV Community Pinch Strength using HandTracking - MR Tutorial for Nreal light https://dev.to/kara_d_en/pinch-strength-using-handtracking-mr-tutorial-for-nreal-light-2878 Pinch Strength using HandTracking MR Tutorial for Nreal lightMeasure the strength of your left and right hand hand tracking Sample Repositorymr tutorials for nreal light PinchStrength at main ·karad mr tutorials for nreal light Run the sampleClone Sample Repository Change current directory to PinchStrength And Open with Unity If you don t have NRSDK Download NRSDK from Open Build Setting change Platform to AndroidOpen Project select Assets gt import package gt Custom Package and import NRSDKForUnityAndroid unitypackage Check Build Settings gt Player Settings by referring to Configure Build SettingsPress Build form Build Settings panelInstall apk on Android or DevKit Tutorial Setting up the project for Nreal developmentSee Quickstart for Android NRSDK Documentation and configure the build settings If you don t have NRSDK Download NRSDK from Open Project select Assets gt import package gt Custom Package and import NRSDKForUnityAndroid unitypackage Setting for HandTracking to NRInputSelect NRInput and change Input Source Type to HandsPut NRHand R from Assets gt NRSDK gt Prefabs gt Hands to NRInput gt Right on the Scene Put NRHand L from Assets gt NRSDK gt Prefabs gt Hands to NRInput gt Left on the Scene Put a Canvas in the scenePut Canvas from Create gt UISet property on Inspector panelRender Mode World SpacePos X Pos Y Pos Z ScaleX Y Z Put Slider in CanvasPut Slider as a child of Canvas with the name PinchStrengthBarRight Set Pos X Pos Y Pos Z Change the Background Color of the child of PinchStrengthBarRight to FF Change the Fill Area gt Fill Color of the child of PinchStrengthBarRight to FF Change the Rect Transform of Fill Area Set Left of Rect Transform to and set Right to as well disable Handle Slide Area Duplicate PinchStrengthBarRightChange name to “PinchStrengthBarLeft Set Pos X Pos Y Pos Z Create an empty GameObject and attach C script to it Create an empty GameObject on Hierarchy with the name BaseGameObject Create the following C script named PinchStrength and attach it to the empty GameObject you just created Set Pinch Strength Right Hand on Inspector panel to PinchStrengthBarRight on the scene Set Pinch Strength Left Hand on Inspector panel to PinchStrengthBarLeft on the scene using NRKernal using System Collections using System Collections Generic using UnityEngine using UnityEngine EventSystems using UnityEngine UI public class PinchStrength MonoBehaviour lt summary gt Pinch Strength Bar for Left Hand lt summary gt public Slider pinchStrengthLeftHand lt summary gt Pinch Strength Bar for Right Hand lt summary gt public Slider pinchStrengthRightHand Start is called before the first frame update void Start Update is called once per frame void Update HandState handStateRight NRInput Hands GetHandState HandEnum RightHand float pinchStrengthRight handStateRight pinchStrength pinchStrengthRightHand value pinchStrengthRight HandState handStateLeft NRInput Hands GetHandState HandEnum LeftHand float pinchStrengthLeft handStateLeft pinchStrength pinchStrengthLeftHand value pinchStrengthLeft BuildPress Build form Build Settings panelInstall apk on Android or DevKit 2022-02-15 09:39:39
海外TECH DEV Community Building an Omegle clone in Flutter using 100ms SDK https://dev.to/100mslive/building-an-omegle-clone-in-flutter-using-100ms-sdk-4mhd Building an Omegle clone in Flutter using ms SDKThe Internet is full of cool people Omegle lets you meet them When you use Omegle it picks someone else at random so you can have a one on one live audio video text chat with them This content was originally published HEREThis post will take you through a step by step guide on how to build an Omegle like app in Flutter using ms Live Audio Video package Features in OmegleJoin the room anonymously Can Share audio and video Can chat anonymouslyCan switch the room This is how your Omegle clone will look like at the end of this tutorial PrerequisitesEnsure that you have the following requirements Flutter v or later stable ms Account Create ms Account This tutorial assumes you have some prior knowledge of Flutter If you are new to Flutter please go through the official documentation ms is a real time audio video conferencing platform that enables you to quickly build a fully customizable audio video engagement experience It is quick to integrate with native cross mobile and web SDKs It provides you with the following features Production ready pre built templates to use Ability to build large rooms with a capacity of participants with audio amp video on Support for dynamic roles disconnection handling and bandwidth management ms SDK itself handles cases like headphone switching phone call interruptions etc on it s own so no need to write extra code for that Setting up ms projectCreate New AppBefore creating a room we need to create a new app Next choose the Video Conferencing template Click on Set up App and your app is created Finally go to Rooms in the dashboard and click on room pre created for you QuickStartStart by cloning the code from here We will see the step by step implementation of the app and also how to use ms flutter SDKin any flutter app from scratch In this app we will need to setup the firebase for firestore which we are using as our database The setup steps can be found here We need to put the google services json file in the android app folder For running the project flutter pub getflutter runHurray This was super easy Now Let s build this from scratch Start a new flutter projectSetting up ms SDK hmssdk flutter In the pubspec yaml file under dependencies add run flutter pub get to install the dependenciesAdd PermissionsWe will require Recording Audio Video and Internet permission in this project as we are focused on the audio and video track in this tutorial A track represents either the audio or video that a peer is publishing Android PermissionAdd the permissions outside your application tag in your AndroidManifest file android app src main AndroidManifest xml lt uses feature android name android hardware camera gt lt uses permission android name android permission INTERNET gt lt uses permission android name android permission RECORD AUDIO gt lt uses feature android name android hardware camera autofocus gt lt uses permission android name android permission CAMERA gt iOS PermissionsAdd the permissions to your Info plist file lt key gt NSCameraUsageDescription lt key gt lt string gt YourAppName wants to use your camera lt string gt lt key gt NSLocalNetworkUsageDescription lt key gt lt string gt YourAppName App wants to use your local network lt string gt lt key gt NSMicrophoneUsageDescription lt key gt lt string gt YourAppName wants to use your microphone lt string gt Now you are ready Let s dive deeper for setting up the functions These steps are common to any application using ms SDK Setting up functionsInitialize a single instance of HMSSDK Multiple instance can also be created but as our app only needs a single instance so we will be focusing on that You can also inject HMSSDK dependency to your required classes Package importsimport package hmssdk flutter hmssdk flutter dart class SdkInitializer static HMSSDK hmssdk HMSSDK We need to run the build method of hmssdk in the next step as SdkInitializer hmssdk build Create a join function which takes HMSSDK as parameter For joining room we need auth token For this we need to make http post request to Body parameters body user id user room id room Id role host role the role with which you want to join the roomuser id Optional Parameter Can be any stringroom id This can be found from the room details page in your ms dashboard After getting the auth token from the above endpoint we need to create an HMSConfig Object to be passed in the join method of HMSSDK HMSConfig config HMSConfig authToken token from above endpoint userName Any username Now the room can be joined by passing this config object as await hmssdk join config config Once we have joined the room we need to add listener to start Listening the SDK updates hmssdk addUpdateListener listener HMSUpdateListener We need to pass the HMSUpdateListener instance in the listener parameter from wherever we want to listen to the updates from SDK General implementation involves implementing HMSUpdateListener in the class where we are maintaining the state of the application We have completed the ms SDK setup for joining room and listening to room updates Methods for updates happening in the RoomLet s set some jargons hereLocal peer YouRemote peers All peers in the room excluding you onJoin This is the method where we get the join update for the local peer We get the local peer object in this method onPeerUpdate In this method we receive the updates for all the remote Peers like when a new peer joins the room or leaves the room In this we receive HMSPeerUpdate object which is an enum You can find more info about enum here onTrackUpdate This is one of the most important method Here we receive the track updates for all peers Tracks will be audio video or auxiliary tracks like screen share custom audio video played from a file onMessage In this method we receive the chat messages update from remote peers onError This is called when errors occur from the SDK side onUpdateSpeakers In this method we receive updates about the current speaker This can be used to highlight who is speaking currently onReconnecting This method gets called when the app loses connection to internet amp is trying to reconnect now onReconnected This method gets called when the user gets connected after reconnection One important thing to note here is that the user will receive the update in OnJoin for local peer and in onPeerUpdate for remotePeers onRemovedFromRoom This method gets called when any remote peer removes the local peer from the room Generally used to pop the user back to home screen onRoleChangeRequest This method gets called when any remote peer requests the local peer to change it s role Generally used in the scenario when you want to invite the user to speak and the user s current role does not have that permission So this can be achieved by changing user s role to the role which has publish permissions onChangeTrackStateRequest This is called when remote peer asks you the local peer to mute unmute your audio video track onRoomUpdate This method gets called when the user gets room updates like Recording Started Stopped RTMP HLS Streaming Start Stop updates etc Setting up Database of RoomsWe will need roomId or roomLink to join the room and since user should be able to join any random room from here we are storing some roomId s in database along with the number of users in the room This is not the best way as all the rooms may get occupied at a time So the best way is to generate room dynamically More details regarding creating a room from api can be found here For the sake of simplicity we have created rooms amp stored roomIds in Firebase First we make a request from the app looking for rooms with a single user and assign it to new user If there are no rooms with a single user then we assign a new room to that user If all the rooms are occupied then we should be able to dynamically create rooms Omegle assumes that every peer should be mapped with another peer and if there are no peer s available then you are shown a waiting screen Here is a basic schema of the Firebase Store of roomIds Feel free to suggest your database strategies we will be more than happy to hear from you all Implementing featuresJoining a RoomThere are two ways to join a room by using room link or roomId Since here we need roomId or roomUrl We are using Firebase to store all the rooms so we ll fetch the roomId use it to join the room The Firebase services can be found in services dart class FireBaseServices static late QuerySnapshot querySnapshot static final db FirebaseFirestore instance Function to get Rooms static getRooms async Looking for rooms with single user querySnapshot await db collection rooms where users isEqualTo limit get Looking for empty rooms if querySnapshot docs isEmpty querySnapshot await db collection rooms where users isEqualTo limit get await db collection rooms doc querySnapshot docs id update users FieldValue increment return querySnapshot Function to leave room basically reducing user count in the room static leaveRoom async await db collection rooms doc querySnapshot docs id update users FieldValue increment When the user clicks JoinRoom the joinRoom function is invoked and it initializes the ms SDK attaches update listeners amp joins the room Handles room joining functionality Future lt bool gt joinRoom async setState isLoading true The join method initialize sdk gets auth token creates HMSConfig and helps in joining the room bool isJoinSuccessful await JoinService join SdkInitializer hmssdk if isJoinSuccessful return false dataStore UserDataStore Here we are attaching a listener to our DataStoreClass dataStore startListen setState isLoading false return true Let s look into the join function from JoinService dartclass JoinService Function to get roomId stored in Firebase static Future lt String gt getRoom async QuerySnapshot result await FireBaseServices getRooms then data result data return result docs get roomId Function to join the room static Future lt bool gt join HMSSDK hmssdk async String roomUrl await getRoom Uri endPoint Uri parse http Response response await http post endPoint body user id user room id roomUrl role host var body json decode response body if body null body token null return false We use the token from above response to create the HMSConfig Object which we need to pass in the join method of hmssdk HMSConfig config HMSConfig authToken body token userName user await hmssdk join config config return true Setting up Audio amp Video for peersWe get audio video and all other updates from the listener which we have attached on our HMSSDK instance Among the various update methods available we will be using only the following methods for our app OnPeerUpdate to handle when peer join leave a roomOnTrackUpdate to get audio video updatesclass UserDataStore extends ChangeNotifier implements HMSUpdateListener To store remote peer tracks and peer objects HMSTrack remoteVideoTrack HMSPeer remotePeer HMSTrack remoteAudioTrack HMSVideoTrack localTrack bool disposed false List lt Message gt messages late HMSPeer localPeer bool isNewMessage false To dispose the objects when user leaves the room override void dispose disposed true super dispose Method provided by Provider to notify the listeners whenever there is a change in the model override void notifyListeners if disposed super notifyListeners Method to attach listener to sdk void startListen SdkInitializer hmssdk addUpdateListener listener this Method to listen to local Peer join update override void onJoin required HMSRoom room for HMSPeer each in room peers if each isLocal localPeer each break Method to listen to peer Updates we are only using peerJoined and peerLeft updates here override void onPeerUpdate required HMSPeer peer required HMSPeerUpdate update switch update To handle when peer joins We are setting up remote peers audio and video track here case HMSPeerUpdate peerJoined messages remotePeer peer isNewMessage false remoteAudioTrack peer audioTrack remoteVideoTrack peer videoTrack break Setting up the remote peer to null so that we can render UI accordingly case HMSPeerUpdate peerLeft messages isNewMessage false remotePeer null break case HMSPeerUpdate audioToggled break case HMSPeerUpdate videoToggled break case HMSPeerUpdate roleUpdated break case HMSPeerUpdate metadataChanged break case HMSPeerUpdate nameChanged break case HMSPeerUpdate defaultUpdate break notifyListeners Method to get Track Updates of all the peers override void onTrackUpdate required HMSTrack track required HMSTrackUpdate trackUpdate required HMSPeer peer switch trackUpdate Setting up tracks for remote peers When a track is added for the first time case HMSTrackUpdate trackAdded if track kind HMSTrackKind kHMSTrackKindAudio if track peer isLocal remoteAudioTrack track else if track kind HMSTrackKind kHMSTrackKindVideo if track peer isLocal remoteVideoTrack track else localTrack track as HMSVideoTrack break When a track is removed i e when remote peer lefts we get trackRemoved update case HMSTrackUpdate trackRemoved if track kind HMSTrackKind kHMSTrackKindAudio if track peer isLocal remoteAudioTrack null else if track kind HMSTrackKind kHMSTrackKindVideo if track peer isLocal remoteVideoTrack null else localTrack null break Case when a remote peer mutes audio video case HMSTrackUpdate trackMuted if track kind HMSTrackKind kHMSTrackKindAudio if track peer isLocal remoteAudioTrack track else if track kind HMSTrackKind kHMSTrackKindVideo if track peer isLocal remoteVideoTrack track else localTrack null break Case when a remote peer unmutes audio video case HMSTrackUpdate trackUnMuted if track kind HMSTrackKind kHMSTrackKindAudio if track peer isLocal remoteAudioTrack track else if track kind HMSTrackKind kHMSTrackKindVideo if track peer isLocal remoteVideoTrack track else localTrack track as HMSVideoTrack break case HMSTrackUpdate trackDescriptionChanged break case HMSTrackUpdate trackDegraded break case HMSTrackUpdate trackRestored break case HMSTrackUpdate defaultUpdate break notifyListeners Method to listen to remote peer messages override void onMessage required HMSMessage message Message newMessage Message message message message peerId message sender peerId messages add newMessage isNewMessage true notifyListeners Method to listen to Error Updates override void onError required HMSException error Method to get the list of current speakers override void onUpdateSpeakers required List lt HMSSpeaker gt updateSpeakers Method to listen when the reconnection is successful override void onReconnected Method to listen while reconnection override void onReconnecting Method to be listened when remote peer remove local peer from room override void onRemovedFromRoom required HMSPeerRemovedFromPeer hmsPeerRemovedFromPeer Method to listen to role change request override void onRoleChangeRequest required HMSRoleChangeRequest roleChangeRequest Method to listen to room updates override void onRoomUpdate required HMSRoom room required HMSRoomUpdate update Method to listen to change track request override void onChangeTrackStateRequest required HMSTrackChangeRequest hmsTrackChangeRequest We have successfully set up the methods for audio and video now let s see how to use them to render video on UI The code for this can be found in user screen dart We are using providers for listening to the audio video toggle changes We are using context select to listen to specific changes corresponding to audio video peer and track updates final isVideoOff context select lt UserDataStore bool gt user gt user remoteVideoTrack isMute true final isAudioOff context select lt UserDataStore bool gt user gt user remoteAudioTrack isMute true final peer context select lt UserDataStore HMSPeer gt user gt user remotePeer final track context select lt UserDataStore HMSTrack gt user gt user remoteVideoTrack For rendering video we will be using HMSVideoView from HMSSDK package We just need to pass the track which we have initialised above in this as HMSVideoView track track as HMSVideoTrack matchParent false HMSVideoView is just like any other widget in flutter and super easy to use More details regarding HMSVideoView can be found here In this way we can render the video for remote peer There are some more functions used in the application let s discuss them one by one switchAudio This function is used to switch local peer audio i e if you want to mute yourself then just call this method with isOn parameter as true SdkInitializer hmssdk switchAudio isOn isLocalAudioOn isOn seems to be confusing so just keep in mind that we need to pass the current audioStatus in isOn parameter switchVideo This is similar to switchAudio function This is used to switch local peer video i e if you want to turnOff the video then just pass isOn parameter as true SdkInitializer hmssdk switchVideo isOn isLocalVideoOn switchCamera This is used to switch between front or rear camera SdkInitializer hmssdk switchCamera If the user s audio and video is mute so we render screen as If the user s video is mute so we render screen as These are the loading screens based on if you are joining a room switching a room and if the room does not have any other peers respectively Chat AnonymouslyThere is also an option to chat anonymously in the application Whenever we receive a message we can show a small dot over the Messages icon Whenever we receive message from remote peer the onMessage method is called where we receive an Object of HMSMessage Here we have created a custom class Message for the application as we only need direct messaging The Message class looks like class Message String peerId String message Message required this message required this peerId So in the onMessage we are converting HMSMessage to Message object and adding in our messages list override void onMessage required HMSMessage message Message newMessage Message message message message peerId message sender peerId messages add newMessage isNewMessage true notifyListeners For sending message we are using sendBroadcastMessage method as SdkInitializer hmssdk sendBroadcastMessage message messageController text Now let s move to the last feature of our application the ability to switch rooms Switch Room In the application switch room involves a series of leave room and join room function call Whenever user clicks on switch room button The user leaves the current roomThe user joins another roomFor leaving the room the leave function of HMSSDK is used as SdkInitializer hmssdk leave We also update the Firebase to maintain correct roomState The join method is same as discussed above bool roomJoinSuccessful await JoinService join SdkInitializer hmssdk The complete switchRoom function can be found below Future lt void gt switchRoom async setState isLoading true SdkInitializer hmssdk leave FireBaseServices leaveRoom bool roomJoinSuccessful await JoinService join SdkInitializer hmssdk if roomJoinSuccessful Navigator pop context setState isLoading false So the user leaves the room and then joins another room whenever the switchRoom button the center red button is pressed That s it give yourself a try Any sort of question suggestion please let us know Hope you guys enjoyed 2022-02-15 09:28:19
海外TECH DEV Community Create a Fullstack Project using Clean Architecture in Node.js https://dev.to/waiphyo285/create-a-fullstack-project-using-clean-architecture-in-nodejs-kjl Create a Fullstack Project using Clean Architecture in Node js Clean Architecture in Node jsClick here for full blog postUncle Bob s famous Clean Architecture is a way to write resilient software Resilient software is divided into layers underpinned by business logic and is independent of technologies It should be Independent of Frameworks Libraries and frameworks should be treated as tools and not dependencies Testable Can be tested without external dependencies Independent of UI You can easily switch CLI for Web or RasberryPi Independent of Database Switch out SQL for MongoDB Independent of any external agency Business rules don t know anything about outside world In practice choice of technology should be the last decision you make or code you write e g database platform framework By following clean architecture you can write software today that can be easily switched out for different technologies in the future Practical Example of Clean Architecture in Node jsThis is an example of a simple CRUD application with layered software and separation of business logic vs technology It is a simple API for creating students and includes validation persistence and UI It includes examples using different interfaces CLI and Web databases in memory MongoDB and libraries validation Click here for my reference github repo Click here for my project github repo Note this application is different to the Clean Architecture diagram above but attempts to achieve the same outcome Software layer overviewThe application is separated into three layers Inner layers cannot depend on outer layers and outer layers should only depend one layer in Inner LayerModels Handles the creation validation and reading of our entities students Note that this should be custom logic and not include the database implementation of models e g in Mongoose ORM their models should be encapsulated in the database layer below Our model schemas live here Database Our choice of database in memory MongoDB SQL this is independent of the model Note that in Clean Architecture this is considered an outer layer framework but for practical applications I find it easier to place it inner and have the controllers layer depend on it rather than injecting it in Middle LayerControllers Handles transfer between the database like an ORM Depends on the model to validate and create the entity in database The key is to have a consistent amp custom API that all outer layers communicate with Testing here will ensure that replacing or using multiple databases doesn t break anything further upstream Outer Layersrc Represents the UI or interface Web or CLI It communicates only with the controllers layer Example application structure INNER LAYER models create new entity by validating payload and returning new read only object L validations students L schema js database database connection and adapter L memory in memory JSON L students js L mongodb mongodb alternative L connection js connection library L seeds seed library L students seeds js async seed students database L models L student js models specific to mongodb this is different to our business logic models which handle tests and validation MIDDLE LAYER Controllers think of it as our internal ORM logic for our use cases lies here L students L index js other controllers and src rely on this API findData listDatas addData L memory in memory L index js expose the memory implementation of findData listData addData L serializer js serializes to database specific properties L mongodb mongodb ORM L index js uses mongoose implementation of findData listData dropAll etc L serializer js serializes id to id L postgres TODO Illustrative OUTER LAYER src L cli L index js L web express webserver L routes L api index js L pages js L fils js L validations L schema js L index js depends on routes Practical approachIn practice we can defer technology decisions by writing our application in the following order Start with models schema and validation Write test spec Defer database decision by using in memory JSON storeCreate a controllers API that depends on model and in memory database Write test spec First tech decision UI interface e g web or CLI Depend on above controllers layer Write integration test spec Second tech decision Database choice MongoDB SQL Replace in memory database store Write controllers methods specific to the database choice Ensure previously written test specs pass ModelsWhile the model schema is dependent on a validation library and breaks the Clean rules I find it easier to understand the model by having the schema inside the model Note see the repo for an example of how the validator could be separated into its own software entity models validations students schema jsconst Joi require joi module exports Joi object keys name Joi string required error gt must have name as string age Joi number error gt age must be a number grade Joi number error gt grade must be a number prefect Joi boolean error gt prefect must be a boolean ControllersThe controllers layer is one of the most important We should feel confident to easily replace DBs Here we need three key componentsAPI and test specSerializers to adapt custom database to our model schemaDatabase implementation of the API and passing of testStart with how we think the outer layers will communicate with the controllers layer and what they should expect to get controllers students mongod index js example test specstudentsDb listData lists students findData finds student by id findDataBy finds students by property addData inserts a student updateData updates a student throws error if student payload invalid deleteData deletes a student dropAll drops students databaseWrite a serializer which adapts the custom database schema with our model schema controllers students mongod serializer js e g mongodb stores property id as idconst serializeSingle dataObj gt if need can filter or hide some field return dataObj const serializer data gt if data return null if Array isArray data return data map serializeSingle return serializeSingle data module exports serializer Write custom database implementation of the test spec API Here is an example of an in memory implementation which you should start with and a MongoDB version Note the advantage of writing a test spec is you can focus on simply writing code that just has to work In memory controllers controllers students memory index jsconst STUDENTS require database memory students const serialize require serializer const listData gt return Promise resolve serialize STUDENTS const findData prop val gt if prop id prop serial const student STUDENTS find student gt student prop val return Promise resolve serialize student const findDataBy prop val gt if prop grade prop year const student STUDENTS filter student gt student prop val return Promise resolve serialize student const addData studentInfo gt STUDENTS push studentInfo return findData serial newStudent serial const deleteData id gt return findData id then student gt if student id id STUDENTS STUDENTS filter student gt student serial id return id status SUCCESS return status FAIL const dropAll gt STUDENTS return STUDENTS module exports listData findData findDataBy addData deleteData dropAll MongoDB controllers Note for our MongoDB controllers implementation we depend on the database from the inner layer The database includes MongoDB specific implementation of the model and database connection We write a dropAll function for the purposes of writing a test spec that can be used across any database choice E g beforeEach test we would drop the database and seed items for testing controller students mongod index jsconst Student require database mongodb models student const serialize require serializer const listData gt return Student find populate path cityid model city select city mm city en populate path townshipid model township select township mm township en then serialize const findData prop val gt if prop id prop id return Student find prop val populate path cityid model city select city mm city en populate path townshipid model township select township mm township en then resp gt return serialize resp const findDataBy params gt if prop id prop id return Student find params populate path cityid model city select city mm city en populate path townshipid model township select township mm township en then serialize const addData dataObj gt return Student create dataObj then serialize const updateData id dataObj gt return Student findByIdAndUpdate id dataObj then serialize const deleteData id gt return Student findByIdAndDelete id then resp gt return id resp id toString status SUCCESS message Delete Successful catch err gt return status FAIL message Delete Unsuccessful const dropAll gt return Student remove module exports listData findData findDataBy addData updateData deleteData dropAll srcFinally we write our src whose only dependency is our controllers layer The src should not communicate directly with the model or database Any changes to the inner layer will cascade up and as a result there should be less testing done on the outer layers E g if we were to test changes to the model schema in the driver layer we would need to rewrite our tests here as well src L cli L index js L web express webserver L routes L api index js L pages js L fils js L validations L schema js L index js depends on routes 2022-02-15 09:19:28
海外TECH Engadget OM Digital's powerful OM-1 mirrorless camera may be the last Olympus-branded flagship https://www.engadget.com/om-digital-om-1-mirrorless-camera-raw-50-fps-090945557.html?src=rss OM Digital x s powerful OM mirrorless camera may be the last Olympus branded flagshipOM Digital Solutions has unveiled the Micro Four Thirds OM its first mirrorless camera since purchasing Olympus It packs a new sensor and technology that gives it a big leap in performance over the last flagship Olympus models and could be the last Olympus branded model you ll see nbsp Marking the th anniversary of the original OM film SLR the OM offers some big improvements over the E M Mark III That starts with the stacked backside illuminate megapixel Live MOS sensor with a quot quad pixel quot AF arrangement using four photodiodes per pixel With the higher speed readout and updated TruePic X processor it can shoot RAW photos at speeds of up to fps in electronic shutter mode with phase detect autofocus enabled with supported PRO series lenses or fps with AF locked nbsp OLYMPUS CORP With the stacked design you ll also see far less rolling shutter when shooting in electronic mode That s pretty important because speeds go down considerably to fps with the mechanical shutter Unfortunately you can only capture up to RAW images at a time with the mechanical shutter or just RAW images in silent mode at fps ーless than seconds of shooting Those speeds are no doubt limited by OM s choice to use dual SD UHS II card slots instead of something faster like CFexpress nbsp Though the OM is mainly aimed at wildlife photographers it can handle more detailed images as well with the High Res Shot mode That allows you to capture megapixel images handheld in just five seconds or megapixel images on a tripod Other modes include live ND to simulate long exposures HDR and focus stacking which delivers an image with everything in focus OLYMPUS CORP The AF is considerably improved in terms of AI smarts as well OM says that its latest face and eye detect algorithms are much more responsive and it now detects cars airplane and trains on top of people birds and animals It also has a new subject tracking feature that s completely separate from face and eye detection nbsp The OM looks to easily be OMD s best camera ever for video You can now shoot K UHD or DCI at up to fps in either bit H or bit H modes p at fps H capture works either in OM Log mode for improved dynamic range or HLG mode for HDR work Better still the OM can output bit Apple ProRes RAW video at up to fps to an Atomos Ninja V or Ninja V external recorder supposedly without any subsampling pixel binning nbsp OM Digital SystemsOther feature include stops of in body image stabilization with supported lenses stops without high end build quality with an outstanding IP camera rating against dust water and freezing conditions a redesigned menu system million dot HZ electronic viewfinder and battery that delivers shots on a charge CIPA rated and minutes of video recording It has a fully articulating million dot rear display that should make this camera ideal for vlogging nbsp nbsp The OM looks to be a strong rival to Panasonic s GH II Micro Four Thirds camera offering faster shooting speeds and superior phase detect autofocus while even matching up well in terms of video for the first time It remains to be seen how it will stack up against the upcoming Panasonic GH however which is set to be launched on February st at PM ET nbsp The OM Digital s OM is now available on pre order for with delivery set for early March Olympus also unveiled a pair of new lenses the M Zuiko Digital ED mm f Pro II and the M Zuiko Digital ED mm f PRO nbsp 2022-02-15 09:09:45
医療系 医療介護 CBnews コロナ経口薬のパキロビッド、保険診療との併用可-時限措置、厚労省 https://www.cbnews.jp/news/entry/20220215183433 保険診療 2022-02-15 18:45:00
金融 RSS FILE - 日本証券業協会 個人情報の苦情処理に関する実績報告 https://www.jsda.or.jp/shiryoshitsu/toukei/kojn_kujyou.html 個人情報 2022-02-15 10:19:00
金融 金融庁ホームページ 入札公告等を更新しました。 https://www.fsa.go.jp/choutatu/choutatu_j/nyusatu_menu.html 公告 2022-02-15 11:00:00
ニュース BBC News - Home Russia pulls some troops back to base https://www.bbc.co.uk/news/world-europe-60386141?at_medium=RSS&at_campaign=KARANGA russia 2022-02-15 09:38:05
ニュース BBC News - Home UK wage growth lags rising cost of living https://www.bbc.co.uk/news/business-60373405?at_medium=RSS&at_campaign=KARANGA figures 2022-02-15 09:17:05
ニュース BBC News - Home What is the UK's inflation rate and why is the cost of living going up? https://www.bbc.co.uk/news/business-12196322?at_medium=RSS&at_campaign=KARANGA inflation 2022-02-15 09:17:37
ニュース BBC News - Home Is Mbappe destined to join Real Madrid this summer? https://www.bbc.co.uk/sport/football/60346116?at_medium=RSS&at_campaign=KARANGA employers 2022-02-15 09:32:15
ニュース BBC News - Home Winter Olympics: Japan crash out to hand Canada women's speed skating team pursuit gold https://www.bbc.co.uk/sport/av/winter-olympics/60387026?at_medium=RSS&at_campaign=KARANGA Winter Olympics Japan crash out to hand Canada women x s speed skating team pursuit goldJapan s Nana Takagi crashes out of the women s team pursuit on the final lap handing Canada gold at the Winter Olympics in Beijing 2022-02-15 09:27:48
ビジネス ダイヤモンド・オンライン - 新着記事 「住信SBIネット銀行(スミシンエスビーアイネットギンコウ)」のIPO情報総まとめ! スケジュールから幹事証券、注目度、銘柄分析、 他のインターネット専業銀行との比較や予想まで解説! - IPO株の銘柄分析&予想 https://diamond.jp/articles/-/296440 2022-02-15 18:15:00
サブカルネタ ラーブロ らーめん いつ樹 本店@青梅市<四季限定・海老味噌つけ麺2022> http://ra-blog.net/modules/rssc/single_feed.php?fid=196527 らーめんいつ樹本店青梅市lt四季限定・海老味噌つけ麺gt訪問日メニュー海老味噌つけ麺味海老味噌コメント今日紹介するのは、小作駅や箱根ヶ崎駅から遠く離れた新青梅街道沿い新町丁目にある「いつ樹」。 2022-02-15 09:00:52
北海道 北海道新聞 ジョコ、未接種の「代償払う」 ワクチンで持論、英BBC報道 https://www.hokkaido-np.co.jp/article/645974/ 新型コロナウイルス 2022-02-15 18:03:49
北海道 北海道新聞 ヤクルト小川、6度目開幕投手へ 直球に力強さ https://www.hokkaido-np.co.jp/article/645989/ 仕上がり 2022-02-15 18:18:00
北海道 北海道新聞 ノルウェーが優勝、銀はフランス バイアスロン男子・15日 https://www.hokkaido-np.co.jp/article/645988/ 男子 2022-02-15 18:18:00
北海道 北海道新聞 ロコ・ソラーレ、英国に敗れ3敗目 北京五輪カーリング https://www.hokkaido-np.co.jp/article/645968/ 北京五輪 2022-02-15 18:18:40
北海道 北海道新聞 支部長代行に角鹿氏 千島連盟根室支部 https://www.hokkaido-np.co.jp/article/645978/ 北方領土 2022-02-15 18:10:00
北海道 北海道新聞 まとめサイト運営会社に賠償命令 ネットギーク名誉毀損訴訟 https://www.hokkaido-np.co.jp/article/645976/ 名誉毀損 2022-02-15 18:04:00
北海道 北海道新聞 保育園児マスク「昼寝時外して」 厚労省が着用推奨で留意点 https://www.hokkaido-np.co.jp/article/645975/ 厚生労働省 2022-02-15 18:02:00
IT 週刊アスキー スマホアプリ『リゼロス』で「【姉様おすすめスイーツ】ラム★3」が新登場するシーズンガチャを開催! https://weekly.ascii.jp/elem/000/004/083/4083553/ lostinmemories 2022-02-15 18:55:00
IT 週刊アスキー テーマは「Enjoy Your Choice!暮らしの選択を、もっと楽しく」。高架下タイニーハウス複合施設「Tinys Yokohama Hinodecho」が3月2日にリニューアルオープン https://weekly.ascii.jp/elem/000/004/083/4083539/ enjoyyourchoice 2022-02-15 18:30: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件)