IT |
気になる、記になる… |
「Mac OS X 10.0」のリリースから丸21年を迎える |
https://taisy0.com/2022/03/25/155110.html
|
appleinsider |
2022-03-24 16:25:47 |
AWS |
AWS Partner Network (APN) Blog |
Reimagining Digital Transformation with Capgemini’s Digital Cloud Platform for Restaurants on AWS |
https://aws.amazon.com/blogs/apn/reimagining-digital-transformation-with-capgemini-digital-cloud-platform-for-restaurants-on-aws/
|
Reimagining Digital Transformation with Capgemini s Digital Cloud Platform for Restaurants on AWSThe restaurant industry is experiencing an unprecedented transformational change Elevated expectations for cleanliness health and safety are accelerating the adoption of contactless technologies curbside pickup options and mobile payments Learn how Capgemini s Digital Cloud Platform DCP for Restaurants empowers the industry to reimagine digital transformation by delivering compelling customer interaction and streamlined operations while reducing costs and improving efficiency |
2022-03-24 16:40:39 |
AWS |
AWS |
Intelligence Bank on AWS: Customer Story |
https://www.youtube.com/watch?v=I9-h1jRunqY
|
Intelligence Bank on AWS Customer StoryIn this episode of AWS Community Chats Aley Hammer is joined with Tessa Court the Founder and CEO from Intelligence Bank Intelligence Bank was recently rated the best Marketing Resource Management Software for advanced search and media and Tessa shares what it is that sets Intelligence Bank apart from its competitors Tessa also gives insight into what she thinks is the biggest threat facing the industry at the moment as well as the sectors that are critical to their next phase of growth Learn more at Subscribe More AWS videos More AWS events videos ABOUT AWSAmazon Web Services AWS is the world s most comprehensive and broadly adopted cloud platform offering over fully featured services from data centers globally Millions of customers ーincluding the fastest growing startups largest enterprises and leading government agencies ーare using AWS to lower costs become more agile and innovate faster IntelligenceBank AWSCaseStudy AWS AmazonWebServices CloudComputing |
2022-03-24 16:46:24 |
海外TECH |
Ars Technica |
FBI trolls Russian embassy with geotargeted ads for disgruntled spies |
https://arstechnica.com/?p=1843287
|
speak |
2022-03-24 16:40:51 |
海外TECH |
Ars Technica |
You can now buy a road-legal replica of Porsche’s mighty 917K racer |
https://arstechnica.com/?p=1843276
|
siefert |
2022-03-24 16:21:17 |
海外TECH |
MakeUseOf |
How to Find and Manage Your TikTok Favorites |
https://www.makeuseof.com/how-to-find-and-manage-tiktok-favorites/
|
tiktok |
2022-03-24 16:45:14 |
海外TECH |
MakeUseOf |
How to Create a Digital Business Card the Right Way: 10 Top Tips |
https://www.makeuseof.com/how-to-create-digital-business-card-tips/
|
business |
2022-03-24 16:31:14 |
海外TECH |
MakeUseOf |
How to Play Xbox 360 Games on PC With Xenia on Windows |
https://www.makeuseof.com/xenia-xbox-360-emulator/
|
xenia |
2022-03-24 16:15:14 |
海外TECH |
DEV Community |
Console.log() inside Visual Studio Code |
https://dev.to/codepo8/consolelog-inside-visual-studio-code-2062
|
Console log inside Visual Studio CodeWe just released version of the Edge DevTools for VS Code extension and the main change is that the Console tool is now available in the extension Console log messages in VS Code Test out some JavaScript window object access DOM convenience API support Style changes Console table Live Expressions Use Console and Elements together There are two caveats at the moment in order to see the Console you need to use Edge Canary as your debugging target version and it can happen that the you need to refresh the target once to see the Console light up This is a bug in VS Code itself and will be fixed in the upcoming version New automatically created launch json settingsTo give you the best debugging experience in VS Code we updated the launch json settings when you generate it from the extension The new file offers you a headless debugging experience by default calling the correct version of the Edge debugger You can see it them in action in the following screencast If you want to see the Console tool right now and not until is the stable version of Edge you need to add a runtimeExecutable canary to the launch json to target the Canary build of the browser Offline availabilityIf you want to use the extension when you are offline we now also cache and copy the last successful connection to DevTools This was a direct request from GitHub issues Other fixes and featuresWe updated webhint to which means improved issue reporting and a general clean up of the code base We fixed some minor problems in the source path resolution which makes CSS syncing and opening files in the editor more stableIf you encounter a problem or you want to have other features please file an issue on GitHub This is where we get our best ideas from |
2022-03-24 16:46:40 |
海外TECH |
DEV Community |
How the cp Command Works on Linux |
https://dev.to/smpnjn/how-the-cp-command-works-on-linux-5pp
|
How the cp Command Works on LinuxThe cp command not to be confused with cd allows us to copy files or directories As such it is very commonly used on Linux and Unix like systems like MacOS The syntax for cp is shown below where OPTIONS are optional settings we can change SOURCE is one or more files directories we want to copy and LOCATION is where we want to copy them to cp OPTIONS SOURCE LOCATION How to copy files with cp on Linux and MacOSAt its most basic we can use cp to copy a file or directory to a new location For example the following command will copy a file called my file txt to a directory called test cp my file txt testIn the above example we don t give a file name so the original file name is used If we add a file name we can copy the file with a new name The following example will copy the file and save it as new file txt in the test directory cp my file txt test new file txtIf the file already exists it will be overwritten If you want to avoid that just add the n option which will prevent any duplicate files from being overwritten cp n my file txt testIf you d instead like to confirm when a file is going to be overwritten use the i option This will trigger a prompt asking if you want to overwrite it cp i my file txt testOn Linux only you can also use the u option which will only overwrite files if the file is older than the file you want to overwrite it with This will not work on MacOS cp u my file txt testFinally if you want a response whenever a cp command is complete use v to get a verbose message which will tell you exactly what s happened cp v my file txt test my file txt gt test my file txt Maintaining file permissions when copying a file on Linux and MacIf you want to maintain all the permissions that existed on the file you are copying when you copy it to its new directory use the p option If you don t the owner will be whoever is using the cp file cp p my file txt test How to copy directories with cp on Linux and MacSo far we ve looked at how to copy files If we want to copy directories we need to use the R option which stands for recursive When we use this option we copy the entire directory and all its children to a new location For instance to copy the test directory and call this copied directory newTest you would write the following in terminal cp R test newTest How to copy multiple files and directories with cpTo copy multiple items at once list them all out and have the last location as the place where you want to copy all that stuff to For example cp my file txt my file txt my file txt newTestAnd if you want to include folders when you copy multiple things use the R option cp R my file txt my file txt test newTest |
2022-03-24 16:41:12 |
海外TECH |
DEV Community |
Python : Crash Course |
https://dev.to/ericchapman/python-crash-course-58ka
|
Python Crash Course What will you learn in this course This course will teach you basic concepts in Python All with easy to understand terms and examples Before learning to run you must know how to walk Knowing the basics is essential to master a language like Python The crash course is free and will be posted here on dev to I will publish a new article every two days or so To not miss anything you can follow me on twitter Follow EricTheCoder Why a crash course This type of course allows you to learn a maximum of concepts in a minimum of time An accelerated course allows the student to maintain a high level of interest and motivation The time saved allows the concepts learned to be put into practice more quickly At the end of the accelerated course the student knows enough about the subject to learn on their own the concepts that have not been covered Python installationTo start coding with Python you need to make sure you have an up to date version of Python version or From the terminal type this command to find out the version of Python installed on your machine python versionou python versionIf you don t have Python or a version earlier than you can get the latest version of Python from the official site If you want to start coding immediately and install Python later you can use a web based free version of Python Here is the link Code editorTo follow this tutorial you will need to use a code editor There are several choices if you don t have a favorite editor yet I recommend Microsoft s vscode Here is the link In this tutorial we will not teach how vscode works If you want to learn the basics of vscode there are several free tools available One option I recommend is to configure vscode to allow running from the terminal Here is a link on the instructions for doing this Max OSXWindows Run python codeOnce the installation of Python is complete on your machine it is now time to run your first Python code In the next sections we will learn together the basics of Python languages I will therefore invite you to create a folder and a file in order to place the code which will be given as an example Create a folder named “demo python mkdir demo python cd demo pythonInside the folder create a file named “main py code main py Your first line of codeAdd this code in the “main py fileprint Hello World Here the “print instruction is used to display text in the terminalOnce the file is saved from the terminal you can run it using Python python main pyou python main pyPython will execute all the lines of code present in the file and display the result in the terminal Hello World Run Python Code QuicklyIf you want to run Python code quickly and without creating a file you can use the shell The shell is an application that allows you to enter a line of Python code execute it and display the result immediately To run the shell just run Python without adding any argument pythonou pythonThe command will launch the shell from the terminalPython main Nov Clang clang on darwinType help copyright credits or license for more information gt gt gt Once the application is launched it is possible to enter a command line after the following characters gt gt gt Example gt gt gt print Hello World Once the command has been entered press the “return key and the code will be executed gt gt gt print Hello World Hello World gt gt gt You will have understood that the shell is more useful for testing a Python command than for writing a real application If you are developing a real python application the approach to use is to put the code in files with the extension “ py Your first steps with PythonFor the next examples I invite you to use the “main py file that we created in the previous example The variablesVariables allow you to store information that can be used later by your application To define a variable all you have to do is give it a name and a value For example suppose you want to store the username you can use a variable and give it the name name and set its contents equal to “Mike Taylor name Mike Taylor print name Here the variable is called “name and contains the text “Mike Taylor The quotes tell Python that its content is text Types of variablesA variable can contain several types of data In the last example it is text but we could have assigned an integer to it num Note that to be recognized as a number you must not use quotes ““With Python it is not necessary to specify the type of the variable Python will detect the type automatically according to the content you assign to it Depending on the type detected by Python it will be possible to perform operations on this variable Here is an example value value Here “value is a text type variable string which contains the text “ This variable is not a number that can be used in a mathematical operation “value is an integer type variable that has the number as its content This variable is a number and therefore can be used for mathematical operations result value value result value value The addition of these two variables does not give the same result In Python Adding a text variable string will pair the two texts together While the addition of integer variables will mathematically add the two values Here are different types of variables that can be defined with Python We will come back to each of them in detail later name Mike string texte age integer nombre entier price float nombre décimal is active True boolean vrai ou faux colors red green blue listestates inactive active archive tupleproducts name iPad Pro price dictionnaireIn order to simplify the tutorial from this point the types of variables will be called by their English name For example I will not use the term “text or “integer but rather “string and “integer Reporting conventionBy convention Python variables are defined in lowercase letters and may contain the character as a separator first name Mike CommentsIt is possible to insert a comment in your code To do this you must use the “ character Anything after this character will not be executed by Python Ceci est un commentairename Mike Taylor age Ceci est un commentaireIt is also possible to create multi line comments with the use of three quotes “ comments “ def say hello Cette fonction permet d afficher un messsage de bienvenu sur plusieurs lignes print Hello World ConclusionThat s all for today I ll post a new article every other day or so To make sure you don t miss anything you can follow me on twitter Follow EricTheCoder |
2022-03-24 16:40:51 |
海外TECH |
DEV Community |
How to Draw Text with HTML Canvas |
https://dev.to/smpnjn/how-to-draw-text-with-html-canvas-3kmo
|
How to Draw Text with HTML CanvasAlong with supporting graphics shapes and drawing HTML Canvas also supports adding text The text on HTML canvas can t be highlighted as it is part of the final graphic produced In this article let s look at how HTML Canvas text works If you re brand new to HTML Canvas start with our Getting Started with HTML Canvas guide How to draw text on HTML CanvasIf you want to draw text onto your HTML canvas we need to start by defining how that font should look To do that we use ctx font which has the same syntax as the CSS font property For example if we wanted our font to be Arial px bold we could define our font like this let canvas document getElementById canvas let ctx canvas getContext d ctx font bold px Arial That string gives us the basic style of our font but if we want to change the color we can reuse the fillStyle property which works the same way as it does for shapes Let s make our font white ctx fillStyle white Now that we ve defined both our font and our color we can fill our text using the ctx fillText function ctx fillText has the following syntax ctx fillText textToDisplay x y textToDisplay is the text we want to show x is the x coordinate of that text y is the y coordinate of that text For example our final code supposing we wanted to show the text Hello World at coordinates px would look like this let canvas document getElementById canvas let ctx canvas getContext d ctx font bold px Arial ctx fillStyle white ctx fillText Hello World This will ultimately produce something like this Why can t I see my HTML canvas text The important thing to note when drawing text is the x y coordinates are measured from the bottom line of the text That means if you draw your text at px you won t see it You need to draw it further down i e px How to add a text border with HTML CanvasSimilar to other canvas utilities you can draw a text border with HTML canvas using ctx lineWidth and ctx strokeStyle We can then use strokeText to draw a stroke around our text let canvas document getElementById canvas let ctx canvas getContext d ctx font bold px Arial ctx strokeStyle red ctx lineWidth ctx strokeText Hello World If you want to fill and stroke text in HTML canvas at the same time use both ctx strokeText and ctx fillText at the same place with the same text That will let you fill and stroke the same text ctx font bold px Arial ctx strokeStyle red ctxt fillStyle white ctx lineWidth ctx strokeText Hello World ctx fillText Hello World Text Align and Baseline in HTML CanvasSimilar to other forms of text on the web HTML Canvas supports both text align and baseline alterations to let us customize our text further ctx textAlignctx textAlign accepts different values left for left aligned text right for right aligned text center for center aligned text start for text aligned at the start depending on whether the text is right to left or left to right end for text aligned at the end depending on whether the text is right to left or left to right The text is aligned based on the x position of where you fill or stroke your text from That means if the x position is center will mean that the center of the text is If your text align is right then will be at the end of your text For example if we had the following code ctx font bold px Arial ctx fillStyle white ctx textAlign left ctx fillText Left Aligned ctx textAlign center ctx fillText Center Aligned ctx textAlign right ctx fillText Right Aligned Each line starts at x coordinate Therefore we end up with something like this where the line represents ctx textBaselineSimilar to ctx textAlign textBaseline has a number of possible values top the text baseline is at the top middle the text baseline is at the middle bottom the text baseline is at the bottom hanging used mostly in indic scripts the baseline is at the top hanging alphabetic the default alphabetic baseline ideographic used mostly in East Asian scripts the baseline is below any letters which protrude under the alphabetic baseline To see what this looks like imagine we had the following code ctx font bold px Arial ctx fillStyle white ctx textBaseline top ctx fillText Top Baseline ctx textBaseline middle ctx fillText Middle Baseline ctx textBaseline bottom ctx fillText Bottom Baseline ctx textBaseline hanging ctx fillText Hanging Baseline ctx textBaseline alphabetic ctx fillText Alphabetic Baseline ctx textBaseline ideographic ctx fillText Ideographic Baseline We would end up with something that looks like this where the red line represents the text baseline Wrapping TextWrapping text in HTML canvas is a little trickier than in other places since there is no built in text wrap function in HTML Canvas If you want to learn about wrapping text read my article on that here ConclusionText is frequently used in HTML Canvas so it s really useful to know how it works This article has covered everything you need to know to start drawing text on your HTML Canvas Don t forget to read my full guide on HTML Canvas here |
2022-03-24 16:36:00 |
海外TECH |
DEV Community |
The Story Behind Our Open Source Ecommerce Platform with +9,000 GH stars in 6 months |
https://dev.to/medusajs/the-story-behind-our-open-source-ecommerce-platform-with-9000-gh-stars-in-6-months-28id
|
The Story Behind Our Open Source Ecommerce Platform with GH stars in monthsMedusa has risen quickly in popularity over the past months getting starts on GitHub in only months On March th Sebastian Rindom the CEO amp Co founder of Medusa did an interview with Flagsmith where he talked about how Medusa started why create a headless commerce solution why make it open source and more This article sums up the main points of the interview but you can take a listen or read the transcript on Flagsmith s website for the full story The frustrations with current platformsReally the start of Medusa came out of frustrations with the current platforms in the market Sebastian CEO and co founder and Oliver CTO and co founder had both worked with several ecommerce platforms before e g Shopify WooCommece Magento but had found that these solutions forced them into pursuing hacky workarounds every time customizations were to be done “We had customers who wanted to have customized experiences on their site At that point it can get a bit tricky depending on the solution you are working with but also how well the API is designed to accommodate these customizations There are many popular ecommerce platforms that provide the entire shopping experience most businesses look for However the common factor between the platforms is that with time they prove to be hard to scale Another issue Sebastian and Oliver experienced was how hard it can be to customize these platforms A lot of times as a developer you would need to do cumbersome workarounds on existing solutions to meet clients requirements when building new functionality “As a developer it hurts your heart a bit because you know what is going on behind the scenes It is more of a hack than real software development With frustrations piling up the team was happy to one day get a chance to build a setup that worked in the way they thought a developer friendly setup should Building Bespoke for TeklaSebastian and Oliver got in the client Tekla that was interested in creating a scalable bespoke solution for their business This client wanted a platform that would solve previous problems they encountered while also scaling with the business growth “They wanted to have a platform that they could grow with over time They were very ambitious about where they wanted to be From the get go they wanted something that could support them throughout the lifetime of their business This client gave them the opportunity to create a platform that they ve always dreamed of having and using Even though at first they didn t have the headless commerce architecture in mind they knew that they wanted to resolve the main issues they struggled with when working with other platforms from a developer perspective They worked with many different programming languages previously but they chose to create a Node js ecommerce solution because they liked how easy it would be switching from working on the backend to the frontend “We have been working on Medusa for years but have only started talking publicly about it We have been battle testing it and working closely with our clients even sitting in their offices to make sure that we would be there every time something could go wrong ready to figure out what and how we could improve going forward Tekla not only benefited from the robust and flexible solution Sebastian and Oliver were creating but they also benefitted from it being open source The open sourcing meant that Tekla over time would benefit from community members testing using and contributing to the platform as a whole Abstraction Based ArchitectureSebastian and Oliver started off with the intention to build one huge platform that combines all the ecommerce and CMS functionalities a business like Tekla could dream of The problem with that however is that it can t be done all at once As they picked it apart they realized that they could abstract all these different components That way they can make use of other existing services whether CMS payment fulfillment or any other services they wanted to be able to cater for different solutions “Every time we had to take one of these things apart we were always thinking in abstractions “What if our client wants to move to the upgraded version of the integration they have How are we going to make that super easy An example of this is adding a CMS system into the platform A full fledged CMS system is a lot of work on its own and would be time consuming They then started thinking “what if instead clients or developers can integrate existing headless CMS solutions like Contentful or Strapi into the platform to add all these advanced functionalities This abstraction would give businesses and developers more flexibility in choosing their CMS systems All we have to do is ensure that they can make this integration easily without any hacky solutions As they added these different abstract layers based on integrating them to other headless solutions they realized that the solution was becoming a headless commerce solution “The notion of headless came with us finding headless CMS solutions We did not realize that what we were building was headless eCommerce Someone came to us and said “You are building headless eCommerce We realized that is true Next step Open Sourcing the SolutionAfter working on this platform for Tekla ew merchants started showing interest for using their platform This was the point where Sebastian and Oliver noticed that this platform could be helpful to a much broader audience After all the problems they faced when using other platforms were problems that other developers faced as well They decided to shift the focus from building specific client solutions towards instead aiming to make the best developer focused ecommerce platform out there And the best way to do that is by working with other developers to test and build this platform So they decided to open source Medusa Open source creates a give and take relationship with people across the world It opens the door for more people to use your solution which means more people are testing the code and contributing to it “We love open source It is amazing that we can share code with everyone across the world and borrow from others It is a huge benefit to innovation in general Nowadays Medusa has a rapidly growing community now members that exchanges ideas daily over Discord and helps onboard new users This is likewise a place the two founders frequent daily to make sure people have a great experience with the software The open source part of the solution also means that you have even more freedom to shape your store into what you want As Medusa has an MIT license you can take Medusa as is and build on top of it or you can take it apart removing and adding components as you see fit “We would love to see other companies build with Medusa as the order engine in their software you would reach Medusa build this application and monetize it without worrying about paying us What s Next for MedusaWe re working hard to add more features and functionalities to Medusa We are focused on making sure that our APIs are incredibly good so that developers and businesses can comfortably start working with Medusa to build their online store If you want to get started with Medusa be sure to check out our GitHub repository for a quickstart guide to get your store up and running in minutes |
2022-03-24 16:32:41 |
海外TECH |
DEV Community |
Forem for Android is Here! 🤖 |
https://dev.to/devteam/forem-for-android-is-here-38ik
|
Forem for Android is Here Today I m excited to share that the Forem app for Android is now available for download and immediate use This fantastic news comes after months of beta testing and collecting valuable feedback from Forem Creators DEV moderators amp Trusted Users on DEV We re so proud of this mobile app built for the many Android users that are part of DEV CodeNewbie Community and the entire Forem ecosystem Much like the Forem iOS app our Android app is meant to help you move through your day without sacrificing smooth access to new articles podcasts and discussions across any Forem community you re a member of With a more seamless experience and a wider world of Forem access at your fingertips we see our Android app as a huge improvement from the now discontinued DEV app gt gt Download the Forem Android App today Here are some of the features you ll get with the Forem iOS amp Android apps Discover preview amp join new Forem communitiesBrowse the list of available public Forems or add a privately listed Forem you belong to Tap into each for a preview before you decide to join Access both public and private ForemsOur dropdown menu or left right swiping functionality allows you to explore different communities through one central list Browse mobile optimized contentArticles discussions and podcasts on public Forems are available for your enjoyment ーwhether you re a member of them or not Share images on the goPost while the inspiration strikes with our mobile image uploader Stay up to date with the latest activitiesPush notifications keep you in the loop with the latest news about your posts comments and network and lots more Ready to get started with Forem on mobile Download Forem for Android and iOS today Let us know what you think of our apps If you love them we hope you ll consider leaving us a five star review ️️️️️ |
2022-03-24 16:30:13 |
海外TECH |
DEV Community |
At Luos, our CI (Continuous Integration) workflow is simple. |
https://dev.to/luos/at-luos-our-ci-continuous-integration-workflow-is-simple-160j
|
At Luos our CI Continuous Integration workflow is simple At Luos our CI Continuous Integration workflow is simple Thanks to a few tools Github Actions and PlatformIO automatic unit tests permit us to increase our code quality every day Do you want to test your feature Check out our read me file on Github |
2022-03-24 16:27:44 |
海外TECH |
DEV Community |
Adding an Animated Dark Theme Toggle to your website |
https://dev.to/alfiejones/adding-an-animated-dark-theme-toggle-to-your-website-3018
|
Adding an Animated Dark Theme Toggle to your websiteHaving a Dark and Light mode to your website is becoming more and more popular I m proud to say I have build an opensource project which provides a collection of elegant and functional toggles The library currently has official support for React but can be easily used in any framework All the togglesGithub Adding to a websiteI m going to show you how to add the Classic toggle to a website If you re using react see below Firstly we need to copy the HTML code from toggles devWe re going to use the button and at the time of writing it looks like this lt button class theme toggle type button title Toggle theme aria label Toggle theme gt lt svg xmlns aria hidden true width em height em fill currentColor stroke linecap round class theme toggle classic viewBox gt lt clipPath id theme toggle classic cutout gt lt path d M ha vHZ gt lt clipPath gt lt g clip path url theme toggle classic cutout gt lt circle cx cy r gt lt g stroke currentColor stroke width gt lt path d M v gt lt path d M v gt lt path d M h gt lt path d M h gt lt path d m gt lt path d m gt lt path d m gt lt path d m gt lt g gt lt g gt lt svg gt lt button gt We then want to make sure we have the CSS Find the latest versions from JSDELIVR and add it to your Head lt head gt lt link rel stylesheet href css classic min css integrity sha ILVFUnh ImxX MnykqVnowoWNCuskhdKSuoOOrago crossorigin anonymous gt lt head gt Now all we need to do is apply the toggled class when the theme is dark The button will toggle when it has the class theme toggle toggled This should be toggled via JavaScript And that s it ReactIf you re using react it s even easier to get the toggles up and running See how to use the react package here |
2022-03-24 16:25:58 |
海外TECH |
DEV Community |
Applying Koa's onion model to front-end requests |
https://dev.to/molvqingtai/applying-koas-onion-model-to-front-end-requests-356p
|
Applying Koa x s onion model to front end requestsCurrently most front end request libraries use two hooks functions to handle requests and responses which becomes difficult to maintain when we add too much business logic to the request The onion model is a very elegant technique for handling requests and responses and we have a very mature application for it in node development so why don t I let the front end requests change to this way as well Here is a simple prototype example Composer param fuction funcs middleware list return function args gt f f f args const compose funcs gt funcs reduce a b gt args gt a b args middlewaresconst middleware next gt async req gt console log const res await next req console log return res const middleware next gt async req gt console log const res await next req console log return res const middleware next gt async req gt console log const res await next req console log return res This can be replaced with fetch XMLRequest const adapter params gt console log request mock ruquest return Promise resolve Hello params username I m mock data Http method const get async path params gt const dispatch compose middleware middleware middleware return dispatch adapter path params Mock login const login async gt const res await get api login username John console log res login Login output request Hello John I m mock data Change one request processing to middleware e g error interception event tracking refresh token etc Each function is a separate middleware there is no coupling between them we can easily remove or add a middleware and the code will work fineWe no longer have to split the logic at a request into two separate hooks methodsI think this is a perfect way to intercept requests and I ve turned this idea into a projectIt looks like this import Resreq from resreq const resreq new Resreq baseUrl Intercepting responses and requests using middlewareresreq use next gt async req gt try console log req Request can be changed here const res await next req console log res Response can be changed here return res catch error console log error Catch errors here throw error const res await resreq get api params foo bar console log res json Github |
2022-03-24 16:23:35 |
海外TECH |
DEV Community |
Testing iframes with Playwright |
https://dev.to/debs_obrien/testing-iframes-with-playwright-328b
|
Testing iframes with PlaywrightHave you ever had to test something in an iframe on your page with end to end testing Even testing the play button of an embedded video used to be difficult but then along came Playwright reliable end to end testing for modern web apps Let s take a look at how Playwright can help you test iframes If you are new to testing with Playwright you might want to check out my previous post Getting Started with Playwright to get a better understanding of how Playwright works and how to easily get started with this amazing tool LocatorsBefore we dive into testing iframes let s first understand how Playwright works when it comes to using locators A locator is a way to find element s on the page at any moment with built in auto waiting and retry ability That means no set timeouts are needed as Playwright will auto wait for the element to appear including iframes Locators are created with the page locator selector options method Strict by defaultLocators are strict by default meaning it will throw an error if it finds more than one await page locator button click So imagine this scenario where we have many buttons on the page If there is more than one button element on the page then the test will fail as it won t know which button you want it to click on Locators firstThere are many ways to fix this but one example is to choose the first instance of the button await page locator button first click Locators nth childAnother option is to use the CSS nth child selector This will select the element that is the nth child of it s parent In this case the first one await page locator div nth child button click Locators hasTextAnother options is using HasText which is case insensitive substring matching and accepts both strings and regular expressions This means we can search in every div with the class of shoes card and find the one which has the text Guchi and locate the button inside of it await page locator shoes card hasText Guchi locator button click Locators has Another option similar to the one above is to use the has option which makes sure it contains another locator inside of it await page locator shoes card has page locator text Guchi locator button click To show you another example of this in action we have a shopping cart page with items in a cart We want to select the remove from cart button to make sure we can remove a specific item from the cart Again we use the has option to find the row that has the a locator this time using the image alt selector with the value of Guchi Our locator now concentrates only inside this one row and locates the button with the aria label of remove from cart Again we need to be careful of strict mode and ensure we really only have one image alt with the value of Guchi otherwise our test will fail Frame LocatorsWhen testing iframes we can use the FrameLocator which allows us to retrieve the iframe and locate elements inside that iframe For example we could test a play or pause button from a youTube video embedded on your page FrameLocator can be created with either page frameLocator selector or locator frameLocator selector method await page frameLocator iframe locator aria label Pause click Just like with locators Frame locators are also strict so this test will throw an error if it finds more than one iframe on the page ConclusionAnd thats how you can use locators and frame locators to test iframes on a page Have fun testing and as always reach out if you have any questions or comments Useful LinksPlaywright docsCodegenVS Code ExtensionFrameLocatorGetting Started with Playwright |
2022-03-24 16:20:57 |
海外TECH |
DEV Community |
Centralization vs Decentralization |
https://dev.to/suprabhasupi/centralization-vs-decentralization-36k5
|
Centralization vs DecentralizationYou have heard about decentralization a lot in Web topic Let s understand centralization and decentralization in deep Decentralization is a core tenet of Web CentralizationCentralization is a form of organizational structure where the decision making capability rests with the top management Useful Higher performance and easier to implementSingle point of failure malicious actors may be able to take down the network by targeting the central authority Participation in the network is controlled by the central authority DecentralizationDecentralization is another form of organizational structure that functions by delegating decision making capabilities to multiple teams across geographies Useful Lower performance and more complex to implementNo single point of failure network can still function even if a large proportion of participants are attacked taken out Anyone can participate in the network there are no “gatekeepers Ideally the cost of participation is very low Twitter Ebooks Instagram |
2022-03-24 16:19:28 |
海外TECH |
DEV Community |
Flutter Fix Warning Mapping new ns to old ns |
https://dev.to/codebangkok/flutter-fix-warning-mapping-new-ns-23ia
|
Flutter Fix Warning Mapping new ns to old ns ปัญหา รันFlutter โปรเจ็คAndroid แล้วขึ้นwarningFlutter Dart DevTools Warning Mapping new ns to old ns Warning Mapping new ns to old ns Warning Mapping new ns to old ns Warning Mapping new ns to old ns Warning Mapping new ns to old ns สาเหตุ โปรเจ็คandroid ใช้gradle version วิธีแก้ปัญหา อัพเกรดไปใช้gradle verion ขึ้นไป ตรวจสอบเวอร์ชั่นgradle ได้ที่ แก้ไขได้ที่ไฟล์android build gradle ผมเลือกใช้เป็น เมื่อสั่งflutter run ปัญหาต่อมาคือไฟล์gradle ต้องใช้เวอร์ชั่น ขึ้นไป ปัจจุบันเป็น ตรวจสอบเวอร์ชั่นไฟล์gradle ได้ที่ ไม่ต้องดาวน์โหลดนะ แก้ไขได้ที่ไฟล์android gradle wrapper gradle wrapper properties ผมเลือกเวอร์ชั่น เมื่อสั่งflutter run ปัญหาต่อมาก็คือEnvironment Variable ที่ผมเคยใช้คือANDROID SDK HOME มันdeprecated ไม่สามารถใช้ได้แล้ว ต้องไปเปลี่ยนให้ใช้ANDROID HOME แทนแค่ตัวเดียว ตัวอย่างนี้ผมใช้macOS แก้ไขไฟล์ zshrc และต้องยกเลิกตัวอื่นที่ใช้ให้หมดด้วยนะexport ANDROID HOME HOME Library Android sdk export ANDROID SDK HOME HOME Library Android sdk ปิดแล้วเปิดvscode แล้วลองรันflutter run อีกครั้งก็จะไม่มีwarning แล้ว ติดตามผลงานได้ที่Page Group Blog YouTube |
2022-03-24 16:17:34 |
Apple |
AppleInsider - Frontpage News |
Discover Samsung Deals Event: save up to $1,700 on TVs, soundbars, Galaxy devices, Z Flip & Fold phones, more |
https://appleinsider.com/articles/22/03/24/discover-samsung-deals-event-save-up-to-1700-on-tvs-soundbars-galaxy-devices-z-flip-fold-phones-more?utm_medium=rss
|
Discover Samsung Deals Event save up to on TVs soundbars Galaxy devices Z Flip amp Fold phones moreSamsung s weeklong spring sale is here and it s chock full of deep discounts on a variety of smartphones tablets kitchen appliances and everything you could need in a connected home Samsung gaming monitor robotic vacuum and speakers are all discountedThe Discover Samsung event will feature a variety of new promotions with Offers of the Day and special Bundle Deals up for grabs all week long Each day through March new deals will go live at a m ET and will remain until a m the next day These deals aren t likely to last long so act fast if you don t want to miss out Read more |
2022-03-24 16:25:24 |
海外TECH |
Engadget |
London police arrest seven people over Lapsus$ hacks |
https://www.engadget.com/london-police-arrests-over-lapsus-hacks-162634421.html?src=rss
|
London police arrest seven people over Lapsus hacksAuthorities are quickly cracking down on the Lapsus hacking group that allegedly compromised Microsoft and Okta BBC Newsreports City of London Police have arrested seven people aged to over connections to Lapsus The police didn t name the older people facing charges but said they d been released quot under investigation quot More details appear to have surfaced around one of the leaders A year old Oxford boy known as quot Breachbase quot or quot White quot has supposedly made the equivalent of million in Bitcoin up to this point and was apparently outed after business partners doxxed him following a dispute Researchers have been following him for almost a year Bloombergadded The teen made multiple mistakes that helped researches trail his activity across online accounts Lapsus claimed to have obtained GB in Microsoft source code for projects like Bing Cortana and mobile apps They also tried to compromise Okta s customer support in January and posted images they said showed the company s internal systems Microsoft acknowledged that the hackers had limited access to its network while Okta indicated there was no hostile action beyond the January incident The arrests won t necessarily put a stop to Lapsus when the group is believed to call South America its home They may chill the organization s activity and rapidly growing buzz though Lapsus has quickly garnered attention due to major targets like Microsoft and its Telegram channel now has members ーthe busts won t exactly encourage copycat attacks |
2022-03-24 16:26:34 |
Cisco |
Cisco Blog |
IE Switching “Experience Matters” |
https://blogs.cisco.com/internet-of-things/ie-switching-experience-matters
|
development |
2022-03-24 16:00:48 |
海外科学 |
NYT > Science |
High Death Rate in Hong Kong Shows Importance of Vaccinating the Elderly |
https://www.nytimes.com/2022/03/21/health/covid-hong-kong-deaths.html
|
High Death Rate in Hong Kong Shows Importance of Vaccinating the ElderlyCovid has surged in a number of Asian countries that had once held the virus at bay Vaccination levels have largely determined how deadly those waves would be |
2022-03-24 16:09:50 |
金融 |
RSS FILE - 日本証券業協会 |
会長記者会見−2022年− |
https://www.jsda.or.jp/about/kaiken/kaiken_2022.html
|
記者会見 |
2022-03-24 16:20:00 |
金融 |
金融庁ホームページ |
「特定目的会社の監査に関する規則及び投資法人の会計監査に関する規則の一部を改正する内閣府令(案)」及び「貸金業法施行規則等の一部を改正する内閣府令(案)」に対するパブリックコメントの結果等について公表しました。 |
https://www.fsa.go.jp/news/r3/shouken/20220324.html
|
会計監査 |
2022-03-24 17:00:00 |
金融 |
金融庁ホームページ |
欧州証券市場監督機構との清算機関(CCP)監督協力枠組みに係る覚書の改定について公表しました。 |
https://www.fsa.go.jp/inter/etc/20220324.html
|
清算機関 |
2022-03-24 17:00:00 |
ニュース |
BBC News - Home |
P&O Ferries: Not consulting on job cuts broke law, boss admits |
https://www.bbc.co.uk/news/business-60862933?at_medium=RSS&at_campaign=KARANGA
|
ferry |
2022-03-24 16:00:54 |
ニュース |
BBC News - Home |
RFU boss 'disappointed' by England's Six Nations but sees progress under Jones |
https://www.bbc.co.uk/sport/rugby-union/60862796?at_medium=RSS&at_campaign=KARANGA
|
RFU boss x disappointed x by England x s Six Nations but sees progress under JonesRugby Football Union chief executive Bill Sweeney says he was really disappointed by England s Six Nations but still backs head coach Eddie Jones |
2022-03-24 16:33:08 |
北海道 |
北海道新聞 |
道内サポーターも歓喜 サッカー日本代表、W杯決定 |
https://www.hokkaido-np.co.jp/article/660856/
|
道内 |
2022-03-25 01:23:00 |
北海道 |
北海道新聞 |
小林陵は予選11位で通過 W杯ジャンプ、25日にも総合V |
https://www.hokkaido-np.co.jp/article/660882/
|
通過 |
2022-03-25 01:13:00 |
北海道 |
北海道新聞 |
国連総会が人道決議採択 特別会合、民間人保護訴え |
https://www.hokkaido-np.co.jp/article/660880/
|
国連総会 |
2022-03-25 01:02:00 |
北海道 |
北海道新聞 |
がん終末期、3割に強い痛み 遺族調査、緩和ケアに課題 |
https://www.hokkaido-np.co.jp/article/660879/
|
国立がん研究センター |
2022-03-25 01:02:00 |
コメント
コメントを投稿