TECH |
Engadget Japanese |
2003年6月28日、スクエアデザインのコンデジ「COOLPIX SQ」が発売されました:今日は何の日? |
https://japanese.engadget.com/today-203044010.html
|
coolpixsq |
2021-06-27 20:30:44 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
BlenderのPython Scripting APIみたいなものを作りたかった |
https://qiita.com/ambara/items/30bf69b780485bff1436
|
|
2021-06-28 05:43:30 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
huggingfaceでの自然言語処理事始めBERT系モデルの前処理方法 |
https://qiita.com/kanataken/items/4298f39e6afb55bd2bd6
|
インポート文fromtransformersimportAutoTokenizer公式ドキュメントtokenizerの適用方法ここでは、ローカルのデータセットを読み込んだデータに関してtokenizerを適用していく例を見ていきます。 |
2021-06-28 05:15:45 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
attr_accessorがあれば、attr_reader、attr_writerはいらない? |
https://qiita.com/subun33/items/8215de47b19110e2fad1
|
attrreadernameageattrwriterを使う場合上記コードから書き込みメソッドの定義を削除し、以下のコードを追加します。 |
2021-06-28 05:23:20 |
海外TECH |
DEV Community |
React Hooks Explained: useEffect( ) (By Building An API Driven App) |
https://dev.to/sjcodebook/react-hooks-explained-useeffect-by-building-an-api-driven-app-16d9
|
React Hooks Explained useEffect By Building An API Driven App Original Interactive Post Link gt In the previous article I talked about the useState react hook In this article We will talk about the useEffect hook which gives us the combined ability of these three famous React class lifecycle methods gt componentDidMount componentDidUpdate and componentWillUnmount So Lets start exploring this powerful hook by building a Coronavirus Tracker Application The Coronavirus Tracker AppLet s start by first defining the basic React functional component import React from react export const CoronaApp gt const renderButtons gt return lt div gt lt button style margin px gt Worldwide lt button gt lt button style margin px gt USA lt button gt lt button style margin px gt India lt button gt lt button style margin px gt China lt button gt lt div gt return lt div gt lt h gt Corona Tracker lt h gt renderButtons lt div gt Now let s define two states gt data To store the tracking data that is fetched from the API region To store the current regionimport React useState from react export const CoronaApp gt const data setData useState const region setRegion useState all const renderButtons gt return lt div gt lt button style margin px onClick gt setRegion all gt Worldwide lt button gt lt button style margin px onClick gt setRegion usa gt USA lt button gt lt button style margin px onClick gt setRegion india gt India lt button gt lt button style margin px onClick gt setRegion china gt China lt button gt lt div gt return lt div gt lt h gt Corona Tracker lt h gt renderButtons lt h style marginTop px gt region toUpperCase lt h gt lt div gt Now We will use axios to fetch the data from the API inside our useEffect hook But before that Let s first look at the basic usage of useEffect The most basic way to use the useEffect hook is by passing a single function as its argument like this gt useEffect gt console log I will run on every render By defining useEffect like this Makes this hook behave like componentDidUpdate lifecycle method meaning it will run on every single render of our functional component To make the useEffect to behave like componentDidMount i e Make it to run only on the first render of our functional component We need to pass an empty array as the second argument in the useEffect hook like this gt useEffect gt console log I will run only on first render We can also pass a value in the array By doing this We are depending the running of useEffect hook on the state of the value passed Like if we take an example of our corona tracker app We want our useEffect to only run when the value of the region changes So We will define our useEffect hook like this gt useEffect gt Data fetching from the API region Okay So now let s get back to our tracker app and use the useEffect hook to fetch the data from the API import React useState useEffect from react import axios from axios export const CoronaApp gt const data setData useState const region setRegion useState all useEffect gt axios get region all region region then res gt setData res data region const renderButtons gt return lt div gt lt button style margin px onClick gt setRegion all gt Worldwide lt button gt lt button style margin px onClick gt setRegion usa gt USA lt button gt lt button style margin px onClick gt setRegion india gt India lt button gt lt button style margin px onClick gt setRegion china gt China lt button gt lt div gt return lt div gt lt h gt Corona Tracker lt h gt renderButtons lt h style marginTop px gt region toUpperCase lt h gt lt ul gt Object keys data map key i gt return lt li key i gt key typeof data key object data key lt li gt lt ul gt lt div gt Lets Quickly also add a collapse info button import React useState useEffect from react import axios from axios export const CoronaApp gt const data setData useState const region setRegion useState all const inDetail setInDetail useState false const dataLen Object keys data length useEffect gt axios get region all region region then res gt setData res data region const renderButtons gt return lt div gt lt button style margin px onClick gt setRegion all gt Worldwide lt button gt lt button style margin px onClick gt setRegion usa gt USA lt button gt lt button style margin px onClick gt setRegion india gt India lt button gt lt button style margin px onClick gt setRegion china gt China lt button gt lt button style margin px onClick gt setInDetail inDetail gt inDetail Show Less Show More lt button gt lt div gt return lt div gt lt h gt Corona Tracker lt h gt renderButtons lt h style marginTop px gt region toUpperCase lt h gt lt ul gt Object keys data map key i gt return lt span key i gt i lt inDetail dataLen lt li key i gt key typeof data key object data key lt li gt lt span gt lt ul gt lt div gt Now If you open the developer console and go to the network tab you will notice that when you click on the Show Less Show More button the useEffect will not run It will only run when you change the value of the region by clicking on any country button That is happening because we passed the value of region in the array as the second argument of our useEffect hook If we remove the region from the array it will run only the first time and if we remove the array then it will run everytime on every state change event useEffect Clean UpIf you have used React then you must be familiar with this warning that comes up in the consoleCan t perform a React state update on an unmounted component This is a no op but it indicates a memory leak in your application To fix cancel allsubscriptions and asynchronous tasks in a useEffect cleanup function This message is simply saying to us that please don t try to change the state of a component which has already been unmounted and its unavailable This error is very common when we subscribe to a service but forgot to unsubscribe or a component gets unmounted before finishing our async operation To prevent this we can run a cleanup inside our useEffect hook To do a cleanup Simply return a function within the method in the useEffect hook like this gt useEffect gt console log Doing some task like subscribing to a service return gt console log Cleaning up like unsubscribing to a service If you observe the console you will see the running pattern like this gt Output You can see that the cleanup will run before the task in useEffect skipping the first run of the useEffect hook The cleanup will also run when the component will get unmounted Thats it that is all you need to know about the useEffect hook If you like my articles please consider liking commenting and sharing them Cheers Original Interactive Post Link gt |
2021-06-27 20:46:29 |
海外TECH |
DEV Community |
React Hooks Explained: useState( ) |
https://dev.to/sjcodebook/react-hooks-explained-usestate-3nnb
|
React Hooks Explained useState Original Interactive Post Link gt Nowadays managing state is the most crucial part in any application s architecture Most applications behaviour depends on the values of states defined in them So understanding how to manage it efficiently becomes very important Before hooks introduction in React version the only way to use state in your application is through class component But now with the help of useState hook we can manage state in our functional components too So in this article we will be learning everything that we need to know about useState to get started with stateful functional components Comparing State Management in classes and functionsLets start by understanding the use of useState hook by looking at an example of a simple counter application written using React s functional component import React useState from react export function Counter const count setCount useState const msg setMsg useState Use the below button to increase the count return lt div gt lt p gt Counter count lt p gt lt p gt msg lt p gt lt button onClick gt setCount count gt Count lt button gt lt div gt For comparison lets also rewrite it into a class component import React Component from react export class CounterClass extends Component constructor props super props this state count msg Use the below button to increase the count render return lt div gt lt p gt CounterClass this state count lt p gt lt p gt this state msg lt p gt lt button onClick gt this setState count this state count gt Count lt button gt lt div gt Okay now lets compare each aspect one by one Defining initial stateIn a class component initial state is defined as an object inside the constructor containing all the state for the component constructor props super props this state count msg Use the below button to increase the count But in a functional component we define the initial state by passing it as an argument in the useState hook useState initialState The return value of useState hook is an array containing the current state and a function to update the value of current state const state setState useState initialState Now like in a class component we can define all state for a component in a single useState hook const state setState useState count msg Use the below button to increase the count But it is a recommended practice to use individual useState hook for managing each state As it is cleaner and easier to maintain const count setCount useState const msg setMsg useState Use the below button to increase the count Now there can be situations where the initial state you are defining may require time to get resolve Passing this as initial state in useState hook can slow down the whole application As you know in functional components the initial state is declared in the render function and its value updates at every render This is not a problem in class component as the initial state is defined in the constructor which is called only once at the start But there is a solution useState also take function as the argument the useState will run this function only once when the component is rendered first time We can pass the function in useState like thisuseState gt Some heavy computation task Updating the StateIn class component we can update the count by calling this setState this setState count this state count Or by returning the updated value of count from a function in this setState this setState prevState gt return count prevState count In functional components as we are using individual useState for each state We can easily update the value of count by calling the setCount function like thissetCount count But if you are depending on the previous state for updating to new state It is recommended to use the function in setState like thissetCount prevCount gt prevCount The reason behind this is say you want to update the state two times in a function and you try to do it like thisexport function Counter const count setCount useState const msg setMsg useState Use the below button to increase the count return lt div gt lt p gt Counter count lt p gt lt p gt msg lt p gt lt button onClick gt setCount count setCount count gt Count lt button gt lt div gt But you will see that the count value is still updating by one This is because the count value in the setCount is the same when we render our functional component and count value doesn t change inside of the function from where it is called So in the above code the count value is same in both setCount overriding eachothers value resulting in value of count increased by just one Now if we use the function in setCount We can get the desired result as the updated count value gets stored in the prevCount and we can use the prevcount to correctly update the value of count inside the function export function Counter const count setCount useState const msg setMsg useState Use the below button to increase the count return lt div gt lt p gt Counter count lt p gt lt p gt msg lt p gt lt button onClick gt setCount prevCount gt prevCount setCount prevCount gt prevCount gt Count lt button gt lt div gt Lastly if you are using the single useState hook to manage all states like thisconst state setState useState count msg Use the below button to increase the count You need to remember that when updating only the value of count Unlike this setState setState will overwrite the whole state object to the new object having only value of count You can see in the output of the code below that after clicking the count button the message will get dissappear export function Counter const state setState useState count msg Use the below button to increase the count return lt div gt lt p gt Counter state count lt p gt lt p gt state msg lt p gt lt button onClick gt setState count gt Count lt button gt lt div gt In order to avoid this you will need to pass the old state with the new state in setState export function Counter const state setState useState count msg Use the below button to increase the count return lt div gt lt p gt Counter state count lt p gt lt p gt state msg lt p gt lt button onClick gt setState prevState gt Expanding prevState object using spread operator return prevState count gt Count lt button gt lt div gt ConclusionuseState provides a cleaner and a maintainable way to manage states in an application After reading this article you are ready to start using useState in your react projects like a pro Original Interactive Post Link gt |
2021-06-27 20:34:36 |
海外TECH |
DEV Community |
Step By Step Guide To Create A Twitter Bot Using Nodejs Hosted On DigitalOcean For Free |
https://dev.to/sjcodebook/step-by-step-guide-to-create-a-twitter-bot-using-nodejs-hosted-on-digitalocean-for-free-2ipn
|
Step By Step Guide To Create A Twitter Bot Using Nodejs Hosted On DigitalOcean For FreeOriginal Post Link gt Recently I posted the tweet shown below The special thing about this tweet is that when the like or retweet counter gets updated my profile name will also get updated to show the current likes and retweet value This is done by the Nodejs script running behind the scene on a DigitalOcean Droplet To see this in action you need to like and retweet the below tweet It will take a minute to reflect the changes in the profile name So In this article i will explain all the steps that i took to create this twitter bot from scratch and also explain how you can host it on the DigitalOcean Droplet for free Steps Firstly If you are new to DigitalOcean Then you need to create a new digitalocean account using this Link Complete the simple signup process and visit the DigitalOcean dashboard by clicking on the DigitalOcean Logo After that click on the New Project option to create a new project After creation You will see your project been added on the left sidebar Now click on the Get Started with a Droplet Button to create your new Droplet DigitalOcean Droplets are simple Linux based virtual machines VMs that run on top of virtualized hardware After this You will be asked to configure your droplet For image selection we will start with a fresh Ubuntu LTS x image Now Select the Basic Plan for our Droplet Now Scroll down directly to Authentication Section and select SSH Keys as the Authentication Method Click on New SSH Key Button to add a new SSH Key After clicking A modal will open asking for your public SSH key To create a new SSH Key pair just type the below command in your terminal ssh keygen o t rsa C your email com Remember to replace the comment with your own email After That you will be asked for the path to save the keys hit enter to accept the default location Generating public private rsa key pair Enter file in which to save the key home sj ssh id rsa Next you will get an option to provide the passphrase to make your keys more secure This is optional and you can skip it by pressing enter two times Enter passphrase empty for no passphrase Enter same passphrase again Finally After your keys are generated You will see the below message Your identification has been saved in home sj ssh id rsaYour public key has been saved in home sj ssh id rsa pubThe key fingerprint is SHA XYRaLvJUVkwrMVgMFQh BaVOhJGZsOsbEU your email comThe key s randomart image is RSA O O o Eo o o XoO o o S o o SHA So we have generated our SSH key pairs Now we can access content of our public key by using cat command cat ssh id rsa pubOutput ssh rsa AAAABNzaCycEAAAADAQABAAABgQDOXmwRpIsoXEQsKgwY yJJaUiYucpgVcDPimLcUzoaYHFyELeDYVZcduPHCxOJP eVzweBEFHqonzNZZmO WZQBddrJKJce JXtHvSPWZQFYXAcueBZwpiSeMIBuSz idafswQYEJBDWOtxduuLeMlrlFj uiN KtDlMuiHUBXcHbYBkyCbQxeSZlo XrttythOxxd XaswwFQYYNYqLRZKHxryg uTBzOMIVXBykTzHffBx BoZioBVsWeH uPCizleMZEBylWDpHhVBpNBrEQEwJqPrHEtchIyiFkBSMUKoAUkuEzyTaFxM OhAJMZwqHXqdFzJbUrMysyuAs MVKedMXqVaijOde TibDMdeKYZSygxhbKHibNIwwoF YtyJoqsBRiOjRYN GCnijNlBsMqJXRcflJKyp your email comcat ssh id rsa pubCopy your public SSH key and paste it in the SSH key content Box and also give a name to your key I am going to give Droplet SSH Name to my key for this tutorial After that click on Add SSH Key Button Select your new key Next Under Choose a hostname Section give your droplet a name that you want I am going to call it twitter bot for this tutorial Now You are all set to go Just click on the Create Droplet Button and wait for DigitalOcean to create your droplet Okay Now to access your droplet via SSH copy your ipv address In my case it is and in your terminal type the below command with your ipv address ssh root After that You will be asked if you trust the host Just enter yes and click enter If you see the prompt then you have successfully logged in to your droplet Okay Now will create our new user in ubuntu We can do that by typing the below command adduser wbmYou will be prompted for a new password Give a new password retype it and click enter Next you will be asked some user information You can fill it if you want otherwise Just click enter Finalise the information by typing y and clicking enter After this You will get back to your root prompt again To verify your new user just type the below command id wbmOutput uid wbm gid wbm groups wbm Now You will notice that our user is not in the sudo group We want to put our user in sudo to run things as administrator So to do thar type the below command with your username usermod aG sudo wbmNow If you run id wbm Command You will see your user in sudo group uid wbm gid wbm groups wbm sudo Okay Now to login with the user just type the below command sudo su wbmAfer this You will see the prompt being changed to wbm twitter bot You can also double check by typing the below command whoamiOutput wbmNow Logging into our user like this is a very cumbersome process To directly login into our user via SSH we need to authorize our SSH Key with our new user For that we need to first make a directory by running the below command mkdir sshNext Change the permission to by typing the below command chmod sshNow We will create a new file named authorized keys nano ssh authorized keys authorized keys file will open up in the nano editor Now we just need to paste our SSH Key into it that we previously saved while configuring our droplet with name Droplet SSH Make sure that whole key comes in single line without spaces After pasting Press ctrl x and y to save and exit Now Change the permission of the file to by typing the below command chmod ssh authorized keysNow Restart the SSH Service to apply the changes sudo service ssh restartOkay Now we are all done To test it out Close your terminal and start a new one Then type the below command to login to the user via SSH ssh wbm So Now you must be logged into your droplet with your user Next step is to install Nodejs on our server To do that run the below commands curl sL sudo E bash sudo apt get install y nodejsAfter this Nodejs is successfully installed on our server We can run node v to see the node version and confirm the installation Okay Now lets proceed to create our bot application For that first create a directory in which we will store our code mkdir twitter botNow cd into the directory cd twitter bot Initialize Npm This will create a package json file npm init yNow create a new file named server js touch server jsOpen server js using nano editor sudo nano server jsPaste the bot script in the editor You can also get the application files from the Github Repo const Twitter require twitter lite let cron require node cron const client new Twitter consumer key paste your key consumer secret paste your key access token key paste your key access token secret paste your key const getTweetLikesAndUpdateProfile async gt const tweetData await client get statuses show id catch err gt console log err if favorite count in tweetData amp amp retweet count in tweetData const name SJ this tweet has tweetData favorite count likes and tweetData retweet count retweets await client post account update profile name catch err gt console log err cron schedule gt console log running a task every minutes getTweetLikesAndUpdateProfile console log started After this you just need to replace the given id with the id of the tweet that you want to track You can easily get the id of the tweet by visiting the tweet on twitter and copying the id from the URL As for the Keys part You have to first visit this Link and apply for a developer account Once you are granted access Create a new project and app by visiting the Twitter Developer Portal After this visit the Keys and tokens section and generate copy your keys So now paste your API Key And Secret in consumer key and consumer secret and Access Token amp Secret in access token key and access token secret Respectively Save the changes and exit the server js file by pressing ctrl x and y After this Open the package json file in nano editor by running the below command sudo nano package jsonDelete the test script and add the start script like this scripts test echo Error no test specified amp amp exit start node server js Also Add the node dependencies that we have in our server js file author license ISC dependencies node cron twitter lite Save the changes and exit the package json file by pressing ctrl x and y Next we also need to install the node dependencies To do that run the below command npm installNow our script is ready and we can start the script by running the below command After successfull startup you will see the log started in the console npm startYou can exit by pressing ctrl c It is recommended to use a service known as pm to run our application as a process To install pm Run the below command sudo npm install pm gNow We can start the server by running the command pm start server jsAfter this You can see our server is online and the terminal is also freed You can now exit the server by typing exit command Anytime you want to see your pm processess use pm ls command or if you want to stop a process use pm stop id Congrats You have successfully deployed your first nodejs application to the cloud If you have any problem Comment it down and i will try to resolve it ASAP Cheers Original Post Link gt |
2021-06-27 20:25:54 |
海外TECH |
DEV Community |
How To Create A Floating Action Button Using Material UI In React |
https://dev.to/sjcodebook/how-to-create-a-floating-action-button-using-material-ui-in-react-4kff
|
How To Create A Floating Action Button Using Material UI In ReactOriginal Post Link gt Recently I added the FAB Button present at the bottom left position providing links to my social accounts and i am very happy with the final result I used Material UI for this and damn it is so easy and awesome In this article i am going to describe all the steps that i took to create this beautiful FAB button Steps Install DependenciesRun the below command to install all the dependencies yarn add material ui core material ui icons material ui lab Create A New Functional Component src components social tray social tsx import React from react export default function SpeedDialTooltipOpen return lt div gt hello lt div gt Create Material UI Styles For The FAB Button src components social tray social tsx import React from react import makeStyles createStyles Theme from material ui core styles const useStyles makeStyles theme Theme gt createStyles backdrop zIndex color fff root height flexGrow speedDial position fixed bottom theme spacing left theme spacing export default function SpeedDialTooltipOpen const classes useStyles return lt div gt hello lt div gt Add SpeedDial Material UI Component src components social tray social tsx import React from react import makeStyles createStyles Theme from material ui core styles import SpeedDial from material ui lab SpeedDial import FavoriteIcon from material ui icons Favorite import FavoriteBorderIcon from material ui icons FavoriteBorder const useStyles makeStyles theme Theme gt createStyles backdrop zIndex color fff root height flexGrow speedDial position fixed bottom theme spacing left theme spacing export default function SpeedDialTooltipOpen const classes useStyles const open setOpen React useState false const icon setIcon React useState lt FavoriteBorderIcon gt const handleOpen gt setOpen true setIcon lt FavoriteIcon style fill d gt const handleClose gt setOpen false setIcon lt FavoriteBorderIcon gt return lt div className classes root gt lt SpeedDial ariaLabel SpeedDial tooltip example className classes speedDial icon icon onClose handleClose onOpen handleOpen open open FabProps color default size small gt lt div gt Add SpeedDialAction Material UI Component src components social tray social tsx import React from react import makeStyles createStyles Theme from material ui core styles import SpeedDial from material ui lab SpeedDial import SpeedDialAction from material ui lab SpeedDialAction import FavoriteIcon from material ui icons Favorite import FavoriteBorderIcon from material ui icons FavoriteBorder import FacebookIcon from material ui icons Facebook import TwitterIcon from material ui icons Twitter import InstagramIcon from material ui icons Instagram import LinkedInIcon from material ui icons LinkedIn const useStyles makeStyles theme Theme gt createStyles backdrop zIndex color fff root height flexGrow speedDial position fixed bottom theme spacing left theme spacing export default function SpeedDialTooltipOpen const classes useStyles const open setOpen React useState false const icon setIcon React useState lt FavoriteBorderIcon gt const SocialLinks any Facebook Instagram Twitter LinkedIn const actions icon lt FacebookIcon style fill b onClick gt handleClick Facebook gt name Facebook icon lt TwitterIcon style fill acee onClick gt handleClick Twitter gt name Twitter icon lt InstagramIcon style fill fb onClick gt handleClick Instagram gt name Instagram icon lt LinkedInIcon style fill ea onClick gt handleClick LinkedIn gt name LinkedIn const handleClick network string gt handleClose window open SocialLinks network blank const handleOpen gt setOpen true setIcon lt FavoriteIcon style fill d gt const handleClose gt setOpen false setIcon lt FavoriteBorderIcon gt return lt div className classes root gt lt SpeedDial ariaLabel SpeedDial tooltip example className classes speedDial icon icon onClose handleClose onOpen handleOpen open open FabProps color default size small gt actions map action gt lt SpeedDialAction id action name key action name icon action icon tooltipTitle action name tooltipPlacement right gt lt SpeedDial gt lt div gt Finally Add Backdrop Material UI Component src components social tray social tsx import React from react import makeStyles createStyles Theme from material ui core styles import Backdrop from material ui core Backdrop import SpeedDial from material ui lab SpeedDial import SpeedDialAction from material ui lab SpeedDialAction import FavoriteIcon from material ui icons Favorite import FavoriteBorderIcon from material ui icons FavoriteBorder import FacebookIcon from material ui icons Facebook import TwitterIcon from material ui icons Twitter import InstagramIcon from material ui icons Instagram import LinkedInIcon from material ui icons LinkedIn const useStyles makeStyles theme Theme gt createStyles backdrop zIndex color fff root height flexGrow speedDial position fixed bottom theme spacing left theme spacing export default function SpeedDialTooltipOpen const classes useStyles const open setOpen React useState false const icon setIcon React useState lt FavoriteBorderIcon gt const SocialLinks any Facebook Instagram Twitter LinkedIn const actions icon lt FacebookIcon style fill b onClick gt handleClick Facebook gt name Facebook icon lt TwitterIcon style fill acee onClick gt handleClick Twitter gt name Twitter icon lt InstagramIcon style fill fb onClick gt handleClick Instagram gt name Instagram icon lt LinkedInIcon style fill ea onClick gt handleClick LinkedIn gt name LinkedIn const handleClick network string gt handleClose window open SocialLinks network blank const handleOpen gt setOpen true setIcon lt FavoriteIcon style fill d gt const handleClose gt setOpen false setIcon lt FavoriteBorderIcon gt return lt div className classes root gt lt Backdrop open open className classes backdrop gt lt SpeedDial ariaLabel SpeedDial tooltip example className classes speedDial icon icon onClose handleClose onOpen handleOpen open open FabProps color default size small gt actions map action gt lt SpeedDialAction id action name key action name icon action icon tooltipTitle action name tooltipPlacement right gt lt SpeedDial gt lt div gt Your FAB component is now completed To use it import the component and place it in your main layout component like this gt src components layout tsx import SpeedDialTooltipOpen from components social tray social type LayoutProps children React ReactNode const Layout React FunctionComponent lt LayoutProps gt children gt return lt ThemeProvider theme theme gt lt gt lt ResetCss gt lt Sticky top innerZ activeClass nav sticky gt lt Navbar gt lt Sticky gt children lt Newsletter gt lt Footer gt lt Link to privacy policy activeClassName active link gt Privacy Policy lt Link gt lt Link to disclaimer activeClassName active link gt Disclaimer lt Link gt lt Link to terms activeClassName active link gt Terms Of Use lt Link gt lt br gt Copyright amp copy new Date getFullYear lt a href gt WebBrainsMedia lt a gt lt Footer gt lt ScrollToTop showUnder duration easing easeInOutCubic style bottom right gt lt ScrollUpButton gt lt ScrollToTop gt lt SpeedDialTooltipOpen gt lt gt lt ThemeProvider gt export default Layout Thats it that is all you need to do to create an awesome FAB button You can also check this Link for reference Enjoy Original Post Link gt |
2021-06-27 20:10:17 |
海外TECH |
DEV Community |
The Console Object In Javascript |
https://dev.to/sjcodebook/the-console-object-in-javascript-34l1
|
The Console Object In JavascriptOriginal Post Link gt Javascript provides a global object called console which gives us the ability to access the browser s debugging console If you have ever worked with javascript you must have used it with its log property But it is not limited to that try running the below commandconsole log console You will see the capabilities that this console object comes with Let s take a look at some useful ones console log This is the most commonly used property It is used to print out anything to the web console that we put inside of log Usage console log foo console log console log null console log undefined console log foo bar console log foo hello bar hi Output console table This property allows us to visualize data as tables inside our web console The input data must be an array or an object Usage console table foo bar Output console table foo hello bar hi Output console error This property is used to log error message to the web console By default the error message will appear in red color Mainly used at the time of code testing Usage console error You Have Got An Error Output console warn This property is used to log warning message to the web console By default the warning message will appear in yellow color Usage console warn You Have Got A Warning Output console assert This property gives an error message to the web console only if the first argument is false If assertion is true it prints out nothing Usage let obj name Sam age console assert obj birth obj doesn t contain birth key Output console count This property logs the number of times the same instance of count is called Usage console count foo console count foo console count bar console count bar console count bar Output console group This property is used to group the output in level indented blocks in our web console To define the group start use console group and to define the end use console groupEnd Usage console log Outer Log console group Outer Group console log Level console group Inner Group console log Level console error Level console groupEnd console log Level console groupEnd Output console time This property is used to keep track of the time that is passed between two console logs To start the timer use console time label and to stop the timer use console timeEnd label Remember to use the same label in both time and timeEnd Usage console time time let i while i lt i console timeEnd time Output console trace This property logs the stack trace in the web console Very useful feature when working with nested functions Usage const func gt const func gt console trace func func Output Styling In ConsoleWe can also style our logs using CSS in our web console We just need to pass our styles as a parameter and they will get applied to the logs Usage console log cWebBrainsMedia background color black color orange font style italic font size em padding px Output Original Post Link gt |
2021-06-27 20:02:25 |
海外TECH |
Engadget |
Samsung's Galaxy Buds 2 might sport a slicker, more colorful design |
https://www.engadget.com/samsung-galaxy-buds-2-leak-202831568.html?src=rss_b2c
|
colors |
2021-06-27 20:28:31 |
海外科学 |
NYT > Science |
Helping Drug Users Survive, Not Abstain: ‘Harm Reduction’ Gains Federal Support |
https://www.nytimes.com/2021/06/27/health/overdose-harm-reduction-covid.html
|
Helping Drug Users Survive Not Abstain Harm Reduction Gains Federal SupportOverdoses have surged during the pandemic Now for the first time Congress has appropriated funds specifically for programs that distribute clean syringes and other supplies meant to protect users |
2021-06-27 20:15:20 |
海外科学 |
NYT > Science |
Dispossessed, Again: Climate Change Hits Native Americans Especially Hard |
https://www.nytimes.com/2021/06/27/climate/climate-Native-Americans.html
|
Dispossessed Again Climate Change Hits Native Americans Especially HardMany Native people were forced into the most undesirable areas of America first by white settlers then by the government Now parts of that marginal land are becoming uninhabitable |
2021-06-27 20:25:49 |
ニュース |
BBC News - Home |
Johanna Konta out of Wimbledon |
https://www.bbc.co.uk/sport/tennis/57632878
|
covid |
2021-06-27 20:29:58 |
ニュース |
BBC News - Home |
US and Canada heatwave: Pacific Northwest sees record temperatures |
https://www.bbc.co.uk/news/world-us-canada-57626173
|
idaho |
2021-06-27 20:11:36 |
ニュース |
BBC News - Home |
We lost because of what I did - De Ligt distraught at Dutch exit |
https://www.bbc.co.uk/sport/football/57632560
|
czech |
2021-06-27 20:23:02 |
ニュース |
BBC News - Home |
Euro 2020: Superb Thorgan Hazard strike breaks deadlock for Belgium against Portugal |
https://www.bbc.co.uk/sport/av/football/57632531
|
Euro Superb Thorgan Hazard strike breaks deadlock for Belgium against PortugalThorgan Hazard breaks the deadlock in the first half with a swerving long range shot to put Belgium in front against Portugal in their last Euro tie |
2021-06-27 20:54:56 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
早慶上理の「真の実力と人気」を5指標で独自判定!最もおトクな大学は? - 入試・就職・序列 大学 |
https://diamond.jp/articles/-/274222
|
上智大学 |
2021-06-28 05:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
三菱地所vs三井不動産の頂上決戦にオープンハウスの下剋上、「5年後の勝者」はここ! - 業績 再編 給与 5年後の業界地図 |
https://diamond.jp/articles/-/275028
|
三菱地所vs三井不動産の頂上決戦にオープンハウスの下剋上、「年後の勝者」はここ業績再編給与年後の業界地図アベノミクス以降は不動産マーケットが強く、中古ビルの転売で荒稼ぎしたヒューリックや、都心周辺で狭小戸建てを売りまくったオープンハウスなどリスクを取った企業が業績を大きく伸ばした。 |
2021-06-28 05:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
埼玉vs千葉で今「企業誘致」大合戦がアツい!三井不動産、埼玉りそな銀行… - 埼玉vs千葉 勃発!ビジネス大戦 |
https://diamond.jp/articles/-/274992
|
三井不動産 |
2021-06-28 05:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
武田薬品の次期CEO候補が「日本人3人」でも“日本企業”には戻らない理由 - 武田薬品「破壊と創造」 |
https://diamond.jp/articles/-/274242
|
日本企業 |
2021-06-28 05:10:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
京大・阪大・神大・関関同立…面接だけで入れる!おトクな大学院、東西26校【西日本編】 - 入試・就職・序列 大学 |
https://diamond.jp/articles/-/274221
|
京大・阪大・神大・関関同立…面接だけで入れるおトクな大学院、東西校【西日本編】入試・就職・序列大学コロナ禍は大学の学部入試だけにとどまらず大学院入試にも変化をもたらしている。 |
2021-06-28 05:05:00 |
ビジネス |
電通報 | 広告業界動向とマーケティングのコラム・ニュース |
企業のビジネスチャンスはどこにある?消費者が実践したい「エシカル消費」とは |
https://dentsu-ho.com/articles/7817
|
意識調査 |
2021-06-28 06:00:00 |
ビジネス |
電通報 | 広告業界動向とマーケティングのコラム・ニュース |
アート思考から生まれる未来とは?(長谷川愛×ドミニク・チェン) |
https://dentsu-ho.com/articles/7718
|
dents |
2021-06-28 06:00:00 |
北海道 |
北海道新聞 |
老朽原発再稼働 既成事実化は許せない |
https://www.hokkaido-np.co.jp/article/560465/
|
美浜原発 |
2021-06-28 05:05:00 |
ビジネス |
東洋経済オンライン |
レオパレス、投資ファンドが570億円投じた「真意」 2021年3月期は「債務超過」、上場廃止の瀬戸際に | 不動産 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/436907?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
上場廃止 |
2021-06-28 05:30:00 |
コメント
コメントを投稿