投稿時間:2022-11-24 02:21:53 RSSフィード2022-11-24 02:00 分まとめ(23件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWS Architecture Blog How to select a Region for your workload based on sustainability goals https://aws.amazon.com/blogs/architecture/how-to-select-a-region-for-your-workload-based-on-sustainability-goals/ How to select a Region for your workload based on sustainability goalsThe Amazon Web Services AWS Cloud is a constantly expanding network of Regions and points of presence PoP with a global network infrastructure linking them together The choice of Regions for your workload significantly affects your workload KPIs including performance cost and carbon footprint The Well Architected Framework s sustainability pillar offers design principles and best practices … 2022-11-23 16:22:49
AWS AWS Management Tools Blog Maximizing resource tagging at scale and across teams for your migration to AWS https://aws.amazon.com/blogs/mt/maximizing-resource-tagging-at-scale-and-across-teams-for-your-migration-to-aws/ Maximizing resource tagging at scale and across teams for your migration to AWSMany customers are migrating to AWS to leverage cost reduction boost staff productivity improve operational resilience and increase business agility When your business decides to migrate to AWS there are many areas that need careful attention and planning It s important to consider these areas across technical business and delivery domains A key area that is … 2022-11-23 16:58:07
python Pythonタグが付けられた新着投稿 - Qiita 歌詞付きMIDIをMusicXMLに変換 その1: 歌詞情報の取得 https://qiita.com/shimajiroxyz/items/485723ae22a922f4df17 midixf 2022-11-24 01:41:14
python Pythonタグが付けられた新着投稿 - Qiita VSCodeからPythonソースを対話的に実行 https://qiita.com/brskidor/items/0e901d8b2e2fdcf33c8f ipython 2022-11-24 01:21:35
Azure Azureタグが付けられた新着投稿 - Qiita 仮想ネットワークとサブネットについて https://qiita.com/ss12345/items/a13c8a79e6941533ec1e azure 2022-11-24 01:09:59
海外TECH MakeUseOf Is Windows 11 Stuck in Airplane Mode? Here's How to Fix It https://www.makeuseof.com/windows-11-stuck-airplane-mode/ airplane 2022-11-23 16:15:16
海外TECH DEV Community How to build the most beautiful Todolist with React Native and Socket.io 🎉 https://dev.to/novu/how-to-build-the-most-beautiful-todolist-with-react-native-and-socketio-df5 How to build the most beautiful Todolist with React Native and Socket io What is this article about Todolist is a simple task list where you mark everything you need to do and the status of it Finished Not Finished In this article you ll learn how to build a to do list application that allows you to sign in create and delete a to do and add comments to each to do using React Native and Socket io Why Socket io If you are reading this you have probably wondered I can do it with a Restful API So why do I need to use Socket io We want to make a todo list where the user can create a todo list for other users and let them see the status online without refreshing the page Socket io is a highly performant JavaScript library that allows us to create real time bi directional communication between web browsers and a Node js server It follows the WebSocket protocol and provides better functionalities such as fallback to HTTP long polling or automatic reconnection which enables us to build efficient real time applications Novu the first open source notification infrastructureJust a quick background about us Novu is the first open source notification infrastructure We basically help to manage all the product notifications It can be In App the bell icon like you have in Facebook Websockets Emails SMSs and so on I would be super happy if you could give us a star And let me also know in the comments ️ How to connect React Native to a Socket io serverHere you ll learn how to connect the to do list application to a Socket io server In this guide I ll be using Expo a tool that provides an easier way of building React Native applications Creating a React Native app with ExpoExpo saves us from the complex configurations required to create a native application with the React Native CLI making it the easiest and fastest way to build and publish React Native apps Ensure you have the Expo CLI Node js and Git installed on your computer Then create the project folder and an Expo React Native app by running the code below mkdir todolist appcd todolist appexpo init appExpo allows us to create native applications using the Managed or Bare Workflow We ll use the blank Managed Workflow in this tutorial Choose a template › Use arrow keys Return to submit Managed workflow ❯blank a minimal app as clean as an empty canvas blank TypeScript same as blank but with TypeScript configuration tabs TypeScript several example screens and tabs using react navigation and TypeScript Bare workflow minimal bare and minimal just the essentials to get you startedInstall Socket io Client API to the React Native app cd appexpo install socket io clientCreate a socket js file within a utils folder mkdir utilstouch socket jsThen copy the code below into the socket js file import io from socket io client const socket io connect http localhost export default socket The code snippet above creates a real time connection to the server hosted at that URL We ll set up the server in the upcoming section Create a styles js file within the utils folder and copy the code below into the file It contains all the styling for the application import StyleSheet from react native export const styles StyleSheet create screen flex backgroundColor fff padding header padding justifyContent space between flexDirection row marginBottom heading fontSize fontWeight bold container padding loginScreen flex loginContainer flex padding flexDirection column justifyContent center textInput borderWidth width padding marginBottom loginButton width backgroundColor DC padding todoContainer flexDirection row justifyContent space between backgroundColor CDFEA padding borderRadius marginBottom todoTitle fontWeight bold fontSize marginBottom subTitle opacity form flexDirection row marginBottom input borderWidth padding flex justifyContent center modalScreen backgroundColor fff flex padding alignItems center textInput borderWidth padding width marginBottom modalButton backgroundColor DC padding buttonText fontSize textAlign center color fff comment marginBottom message padding backgroundColor CDFEA width borderRadius Install React Navigation and its dependencies  React Navigation allows us to move from one screen to another within a React Native application npm install react navigation nativenpx expo install react native screens react native safe area context Setting up the Node js serverHere I will guide you through creating the Socket io Node js server for real time communication Create a server folder within the project folder cd todolist appmkdir serverNavigate into the server folder and create a package json file cd server amp npm init yInstall Express js CORS Nodemon and Socket io Server API npm install express cors nodemon socket ioExpress is a fast minimalist framework that provides several features for building web applications in Node js  CORS is a Node js package that allows communication between different domains Nodemon is a Node js tool that automatically restarts the server after detecting file changes and Socket io allows us to configure a real time connection on the server Create an index js file the entry point to the Node js server touch index jsSet up a simple Node js server using Express js The code snippet below returns a JSON object when you visit the http localhost api in your browser index jsconst express require express const app express const PORT app use express urlencoded extended true app use express json app get api req res gt res json message Hello world app listen PORT gt console log Server listening on PORT Next add Socket io to the project to create a real time connection Before the app get block copy the code below New imports const socketIO require socket io http cors origin http localhost Add this before the app get blocksocketIO on connection socket gt console log socket id user just connected socket on disconnect gt socket disconnect console log A user disconnected From the code snippet above the socket io connection function establishes a connection with the React app creates a unique ID for each socket and logs the ID to the console whenever you refresh the app When you refresh or close the app the socket fires the disconnect event showing that a user has disconnected from the socket Configure Nodemon by adding the start command to the list of scripts in the package json file The code snippet below starts the server using Nodemon In server package json scripts test echo Error no test specified amp amp exit start nodemon index js You can now run the server with Nodemon by using the command below npm start Building the app user interfaceIn this section we ll create the user interface for the to do list application to enable users to sign in to the application create and delete to dos and add comments to each to do First let s set up React Navigation Create a screens folder within the app folder and add the Home Login and Comments components Render a Hello World text within them mkdir screenscd screenstouch Home js Login js Comments jsCopy the code below into the App js file within the app folder the app componentsimport Home from screens Home import Comments from screens Comments import Login from screens Login React Navigation configurationsimport NavigationContainer from react navigation native import createNativeStackNavigator from react navigation native stack const Stack createNativeStackNavigator export default function App return lt NavigationContainer gt lt Stack Navigator gt lt Stack Screen name Login component Login options headerShown false gt lt Stack Screen name Home component Home options headerShown false gt lt Stack Screen name Comments component Comments gt lt Stack Navigator gt lt NavigationContainer gt The Login screenCopy the code below into the Login js file import View Text SafeAreaView StyleSheet TextInput Pressable from react native import React useState from react const Login navigation gt const username setUsername useState const handleLogin gt if username trim console log username else Alert alert Username is required return lt SafeAreaView style styles loginScreen gt lt View style styles loginContainer gt lt Text style fontSize fontWeight bold marginBottom textAlign center gt Login lt Text gt lt View style width gt lt TextInput style styles textInput value username onChangeText value gt setUsername value gt lt View gt lt Pressable onPress handleLogin style styles loginButton gt lt View gt lt Text style color fff textAlign center fontSize gt SIGN IN lt Text gt lt View gt lt Pressable gt lt View gt lt SafeAreaView gt export default Login The code snippet accepts the username from the user and logs it on the console Next update the code and save the username using Async Storage for easy identification Async Storage is a React Native package used to store string data in native applications It is similar to the local storage on the web and can be used to store tokens and data in string format Run the code below to install Async Storage expo install react native async storage async storageUpdate the handleLogin function to save the username via AsyncStorage import AsyncStorage from react native async storage async storage const storeUsername async gt try await AsyncStorage setItem username username navigation navigate Home catch e Alert alert Error While saving username const handleLogin gt if username trim calls AsyncStorage function storeUsername else Alert alert Username is required The Home screenUpdate the Home js file to contain the code snippet below import SafeAreaView Text StyleSheet View FlatList from react native import Ionicons from expo vector icons import React useState from react import Todo from Todo import ShowModal from ShowModal const Home gt const visible setVisible useState false demo to do lists const data setData useState id title Hello World comments id title Hello comments return lt SafeAreaView style styles screen gt lt View style styles header gt lt Text style styles heading gt Todos lt Text gt lt Ionicons name create outline size color black onPress gt setVisible visible gt lt View gt lt View style styles container gt lt FlatList data data keyExtractor item gt item id renderItem item gt lt Todo item item gt gt lt View gt lt ShowModal setVisible setVisible visible visible gt lt SafeAreaView gt export default Home From the code snippet above we imported two components Todo and ShowModal as sub components within the Home component Next let s create the Todo and ShowModal components touch Todo js ShowModal jsUpdate the Todo js file to contain the code below It describes the layout for each to do import View Text StyleSheet from react native import React from react import AntDesign from expo vector icons const Todo item gt return lt View style styles todoContainer gt lt View gt lt Text style styles todoTitle gt item title lt Text gt lt Text style styles subTitle gt View comments lt Text gt lt View gt lt View gt lt AntDesign name delete size color red gt lt View gt lt View gt export default Todo Update the ShowModal js file to contain the code below import Modal View Text StyleSheet SafeAreaView TextInput Pressable from react native import React useState from react const ShowModal setVisible visible gt const input setInput useState const handleSubmit gt if input trim console log input setVisible visible return lt Modal animationType slide transparent true visible visible onRequestClose gt Alert alert Modal has been closed setVisible visible gt lt SafeAreaView style styles modalScreen gt lt TextInput style styles textInput value input onChangeText value gt setInput value gt lt Pressable onPress handleSubmit style styles modalButton gt lt View gt lt Text style styles buttonText gt Add Todo lt Text gt lt View gt lt Pressable gt lt SafeAreaView gt lt Modal gt export default ShowModal The code snippet above represents the modal that pops up when you press the icon for creating a new to do The Comments screenCopy the code snippet below into the Comments js file import React useLayoutEffect useState from react import View StyleSheet TextInput Button FlatList from react native import AsyncStorage from react native async storage async storage import CommentUI from CommentUI const Comments navigation route gt const comment setComment useState const commentsList setCommentsList useState id title Thank you user David id title All right user David const user setUser useState fetches the username from AsyncStorage const getUsername async gt try const username await AsyncStorage getItem username if username null setUser username catch err console error err runs on page load useLayoutEffect gt getUsername logs the comment details to the console const addComment gt console log comment user return lt View style styles screen gt lt View style styles form gt lt TextInput style styles input value comment onChangeText value gt setComment value multiline true gt lt Button title Post Comment onPress addComment gt lt View gt lt View gt lt FlatList data commentsList keyExtractor item gt item id renderItem item gt lt CommentUI item item gt gt lt View gt lt View gt export default Comments The code snippet above contains a sub component CommentUI which represents the layout for each comment Update the CommentUI component as below import View Text StyleSheet from react native import React from react const CommentUI item gt return lt View style styles comment gt lt View style styles message gt lt Text style fontSize gt item title lt Text gt lt View gt lt View gt lt Text gt item user lt Text gt lt View gt lt View gt export default CommentUI Sending real time data via Socket ioIn this section you ll learn how to send data between the React Native application and a Socket io server How to create a new to doImport socket from the socket js file into the ShowModal js file import socket from utils socket Update the handleSubmit function to send the new to do to the server Within ShowModal jsconst handleSubmit gt if input trim sends the input to the server socket emit addTodo input setVisible visible Create a listener to the addTodo event on the server that adds the to do to an array on the backend array of todosconst todoList function that generates a random string as IDconst generateID gt Math random toString substring socketIO on connection socket gt console log socket id user just connected listener to the addTodo event socket on addTodo todo gt adds the todo to a list of todos todoList unshift id generateID title todo comments sends a new event containing the todos socket emit todos todoList socket on disconnect gt socket disconnect console log A user disconnected How to display the to dosImport socket from the socket js file into the Home js file import socket from utils socket Create an event listener to the to dos created on the server and render them on the client const data setData useState useLayoutEffect gt socket on todos data gt setData data socket The todos event is triggered only when you create a new to do Next create a route on the server that returns the array of to dos so you can fetch them via API request within the app Update the index js file on the server to send the to do list via an API route as below app get todos req res gt res json todoList Add the code snippet below to the Home js file fetch the to do list on page loaduseLayoutEffect gt function fetchTodos fetch http localhost todos then res gt res json then data gt setData data catch err gt console error err fetchTodos How to delete the to dosFrom the image below there is a delete icon beside each to do When you press the button the selected todo should be deleted on both the server and within the app Navigate to the Todo js file and import Socket io import socket from utils socket Create a function deleteTodo that accepts the to do id when you press the delete icon and sends it to the server import View Text StyleSheet from react native import React from react import AntDesign from expo vector icons import useNavigation from react navigation native import socket from utils socket const Todo item gt const navigation useNavigation deleteTodo function const deleteTodo id gt socket emit deleteTodo id return lt View style styles todoContainer gt lt View gt lt Text style styles todoTitle gt item title lt Text gt lt Text style styles subTitle onPress gt navigation navigate Comments title item title id item id gt View comments lt Text gt lt View gt lt View gt lt AntDesign name delete size color red onPress gt deleteTodo item id gt lt View gt lt View gt export default Todo Delete the to do via its ID socket on deleteTodo id gt let result todoList filter todo gt todo id id todoList result sends the new todo list to the app socket emit todos todoList Adding and displaying commentsWhen you click the View comments text it navigates to the Comments page where you can view all the comments related to the to do lt Text style styles subTitle onPress gt navigation navigate Comments title item title id item id gt View comments lt Text gt The navigation function accepts the title and id of the selected to do as parameters because we want the to do title at the top of the route and also fetch its comments from the server via its ID To achieve this update the useLayoutEffect hook within the Comments js file to change the route s title and send the ID to the server useLayoutEffect gt update the screen s title navigation setOptions title route params title sends the todo s id to the server socket emit retrieveComments route params id getUsername Listen to the retrieveComments event and return the to do s comments socket on retrieveComments id gt let result todoList filter todo gt todo id id socket emit displayComments result comments Add another useLayoutEffect hook within the Comments js file that updates the comments when it is retrieved from the server useLayoutEffect gt socket on displayComments data gt setCommentsList data socket To create new comments update the addComment function by sending the comment details to the server const addComment gt socket emit addComment comment todo id route params id user Create the event listener on the server and add the comment to the list of comments socket on addComment data gt Filters the todo list let result todoList filter todo gt todo id data todo id Adds the comment to the list of comments result comments unshift id generateID title data comment user data user Triggers this event to update the comments on the UI socket emit displayComments result comments Congratulations  You ve completed the project for this tutorial ConclusionSo far you ve learnt how to set up Socket io in a React Native and Node js application save data with Async Storage and communicate between a server and the Expo app via Socket io This project is a demo of what you can build using React Native and Socket io Feel free to improve the project by using an authentication library and a database that supports real time storage The source code for this application is available here Thank you for reading Help me out If you feel like this article helped you understand WebSockets better I would be super happy if you could give us a star And let me also know in the comments ️Thank you for reading 2022-11-23 16:30:44
海外TECH DEV Community A poor man's API https://dev.to/apisix/a-poor-mans-api-533m A poor man x s APICreating a full fledged API requires resources both time and money You need to think about the model the design the REST principles etc without writing a single line of code Most of the time you don t know whether it s worth it you d like to offer a Minimum Viable Product and iterate from there I want to show how you can achieve it without writing a single line of code The solutionThe main requirement of the solution is to use the PostgreSQL database It s a well established Open Source SQL database Instead of writing our REST API we use the PostgREST component PostgREST is a standalone web server that turns your PostgreSQL database directly into a RESTful API The structural constraints and permissions in the database determine the API endpoints and operations PostgRESTLet s apply it to a simple use case Here s a product table that I want to expose via a CRUD API Note that you can find the whole source code on GitHub to follow along PostgREST s Getting Started guide is pretty complete and works out of the box Yet I didn t find any ready made Docker image so I created my own FROM debian bookworm slim ARG POSTGREST VERSION v ARG POSTGREST FILE postgrest POSTGREST VERSION linux static x tar xz RUN mkdir postgrestWORKDIR postgrestADD POSTGREST VERSION POSTGREST FILE RUN apt get update amp amp apt get install y libpq dev xz utils amp amp tar xvf POSTGREST FILE amp amp rm POSTGREST FILE Start from the latest DebianParameterize the buildGet the archiveInstall dependencies and unarchiveThe Docker image contains a postgrest executable in the postgrest folder We can deploy the architecture via Docker Compose version services postgrest build postgrest volumes postgrest product conf etc product conf ro ports entrypoint postgrest postgrest command etc product conf depends on postgres postgres image postgres alpine environment POSTGRES PASSWORD root volumes postgres docker entrypoint initdb d ro Build the above DockerfileShare the configuration fileRun the postgrest executableWith the configuration fileInitialize the schema the permissions and the dataAt this point we can query the product table curl localhost productWe immediately get the results id name Stickers pack description A pack of rad stickers to display on your laptop or wherever you feel like Show your love for Apache APISIX price hero false id name Lapel pin description With this Powered by Apache APISIX lapel pin support your favorite API Gateway and let everybody know about it price hero false id name Tee Shirt description The classic geek product At a conference at home at work this tee shirt will be your best friend price hero true That was a quick win Improving the solutionThough the solution works it has a lot of room for improvement For example the database user cannot change the data but everybody can actually access it It might not be a big issue for product related data but what about medical data The PostgREST documentation is aware of it and explicitly advises using a reverse proxy PostgREST is a fast way to construct a RESTful API Its default behavior is great for scaffolding in development When it s time to go to production it works great too as long as you take precautions PostgREST is a small sharp tool that focuses on performing the API to database mapping We rely on a reverse proxy like Nginx for additional safeguards Hardening PostgRESTInstead of nginx we would benefit from a full fledged API Gateway enters Apache APISIX We shall add it to our Docker Compose version services apisix image apache apisix alpine volumes apisix config yml usr local apisix conf config yaml ro ports restart always depends on etcd postgrest etcd image bitnami etcd environment ETCD ENABLE V true ALLOW NONE AUTHENTICATION yes ETCD ADVERTISE CLIENT URLS ETCD LISTEN CLIENT URLS Use Apache APISIXAPISIX stores its configuration in etcdWe shall first configure Apache APISIX to proxy calls to postgrest curl http apisix apisix admin upstreams H X API KEY xyz X PUT d type roundrobin nodes postgrest curl http apisix apisix admin routes H X API KEY xyz X PUT d uri upstream id Should be run in one of the Docker nodes so use the Docker image s name Alternatively use localhost but be sure to expose the portsCreate a reusable upstreamPoint to the PostgREST nodeCreate a route to the created upstreamWe can now query the endpoint via APISIX curl localhost productIt returns the same result as above DDoS protectionWe haven t added anything but we re ready to start the work Let s first protect our API from DDoS attacks Apache APISIX is designed around a plugin architecture To protect from DDoS we shall use a plugin We can set plugins on a specific route when it s created or on every route in the latter case it s a global rule We want to protect every route by default so we shall use one curl http apisix apisix admin global rules H X API KEY xyz X PUT d plugins limit count count time window rejected code limit count limits the number of calls in a time windowLimit to call per seconds it s for demo purposesReturn Too Many Requests the default is Now if we execute too many requests Apache APISIX protects the upstream curl localhost product lt html gt lt head gt lt title gt Too Many Requests lt title gt lt head gt lt body gt lt center gt lt h gt Too Many Requests lt h gt lt center gt lt hr gt lt center gt openresty lt center gt lt body gt lt html gt Per route authorizationPostgREST also offers an Open API endpoint at the root We thus have two routes for the Open API spec and product for the products Suppose we want to disallow unauthorized people to access our data Regular users can access products while admin users can access both the Open API spec and products APISIX offers several authentication methods We will use the simplest one possible key auth It relies on the Consumer abstraction key auth requires a specific header the plugin does a reverse lookup on the value and finds the consumer whose key corresponds Here s how to create a consumer curl http apisix apisix admin consumers H X API KEY xyz X PUT d username admin plugins key auth key admin Create a new consumerConsumer s nameConsumer s key valueWe do the same with consumer user and key user Now we can create a dedicated route and configure it so that only requests from admin pass through curl http apisix apisix admin routes H X API KEY xyz X POST d uri upstream id plugins key auth consumer restriction whitelist admin Create a new routeUse the key auth and consumer restriction pluginsOnly admin authenticated requests can call the routeLet s try the following curl localhost It doesn t work as we are not authenticated via an API key header message Missing API key found in request curl H apikey user localhost It doesn t work as we are authenticated as user but the route is not authorized for user but for admin message The consumer name is forbidden curl H apikey admin localhost This time it returns the Open API spec as expected MonitoringA much undervalued feature of any software system is monitoring As soon as you deploy any component in production you must monitor its health Nowadays many services are available to monitor We will use Prometheus as it s Open Source battle proven and widespread To display the data we will rely on Grafana for the same reasons Let s add the components to the Docker Compose file version services prometheus image prom prometheus v volumes prometheus prometheus yml etc prometheus prometheus yml depends on apisix grafana image grafana grafana volumes grafana provisioning etc grafana provisioning grafana dashboards var lib grafana dashboards grafana config grafana ini etc grafana grafana ini ports depends on prometheusPrometheus imagePrometheus configuration to scrape Apache APISIX See the full file hereGrafana imageGrafana configuration Most of it comes from the configuration provided by APISIX Change the default port from to to avoid conflict with the PostgREST serviceOnce the monitoring infrastructure is in place we only need to instruct APISIX to provide the data in a format that Prometheus expects We can achieve it through configuration and a new global rule plugin attr prometheus export addr ip port Bind to any addressBind to port Prometheus metrics are available on http apisix apisix prometheus metrics on the Docker networkWe can create the global rule curl http apisix apisix admin global rules H X API KEY xyz X PUT d plugins prometheus Send a couple of queries and open the Grafana dashboard It should look similar to this ConclusionCreating a full fledged REST ful API is a huge investment One can quickly test a simple API by exposing one s database in a CRUD API via PostgREST However such an architecture is not fit for production usage To fix it you need to set a façade in front of PostgREST a reverse proxy or even better an API Gateway Apache APISIX offers a wide range of features from authorization to monitoring With it you can quickly validate your API requirements at a low cost The icing on the cake when you ve validated the requirements you can keep the existing façade and replace PostgREST with your custom developed API The source code is available on GitHub ajavageek poor man api To go further PostgRESTGetting started with Apache APISIXApache APISIX pluginsOriginally published at A Java Geek on November th 2022-11-23 16:25:00
海外TECH DEV Community Building a Cryptocurrency News Aggregator with Xata and Cloudinary https://dev.to/hackmamba/building-a-cryptocurrency-news-aggregator-using-xata-and-cloudinary-4818 Building a Cryptocurrency News Aggregator with Xata and CloudinaryCryptocurrencies are digital assets that are traded on exchanges or pair to pair they vary in value and are susceptible to market news People who trade these digital assets have to pay attention to news to be informed of market movements because positive news tends to drive up prices while negative news tends to drive down prices Navigating through numerous news sources is challenging for traders as some of these sources publish simultaneously or at various times of the day This challenge would be well solved by a news aggregator which would bridge the information gap by gathering market news and trends on one website that traders could access In this tutorial I will be discussing how to build a cryptocurrency news aggregator application with React while implementing tools like Cloudinary and Xata At the end of this tutorial your website should look like the below image ToolsI will be using the tools below for this project React js React is a front end JavaScript toolkit that is free and open source for creating user interfaces using UI components Cloudinary Cloudinary is a platform users deliver manage and deliver photos and videos for websites and apps Xata Xata is a serverless data platform with a spreadsheet like user interface and an infinitely scalable data API Xata also functions as a free text search engine PrerequisitesReaders should have the following before building A text editorNode installed on your local computerBasic knowledge of ReactjsAn understanding of how APIs workCloudinary account Getting StartedIn building our cryptocurrency news aggregator we will create a react app add features to it proceed to integrating Cloudinary to manage media upload and Xata for database management If you would like to get started with the code right away you can visit the GitHub repository here Create react appOn your computer create a project folder and open it up with your text editor In the project directory open up a terminal and run the below commandsnpx create react app news aggregatorcd news aggregatornpm startThe npm start command is used to start the react application on a development server in your web browser Open localhost in your browser and you should see the below imageNow your react application is ready it s time to setup Cloudinary Cloudinary SetupAs you already know Cloudinary is used for media management and we will be integrating it into the application to manage crypto images on the watch list Before configuring Cloudinary in your React app install the Cloudinary React js SDK in your project using the command belownpm i cloudinary url gen cloudinary reactIn the root of your project create a env file on the project folder and include your Cloudinary Cloud name You should find the cloudName by going to your Cloudinary dashboard Register the cloudname as follows in your env file cloudName demo Using Cloudinary component for global use in your App js file by adding the following import React from react import AdvancedImage from cloudinary react import Cloudinary from cloudinary url gen const App gt Create a Cloudinary instance and set your cloud name const cloud new Cloudinary cloud cloudName demo NB Replace demo with your cloudname from cloudinary Creating ComponentsBy now you should have an src folder in your project directory which was created from react Inside the folder create a component folder which will contain the following fileslatest jsnavigation jsnews jsoptions jswatchlist jsThese component files are structures for the application Latest jsCreate a latest js file and paste the below into itimport React from react export default function TheLastest return lt h className latest gt Latest News lt h gt Navigation jsCreate a navigation js file and paste the below into itimport React from react export default function Nav return lt div gt lt nav gt lt img src className logoimg gt lt div gt lt h className logoname gt LightCrypto lt h gt lt p className newstor gt News Aggregator lt p gt lt div gt lt h className search gt lt input type search placeholder search className searchtab gt lt h gt lt nav gt lt div gt News jsCreate a news js file and implement the below configuration as wellimport React from react export default function News props return lt div className newstab gt lt div gt lt p className Arrival gt props timestamp lt p gt lt div gt lt div className the news gt lt h className the heading gt lt a href link alt className sourceList gt props heading lt a gt lt h gt lt h className the preview gt source props source lt h gt lt div gt lt div gt Options jsCreate a options js file and paste the below into itimport React from react export default function Options return lt div className optionsArea gt lt div className optionButton gt lt h className home gt Home lt h gt lt h className calender gt lt a href className calender gt Calender lt a gt lt h gt lt h className aboutUs gt About Us lt h gt lt h gt lt a href kalio className blog gt Blog lt a gt lt h gt lt div gt lt div className socails gt lt h className socailhead gt Socials lt h gt lt div className twitter gt lt img src alt youtube className twitter img gt lt a href className twitterr gt Youtube lt a gt lt div gt lt div className twitter gt lt img src alt discord className twitter img gt lt a href className twitterr gt Discord lt a gt lt div gt lt div gt lt div gt Watchlist jsCreate a watchlist js file and add the following code snippet Configuring Mock APIFully fledged news aggregator applications would have API integration to fetch news from numerous news platforms or sources Since this is not an advanced or complex application at the moment we would be implementing a mock API which does the job as well This is how an actual API integration works but the only difference here is we are using a mock version The mock API here would be used to fetch news from various sources on its arrival and serve the news to users The API will be arranged in the following manner idarrivallinkheadingsourceReturn to the src folder and create an Api js file src Api js and paste the below snippets into it Feel free to play around with the API by adding your own informationOpen your App js file and replace the existing configuration with the codes snippet below We are importing the components we developed previously into App js and setting up the API to get it working Formatting the CSS stylingI will be using basic CSS to style the application paste the code snippet below After completing the above steps restart the application with the npm start command and your application be ready Xata SetupFor this application to manage the database of your application you need to create an account with Xata by clicking here It is completely free to create an account and should take about a minute On your Workspace create a database by clicking add a database which we would be querying from our application Run the below on your local terminalnpm install typescript types node types react DNext on your terminal install the Xata CLI globallynpm i g xata io cliTo login into your Xata run he Auth login on your terminalxata auth loginCreate an API key for Xata by clicking here To initialize Xata run the following commandxata initCopy and paste the codes below to your main src file to query the databaseimport FC from react import XataClient from util xata type Props Awaited lt ReturnType lt typeof getServerSideProps gt gt props At this point your application is complete and the necessary tools have been implemented as I earlier discussed ConclusionThis tutorial explains how to build a cryptocurrency news aggregator web application which I implement Cloudinary to manage media assets and Xata for database management ResourcesYou can visit Cloudinary s official documentation to understand how to get started To get started with Xata as well a good place to visit is their official documentation Xata has uploaded YouTube videos that walk you through the implementation of the tool in your projects and explain how Xata simplifies development 2022-11-23 16:04:39
Apple AppleInsider - Frontpage News Apple will not buy Disney, no matter how often it hears that it will https://appleinsider.com/articles/22/11/23/apple-will-not-buy-disney-no-matter-how-often-it-hears-that-it-will?utm_medium=rss Apple will not buy Disney no matter how often it hears that it willThe rumor that Apple will buy Disney is old enough to buy an overpriced beer at EPCOT And it s back again with so many talking heads strangely inspired by Disney re hiring Steve Jobs friend Bob Iger as CEO Are you ready to see an Apple logo on the front of Cinderella s Castle It is true that Disney has just re hired Bob Iger as its CEO three years after he stepped down And it s true that during those three years Iger said there had been a point where a merger between Disney and Apple could have gotten there Read more 2022-11-23 16:54:46
Apple AppleInsider - Frontpage News Satechi Black Friday 2022: Get up to 30% off on all products https://appleinsider.com/articles/22/11/23/satechi-black-friday-2022-get-up-to-30-off-on-all-products?utm_medium=rss Satechi Black Friday Get up to off on all productsSatechi is kicking off its Black Friday sale including accessories for Mac and other Apple products Satechi offers great deals for its productsThrough its website Satechi s Black Friday sale offers off products using the code BFCM or off for orders over with the code BFCM These codes can t be combined with other promotions Read more 2022-11-23 16:08:34
海外TECH Engadget Moog's holiday deals include a free new effects plugin https://www.engadget.com/moog-ios-mac-synth-app-sale-free-plugin-165725712.html?src=rss Moog x s holiday deals include a free new effects pluginMoog s holiday promos this year include a particularly nice perk a freebie The synthesizer pioneer has released a free new MF S Saturator add on shown above for all Moogerfooger Effects Plugins users As the name implies the plugin gives you more control over the input drive circuit to produce anything from analog saturation through to smooth compression It also replicates the noise generator circuit of the Minimoog Model D with control through a switchable filter type You ll need to own Moogerfooger Effects Plugins to get the MF S but the pack is on sale for normally as of this writing It works with common plugin formats like AudioUnits ProTools AAX and VST on Macs and Windows PCs And don t worry if you d rather buy full fledged creative software ーMoog has deals there too The company is once again offering percent off its iOS and Mac software including the Animoog Z wavetable synthesis app to unlock Minimoog Model D and Model also This isn t the first time Moog has run a sale on its apps this year but you might not mind if you re hoping to add classic synth sounds to your musical repertoire It may be worth investing in the Moogerfooger effects set even if the bonus isn t a draw We were impressed with the plugins when we tried them in October You can produce subtle results if you want but they re at their best when you venture to the stranger side ーeven a basic track can stand out with the right tweaks They re treats for musicians who revere analog synthesis but don t have thousands of dollars to spend on vintage hardware 2022-11-23 16:57:25
海外TECH Engadget The best monitors for 2022 https://www.engadget.com/how-to-buy-a-monitor-143000069.html?src=rss The best monitors for Computer monitors keep evolving rapidly with new technology like OLED Flex QD OLED and built in smart platforms just in the last year alone That s on top of big improvements in things like color accuracy image quality size and resolution The choice is nice but overwhelming as there are a lot of products in this market and a lot of features Buyers looking for computer monitors now have to consider things like HDR brightness color accuracy type of display technology input lag and more And then there are the usual considerations like size adjustability inputs and so on To help you with all that we ve researched the latest models for all kinds of markets whether you re a gamer business user or content creator Read on to find out which is the best computer monitor for you and especially your budget The basicsPanel typeThe cheapest monitors are still TN twisted nematic which are strictly for gaming or office use VA vertical alignment monitors are also relatively cheap while offering good brightness and a high contrast ratio However content creators will probably want an IPS in plane switching LCD display that delivers better color accuracy image quality and viewing angles If maximum brightness is important a quantum dot LCD display is the way to go ーthose are typically found in larger displays OLED monitors are now available and offer the best blacks and color reproduction but they lack the brightness of LED or quantum dot displays Plus they cost a lot The latest type of OLED monitor called QD OLED from Samsung just came out this year The most notable advantage is that it can get a lot brighter with monitors shown at CES hitting up to nits of peak brightness MiniLEDs are now widely used in high end displays They re similar to quantum dot tech but as the name suggests it uses smaller LED diodes that are just mm in diameter As such manufacturers can pack in up to three times more LEDs with more local dimming zones delivering deeper blacks and better contrast Screen size resolution and display formatIn this day and age screen size rules Where inch displays used to be more or less standard and can still be useful for basic computing and even inch displays have become popular for entertainment content creation and even gaming these days Nearly every monitor used to be but it s now possible to find and other more exotic display shapes On the gaming and entertainment side we re also seeing curved and ultrawide monitors with aspect ratios like If you do decide to buy an ultrawide display however keep in mind that a inch model is the same height as a inch monitor so you might end up with a smaller display than you expected As a rule of thumb add percent to the size of a monitor to get the vertical height you d expect from a model with a aspect ratio A K monitor is nearly a must for content creators and some folks are even going for K or all the way up to K Keep in mind though that you ll need a pretty powerful computer to drive all those pixels And K resolution should be paired with a screen size of inches and up or you won t notice much difference between p At the same time I wouldn t get a model larger than inches unless it s K as you ll start to see pixelation if you re working up close to the display One new category to consider is portable monitors designed to be carried and used with laptops Those typically come in p resolutions and sizes from inches They usually have a lightweight kickstand type support that folds up to keep things compact SamsungHDRHDR is the buzzy monitor feature to have these days as it adds vibrancy to entertainment and gaming but be careful before jumping in Some monitors that claim HDR on the marketing materials don t even conform to a base standard To be sure that a display at least meets minimum HDR specs you ll want to choose one with a DisplayHDR rating with each tier representing maximum brightness in nits However the lowest DisplayHDR and tiers may disappoint you with a lack of brightness washed out blacks and mediocre color reproduction If you can afford it choose a model with DisplayHDR or True Black True Black and True Black The True Black settings are designed primarily for OLED models with maximum black levels at nits Where televisions typically offer HDR and Dolby Vision or HDR most PC monitors only support the HDR standard other than a few very expensive models That doesn t matter much for content creation or gaming but HDR streaming on Netflix Amazon Prime Video and other services won t look quite as punchy In addition most models supporting HDR and up are gaming rather than content creation monitors with a few exceptions nbsp Refresh rateRefresh rate is a key feature particularly on gaming monitors A bare minimum nowadays is Hz and Hz refresh rates and up are much easier on the eyes However most K displays top out at Hz with some rare exceptions and the HDMI spec only supports K at Hz so you d need at least DisplayPort K at Hz or HDMI The latter is now available on a number of monitors particularly gaming displays However it s only supported on the latest NVIDIA RTX and series AMD RX series GPUs InputsThere are essentially three types of modern display inputs Thunderbolt DisplayPort and HDMI Most monitors built for PCs come with the latter two while a select few typically built for Macs will use Thunderbolt To add to the confusion USB C ports may be Thunderbolt and by extension DisplayPort compatible so you may need a USB C to Thunderbolt or DisplayPort cable adapter depending on your display Color bit depthSerious content creators should consider a more costly bit monitor that can display billions of colors If budget is an issue you can go for an bit panel that can fake billions of colors via dithering often spec d as “ bit FRC For entertainment or business purposes a regular bit monitor that can display millions of colors will be fine Color gamutThe other aspect of color is the gamut That expresses the range of colors that can be reproduced and not just the number of colors Most good monitors these days can cover the sRGB and Rec gamuts designed for photos and video respectively For more demanding work though you ll want one that can reproduce more demanding modern gamuts like AdobeRGB DCI P and Rec gamuts which encompass a wider range of colors The latter two are often used for film projection and HDR respectively Console gamingBoth the Xbox Series X and Sony s PS can handle K Hz HDR gaming so if you re into resolution over pure speed you ll want a monitor that can keep up K resolution HDR and at least Hz is the minimum starting point but fortunately there are inch displays with those specs starting at well under Pricing and parts shortagesThough the pandemic has eased monitor supply is still a bit tighter than pre pandemic levels due to supply and demand issues To that end you may have trouble finding monitors at Amazon B amp H or elsewhere for the suggested retail price For our guide below we re basing our picks on the MSRP as long as the street price doesn t exceed that by more than Engadget picksBest monitors under Samsung TFSamsungThe monitor with the best balance of size refresh rate and color accuracy is Samsung s inch p TF It s good for business or light gaming and content work thanks to the IPS panel and Hz refresh rate Plus it s fairly attractive and modern looking There are some things you don t get at that price of course it can only tilt and has an HDMI connection Buy Samsung TF at Amazon LG GLFIf you re fine with a smaller display and are more into gaming another solid option is LG s inch GLF It offers a high Hz refresh rate with AMD FreeSync support a ms response time and low input lag You also get HDMI and DisplayPort inputs but like the TF there s no height adjustment Buy LG GLF at Amazon Best monitors under HP U K HDR MonitorHPThe inch HP U K HDR monitor is a great all around choice especially for content creators The Hz IPS panel and factory calibration delivers excellent color accuracy and it s a nice size for creative or business work It comes with DisplayPort HDMI and three USB ports along with a USB C port with W of charging for a laptop or tablet And it s easy to set just right thanks to height swivel and pivot adjustment Buy HP U K HDR monitor at Amazon Gigabyte GQCIf gaming is more your thing the Gigabyte GQC is a top pick The inch p curved monitor has an ideal size and resolution for gaming and it has a quick Hz refresh rate and ms response time You can connect via HDMI or DisplayPort connections and get HDR support albeit without DisplayHDR certification Buy Gigabyte GQC at Amazon Best monitor under BenQ inch QHD HDR MonitorBenQThe BenQ inch K QHD HDR model is ideal for creative work particularly photo editing and graphic design While resolution is limited to p it covers percent of the sRGB color gamut with a “Delta E accuracy value of less than for consistent color performance You also get height pivot and swivel adjustment a full degrees with HDMI DisplayPort and USB C daisy chaining and W power delivery Buy BenQ K QHD HDR monitor at Amazon Best monitors under LG UN WLGThe inch LG UN W is a great K monitor for entertainment creative chores and gaming The inch Hz IPS panel covers an excellent percent of the DCI P gamut with bit color but also supports AMD FreeSync for gaming It also supports HDR albeit with just nits of maximum brightness It has HDMI and DisplayPort ports tilt and height adjustments and even built in speakers Buy LG UN W at Amazon ASUS ROG Swift PGQNSometimes speed rules over size and resolution and the inch p ASUS ROG Swift PGQN is fast It maxes out at a Hz refresh rate with NVIDIA G Sync support and ms GtG response time At the same time you get billion colors with HDR support up to nits brightness so you can see your enemies quickly and clearly Other niceties include a fully adjustable stand ASUS s GamePlus Hotkey Enhancements and a large heatsink Buy ASUS ROG Swift PGQN at Amazon Gigabyte MUGigabyte s MU inch Hz K gaming monitor sure does a lot It has an IPS panel with a ms MPRT response time percent DCI P coverage DisplayHDR certification HDMI ports and FreeSync Premium Pro support It comes in a little bit more expensive than but we ve often seen it on sale for Buy Gigabyte MU at Amazon Best monitors under ViewSonic ColorPro VP KViewSonicIn this price range you can have resolution color accuracy or brightness but not all three The one with the best balance is ViewSonic s ColorPro VP inch K HDR Monitor The true bit IPS panel covers percent of the DCI P color palette with an excellent Delta lt accuracy figure and is certified for soft proofing by the demanding Fogra print industry At the same time it offers HDR support albeit with a limited nits of output It even includes a “ColorPro wheel control compatible with Adobe or Capture One apps Buy ViewSonic ColorPro at Amazon Dell GQThe best K gaming monitor under is Dell s GQ K inch HDR Hz monitor because of the speed brightness and compatibility It has an IPS panel with a Hz refresh rate ms GtG response time percent DCI P coverage and DisplayHDR certification Plus it comes with a pair of HDMI ports and is both FreeSync and G Sync compatible Buy Dell GQ at Amazon Dell PQEDell s PQE K USB C Hub monitor is productivity oriented thanks to the wired Ethernet connectivity and USB C ports that offer up to W of power delivery for laptops It s a K IPS panel with a degree viewing angle and nits of brightness and support for a billion colors bit FRC It offers height pivot swivel and tilt adjustment a VESA mounting interface and DisplayPort HDMI inputs Buy Dell PQE at Amazon Best monitor for Mac usersApple Studio DisplayDevindra Hardawar EngadgetIn general monitor compatibility issues with MacBooks and Macs are a thing of the past though you can still experience issues with things like refresh rates particularly on M Macs If you d prefer to stay within the Apple family the most cost effective option is still the inch Apple Studio Display It supports K resolution x with up to nits of brightness so it can handle creative chores with ease It even includes a megapixel UltraWide camera that keeps you in frame via Center Stage along with a three mic array Buy Apple Studio Display at Amazon LG Ultrafine K and K LG The best third party option is LG s UltraFine display also sold on Apple s Store With a inch K panel you not only get very high resolution but also nits of brightness albeit without HDR capability It s color accurate out of the box making it great for video and photo editing work on a Mac or MacBook Finally it supports Thunderbolt with daisy chaining and power delivery all of which is very useful for Mac users who may want multiple displays Buy LG Ultrafine K at Apple Buy LG Ultrafine K at Apple Best Ultrawide monitorLG GPG BLGUltrawide monitors are a great option for some types of content creation games particularly driving and flight sims and productivity work The best model this year is LG s GPG B a inch x curved monitor The curved IPS panel supports HDR with nits of brightness and maximum via overclocking Hz refresh rate It s also G Sync and FreeSync compatible the latter over DisplayPort only Buy LG GPG B at B amp H Photo Best portable monitorLePow CSLePowFor the best balance of performance and price LePow s inch p CS is a solid option It offers decent brightness nits solid contrast and a very respectable percent sRGB gamut coverage You get a generous selection of ports one mini DisplayPort one mini HDMI port and two USB C ports along with a headphone jack The metal stand is solid and practical and it even has built in speakers of decent quality Buy LePow CS at Amazon Best luxury monitorASUS ProArt PAUCG K ASUS ASUS still holds the prize for best luxury monitor but it discontinued the previous mini LED ProArt PAUCX monitor and replaced it with the PAUCG K display It uses the same mini LED tech but ups the ante with nits of brightness via backlight zones an HDMI port K Hz resolution bit percent DCI P coverage and an impressive percent Rec coverage Oh and it s one of the few monitors out there that supports Dolby Vision along with HDR and HLG You re probably doing it wrong if you re using a K monitor for gaming However it does support AMD FreeSync good for gaming creation and has a millisecond response time very respectable for a display essentially designed for professional colorists And to that end color accuracy is calibrated to Delta E lt and it s a true bit panel delivering billions of colors To verify that it even comes with an X rite i Display Pro color calibrator normally sold separately for around On top of this model ASUS now makes several slightly less bright and less expensive variants namely the PAUCX PK plus P and K variants with slightly different features offering nits of brightness and a Hz not Hz refresh rate Specs are nearly identical otherwise Buy ASUS ProArt PAUCG K at Amazon 2022-11-23 16:15:04
海外TECH Engadget The Fitbit Inspire 3 is down to $70 in an Amazon Black Friday deal https://www.engadget.com/amazon-black-friday-fitbit-sale-143045491.html?src=rss The Fitbit Inspire is down to in an Amazon Black Friday dealIf you re looking for something to help you get in shape or assist someone else on their health journey a fitness tracker can be a worthwhile purchase With Black Friday around the corner Amazon has discounted a selection of Fitbit s most popular devices To start the entry level Inspire is currently percent off putting it just under That s a new all time low for the wearable What s more the Inspire is a great option if you re looking for a no thrills fitness tracker that nails the essentials It includes Fitbit s handy automatic workout detection feature and the usual activity tracking capabilities Best of all you can expect to get about days of battery life from the Inspire Buy Inspire at Amazon For those looking for a more robust offering the Charge is also on sale After a percent discount one of the best fitness trackers you can buy is down from Think of the Charge as a more capable Inspire It features a full color AMOLED display and built in GPS support for more accurate tracking when running and cycling Fitbit also integrated EDA sensors into the Charge giving the wearable the ability to measure your stress levels Engadget awarded the Charge a score of praising the wearable for its comfortable design and multi day battery life Buy Charge at Amazon Lastly the sale includes Fitbit s smartwatches The more affordable Versa is after an price cut while the top tier Sense is down from Both offer continuous heart rate monitoring paired with activity stress and sleep tracking They also include Google Maps integration for turn by turn navigation on your wrist and support for Google Wallet By paying for the more expensive Sense you get a device that can also take skin temperature readings and track your stress levels Buy Versa at Amazon Buy Sense at Amazon Get the latest Black Friday and Cyber Monday offers by following EngadgetDeals on Twitter and subscribing to the Engadget Deals newsletter 2022-11-23 16:00:45
海外科学 BBC News - Science & Environment Disabled man joins European Space Agency's astronaut programme https://www.bbc.co.uk/news/science-environment-63730022?at_medium=RSS&at_campaign=KARANGA programme 2022-11-23 16:10:57
金融 ◇◇ 保険デイリーニュース ◇◇(損保担当者必携!) 保険デイリーニュース(11/24) http://www.yanaharu.com/ins/?p=5084 太陽光パネル 2022-11-23 16:09:00
海外ニュース Japan Times latest articles Japan stuns Germany with late strikes in World Cup opener https://www.japantimes.co.jp/sports/2022/11/24/soccer/world-cup/japan-beats-germany-world-cup/ Japan stuns Germany with late strikes in World Cup openerAs the game wore on Japan s raids into the German half became more frequent culminating in Ritsu Doan s equalizer and a brilliant finish from Takuma 2022-11-24 01:27:38
ニュース BBC News - Home Independence referendum: Scottish government loses indyref2 court case https://www.bbc.co.uk/news/uk-scotland-scotland-politics-63727562?at_medium=RSS&at_campaign=KARANGA consent 2022-11-23 16:41:56
ニュース BBC News - Home US Walmart shooting: Employee kills six at Virginia supermarket https://www.bbc.co.uk/news/world-us-canada-63724716?at_medium=RSS&at_campaign=KARANGA gunman 2022-11-23 16:13:38
ニュース BBC News - Home Why James Cleverly wants new relationship with Africa https://www.bbc.co.uk/news/uk-63731915?at_medium=RSS&at_campaign=KARANGA africathe 2022-11-23 16:21:30
ニュース BBC News - Home Jofra Archer returns for England Lions against England https://www.bbc.co.uk/sport/cricket/63730255?at_medium=RSS&at_campaign=KARANGA england 2022-11-23 16:18:00
ニュース BBC News - Home World Cup 2022: OneLove armband - Germany players cover mouths amid row with Fifa https://www.bbc.co.uk/sport/football/63729563?at_medium=RSS&at_campaign=KARANGA World Cup OneLove armband Germany players cover mouths amid row with FifaGermany players cover their mouths for the team photograph before their World Cup opener against Japan amid the row with Fifa over the OneLove armband 2022-11-23 16:18:01
ビジネス ダイヤモンド・オンライン - 新着記事 マードック氏FOX・ニューズ再統合、大株主が反対 - WSJ発 https://diamond.jp/articles/-/313362 統合 2022-11-24 01:19: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件)