投稿時間:2022-02-08 01:34:47 RSSフィード2022-02-08 01:00 分まとめ(35件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… Microsoft、「Surface Pro 7+」の一般向け通常モデルを発売 − タイプカバー同梱の数量限定モデルもまだ在庫あり https://taisy0.com/2022/02/08/151741.html microsoft 2022-02-07 15:16:42
IT 気になる、記になる… Microsoft、「Surface Go 3」のLTEモデルを発売 https://taisy0.com/2022/02/08/151739.html qualc 2022-02-07 15:11:30
python Pythonタグが付けられた新着投稿 - Qiita 【競プロ】超大規模マラソン問題に取り組む際の3つのポイント〜日立北大ラボ×北大コンテスト2021〜 https://qiita.com/toast-uz/items/29a3594a1b9a65031c79 HCpictwittercomzAZpCNWnqvーtoastuzToastUzJanuaryログをもとに見える化する事前の見える化で実装方針を立てることは重要ですが、実行時の適切なログ出力により、何が起こっているのか、想定通りかどうか、を見える化することも重要です。 2022-02-08 00:11:49
python Pythonタグが付けられた新着投稿 - Qiita mayaの環境を構築していく 3日目 https://qiita.com/9boz/items/83fb4cca238d2016e8e6 tool開発の為の準備tool開発主にpythonはついついScriptEditorでやりがちなのですが、予期せぬmayaの強制終了うっかり複数起動して、終了する順番間違えるなどによって編集内容が消えてしまう事が割と多く、その度にやる気が削がれていくので、なるべく外部ファイルで編集してmayaで実行するという風にしています。 2022-02-08 00:01:54
AWS AWSタグが付けられた新着投稿 - Qiita ネットワーク入門 VPCとセキュリティ https://qiita.com/aki_7_engineer/items/9b886cdeb2c12231996c このIGWを設定しないとVPCは外部のネットワークと通信が出来ない形となります。 2022-02-08 00:24:35
AWS AWSタグが付けられた新着投稿 - Qiita PaloaltoVM on AWS(10.0.4) 脆弱性保護プロファイル/セキュリティポリシー https://qiita.com/nw-engineer/items/21e2c12f3ee55fcf38d8 また、Paloaltoに後から追加したDMZとInternal用NICのセキュリティグループは下記の通り設定しています。 2022-02-08 00:05:10
Git Gitタグが付けられた新着投稿 - Qiita マージ済みのブランチを対話式で削除するgitサブコマンド(dansyari)を作ってみた https://qiita.com/kure/items/8a5b426bf050d248da7f 2022-02-08 00:42:39
海外TECH Ars Technica Russia has given its space chief a series of huge raises https://arstechnica.com/?p=1832157 rogozin 2022-02-07 15:34:43
海外TECH MakeUseOf How to Fix the “File or Directory is Corrupted and Unreadable” Error on a Windows 10 Computer https://www.makeuseof.com/windows-10-fix-the-file-or-directory-is-corrupted-and-unreadable-error/ How to Fix the “File or Directory is Corrupted and Unreadable Error on a Windows ComputerThe dreaded “File or Directory is Corrupted and Unreadable error can stop you from accessing your important files but you can fix it Here s how 2022-02-07 15:45:12
海外TECH MakeUseOf Asustor Drivestor 2 Review: An Excellent Entry-Level NAS for Your Data https://www.makeuseof.com/asustor-drivestor-2-as1102t-review-2-bay-nas/ Asustor Drivestor Review An Excellent Entry Level NAS for Your DataThe Drivestor balance of power and accessibility allows you to scale up without much expense attached but there are some performance issues 2022-02-07 15:05:23
海外TECH MakeUseOf A Beginner's Guide: What Are Normals in 3D Modeling? https://www.makeuseof.com/normals-in-3d-modeling-explained/ modeling 2022-02-07 15:00:50
海外TECH DEV Community Auto-generate your NodeJs app + Admin-UI 😳 https://dev.to/itsrakesh/auto-generate-your-nodejs-app-admin-ui-4880 Auto generate your NodeJs app Admin UI Think of building a RESTApi What do you actually do Set up a server with Expressjs configure a database write models controllers and some crud operations etc Don t you think you are wasting time writing some boilerplate code And what about Admin UI Is there any logic involved in building an Admin UI Now what if there is a UI tool that generates a Nodejs application with a database along with all those models CRUD operations and a great Admin UI Let s get startedAnd that tool is Amplication Amplication Amplication is an open source low code tool Means a completely free to use tool Interestingly amplication can be used by front end developers also using its UI you can just make a few clicks and boom your typescript NodeJs application along with React admin UI is ready Let s see what amplication provides React Admin UI generated with react admin NodeJs app with Postgres database authenticationSync with GitHub or download code Sandbox environment to develop and test your app without setting it up locally Docker setup to deploy to the cloud And many more Let s start using amplication by creating a project PrerequisitesGitHub account Step Get AmplicationGo to amplication com Signup with GitHub Step Create a new projectClick New app You have three amazing options Generate the app schema according to your data by uploading an excel or CSV file Start from scratchStart from a templateAs we are learning how to use select Start from scratch Step Customize appGo to app Dashboard App Settings Change app name description colorDB Settings Leave them as it is because they can be used for dev purposes only as they are exposed in the generated app Auth Settings Select which authentication method you want to use Sync with GitHub Turn this on if you want to automatically push code to your repo Step Create entitiesGo to Entities The app automatically creates an entity called User You can t remove this because a user is needed to manage the app like permissions admin UI etc Start creating your own entities by clicking Add entity Step Test the appCommit changes Now you have two options Test your app in a cloud environment with a sandbox that is free and everything will be ready for you No need to install anything or no need to configure the database Download code as zip or clone from GitHub repo and set up everything locally Step DeploySandbox is only for development purposes with limited resources so you can t use it for production As amplication provides docker support you can build an image and deploy it to any cloud service That s it Your NodeJs application is ready within minutes Super simple right ️Tool of the week ️Website Mockup GeneratorIf you find this useful Follow for more And don t forget to give a star to this great tool github 2022-02-07 15:31:03
海外TECH DEV Community Building microservices with Node.js https://dev.to/logrocket/building-microservices-with-nodejs-1gjf Building microservices with Node jsWritten by Frank Joseph️Early on in the practice of software development best practice involved tightly coupling all of the software s components in what is known as a monolithic application However monolithic applications require extra effort to respond to changes in the system If any particular component develops a fault the entire system is affected Nowadays we can solve the problem using microservices which allow us to build our software product components separately If there is a fault in one component it won t affect the functioning of the entire software product In this article we ll review the concept of microservices learn how to implement a microservice with Node js and explore how microservices are changing the practice of software development Let s get started PrerequisitesTo follow along with this article you ll need the following Node js installed on your computer Basic knowledge of JavaScript and Node js Microservices vs monolithic applications Understanding monolithic applicationsA monolithic application is a single tiered application in which all components are composed as one unit Imagine you re building a library management system and all of the components like books users and their respective services and databases are fused together as one unit If there is a fault in any one component the entire system will need to be brought down to correct the error For this reason monolithic applications are neither flexible nor easily scalable You cannot build features concurrently or achieve continuous deployment However while monolithic applications are not cost effective to manage they are cost effective to build Developers recognized the need to create a system in which one faulty component wouldn t affect the entire software system Understanding microservicesMicroservices became necessary due to the shortcomings of the monolithic pattern of software development In a microservice each software application feature is separated from the other in most cases with their respective servers and databases Applications built with this kind of architecture are loosely coupled also referred to as distributed applications Imagine we re building an ecommerce store We ll need models for a payment feature cart customers admin and order Each of these features will have its own separate servers and databases Our ecommerce microservices will communicate with each other using the REST API framework With our store features developed independently from each other we can easily identify which feature to debug if our system develops a fault and avoid having to bring down the entire application In contrast to monolithic applications applications developed using microservices are scalable You can use any programming language to develop a microservice in fact you can use different languages to develop different features in a microservice application Overall microservices offer a better developer experience A new developer joining the team won t have to understand the entire code base but rather only the features they are working on increasing productivity Lastly unit testing is encouraged in microservices A unit test can be written to test a particular functionality However it s important to keep in mind that building microservices requires expertise because integration and end to end testing can be very challenging Additionally microservices can become very bulky causing high maintenance costs Finally it s not always easy to migrate software already developed using monolithic architecture to a microservice and it can be challenging for applications to locate each other within a complex network Using Node js for our microserviceYou can use any programming language like Java C or Python to develop a microservice but Node js is an outstanding choice for a few reasons For one Node js uses an event driven architecture and enables efficient real time application development Node js single threading and asynchronous capabilities enable a non blocking mechanism Developers using Node js to build microservices have an uninterrupted flow with Node js code being fast highly scalable and easy to maintain Build a simple microservice application with Node jsTo illustrate how to develop microservices with Node js we ll use the OpenWeather API service First create a free account Create a new folder on your computer preferably on your desktop for easy access and name it weathermicroservice Open weathermicroservice in your code editor and confirm you have Node js installed on your computer by running the command below node vIf Node js is not installed go ahead and download it In weathermicroservice run the command below to initialize the package json Run npm init or npm init yWith npm init you customize the setting or fields to create the package json file On the other hand npm init y uses the default setting or fields to create the package json file Now let s install our required dependencies with the command below run npm install Express nodemon requestNow your package json file should look similar to the screenshot below Directly inside the main folder create a file called server js Inside write the following code require expressconst express require express create an app using express constructorconst weatherApp express declare your portconst port require routes from the routes js fileconst routes require api routes set the route for our application by passing the app to the routes objectroutes weatherApp call the listen method on the appweatherApp listen port gt console log Server is running is port port server js is the main file for our microservice app as indicated in our package json file Next we ll create another folder inside the weathermicroservice folder named api source Inside the api source folder create two files named controller js and routes js Inside the routes js file write the following code create a controller objectconst controller require controller declare a function and export it to be used in another filemodule exports function weatherApp weatherApp route about get controller about weatherApp route weather get controller getWeather The function takes weatherApp as a parameter and defines the routes for our application weatherApp route about listens for a GET request on the about endpoint This request is then handled by the about function in the controller js file The weatherApp route weather listens for a GET request on the weather endpoint The getWeather function handles the request Now that we re done with the route module it s time to create the controllers to handle the GET request from the route module Inside your controller js file write the following code create a variable referencing to the package json filelet properties require package json create a variable and require the weather file inside the service folderlet weather require service weather create an objectlet controllers about req res gt create an object and access the values in the package json file let aboutInfo name properties name description properties description author properties author return the object in json format res json aboutInfo create a function getWeather function req res call the find method on the weather module weather find req res function err weath if err res send err res json weath export the controller module so it can be use in another file within the applicationmodule exports controllers Inside the main folder create another folder called service Inside the service folder create a file called weather js where we ll connect to the external API Inside the weather js file write the following code declare the request package we added to the package jsonlet request require request assign your api key and api url to a variableconst apiKey your own api key const apiUrl your api url as provided on your dashboard let weather find req res next gt request apiUrl apiKey weather json req params weather function error response body check that there is no error if error amp amp response statusCode response JSON parse body res send response else console log response statusCode response body res send An error occurred it could be from your api export the weather module module exports weather In the code above we use the find function which accepts three parameters request response and next objects The request object in line accepts the URL of the service and defines a callback function to handle the response ConclusionIn this tutorial we learned about the important differences between microservices and monolithic applications We learned why Node js is a great choice for building microservices and we ran through an example using the OpenWeather API Using a microservice offers flexibility and performance benefits that can t be achieved with a monolithic application The event driven architecture of Node js makes it a perfect choice for microservices being fast highly scalable and easy to maintain s only ️Monitor failed and slow network requests in productionDeploying a Node based web app or website is the easy part Making sure your Node instance continues to serve resources to your app is where things get tougher If you re interested in ensuring requests to the backend or third party services are successful try LogRocket LogRocket is like a DVR for web and mobile apps recording literally everything that happens while a user interacts with your app Instead of guessing why problems happen you can aggregate and report on problematic network requests to quickly understand the root cause LogRocket instruments your app to record baseline performance timings such as page load time time to first byte slow network requests and also logs Redux NgRx and Vuex actions state Start monitoring for free 2022-02-07 15:21:26
海外TECH DEV Community Mirage of memory, part 2: PSS https://dev.to/yugabyte/mirage-of-memory-part-2-pss-1n8o Mirage of memory part PSSThis is a blog series about linux kernel memory management in general and how it relates to postgres specifically This part is about the Linux memory statistic PSS proportional set size The first part of this series was about RSS resident set size That is a fundamentally important statistic and is the statistic that the OOM killer out of memory killer uses However the resident set size is not the absolute truth about memory used at least on linux The reason for saying that is because linux provides COW copy on write access to the memory pages of the parent process for its children A threaded process inherently has access to the memory areas in the process for all threads This means that for linux applications that fork or clone processes it gives these applications the ability to share memory pages to which it can provide read only access One such application is PostgreSQL vagrant centos pg ps ef grep pgrep f postmaster postgres usr pgsql bin postmaster D var lib pgsql data postgres postgres loggerpostgres postgres checkpointerpostgres postgres background writerpostgres postgres walwriterpostgres postgres autovacuum launcherpostgres postgres stats collectorpostgres postgres logical replication launcherThe postmaster process has PID as parent and all the background processes have the postmaster as parent But that is all nice do I have any proof this is happening The proof for this can be found in the proc meta filesystem smaps file which shows the memory allocations as well as the PSS figure This is how that looks like vagrant centos pg sudo grep A proc smaps af r xp fd usr pgsql bin postgresSize kBKernelPageSize kBMMUPageSize kBRss kBPss kBShared Clean kBThis is the text code segment for the postgres executable for the postmaster process which has a virtual set size of kB Based on the demand paging mechanism I described in the previous post it only paged in kB And because it forked several processes which also use this code segment proportionally the use is kB This is where things get a bit blurry A process either uses a memory or not in other words it uses the full kB of a page or not The PSS in the above example is kB That means so it suggests a fractional page A linux process does not use fractional pages of memory The kernel simply keeps a counter per memory page for the amount of processes that use the page alias have the page paged in to their process space When the PSS figure is requested the size of the page is divided by the number of processes it is shared with which provides the proportional size of memory instead of the real size This means for actual space usage calculations you must calculate all the PSS sizes of all the processes involved for a memory segment at that moment in time to get a meaningful figure to calculate the total memory used based on PSS If you wonder why I am mentioning memory usage calculations this is something that I have seen being mentioned and tried forever since I work in IT Every once in a while someone wants to calculate the accurate actual amount of memory in use for an application With PostgreSQL the most logical biggest taker of memory will be the shared memory segment that it is using as the buffer cache The buffer cache is explicitly defined as shared without the somewhat hidden COW page sharing Also mind that if the buffer cache is sized to contain a significant percentage of memory the page sharing for the executable and library memory segments might be marginal However the same proportional sharing applies to the shared memory segment It is a lot of work to inspect all the smaps files in proc Luckily there is a utility that can give the PSS figures without having to go through all the smaps files That utility is smem The smem utility is available in EPEL extra packages for enterprise linux added via yum install epel release on most EL based linuxes For my lab Alma virtual machine with postgres this is how that looks like vagrant alma sudo smem U postgres tk PID User Command Swap USS PSS RSS postgres postgres logger K K M postgres postgres stats collector K K M postgres postgres background writer K M M postgres postgres checkpointer K M M postgres postgres logical replicati K M M postgres postgres autovacuum launch K M M postgres postgres walwriter K M M postgres usr pgsql bin postmaste M M M M M MThis utility introduces another abbreviation USS which means unique set size It s the opposite of PSS and counts memory that is uniquely allocated to a process Any memory page changed by a process is counted as USS because that makes it unique for that process The above smem output quite well shows the double counting that can take place the actual allocation on this system for the postgres executables is M USS M PSS M whilst the count of all RSS memory is M I hope my explanation made you realize that by this clever page sharing for readonly pages the RSS size can double count memory 2022-02-07 15:12:31
海外TECH DEV Community GitHub Actions testing https://dev.to/cardinalby/github-actions-testing-h3h actions 2022-02-07 15:09:35
海外TECH DEV Community Building a Modal Using ReactJS and TailwindCSS https://dev.to/ayushdev_24/building-a-modal-using-reactjs-and-tailwindcss-38d0 Building a Modal Using ReactJS and TailwindCSSHello people as developers we frequently come across tasks to create forms The general first thought that comes to our mind is to create a button or link that takes us to the form when clicked But this way is too old school and makes an extra effort for the user to navigate Curious to know another method Yes that is what Modals are Instead of routing to a new page or tab the form appears right on the same page Still not clear let s understand it with a snapshot of the final page we will be building today Modal In Action When the button is clicked we can observe the form comes right there instead of going to a new page Now let s get into building this simple modal I hope you ignore the CSS Pre Requirements Basic knowledge of HTML CSS and ReactJS specifically useState Experience in using Tailwind CSS in ReactJS projects Setup Setting Up ReactJS projectCreate a project directory Let s say modal Open the terminal Navigate to the modal directory and run the below command npx create react app Delete every file in src folder except for App js index css index js Clear out App jsBonus If you wish to avoid the above hassle clone my ReactJS project boiler and do npm i ayushhagarwal ReactJS Project Boiler ayushhagarwal ReactJS Project Boiler Setting Up Tailwind CSSI have used Tailwind CSS official docs to write the steps on installing it into your ReactJS project So you can refer directly to the site too Here s how you can install Tailwind CSS In the root directory of your project folder run the below commands npm install D tailwinds postcss autoprefixernpx tailwindcss initAdd the paths to all of your template files in your tailwind config js file This is what the file looks like after adding them module exports content src js jsx ts tsx theme extend plugins Add the tailwind directives for each of Tailwind s layers into the src index css file tailwind base tailwind components tailwind utilities That s it Now the project is ready with both TailwindCSS and ReactJs We can start coding our Modal Bonus Instead of spending time on setting up ReactJS and TailwindCSS you can clone the boiler repo from my Github It is ready with all the setups and folder structure Just clone install and code ayushhagarwal ReactJS Tailwind Boiler This project is a boiler to start ReactJS and Tailwind project Creating Modal ComponentNow comes the integral part of this blog We will be creating a modal component and using it directly on App js to render our modal Create a file Modal js in src Components directory Next the code to get the Modal functionality working is import React useState from react const Modal gt const showModal setShowModal useState false return lt gt lt button className bg blue text black active bg blue font bold px py rounded shadow hover shadow lg outline none focus outline none mr mb type button onClick gt setShowModal true gt Fill Details lt button gt showModal lt gt lt div className flex justify center items center overflow x hidden overflow y auto fixed inset z outline none focus outline none gt lt div className relative w auto my mx auto max w xl gt lt div className border rounded lg shadow lg relative flex flex col w full bg white outline none focus outline none gt lt div className flex items start justify between p border b border solid border gray rounded t gt lt h className text xl font semibold gt General Info lt h gt lt button className bg transparent border text black float right onClick gt setShowModal false gt lt span className text black opacity h w text xl block bg gray py rounded full gt x lt span gt lt button gt lt div gt lt div className relative p flex auto gt lt form className bg gray shadow md rounded px pt pb w full gt lt label className block text black text sm font bold mb gt First Name lt label gt lt input className shadow appearance none border rounded w full py px text black gt lt label className block text black text sm font bold mb gt Last Name lt label gt lt input className shadow appearance none border rounded w full py px text black gt lt label className block text black text sm font bold mb gt Address lt label gt lt input className shadow appearance none border rounded w full py px text black gt lt label className block text black text sm font bold mb gt City lt label gt lt input className shadow appearance none border rounded w full py px text black gt lt form gt lt div gt lt div className flex items center justify end p border t border solid border blueGray rounded b gt lt button className text red background transparent font bold uppercase px py text sm outline none focus outline none mr mb type button onClick gt setShowModal false gt Close lt button gt lt button className text white bg yellow active bg yellow font bold uppercase text sm px py rounded shadow hover shadow lg outline none focus outline none mr mb type button onClick gt setShowModal false gt Submit lt button gt lt div gt lt div gt lt div gt lt div gt lt gt null lt gt export default Modal Understanding the Code LogicThe code looks complex right Don t worry I ll break the logic into simple terms and help you understand So let s see step by step what is happening In the useState hook const showModal setShowModal useState false We have defined the initial state as showModal and the update function as setShowModal This function will tell us if we intend to show the Modal or not Next to the right side of we have defined the default value of the initial state i e showModal as false Next we have a lt button gt tag This button is to get to the form so we have added a React onClick event Whenever the user clicks the button it will set the showModal to true using setShowModal That s it After that we have a ternary condition that displays the form using TailwindCSS If showModal is true the meaning button was clicked The basic gist is if the showModal state is true we have to display the form otherwise the Form is closed At the end we export the component to use it in App js to render it on our page Rendering Modal ComponentAs we are very well aware of rendering a component in React we have to import it in App js So we will do the same with some basic CSS to the home page import Modal from Components Modal const App gt return lt div className App h screen flex flex col items center justify center bg purple gt lt Modal gt lt div gt export default App Launching the ApplicationThat s it we have come to the end of creating a modal in React To check Our project just does npm start and voila ConclusionVia this blog I have tried my best to try and teach a small but valuable mini project in React The link to the Github repo of the project is below ReactJS Tailwind CSS ModalI would love to read your thoughts about the blog so please comment below Hope to meet you again in my next blog Bubye 2022-02-07 15:05:52
海外TECH DEV Community Low Cost Value-Adds for Any React Project https://dev.to/_ezell_/low-cost-value-adds-for-any-react-project-103k Low Cost Value Adds for Any React ProjectLanded a new role New to a React project Just want to see if there s anything new here Here are a few ways to hit the ground running with minimal cost to existing codebases Free of any package installations Default PropsIt is not uncommon to discover legacy or current React codebases with components containing no default values for the props it consumes Which implies the value undefined is part of expected behavior which is risky business What should we see if the message prop isn t provided const Greeting props gt lt h gt props message lt h gt Leveraging React s defaultProps component propertyconst Greeting props gt lt h gt props message lt h gt Greeting defaultProps message No message prop provided Using Object Destructuring Assignmentconst Greeting message No message prop provided gt lt h gt message lt h gt Adding TypeScript Types via JSDocIt s safe to assume numerous React developers are using Visual Studio Code as their text editor Why not enhance the development experience by leveraging VSCode s Intellisense Adding types via React Prop Types or TypeScript may face some resistance but it doesn t mean we can t use types with comments description defaults to No message prop provided param message string message returns JSX Element Greeting component const Greeting message No message prop provided gt lt h gt message lt h gt Learn more Here Explanatory CommentsI admit this is a piece of advice for myself as much as it is for anyone else Also this is a general good habit for any project Ideally we want to write comments explaining why we re adding a component or a highly re used module If we can t explain it in a line try to include a reference to the ticket Received a hard to understand piece of code from the internet Include a link to where it was found Your teammates and future self will greatly appreciate this Wanted a concise way to compose the props for a hairy view See ticket for detailsexport const pipe input fns gt fns reduce output fn gt fn output input Have any more tips I d love to know more 2022-02-07 15:03:56
海外TECH DEV Community A complete guide to the Browser console https://dev.to/codepapi/a-complete-guide-to-the-browser-console-6gd A complete guide to the Browser consoleIn this article you will learn the A to Z about the console Everything you need to know about the Console in JavaScript including how to use it to format output and how to use it to debug your code You will also learn all the features of the console object additional styling options and using string substitution to format output PrerequisitesBasic knowledge of JavaScript is required or Be console friendly what is a console in javascript A console is a global object that is used to output data to the console environment in the browser or the Nodejs command line interface This is a very useful tool for debugging and testing your code It is also used to output data to the browser console in a more readable format This object is available in the global scope and made up of methods as at th of February To check out the methods you can use the console log Object keys console length in any console environment to check out the number of methods available and also console log console to check out all the current available console object methods How to open a console in javascript For different browsers and operating systems there are different ways to open a console These are For Google Chrome open the Chrome Menu in the upper right hand corner of the browser window and select More Tools gt Developer Tools You can also use Option ⌘ J on macOS or Shift CTRL J on Windows Linux For Firefox click on the Firefox Menu in the upper right hand corner of the browser and select More Tools gt Browser Console You can also use the shortcut Shift ⌘ J on macOS or Shift CTRL J on Windows Linux For Microsoft Edge open the Edge Menu in the upper right hand corner of the browser window and select More Tools gt Developer Tools You can also press CTRL Shift i to open it For other browsers kindly check out their documentations How do you use the console console log The easiest way to use the console is to use the console log function on your browser console example Passing in a simple single argument of any data type console log “Hello World This would simply output the text “Hello World to the console Somethings to note is thats the console will output any data type that is passed in For instance if you pass in a number it will output the number If you pass in a string it will output the string If you pass in an object it will output the object in a readable format example Passing in multiple argumentsThe console log function can take in any number of arguments and will output them to the console It also outputs the arguments to the console in a readable format console log Hello World true false null test test undefined This would output the following to the console Hello World true false null test test undefined The console will output the arguments in a readable format example Performing logics arithmetic operations or strings concatenations Console log allows logic strings concatenation or mathematical operations to be performed inside it and returns the resultconsole log gt returns falseconsole log returns console log I am Learning returns I am Learning example Strings Styling like the css to htmlconsole log c I am a blue text on a black background color blue background color black The above example we uses c to specify that we have styles to add which are later added as the second arguments of the console log method example String Substitutionconsole log Hi s my name is s and i am d years old world Joe The above example takes in a string as the first argument which also contains s and d making the statement not clear This shows that the second third and forth arguments are to replace the s and d values but what makes the two different s can only take in a string and d takes in a digit console table The console table function is used to output data to the console in a table format unlike the console log that logs out all data as inputted It takes in an array of objects an Array or an Object and outputs them to the console in a table format let arr a b c let obj firstName John lastName Doe age eyeColor blue let arrOfObj name shark likes ocean name turtle likes pond name otter likes fish biscuits The above code sample would be used to illustrate how code would output on console log vs console table example console log arr vs console table arr example console log obj vs console table obj example console log arrOfObj vs console table arrOfObj The difference between the console log and the console table is that the console log outputs Arrays and Objects just the way they are while the console table presents them in a tabular format A very important use case for this is when testing an API with a list of data This makes it more readable console clear The console clear function is used to clear the console It is very useful when you are debugging and you want to clear the console before you start writing your code example console log Hello World Before Clear console clear console log Hello World After Clear This would clear the console with the text Hello World Before Clear and would output only Hello World After Clear console assert The console assert function is used to check if a condition is true or false If the condition is false it will output an error message to the console but if it is not it will do nothing example console assert is not equal to This would output nothing to the console because the condition is true since integer is equal to integer example console assert is not equal to This would output the following to the console is not equal to because the condition is false console log Aliases console error console warn console info console debug There are console log aliases because there are different types of messages that can be outputted to the console There are aliases because there work like the console log but the functions are used to output data to the console in a different format and or background colors The console error function is used to output an error message to the console The console warn function is used to output a warning message to the console The console info function is used to output an informational message to the console The console debug function is used to output a debugging message to the console These functions are all very similar to the console log function The only difference is that they output renders in a different format background colors or the left icon which may vary from browser to browser These are all aliases for the console log function exampleconsole info Console Info console debug Console Debug console warn Console Warn console error Console Error The above is a representation of the console log aliases behavior on the Google Chrome browser which indicates the exhibition of the console error on a red background color and console warn on a yellow background color The colors and behavior varies from browsers to browser and it is more informative than just using the console log  The Time Tracking Logs console time console timeLog and console timeEnd The time tracking Logs in the console are used to track the time it takes to run a piece of code There are functions that are used to track the time The console time function is used to start a timer in a console it should be placed at the beginning a process It takes in a label as an argument which is of string data type This label act as an identifier of whatever process time interval you want to track console timeLog function is used to output processing time to the console at a each interval interval If you only want to track the total time you might not need the console timeLog function It also takes in the same argument as the console time The console timeEnd function is used to stop a timer and output a message to the console of the total time to run the process It also takes in the same argument as the console time Note The reason why we use the same argument for the console time and console timeEnd is because we want to track the time of a process if we want to track the time of another process we can use the same label Our label here is Track Timeconsole time Track Time Here is our time tracking beginsfor let i i lt i some code console log i console timeLog Track Time This is what keeps track of time after each loop console timeEnd Track Time Here is where our time tracking endsThe above example shows time tracked after each loop from to while the last shows the total time tracked after the whole process A good use case for using the time tracking logs is when trying to compare the speed of algorithms to enable you make use of the most efficient The Counter Logs console count and console countReset The counter logs in the console are used to count the number of times a piece of code is executed There are functions that are used to count the number of times a piece of code is executed The console count function is used to output a message to the console and start a counter The console countReset function is used to output a message to the console and reset the counter The Count Tracker Logs also takes in a label as a argument In this below example we named in the Count Track example console count function Counter console count Count Track function Counter console count Count Track Counter Counter Counter Counter Counter console countReset console countReset Count Track counts after resetCounter Counter From the result above Counter and Counter functions tracked the count using the console method console count with a label Count Track at each function call up to times till the console countReset method was introduced with the same label as the console count The count restarted after the countReset was called The Grouping Logs console group console groupEnd and console groupCollapsed The grouping logs in the console are used to group a set of logs together There are functions and are used to group a set of logs together The console group function is used to output a message to the console and start a group The console groupEnd function is used to output a message to the console and stop a group The console groupCollapsed function is used to output a message to the console at any group level but is is collapsed by default example console log This is the outer level which is Level console group console log Level console group console log Level console log More of level console groupCollapsed console log test collapse console log test collapse console groupEnd console log Back to level console groupEnd console log Back to the outer level The above displays the result of the grouped codes The result shows levels of each group formed using the console group method at every time the console group method was called a new group was created at any point a groupEnd was called the last group was taken off The groupCollapsed maintained any group it found itself except gave birth to children which where collapsed by default console trace The console trace function is used to output a stack trace to the console This is very useful when you are debugging and you want to see the stack trace of the error example function showTrace function foo function bar console trace show me traces bar foo showTrace The above example shows stack trace of the in order of the last child to the parent function A good use case for it is when debugging to sort the origin of a certain stack console dir The console dir is used to output all the properties of a javascript object to the console This is very useful when you are debugging and you want to see the properties of an object It outputs the properties of an object in hierarchical format I hope it helped Thanks for reading and Happy coding You can also check out My other article onDebouncing in Javascript using a custom function or Lodash library 2022-02-07 15:02:30
Apple AppleInsider - Frontpage News Deaf rappers join Dr. Dre for the Super Bowl Halftime Show https://appleinsider.com/articles/22/02/07/deaf-rappers-join-dr-dre-for-the-super-bowl-halftime-show?utm_medium=rss Deaf rappers join Dr Dre for the Super Bowl Halftime ShowBeats by Dre co founder Dr Dre is including a pair of deaf rappers as part of the Super Bowl Halftime Show marking the first time sign language interpreters will take part in the entertainment event The Super Bowl Halftime Show is a major entertainment spectacle a musical extravaganza in the middle of the major football final For Sunday s event Dr Dre is taking part in the show and is bringing along some unexpected guests as well Sean Forbes and Warren WaWa Snipe will be on stage alongside Dre who will be signing along with the performance Variety reports it will be the first time in the halftime show s history that it will use sign language interpreters though interpreters have been employed for pre game activities in the past Read more 2022-02-07 15:49:29
海外TECH Engadget Tobii says it's in talks to provide eye tracking for Sony's PlayStation VR2 https://www.engadget.com/tobii-playstation-vr2-eye-tracking-talks-155325972.html?src=rss Tobii says it x s in talks to provide eye tracking for Sony x s PlayStation VRSony might not have locked down PlayStation VR specifications despite providing some details at CES Tobii says it s in talks to provide eye tracking technology for the next gen VR headset It noted the discussions were quot ongoing quot and that it couldn t share the potential financial impact of the deal The firm is required to divulge the negotiations to honor EU market regulations We ve asked Sony for comment The company previously confirmed the PlayStation VR would use eye tracking but didn t name a tech supplier or explain in detail how the feature would work The headset will also use camera based quot inside out quot tracking to detect head and controller movement The revelation suggests PlayStation VR might not arrive for a while Game console makers typically need to solidify hardware specs well in advance both for the sake of manufacturing and to give developers time to produce games optimized for new devices If Sony still hasn t chosen a provider for a key feature like eye tracking a launch is still a long ways off Not that this would be a complete surprise Sony first teased PlayStation VR in early and warned there was quot a lot quot of work left on the project The electronics firm ruled out any release that year and still hasn t given a general timeframe for the wearable s debut Tobii s claim might just temper expectations for PlayStation owners eager to try Sony s latest take on VR 2022-02-07 15:53:25
金融 RSS FILE - 日本証券業協会 新型コロナウイルス感染症への証券関係機関等・各証券会社の対応について(リンク集) https://www.jsda.or.jp/shinchaku/coronavirus/link.html 新型コロナウイルス 2022-02-07 15:10:00
金融 金融庁ホームページ 審判期日の予定を更新しました。 https://www.fsa.go.jp/policy/kachoukin/06.html 期日 2022-02-07 16:00:00
ニュース ジェトロ ビジネスニュース(通商弘報) 英政府、イスラエルとの新貿易協定の交渉に向け、意見公募を開始 https://www.jetro.go.jp/biznews/2022/02/3a733ef7c389b9c1.html 貿易協定 2022-02-07 15:40:00
ニュース ジェトロ ビジネスニュース(通商弘報) 国家統計情報庁、CPI基準年を改定、消費傾向に合わせ対象品目の改廃も https://www.jetro.go.jp/biznews/2022/02/e942ee07a34e3024.html 対象品目 2022-02-07 15:30:00
ニュース ジェトロ ビジネスニュース(通商弘報) 補正予算成立、北部紛争の戦費負担が中心に https://www.jetro.go.jp/biznews/2022/02/8dd9e232aaf87c0f.html 補正予算 2022-02-07 15:20:00
ニュース ジェトロ ビジネスニュース(通商弘報) エリア1天然ガスプロジェクトは2022年内再開を目標 https://www.jetro.go.jp/biznews/2022/02/3f946428439bd93a.html 天然ガス 2022-02-07 15:10:00
ニュース BBC News - Home Ukraine crisis: World leaders step up talks amid invasion fears https://www.bbc.co.uk/news/world-europe-60292437?at_medium=RSS&at_campaign=KARANGA ukraine 2022-02-07 15:48:25
ニュース BBC News - Home World Cup 2030: UK & Republic of Ireland FAs abandon 2030 bid to focus on Euro 2028 https://www.bbc.co.uk/sport/football/60285799?at_medium=RSS&at_campaign=KARANGA World Cup UK amp Republic of Ireland FAs abandon bid to focus on Euro The UK and Republic of Ireland football associations agree not to bid for the World Cup and will instead focus on a joint bid to host Euro 2022-02-07 15:33:30
ニュース BBC News - Home Rayan: Morocco holds funeral for five-year-old who died trapped in well https://www.bbc.co.uk/news/world-africa-60287997?at_medium=RSS&at_campaign=KARANGA effort 2022-02-07 15:18:10
ニュース BBC News - Home Asda in cheap food promise after Jack Monroe complaints https://www.bbc.co.uk/news/business-60287010?at_medium=RSS&at_campaign=KARANGA activist 2022-02-07 15:42:50
ニュース BBC News - Home Fancy forwards, Tuilagi trauma and Scottish resilience - Six Nations talking points https://www.bbc.co.uk/sport/rugby-union/60290112?at_medium=RSS&at_campaign=KARANGA opening 2022-02-07 15:04:56
ニュース BBC News - Home Winter Olympics: GB's Dodds & Mouat to play for bronze after semi-final defeat https://www.bbc.co.uk/sport/av/winter-olympics/60289859?at_medium=RSS&at_campaign=KARANGA Winter Olympics GB x s Dodds amp Mouat to play for bronze after semi final defeatGreat Britain s mixed doubles curling pair Jen Dodds and Bruce Mouat miss the chance to guarantee at least a silver medal losing to Norway in a tense semi final 2022-02-07 15:05:11
サブカルネタ ラーブロ 元祖ラーメン 長浜家@赤坂(福岡県) 「ラーメン、ほか」 http://ra-blog.net/modules/rssc/single_feed.php?fid=196273 元祖長浜屋 2022-02-07 15:01:25
サブカルネタ ラーブロ 葛西「一番星」塩まぜそば http://ra-blog.net/modules/rssc/single_feed.php?fid=196269 東京都江戸川区 2022-02-07 15:00:44
北海道 北海道新聞 判定で中国「金」にブーイング ショートトラック男子1000m https://www.hokkaido-np.co.jp/article/643083/ 男子 2022-02-08 00:01: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件)