AWS |
AWSタグが付けられた新着投稿 - Qiita |
リソースレコードの種類 |
https://qiita.com/hikotaro_san/items/bb20ec0809fd13b7cf0d
|
ゾーンの中には、レコードとという単位でドメイン名とIPアドレスを紐付ける情報を保持しています。 |
2022-01-25 21:01:50 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
Docker Desktop for WindowsをやめてWSL2上のDocker Engineへ移行する |
https://qiita.com/hkato/items/7cf083ee73753162120a
|
catetcgroupgrepdockerdockerxusernameDockerEngineインストールこちらも通常のUbuntuへのインストール手順で起動設定今現在のWSLはSystemdなどからサービス起動が行われないので、シェル起動時に実行する。 |
2022-01-25 21:53:44 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
rails GoogleFont導入仕方 |
https://qiita.com/Takahiro011202/items/3dbe815a47961bba723b
|
railsGoogleFont導入仕方はじめにRailsのHTMLCSSに対して、GoogleFont適用するつの方法を学んでもらうのがこの記事のゴールだよまずは、GoogleFontのサイトから使用するFontを選ぶGoogleFontのサイト↑ここからサイトへ飛びますそしたら上記のページに行くと思います。 |
2022-01-25 21:21:53 |
海外TECH |
MakeUseOf |
5 No-Hassle Ways to Connect a Microphone to Your PC |
https://www.makeuseof.com/tag/ways-connect-microphone-pc/
|
external |
2022-01-25 12:35:11 |
海外TECH |
MakeUseOf |
Struggling to Learn a New Language? These 5 Chrome Extensions Can Help |
https://www.makeuseof.com/chrome-extensions-learn-new-language/
|
Struggling to Learn a New Language These Chrome Extensions Can HelpIf you ve been struggling to learn a new language here are five Chrome extensions that can help by bringing the language into your browsing |
2022-01-25 12:31:42 |
海外TECH |
MakeUseOf |
What Is a Staking Pool and Can You Earn With One? |
https://www.makeuseof.com/what-is-a-staking-pool/
|
What Is a Staking Pool and Can You Earn With One If you don t have a large portfolio staking pools serve as a great way to invest your crypto and make passive income Here s all you need to know |
2022-01-25 12:02:09 |
海外TECH |
DEV Community |
WebScrapperJS - Get Content/HTML of any website without being blocked by CORS even using JavaScript by WhollyAPI |
https://dev.to/sh20raj/webscrapperjs-get-contenthtml-of-any-website-without-being-blocked-by-cors-even-using-javascript-by-whollyapi-42l7
|
WebScrapperJS Get Content HTML of any website without being blocked by CORS even using JavaScript by WhollyAPI WebScrapperJSWebScrapperJS Get Content HTML of any website without being blocked by CORS even using JavaScript by WhollyAPI Website GitHub Repl it Dev to Article Grab the CDN or Download the JavaScript File lt script src gt lt script gt To Get HTML Content of Any Websitevar url var html WebScrapper gethtml url html of the url will be stored in this variableconsole log html Intialise own WebScrapper with URLlet MyWebScrapper new scrapper You can now directly call gethtml instead of passing a url into it console log MyWebScrapper gethtml Grab and print on consoleStill you can Use new created scrapper MyWebScrapper for grabbing new URLs Likelet MyWebScrapper new scrapper You can now directly call gethtml instead of passing a url into it console log MyWebScrapper gethtml Grab and print on consoleconsole log MyWebScrapper gethtml Grab and print on console |
2022-01-25 12:45:22 |
海外TECH |
DEV Community |
Building Video Chat App with VueJs and Golang |
https://dev.to/100mslive/building-video-chat-app-with-vuejs-and-golang-2367
|
Building Video Chat App with VueJs and GolangIt has become very clear that the future of work will be fully remote or a hybrid A lot of companies would have to use or develop tools to enhance their communication and remotely provide services to their customers This content was originally published HEREIn this article we will demonstrate how easy it is to build a video chat application with ms SDKs in VueJs using TypeScript and Netlify functions in Golang Tailwindcss will be used for the styles At the end of the tutorial this is how our application will look like FeaturesCreating a new room where conversation can take placeJoining a room after generating an authentication tokenMuting and unmuting the audio and video for both Local and Remote Peers Displaying appropriate user interface for the on and off states of the audio and video Prerequisitesms live account You ll need to get the APP ACCESS KEY and APP SECRET from developer section in the dashboard Familiarity with Golang which we will be using to create new rooms and generate auth tokens A fair understanding of VueJs and its composition API Serverless functions We ll be using Netlify functions in this blog to host our Golang backend Make sure to install the Netlify CLI Project SetupCreate a new VueJs applicationnpm init vite latest vue video chat template vue tscd vue video chatnpm installInitialize a new Netlify app inside the application Follow the prompts after running the following command ntl initInstall ms JavaScript SDK and project dependencies For Tailwindcss follow this installation guide ms SDKs for conferencingnpm install mslive hms video store Axios for making API callsnpm install axios Setup tailwindcss for styling A tailwind plugin for formsnpm install tailwindcss formsAdd a netlify toml file and add the path to the functions directory Let s tell Netlify about the directory where we ll keep the serverless functions functions directory hms functions Create Netlify functions createRoom and generateAppToken inside a directory named hms functions inside the root directory of the project i e vue video chatmkdir hms functionscd hms functionsntl functions create name createRoom ntl functions create name generateAppToken Rest APIS For Room and TokenThere are two things we want to have APIs for The first is create room which will be invoked when a user wants to create a new room The second is auth token which will be invoked when a user wants to join the room The auth token is necessary to let ms allow the join Let s start with the Room Creation EndpointNavigate to the createRoom directory and install the following libraries cd hms functions createRoomgo get github com golang jwt jwt v v go get github com google uuid v go mod tidyThis endpoint will take the room name as an input which will be used while creating the room ms ensures that we can only create one room with a name So if we try to create it the next time we ll get the same room as earlier We ll use this feature by calling the same creation endpoint from our UI while both creating the room and joining an existing one The endpoint does the following Generates a management token in the generateManagementToken function which is used for authorisation while creating the room Creates a room using the management token and the passed in room name Add the following to hms functions createRoom main gopackage mainimport bytes context encoding json errors io ioutil net http strings time os github com aws aws lambda go events github com aws aws lambda go lambda github com golang jwt jwt v github com google uuid type RequestBody struct Room string json room management tokenfunc generateManagementToken string appAccessKey os Getenv APP ACCESS KEY appSecret os Getenv APP SECRET mySigningKey byte appSecret expiresIn uint now uint time Now UTC Unix exp now expiresIn token jwt NewWithClaims jwt SigningMethodHS jwt MapClaims access key appAccessKey type management version jti uuid New String iat now exp exp nbf now Sign and get the complete encoded token as a string using the secret signedToken token SignedString mySigningKey return signedToken func handleInternalServerError errMessage string events APIGatewayProxyResponse error err errors New errMessage return amp events APIGatewayProxyResponse StatusCode http StatusInternalServerError Headers map string string Content Type application json Body Internal server error err func handler ctx context Context request events APIGatewayProxyRequest events APIGatewayProxyResponse error var f RequestBody managementToken generateManagementToken b byte request Body err json Unmarshal b amp f if err nil return amp events APIGatewayProxyResponse StatusCode http StatusUnprocessableEntity errors New Provide room name in the request body postBody json Marshal map string interface name strings ToLower f Room active true payload bytes NewBuffer postBody roomUrl os Getenv ROOM URL method POST client amp http Client req err http NewRequest method roomUrl payload if err nil return handleInternalServerError err Error Add Authorization header req Header Add Authorization Bearer managementToken req Header Add Content Type application json Send HTTP request res err client Do req if err nil return handleInternalServerError err Error defer res Body Close resp err ioutil ReadAll res Body if err nil return handleInternalServerError err Error return amp events APIGatewayProxyResponse StatusCode res StatusCode Headers map string string Content Type application json Body string resp IsBaseEncoded false nil func main start the serverless lambda function for the API calls lambda Start handler Token Generation EndpointNow that we have an API to create a room we ll also need to allow for users to join them ms requires an app token to authorise a valid join Navigate to the generateAppToken directory and install the following libraries cd hms functions generateAppTokengo get github com golang jwt jwt v v go get github com google uuid v go mod tidyThis endpoint accepts the following params user id This is meant to be used to store the reference user id from our system but as we don t have any we ll simply use the name as user id in our UI room id The room id which the user wants to join role The role you want to assign to a user while joining the video chat For e g host or guest This decides what all permissions they ll have post joining The following code accepts the params listed above and returns a JWT token with a day expiration period which will be used when joining a video call Add the following code to hms functions generateAppToken main go package mainimport context encoding json errors net http os time github com aws aws lambda go events github com aws aws lambda go lambda github com golang jwt jwt v github com google uuid type RequestBody struct UserId string json user id RoomId string json room id Role string json role func handler ctx context Context request events APIGatewayProxyRequest events APIGatewayProxyResponse error var f RequestBody b byte request Body err json Unmarshal b amp f if err nil return amp events APIGatewayProxyResponse StatusCode http StatusUnprocessableEntity errors New Provide user id room id and room in the request body appAccessKey os Getenv APP ACCESS KEY appSecret os Getenv APP SECRET mySigningKey byte appSecret expiresIn uint now uint time Now UTC Unix exp now expiresIn token jwt NewWithClaims jwt SigningMethodHS jwt MapClaims access key appAccessKey type app version room id f RoomId user id f UserId role f Role jti uuid New String iat now exp exp nbf now Sign and get the complete encoded token as a string using the secret signedToken err token SignedString mySigningKey if err nil return amp events APIGatewayProxyResponse StatusCode http StatusInternalServerError Headers map string string Content Type application json Body Internal server error err return the app token so the UI can join return amp events APIGatewayProxyResponse StatusCode http StatusOK Headers map string string Content Type application json Body signedToken IsBaseEncoded false nil func main lambda Start handler The UIThe UI is made up of a form where users will enter some details to join a room and where their video and audio streams will be displayed when they successfully join the same room for the video chat Utility functions to make the API requests Create types ts to contain our type definitions Inside the project s root directorytouch src types ts Add the following code to types tsexport type HmsTokenResponse user id String room id String token String Create hms ts which will contain the utility functions and initiate ms SDK instances We initialise the HMSReactiveStore instance and create the following hmsStore For accessing the current room state who all are there in the room and if their audio video is on hmsActions For performing actions in the room like muting and unmuting The FUNCTION BASE URL is the base url for hitting the Netlify functions fetchToken This function is used for creating the room followed by generating the authToken which will be used when joining the video chat We ll set the role to host in all cases for simplicity Roles can be used to decide the set of permissions a user will have if required this code will be in src hms tsimport axios from axios import HMSReactiveStore from mslive hms video store import HmsTokenResponse from types const FUNCTION BASE URL netlify functions const hmsManager new HMSReactiveStore store will be used to get any state of the room actions will be used to perform an action in the roomexport const hmsStore hmsManager getStore export const hmsActions hmsManager getActions export const fetchToken async userName string roomName string Promise lt HmsTokenResponse any gt gt try create or fetch the room id for the passed in room const data room await axios post FUNCTION BASE URL createRoom room roomName headers Content Type application json Generate the app authToken const data token await axios post FUNCTION BASE URL generateAppToken user id userName room id room id role host headers Content Type application json return token catch error any throw error Add a form where users enter their details to join the video chat in a file named join vueThis is a simple form where users enter their username and the room they want to join for the video call joinHmsRoom This function calls the fetchToken method and uses the response to join the room with hmsActions join method All users who join will have their audio muted by default as we have set isAudioMuted true Add the following to src components Join vue lt script setup lang ts gt import reactive ref from vue import fetchTokens hmsActions from hms const defaultRoomName import meta env VITE APP DEFAULT ROOM const isLoading ref false const formData reactive name room defaultRoomName const joinHmsRoom async gt try isLoading value true const authToken await fetchToken formData name formData room hmsActions join userName formData name authToken authToken settings isAudioMuted true Join with audio muted catch error alert error isLoading value false lt script gt lt template gt lt div class mt sm mx auto sm w full sm max w md gt lt div class bg white py px shadow sm rounded lg sm px gt lt form class space y submit prevent joinHmsRoom gt lt div gt lt label for name class block text sm font xl text gray gt Name lt label gt lt div class mt gt lt input id name name name type text autocomplete username required v model formData name class appearance none block w full px py border border gray rounded md shadow sm placeholder gray focus outline none focus ring indigo focus border indigo sm text sm gt lt div gt lt div gt lt div gt lt label for room class block text sm font medium text gray gt Room lt label gt lt div class mt gt lt input id room name room type text required disabled v model formData room class appearance none block w full px py border border gray rounded md shadow sm placeholder gray focus outline none focus ring indigo focus border indigo sm text sm disabled cursor not allowed gt lt div gt lt div gt lt div gt lt button type submit disabled formData name isLoading class cursor not allowed isLoading class w full flex justify center py px border border transparent rounded md shadow sm text sm font medium text white bg indigo hover bg indigo focus outline none focus ring focus ring offset focus ring indigo gt lt svg class animate spin mr h w text white xmlns fill none viewBox v if isLoading gt lt circle class opacity cx cy r stroke currentColor stroke width gt lt circle gt lt path class opacity fill currentColor d M a VC hzm A Hc l z gt lt path gt lt svg gt isLoading Joining Join lt button gt lt div gt lt form gt lt div gt lt div gt lt template gt Create the component where the video streams will be displayed named conference vueThe hmsStore as I mentioned earlier contains the various states provided by ms for a video chat The subscribe method provides a very easy way to get the value for the various states All you need to do is subscribe a state and attach a handler function to process the state changes from the given selector hmsStore getState also accepts a state selector to get the value at a point in time We ll be using it at places where reactivity is not required We use selectors to determine the audio and video states for the Local and Remote Peers Explanation of the various methods used onAudioChange A handler for when the local peer mutes unmutes audioonVideoChange A handler for when the local peer mutes unmutes videoonPeerAudioChange A handler for when the remote peer mutes unmutes audioonPeerVideoChange A handler for when the remote peer mutes unmutes videotoggleAudio amp toggleVideo Function to mute unmute local audio and videorenderPeers This is a handler that detects Peer addition and removal via the selectPeers selector For every peer that connects their video stream is displayed with the hmsActions attachVideo method For a RemotePeer we subscribe to their audio and video s muted states with the selectIsPeerAudioEnabled and selectIsPeerVideoEnabled selectors The detected changes trigger the respective UI change Add the following to src components Conference vue lt script setup lang ts gt import ref reactive onUnmounted from vue import selectPeers HMSPeer HMSTrackID selectIsLocalAudioEnabled selectIsLocalVideoEnabled selectIsPeerAudioEnabled selectIsPeerVideoEnabled from mslive hms video store import hmsStore hmsActions from hms const videoRefs any reactive const remotePeerProps any reactive const allPeers ref lt HMSPeer gt const isAudioEnabled ref hmsStore getState selectIsLocalAudioEnabled const isVideoEnabled ref hmsStore getState selectIsLocalVideoEnabled enum MediaState isAudioEnabled isAudioEnabled isVideoEnabled isVideoEnabled onUnmounted gt if allPeers value length leaveMeeting const leaveMeeting gt hmsActions leave const onAudioChange newAudioState boolean gt isAudioEnabled value newAudioState const onVideoChange newVideoState boolean gt isVideoEnabled value newVideoState const onPeerAudioChange isEnabled boolean peerId string gt if videoRefs peerId remotePeerProps peerId MediaState isAudioEnabled isEnabled const onPeerVideoChange isEnabled boolean peerId string gt if videoRefs peerId remotePeerProps peerId MediaState isVideoEnabled isEnabled const renderPeers peers HMSPeer gt allPeers value peers peers forEach peer HMSPeer gt if videoRefs peer id hmsActions attachVideo peer videoTrack as HMSTrackID videoRefs peer id If the peer is a remote peer attach a listener to get video and audio states if peer isLocal Set up a property to track the audio and video states of remote peer so that if remotePeerProps peer id remotePeerProps peer id remotePeerProps peer id MediaState isAudioEnabled hmsStore getState selectIsPeerAudioEnabled peer id remotePeerProps peer id MediaState isVideoEnabled hmsStore getState selectIsPeerVideoEnabled peer id Subscribe to the audio and video changes of the remote peer hmsStore subscribe isEnabled gt onPeerAudioChange isEnabled peer id selectIsPeerAudioEnabled peer id hmsStore subscribe isEnabled gt onPeerVideoChange isEnabled peer id selectIsPeerVideoEnabled peer id const toggleAudio async gt const enabled hmsStore getState selectIsLocalAudioEnabled await hmsActions setLocalAudioEnabled enabled const toggleVideo async gt const enabled hmsStore getState selectIsLocalVideoEnabled await hmsActions setLocalVideoEnabled enabled rendering again is required for the local video to show after turning off renderPeers hmsStore getState selectPeers HMS ListenershmsStore subscribe renderPeers selectPeers hmsStore subscribe onAudioChange selectIsLocalAudioEnabled hmsStore subscribe onVideoChange selectIsLocalVideoEnabled lt script gt lt template gt lt main class mx min h vh gt lt div class grid grid cols gap sm grid cols lg grid cols my gt lt div v for peer in allPeers key peer id class relative gt lt video autoplay muted peer isLocal playsinline class h full w full object cover ref el gt if el videoRefs peer id el gt lt video gt lt p class flex justify center items center py px text sm font medium bg black bg opacity text white pointer events none absolute bottom left gt lt span class inline block w v show peer isLocal amp amp isAudioEnabled peer isLocal amp amp remotePeerProps peer id MediaState isAudioEnabled gt lt svg viewBox xmlns gt lt path stroke FFF fill FFF d m va v h va vh vhv h v a v z gt lt path stroke FFF fill FFF d m a v a va z gt lt path d m hvh z fill none gt lt svg gt lt span gt lt span class inline block w v show peer isLocal amp amp isAudioEnabled peer isLocal amp amp remotePeerProps peer id MediaState isAudioEnabled gt lt svg viewBox xmlns gt lt path fill FFF d m a l a v l a vh vhv h v a v h z gt lt path fill FFF d m c v h va z gt lt path fill FFF d m a vz gt lt path d m hvh z fill none gt lt svg gt lt span gt lt span class inline block gt peer isLocal You peer name peer name lt span gt lt p gt lt p class text white text center absolute top right left v show peer isLocal amp amp isVideoEnabled peer isLocal amp amp remotePeerProps peer id MediaState isVideoEnabled gt Camera Off lt p gt lt div gt lt div gt lt div class mx auto mt flex items center justify center v if allPeers length gt lt button class bg teal text white rounded md p block click toggleAudio gt isAudioEnabled Mute Unmute Microphone lt button gt lt button class bg indigo text white rounded md p block mx click toggleVideo gt isVideoEnabled Mute Unmute Camera lt button gt lt button class bg rose text white rounded md p block click leaveMeeting gt Leave Meeting lt button gt lt div gt lt div v else gt lt p class text white text center font bold text xl gt Hold On Loading Video Tiles lt p gt lt div gt lt main gt lt template gt Add the components to App vueWe subscribe to the selectRoomStarted state to know when the join has completed and show the Conference component If room has not started we ll show the the Join component lt script setup lang ts gt import ref from vue import selectRoomStarted from mslive hms video store import hmsStore from hms import Join from components Join vue import Conference from components Conference vue const isConnected ref false const onConnection connectionState boolean undefined gt isConnected value Boolean connectionState hmsStore subscribe onConnection selectRoomStarted lt script gt lt template gt lt div class min h full flex flex col justify center py sm px lg px gt lt div class sm mx auto sm w full sm max w md gt lt img class mx auto block h w auto src alt ms gt lt h class mt text center text xl font extrabold text white gt Kofi Mupati Video Call Meeting lt h gt lt div gt lt Conference v if isConnected gt lt Join v else gt lt div gt lt template gt Add Environment variablesUpdate the following environment variables in the env file Note that I ve set a default room name to prevent room creation every time we try to join a video chat For other people to join the video chat they must use the same room name ROOM URL APP ACCESS KEY your hms app access key from dashboardAPP SECRET your hms app secret from dashboardVITE APP DEFAULT ROOM kofi mupati secret room Testing the ApplicationRun the application locally with the Netlify cli The application will open on the following port http localhost ntl devOpen two browsers One should be in the regular mode and the other incognito and open the link the application will run on Enter your username and join the video chat Visual learners can watch the application demonstration on YouTube ConclusionYou can find the complete project repository here For me the the ability to simply subscribe to specific states makes the ms SDKs very easy to use The type definitions are great documentations are simple and provide a very good developer experience I hope this tutorial is a very welcoming introduction to the ms live platform and I look forward to the amazing applications you are going to build |
2022-01-25 12:43:35 |
海外TECH |
DEV Community |
How To Handle Alerts And Popups In Protractor With Selenium? |
https://dev.to/mishrapraveen/how-to-handle-alerts-and-popups-in-protractor-with-selenium-2ao5
|
How To Handle Alerts And Popups In Protractor With Selenium There are times in the life cycle of various web applications where you need to interrupt a message to the user These may be warnings alerts or information Browsers have native dialog boxes one that you can show to alert users to these important messages using JavaScript Suppose you fill in an application form and accidentally miss out on a couple of details How do you know this unless there is a notification alert or a pop up window Or If we test a web application using Selenium JavaScript and try logging in to a web site but do not add an email ID or password to the required fields the program sends an alert This is precisely what I will be talking about today I will be performing Selenium test automation using Protractor to handle alerts and pop ups In this Selenium Protractor tutorial I ll explain in detail about handling alerts and pop ups in Selenium If you are not familiar with running test scripts on Selenium Protractor you can refer to our previous article on Automation testing with Selenium Protractor Why Do You Need To Test Alerts And Popups Alerts and pop up are widely used to issue warnings to the user or asking permissions from them They allow us to take user s permission for certain actions on the web page Let s take a scenario to make things simple You want to log in to a website but if you enter the wrong email ID or password to the required fields you ll get an alert stating the wrong email or password Alerts and popups help in establishing user flow in web application and notify them in case something goes wrong this is you should be handling alerts and popups in Selenium There can be several instances that cause an alert to popup in protractors when browsing web pages However the most commonly observed classification of alerts is observed during execution of actions such as To show a message or important alert to the userTo notify the user about an update To show error and notify the user in case of incorrect data entry To show a message on saving of certain information With that said it is important to note that Protractor allows you to automate testing using Selenium to handle alerts and pop ups of your web app Here s a short glimpse of the Selenium JavaScript certification from LambdaTest Handling Alerts in Selenium ProtractorThe purpose of alerts on a webpage is to drive the attention of the user If an alert is present on a webpage the user may have to input operation in order to address such alerts The formation of Alerts on a web page is done utilizing the JavaScript framework The characteristics of alerts often block the source page and force the intended user to read the alert before they can access the web page The Alerts in the protractor framework are not part of a window therefore they cannot be handled by utilization of JavaScript Executor In Alerts one cannot write Xpaths and the same cannot be identified through inspecting tools The characteristic of Alerts block the operation webpage and does not allow the performance of any task on the web page unless the alert is handled on a priority basis If a user attempts to proceed on the webpage without prior handling of the Alert popup then they may receive “Unhandled Alert Error Alerts can be classified into the following types PromptAlertsConfirmation DialogueThese alerts are further explained in detail in this Selenium Protractor tutorial below PromptThe prompt alert is utilized to derive value from the user in a text format It contains a text bar in which the user can input their values This alert type is not commonly used in webpage alerts AlertThis type of alert method ideally displays a message box with an “OK button integrated with the dialogue box This method is utilized with the intent to inform the target user of any specific operational details or changes therewith Examples of alerts can be Successfully Loaded webpage or any other database information alerts The presence of the alert command is solely to inform the user of existing information The command can be created by utilizing alert “message in JavaScript The Alert Pop up can be handled clicking on the “X or “OK command Confirmation DialogueThe confirmation alert is based on the incidence of the dialogue box information being true or false This alert type is embedded with two commands “OK or “Cancel This is a choice based command box in which the user determines the correctness of the information by clicking on “OK or “Cancel Handling Alerts In Selenium Protractor Using Alert ClassIn Alert Class the user is presented with four methods in handling alerts in Selenium Protractor The user may dismiss accept retrieve details or send key values with intent to handle the alerts on a web page Alert Class Methods dismiss accept sendKeys getText First we have to create the object in the Alert Class for handling alerts in Selenium The same can be executed by entering the command Alert alert new Alert Once the object command is executed we need to direct the command to the webpage in which the operation is required to be performed for handling alerts and popups in Selenium This is because the object command merely contains the memory address Next we will direct the browser object to the Alert class so that it identifies the browser Chrome Firefox on which it has to create its operation var abc Alert browser switchTo alert dynamic javascript to switch to alertvar abc browser switchTo alert dismiss Alert Class Methods in Selenium ProtractorThe dismiss alert class method is used to close the alert for handling alerts in Selenium It operates by clicking on the “X button in the prompt This method is functional for all alert types prompt alert and confirmation dialogue box The protractor web driver uses a void dismiss command to cancel the alert driver switchTo alert dismiss The following command is executed for handling alert in Selenium Protractor wit dismiss alert class method import the required modules from the library for handling alerts and popups in Selenium Protractor tutorial import browser element by ExpectedConditions from protractor import Alert from selenium webdriver var script require protractor var webdriver require selenium webdriver var alert new Alert defining the test scenario for the use case in protractor describe Protractor Javascript Selenium Alert Test function ignore synchronization browser ignoreSynchronization true information about the test case it Dismiss Alert types in Protractor function set the wait timeout to secs browser manage timeouts implicitlyWait browser get element by name confirmation click alert browser switchTo alert alert dismiss accept Alert Class Methods in Selenium ProtractorThe accept alert class method is used to accept an alert and continue with the webpage operation The accept alert can be utilized for all JavaScript alert types An alert command can be executed by using the ale variable for handling alerts in Selenium var myAlert browser switchTo alert clicking the OK button will confirm the action myAlert accept The following command is executed for handling alerts and popups in Selenium using accept import the required modules from the library for handling alerts and popups in Selenium Protractor tutorial import browser element by ExpectedConditions from protractor import Alert from selenium webdriver var script require protractor var webdriver require selenium webdriver var myAlert new Alert defining the test scenario for the use case in protractor describe Protractor Javascript Selenium Alert Test function disable synchronization browser ignoreSynchronization true information about the test case it Accept Alert types in Protractor function set the wait timeout to secs browser manage timeouts implicitlyWait browser get element by name alert click myAlert browser switchTo alert clicking the OK button will confirm the action myAlert accept sendKeys Alert Class Methods in Selenium ProtractorThe sendKeys command can help the user to set certain values to the prompt The nature of the sendKeys command is to input value based responses It can handle all the JavaScript based alerts The following command is executed to launch handle sendKeys Alert Class Methods in Protractor import the required modules from the library for handling alerts and popups in Selenium import browser element by ExpectedConditions from protractor import Alert from selenium webdriver var script require protractor var webdriver require selenium webdriver var myAlert new Alert defining the Selenium test automation scenario for handling alerts and popups in Selenium describe Protractor Javascript Selenium Alert Test function browser ignoreSynchronization true disable synchronization it contains information about the test case it Send Keys Alert types in Protractor function set the wait timeout to secs browser manage timeouts implicitlyWait browser get element by name confirmation click myAlert browser switchTo alert set text to the prompt myAlert sendKeys Protractor Test Successful Handling Popups in Selenium ProtractorPopups are windows that pop up on your screen when you perform a certain action on the web application These can be when you download a file or when you enter a password protected website there are several such cases and i ll share them with you in the next section of this Selenium Protractor tutorial While performing Selenium test automation on a web page a tester may needs to be handling popups in Selenium of different types these are Download popupsAuthentication popupsConfirmation popupsAlert popupsHidden Division popupsUpload popupsCalendar popupsNext I ll go into handling popups in Selenium here are some of the popups you should know how to handle Hidden Division PopupsHidden division popup is the newer version of protractor alert that has gained preference with new developers This alert is an HTML code that stays hidden at the beginning of the loading of a webpage The execution of the hidden division pop up is activated by clicking on a pre set trigger tab popups such as contact forms error messages are the most common form of hidden division popups A hidden division popup can be identified by the following characteristics It is not a form of JavaScript pop upIt can integrate another division of pop up with the initial alert dialogue It can be customized to contain a scroll bar for extended content Hidden division popups are customizable and resizableThese popups are locked in a single space and cannot be moved by the user These popups can be inspectedThese popups do not allow the user to operate further until the alert is handled Non handling the popup triggers selenium to throws ElementNotClickableErrorThe complete command for hidden division popups that is executed for handling popups in Selenium import the required modules from the library or handling popups in Selenium import browser element by ExpectedConditions protractor from protractor import Alert from selenium webdriver var script require protractor var webdriver require selenium webdriver var myAlert new Alert defining the Selenium test automation scenario for the use case in protractor for or handling popups in Selenium describe Protractor Javascript Selenium Alert Test function browser ignoreSynchronization true disable synchronization it contains information about the Selenium test automation case for or handling popups in Selenium it Hidden Division Alert types in Protractor function set the wait timeout to secs browser manage timeouts implicitlyWait browser get element by className cd popup trigger click element by xpath input type text sendKeys Protractor hidden division alert in Test adding sleep for validation purposes browser sleep Authentication PopupsThe key usage of authentication popups is to authenticate user access These popups are generally observed in password protected pages and consist of a username and password dialogue boxes An authentication popup can be identified by the following characteristics The elements of the authentication pop up overlay cannot be inspected by the user This pop up is displayed on the occurrence of the loading of the web page The page can only be accessed through the input of valid credentials The pop up may or may not be movable as per the browser configuration The UI of the pop up is highly customizable The solution to handle this type of alert in selenium is to enter valid credentials along with the URL The syntax for password and username in authentication pop ups are driver get protocol Usename Password URL Address The complete command for Authentication popups for handling popups in Selenium is import the required modules from the library for handling popups in Selenium import browser element by ExpectedConditions protractor from protractor import Alert from selenium webdriver var script require protractor var webdriver require selenium webdriver var myAlert new Alert defining the Selenium test automation scenario for the use case in protractor for handling popups in Selenium describe Protractor Javascript Selenium Alert Test function browser ignoreSynchronization true disable synchronization it contains information about the Selenium test automation case it Authentication Alert types operation in Protractor function set the wait timeout to secs browser manage timeouts implicitlyWait browser get browser getTitle then function title if title Selenium Authentication is Successful console log Login successful else console log Login Failed On successful login through entering of valid credentials the webpage can be accessed and the alert can be handled for Selenium test automation Upload PopupsThe upload pop up is an alert type that is triggered when the user needs to upload a certain file to the web page This pop up is customized to initially ask permission for local storage access to browse files that need to be uploaded The upload command box consists of the “browse choose tab clicking on the tab triggers a system based operation in which the local storage of the user is opened Once the trigger command opens the local storage the user needs to select the file that needs to be uploaded and click on the “ok confirmation button This action will successfully upload the target file to the webpage The user will further need to click on the “upload file button in order to send the file to the storage database of the webpage To execute this command the sendkeys method can be efficiently utilized The detailed code to execute the sendkey command for handling popups in Selenium for dialogue box is import the required modules from the library for handling alerts and popups in Selenium import browser element by ExpectedConditions protractor from protractor import Alert from selenium webdriver var script require protractor var webdriver require selenium webdriver var myAlert new Alert defining the Selenium test automation scenario for the use case in protractor for handling popups in Selenium describe Protractor JavaScript Selenium Alert Test function browser ignoreSynchronization true disable synchronization it contains information about the Selenium test automation case it Upload Alert types operation in Protractor function set the wait timeout to secs browser manage timeouts implicitlyWait browser get element by name upload sendKeys myfile txt adding sleep for validation purposes browser sleep Integrating With Cloud Selenium Grid And Other ToolsWe constantly look for ways to help us increase our test coverage and enhance our test case while running our Selenium test automation scripts To support this there are several tools to scale our testing efforts The Protractor is capable of integrating with many other popular tools and platforms such as Github Jenkins Selenium Grid etc It s best that we utilize this capability of Protractor to scale your testing efforts By providing substantial added value these tools make our Protractor test script more efficient and reliable Whether a novice or a professional with Protractor one of the best tools to get started is to deploy the application on Online Selenium Grid like LambdaTest and quickly monitor our testing very easily Integrating LambdaTest in our Protractor scripts allows us to improve our test coverage and ensure that we ve covered our browser matrix By utilizing a cloud Selenium Grid you can run test scripts on real browsers and their different versions which helps us to adequately construct the test case and maximize our test coverage You can further use a Selenium Grid for handling alerts and popups in Selenium over different browsers and OS combinations Integrating Protractor with a cloud Selenium Grid is easy you just have to make changes to specification files as only a config file is required which will have all the connection information the hub and the access key needed to connect to the LambdaTest network Therefore when combined with the internal capabilities of Protractor it gives greater flexibility to handle our tests and run parallel tests which will exponentially improve our test run speed Here is the link to visit LambdaTest Selenium desired capabilities generator Below is our updated script for this Selenium Protractor tutorial on handling alerts and popups with the required changes test config js The test config js file servers as a configuration file for our test case for handling alerts and popups in Selenium LT USERNAME process env LT USERNAME irohitgoyal Lambda Test User nameLT ACCESS KEY process env LT ACCESS KEY Lambda Test Access keyexports capabilities build Automation Selenium Webdriver Test Script Build Name to be display in the test logs name Protractor Selenium Test on Chrome The name of the test to distinguish amongst test cases platform Windows Name of the Operating System browserName chrome Name of the browser version browser version to be used visual false flag to check whether to take step by step screenshot network false flag to check whether to capture network logs console false flag to check whether to capture console logs tunnel false flag to check if it is required to run the localhost through the tunnel setting required for the config parameters for handling alerts and popups in Selenium exports config directConnect true Desired Capabilities that are passed as an argument to the web driver instance for handling alerts and popups in Selenium capabilities browserName chrome name of the browser used to test Flavour of the framework to be used for our test case framework jasmine The patterns which are relative to the current working directory when protractor methods are invoked specs test script js overriding default value of allScriptsTimeout parameter allScriptsTimeout jasmineNodeOpts overriding default value of defaultTimeoutInterval parameter defaultTimeoutInterval onPrepare function browser manage window maximize browser manage timeouts implicitlyWait test script js import the required modules from the library import browser element by ExpectedConditions from protractor import Alert from selenium webdriver var script require protractor var webdriver require selenium webdriver var myAlert new Alert Build the web driver that we will be using in Lambda Testvar buildDriver function caps return new webdriver Builder usingServer http LT USERNAME LT ACCESS KEY hub lambdatest com wd hub withCapabilities caps build describe Protractor Javascript Selenium Alert Test function disable synchronization browser ignoreSynchronization true adding the before an event that builds the driver and triggers before the test execution for handling alerts and popups in Selenium beforeEach function done caps name this currentTest title driver buildDriver caps done it Accept Alert types in Protractor function set the wait timeout to secs browser manage timeouts implicitlyWait browser get element by name alert click myAlert browser switchTo alert clicking the OK button will confirm the action myAlert accept Wrapping It Up Now this takes us to the conclusion of this Selenium Protractor tutorial on handling alerts and popups in Selenium protractor There are several options for notifying users with critical information about the web application flow and it should be kept in mind while writing scripts for automated browser testing I explored how browsers have native alert dialogs that can be used to give prompts using JavaScript and also create our own custom alerts and popups But you need to keep in mind that the ability to show messages to the user is not overused as this may annoy the user and ruin their experience I hope you liked this Selenium Protractor tutorial on handling alerts and popups in Selenium Protractor Finally if you think this Selenium Protractor tutorial was helpful to you you can share it with your peers and colleagues who are facing the same problem and would benefit by reading this article You can even retweet us or share our post on LinkedIn That s all folks Happy Testing |
2022-01-25 12:35:49 |
海外TECH |
DEV Community |
The Power of Code Refactoring: How to Measure Refactoring Success📈✨ |
https://dev.to/alexomeyer/the-power-of-code-refactoring-how-to-measure-refactoring-success-4p68
|
The Power of Code Refactoring How to Measure Refactoring SuccessMany engineering teams struggle to measure the effectiveness of their refactoring efforts Let s look at the metrics that will help you measure refactoring success Code refactoring provides a well needed mental break for developers and I think many devs can relate to this Writing code all day is very demanding especially if you create new functionality day by day It s a taxing exercise and developers often need some space to think about the codebase s overall organisation and look back on what can be improved This is exactly what code refactoring does It provides this well needed mental break for developers and it gives them the chance to tackle higher level codebase related issues However it s also a great moment to check your code against the codebase guidelines No codebase is perfect Small faults against the guidelines make it to the “main branch On top of that it reduces technical debt Developers get the chance to explore the codebase and learn about other parts or features they haven t touched It s an excellent side benefit of code refactoring Yet many teams struggle to measure the effectiveness of their refactoring efforts Team leads or a CTO often have to report to management Without “hard numbers it s not easy to justify the time spent refactoring a codebase versus time spent developing new features For many startups the pressure is always on This constant pressure makes it hard to justify codebase refactoring This article looks at different metrics you can use to measure code refactoring success Metrics to Measure Refactoring SuccessThere are several metrics you can implement to measure codebase refactoring success You don t need to implement all metrics because code refactoring is still a logical effort However specific metrics can give you a good indication of the success of your refactoring Number of Open Codebase IssuesWhen the number of open codebase issues keeps growing it s a red flag for declining codebase quality However besides being a red flag it can also help you track your refactoring efforts success Your obvious goal is to reduce the number of open codebase issues to zero before starting the next sprint You want to fix those issues as soon as possible because they are still relatively small issues However when your codebase progresses over time minor issues can become complex and time consuming issues to solve You want to avoid this situation as it will set you further back timewise and cost wise If you re wondering how to track and gain visibility on your codebase issuesーtry out Stepsize VSCode and JetBrains extensions The tool will help you Link your issues tool to codeShare knowledge within the team about ticking bombs in the codebasePrioritise issues and track progress Number of TODOs in CodebaseGenerally you don t want to see too many TODOs sitting idle in your codebase It s a sign things need improvement but aren t actively addressed When your codebase evolves the context of TODOs might get lost making it hard to understand the original problem and more importantly solve the TODO Therefore use a refactoring moment to remove idle TODOs from your codebase or organise your TODOs in a way you can see the context and resolve them quicker later Number of Failed Unit TestsMany codebases suffer from failing unit tests As long as the percentage of failed unit tests stays relatively low this won t threaten your codebase s quality Though keep an eye out on the number of failed tests It s a red flag for starting a code refactoring week and also measuring the success of your code refactoring You want to reduce the number of failed tests as close to zero before starting a new sprint Code CoverageThe code coverage metric is closely linked to measuring the number of failed unit tests However to measure the success of your code refactoring you also want to know how the quality of your codebase increases One way to measure the quality of your codebase is by measuring the code coverage as it tells you how much you can trust your codebase If tests are written correctly a higher code coverage often results in higher code quality No codebase is perfect yet try to get close to that code coverage mark If you don t have the resources to fully cover your codebase with tests make sure to cover the most critical paths throughout your code This will help you to increase trust in your code Common pitfall Don t forget to write update or change tests when refactoring code You don t want to improve your code but decrease the code coverage In other words refactoring and code testing go hand in hand Measure DuplicationMeasuring duplication is not a high level metric you should aim for However it s still a valuable metric to watch for when refactoring code When codebases grow people don t always fully understand the codebase Therefore they might not know a helper library or function already exists and create a new one with the same functionality The same often happens for modules in larger codebases First try to identify duplicate code and write down the locations to measure refactoring success You can revisit this list to measure how many lines of duplicated code have been removed from the codebase when you ve finished code refactoring How to Use These Metrics to Improve Your Refactoring Process If you consider codebase refactoring don t jump straight in without having a plan You need to set goals and boundaries for your refactoring process to make it easier to measure success First of all you want to collect all codebase related issues you want to tackle during this codebase refactoring sprint If some tickets are missing make sure to track them or create issues For instance review all TODOs you want to be removed from the codebase Once you ve identified the issues you want to tackle set out metrics that help you to track refactoring success For example you want to remove three duplicate modules and increase code coverage by Now you have collected all issues and set targets it s time to share knowledge about the codebase and why specific issues need to be tackled You can explain the context and impact of issues on the project if you leave them untackled It s also a great moment to share knowledge about new parts of the codebase so all developers are up to speed And lastly prioritise issues that you want to tackle first You won t be able to finish all issues during a refactoring week or whatever timeline you ve set Therefore make sure to tackle the highest impact organisational issues first before committing to less important issues To end your codebase refactoring collect all metrics data and verify it against the goals you ve set It s a great moment to discuss what went wrong and how you can improve your codebase refactoring process in the future Don t expect everything to go well Mistakes can happen and that s fine Conclusion Refactoring Success and Purpose No matter how you approach measuring refactoring success make sure not to use these metrics to evaluate programmer performance or decide promotion or anything like that Refactoring code aims to solve codebase and organisational issues early on If you leave them untreated they might escalate into more significant problems that can require more time and resources to solve This is also one of the main arguments for organising code refactoring In startups the pressure is always on to deliver new features However as a team you sometimes have to take a step back to evaluate the code and refactor it to maintain software quality |
2022-01-25 12:29:46 |
海外TECH |
DEV Community |
Build, deploy and host your .Net core API for Free with Utopiops |
https://dev.to/mohsenkamrani/build-deploy-and-host-your-net-core-api-for-free-with-utopiops-156p
|
Build deploy and host your Net core API for Free with UtopiopsAs a software developer or a software development team the most important thing for you is building quality software shipping it and getting feedback from your customers Utopiops utopiops com is a new player in town that aims to solve the problem uniquely by giving you a complete ecosystem that supports you entire platform from build deployment and hosting your applications to monitoring the platform incident reports and integrations with issue tracking systems Utopiops also supports Fully managed and Managed applications The Fully managed applications are hosted on Utopiops cloud platform while Managed applications are hosted on your own cloud accounts In his post I show you how to host your applications using Fully managed applications on Utopiops for free To do so I have implemented a simple Web API with Net Core along with a typical Dockerfile You can create the project like this dotnet new webapi no httpsI ve been using VS Code so I used the C extension to add the Dockerfile effortlessly You can follow the steps in this tutorial which perfectly explains how to set up your project to run inside a Docker container I also updated launchSettings json and modified the applicationUrl so the API listens on port When you create the new project with the command I mentioned earlier it adds a dummy controller which I keep as it serves the purpose The only thing you have to add is a health check controller This controller should determine if your application is healthy or not If the status code of the response to the GET request to this endpoint is in the range it s considered as healthy otherwise your application s container will be automatically replace by a new one This is the code I added in HealthController cs using Microsoft AspNetCore Mvc namespace netcore api deployed on utopiops Controllers ApiController Route health public class HealthController ControllerBase HttpGet public String Get return Healthy You can find all these files in the repository here Before we begin the deployment you need to create an account on Utopiops if you already haven t done that before by registering and verifying your email Now we create a dockerized applicationThen we choose the repository we have stored our code I m using Github for this example but you can also use Gitlab and Bitbucket too Finally just git your application a name set the git branch the port your application is listening on and an endpoint that can be used as health check Remember that health check path is just any endpoint that returns a xx response to an unauthorized HTTP GET request You can also set the environment variables if you like Right away the built in CICD on Utopiops is set up and starts building and deploying your application You can see the build logs live as they happen And in a just few seconds your application is available for this example it took seconds to be precise Notice that by default HTTPS is provided for you application just the certificate takes a few minutes to be effective but guess what We re working on it to reduce that to few seconds as well Worth mentioning any time you make a change to your target branch the new version of your application is built and deployed right away Final noteWe re a very young startup with huge goals in our mind You can be part of the first users who get to know about our features and our journey Please join our family by joining our discord channel and following us on Twitter and using our service We have a generous hobby plan Please leave a comment if you have any questions or even want to see a private demo |
2022-01-25 12:06:51 |
海外TECH |
DEV Community |
E-Commerce Website Development Cost-How Much Does an E-Commerce Website Development Cost in 2022? |
https://dev.to/daviddalton/e-commerce-website-development-cost-how-much-does-an-e-commerce-website-development-cost-in-2022-2eg7
|
E Commerce Website Development Cost How Much Does an E Commerce Website Development Cost in This is a question that many are asking what is the cost of an e commerce website This is a perfectly normal question and it is legitimate for you to ask it Only answering it is not so simple and depends on your project the chosen solution the degree of personalization of the website the functionalities In short a very large number of factors In this article we will try to present the different types of e commerce websites that can be created and the prices associated with them How Much Does an E Commerce Website Development Cost The Summary •The price depends on the type of solution used to create the e commerce website•The price depends on the level of customization of your e commerce website•Breakdown of the main costs of an e commerce website The price depends on the type of solution used to create the ecommerce Website E commerce website created with web software like ShopifyYou will find numerous proprietary software on the internet allowing you to create your own e commerce website but you must above all look at the different prices such as Wizishop Shopify prices This software is designed to create an e commerce website without special technical skills and has a very simple user interface you select the theme that corresponds to your business and your needs and you configure this theme If you want to create an ecommerce website you can opt for a solution like Shopify This is one of the key solutions when it comes to ecommerce It has evolved with the times especially in terms of personalization Then you just have to put it online Regarding the price of such a solution count between Dollar and Dollar per month Little personalized e commerce website created with an open source CMSIf your product catalog has several thousand products and you choose the proprietary software solution browsing your website may be very difficult If you don t have a big budget you can opt for an e commerce website solution created using an open source CMS You need to think about comparing hosting software This solution will make navigation easier and more pleasant for the Internet user E commerce websites created in open source are generally more qualitative although the limits in terms of customization are quickly reached Thanks to open source CMS you will above all benefit from a more complete and flexible back end allowing you to manage all your product sheets and all your page templates Regarding the price of such a solution count between Dollar and Dollar The price range is quite wide as you can see in fact the price will depend on the level of customization of your e commerce website Needless to say the more the customization is pushed the more the prices go up Very personalized e commerce websiteIf you want to create an e commerce website that is unlike any other that has its own brand and reflects the values of your company that clearly stands out from the competition you must plan for a substantial budget In the same way the more specific your need the more customization of the website is necessary However in this matter the rule is very simple the more the website is personalized the higher the price unlike the price of a showcase website For at least two reasons first you will be forced to use more flexible and therefore more complex and therefore more expensive technologies Second you will have to call on a developer who will offer you a tailor made service To create a very personalized e commerce website meeting very specific needs two solutions are available to you •Use an open source CMS But it is obvious that many modifications will undoubtedly have to be made to make the internal specifications of the CMS coincide with your needs •Create a fully bespoke website This solution the most expensive but the most qualitative is meeting with increasing success In both cases the use of a developer service provider is necessary This obviously has an impact on the price of your e commerce website Count at least Dollar Of course these are only indicative prices Who says tailor made service says tailor made price the price will therefore be very variable and will depend on your e commerce specifications and your e commerce business plan The Price Depends On the Level of Customization of Your E Commerce WebsiteAs said before the variable that plays the biggest role in determining the final price is the degree of personalization of the website Price Personalization concerns both the exterior design of the store front end visible to the Internet user and the back end Shop Design CustomizationThe design of an e commerce website is obviously essential A user who arrives at a “well done “beautiful and “well designed website will be more likely to stay buy and come back The design has a real impact on the conversion rate It is therefore very important to take care of the design of the website The design can be more or less personalized and in any case considered at two different levels The purely aesthetic graphic aspect choice of theme templates font colors…But also the way of arranging the text and photos etc In short the appearance of your website The functional or ergonomic aspect mode of navigation on the website organization of content interactivity customized pages functionalities etc These two aspects are inseparable in reality a “well done website is often a “beautiful website and vice versa It is very difficult to offer Internet users an ultra design website through a web software solution or even an open source CMS Personalization of the Back EndEveryone may not be familiar with the concept of back end applied to the web In fact it s very simple the back end is the whole part of the website which is only accessible to the administrator and which allows you to manage the content and the functionalities of the website In the context of an e commerce website the back end encompasses elements as diverse as management of product sheets categories means of payment monitoring of invoicing orders and deliveries statistics and conversion rate analysis systems the possibility of creating new product sheets and new catalogs the customer area promotions and loyalty systems inventory management integration of social networks into the interface The back end is opposed to the front end the part visible to users of the website For you to be able to use your website as you wish the back end must be customized and adapted to your needs The costs can be important to match your needs requirements with the back end of your website These two aspects front end and back end are inseparable the richness of a back end is generally reflected in the quality of your front end We have a real Appearance Essence relationship between the two Focus On the Main Items of Expenditure to Create an E Commerce WebsiteCustom template you must choose a template and customize it according to your specific needs A template is a website model that must necessarily be adapted therefore personalized To take a very general picture a Word page model is a template Personalization consists of creating content based on the functionalities of this page template For a website template the greater the customization required the more this cost item will weigh the template itself is mostly not very expensive Some are even free Warning if you create a completely custom website you will not use a template HTML integration the HTML integration of your website consists of transforming your graphic model the visual you want to obtain into a web language understandable by browsers for example In other words in a shorter way it s about transforming graphics visuals into coded language It is a very technical phase and which therefore is quite expensive Catalog management this cost item is specific to e commerce websites It incorporates all the work of importing product sheets managing special cases categorizing different products etc This is to adapt your real catalog to the web format Adaptation of the Back End if you have read the article you now know what it is about To adapt to your needs the back end the administrator interface of your website must be personalized This cost item can be very significant if you opt for a software solution especially with the costs of maintaining the website The software presents a “general back end not necessarily adapted to your specific needs This cost item can be minimal if the level of customization required is low SEO optimization if you create an e commerce website the goal is for it to be visited Before even converting visitors into buyers you must have visitors The work of SEO optimization consists in making your website more visible on the internet by making it appear in a good position on certain targeted queries This position should not be neglected having a good website is not enough it still has to be visible on the web Check this phase is the final step in creating your website Its function is to test the website to check that everything works as it should that your specifications have been taken into account by the developers etc Final WordsIt s just significant that you take your time and figure them out before you spend big on an e commerce website This article can help you determine your E Commerce Website Development Cost upfront |
2022-01-25 12:06:01 |
海外TECH |
DEV Community |
Data Pipelines explained with Airflow |
https://dev.to/barbara/data-pipelines-explained-with-airflow-6e7
|
Data Pipelines explained with AirflowIn the following lines I am doing a write up about everything I learned about data pipelines at the Udacity online class It gives a general overview about data pipelines and provides also the core concepts of Airflow and some links to code examples on github WHAT A seriesA data pipeline is a series of steps in which data is processed mostly ETL or ELT Data pipelines provide a set of logical guidelines and a common set of terminology The conceptual framework of data pipelines will help you better organize and execute everyday data engineering tasks Examples of use cases are automate marketing emails real time pricing or targeted advertising based on the browsing history WHY Data QualityWe want to provide high quality data There can be different requirements how to measure data quality based on the use case For example Data must be a certain sizeData must be accurate to some margin of errorData must arrive within a given timeframe fro the start of the execution Pipelines must run on a particular scheduleData must not contain any sensitive information Data Validationis the process of ensuring that data is present correct and meaningful Ensuring the quality of your data through automated validation checks is a critical step when working with data Data Lineageof a dataset describes the discrete steps involved in the creation movement and calculation of a dataset It is important for the following points Gain ConfidenceIf we can describe the data lineage of a dataset or analysis is building confidence in our data consumers like Engineers Analyst Data Scientists Stakeholders Else if the data lineage is unclear it is very likely that our data consumers do not trust or want to use the data Defining MetricsIf we can surface data lineage everyone in the company is able to agree on the definition of how a particular metric is calculated DebuggingIf each step of the data movement and transformation process is well described it s easy to find problems if they occur Airflow DAGs are a natural representation for the movement and transformation of data The components can be used to track data lineage the rendered code tab for a task the graph view for a DAG historical runs under the tree view Schedulesallow us to make assumption about the scope of the data The scope of a pipeline run can be defined as the time of the current execution until the end of the last execution Schedules improve data quality by limiting our analysis to relevant data to a time period If we use schedules appropriately they are also a form of data partitioning which can increase the speed of our pipeline runs With the help of schedules we also can leverage already completed work For example we only would need the aggregation of the current month and add it to the existing totals instead of aggregating data of all times How to scheduleIf we answer the below questions we can find an appropriate schedule for our pipelines What is the average size of the data for a time period The more data we have the more often the pipeline needs to be scheduledHow frequently is data arriving and how often do we need to perform analysis If the company needs data on a daily basis that is the driving factor in determining the schedule What is the frequency on related datasets A rule of thumb is that the frequency of a pipeline s schedule should be determined by the dataset in our pipeline that requires the most frequent analysis Data PartitioningThis is the process of isolating data to be analyzed by one or more attributes such as time schedule partitioning conceptually related data into discrete groups logical partitioning data size size partitioning or location This will lead to faster and more reliable pipelines As smaller datasets time periods and related concepts are easier to debug than big amounts of data and unrelated concepts There will also be fewer dependencies Tasks operating on partitioned data my be more easy parallelized HOW does a pipeline work DAGs Directed Acyclic GraphsA DAG is a collection of nodes and edges that describe the order of operations for a data pipeline The conceptual framework of data pipelines help us to better organize and execute everyday data engineering tasks NODEA node is a step in a data pipeline process EDGEThe dependencies or relationships other between nodes GRAPHA graph describes entities and relationships between the DAGSIn real world it is possible to model a data pipeline that is not a DAG meaning it contains a cycle within the process But the majority of pipelines can be described as a DAG This makes the code more understandable and maintainable Apache Airflowis an open source DAG based schedulable data pipeline tool that can run mission critical environments It is not a data processing framework it is a tool that coordinates the movement between other data stores and data processing tools Airflow allows users to write DAGs in Python that run on a schedule and or from an external trigger The advantage of defining pipelines in code are maintainabilityversionabletestablecollaborativeAirflow is simple to maintain and can run data analysis itself trigger external tools Redshift Spark etc It also provides a web based UI for users to visuzalize and interact with their data pipelines Components of AirflowA Scheduler for orchestrating the execution of jobs on a trigger or schedule A Work Queue which holds the state of the running DAGs and Tasks Worker Processes that execute the operations defined in each DAG A Database which saves credentials connections history and configuration A Web Interface that provides a control dashboard for users and maintainers How it worksThe scheduler starts a DAG based on time or external triggers If a DAG is started the scheduler looks at the steps within the DAG and determines which steps can run by looking at their dependencies The scheduler places runnable steps in the queue Workers pick up those tasks and run themOnce the worker has finished running a step the final status of the task is recorded and additional tasks are placed by the scheduler until all tasks are complete Once all tasks have been completed the DAG is complete Creating a DAGTo create a DAG you need a name a description a start data and an interval from airflow import DAGmy first dag DAG my first description Says hello world start date datetime schedule interval daily If the start date is in the past Airflow will run your DAG as many times as there are schedule intervals between the start date and the current date This is called backfill If a company has established years of data that may need to be retroactively analyzed this is useful Schedule intervals are optional and can be defined with cron strings or Airflow presets like once hourly daily weekly monthly yearly or None End date is optional if it is not specified the DAG will run until it is disabled or deleted An end date might be useful to mark the end of life or handling data bounds by two points in time Operatorsdefine the atomic steps of a work that make up a DAG Instantiated operators are referred to as Tasks Airflow comes with many operators that can perform common operations like SToRedshiftOperator or SimpleHttpOperator Task dependencies can be described programmatically using a gt gt b or a set downstream b telling a comes before b ora lt lt b or a set upstream b telling a comes after b from airflow operators python operator import PythonOperatordef hello world print Hello World def second step print Second Step my first sample task PythonOperator task id hello world python callable hello world dag my first dag second step task PythonOperator task id second step python callable second step dag my first dag my first sample task gt gt second step task Task BoundariesDAG tasks should be atomic and have a single well defined purpose The more work a task performs the less clear becomes its purpose So it will be easy to maintain understand and run fast Write programs that do one thing and do it well Ken Thompson s Unix Philosophymaximize parallelism if a task is scoped properly we can minimize dependencies and enable parallelism This parallelization can speed up the execution of DAGs We also can create custom operators as plugins One example of a custom operator can be a certain data quality check that is needed more often To create a custom operator we have to Identify operators that perform similar functions and can be consolidatedDefine a new operator in the plugins folderReplace the original operators with your new custom one re parameterize and instantiate them You can find a sample for custom operators here SubDAGsCommonly repeated series of tasks within DAGs can be captured as reusable SubDAGs An example would be the SToRedshiftSubDag Advantagesdecrease the amount of code we need to write and maintain to create a new DAGeasier to understand the high level goals of a DAGbug fixes speedups and other enhancements can be made more quickly and distributed to all DAGs that use that SubDAG Disadvantageslimited visibility within the AirflowUIharder to understand because of the abstraction levelIf you want you can also use nested subDAGs but keep in mind that it makes it much harder to understand and maintain HooksConnections can be accessed in code via hooks Hooks provide a reusable interface to external systems and databases Airflow comes with many hooks like HttpHook PostgresHook SlackHook etc We don t have to worry how and where to store connection strings and secrets You can store those in the Airflow user interface under Admin Variables from airflow import DAGfrom airflow hooks postgres hook import PostgresHookfrom airflow operators python operator import PythonOperatordef load Create a PostgresHook option using the demo connection db hook PostgresHook demo df db hook get pandas df SELECT FROM my sample print f your sample has len df records load task PythonOperator task id load sample data python callable hello world Like for operators we also can create custom hooks Before creating a new plugin you might want to check Airflow contrib to see if there was already a plugin created by community members for your needs If not you can build one and contribute it to the community Runtime variablesAnother feature is that Airflow provides runtime variables that can be used One example is the execution date the execution date def hello date args kwargs print f“Hello kwargs execution date divvy dag DAG task PythonOperator task id hello date python callable hello date provide context True dag my first dag MonitoringDAGs can be configured to have a SLA Service Level Agreement which is defined as a time by which a DAG must complete We can email a list of missed SLAs or view it in the AirflowUI Missed SLAs can also be early indicators of performance problems or inidicate that we need to scale up the size of your Airflow cluster If you are working on a time sensitive application an SLA would be crucial Airflow can be configured to send emails on DAG and task state changes These state changes may include successes failures or retries Failure emails can allow you to easily trigger alerts It is common for alerting systems to accept emails as a source of alerts MetricsAirflow comes out of the box with the ability to send system metrics using a metrics aggregator called statsd Statsd can be coupled with metrics visualization tools like Grafana to provide you and your team high level insights into the overall performance of your DAGs jobs and tasks These systems can be integrated into your alerting system These Airflow system level metrics allow you and your team to stay ahead of issues before they even occur by watching long term trends You can find code samples to all of the above mentioned topics here |
2022-01-25 12:06:00 |
Apple |
AppleInsider - Frontpage News |
Apple's AirTag uncovers a secret German intelligence agency |
https://appleinsider.com/articles/22/01/25/apples-airtag-uncovers-a-secret-german-intelligence-agency?utm_medium=rss
|
Apple x s AirTag uncovers a secret German intelligence agencyA researcher has sent one of Apple s AirTags to a mysterious federal authority in Germany to locate its true offices ーand to help prove that it s really an part of an intelligence agency Apple s AirTags have already been used for good and for bad in cases involving the tracking of individuals but now a German researcher has used one in an expose of government secrets Activist Lilith Wittmann claims that she has uncovered how Germany s little known Federal Telecommunications Service is actually a camouflage authority for a secret intelligence agency Initially she wrote how she accidentally stumbled upon a federal authority that does not exist Read more |
2022-01-25 12:27:50 |
Apple |
AppleInsider - Frontpage News |
Nvidia close to giving up on $40B Arm acquisition |
https://appleinsider.com/articles/22/01/25/nvidia-close-to-giving-up-on-40b-arm-acquisition?utm_medium=rss
|
Nvidia close to giving up on B Arm acquisitionGraphics chipmaker Nvidia may be close to giving up on an acquisition of Arm with slow progress and industry backlash making it tough for the billion deal to complete In September Nvidia initially announced it would be buying Arm from SoftBank for billion in a cash and stock based purchase Over a year later and that deal may be heading off the table Various obstacles that have surfaced since the deal became public knowledge has reportedly led to a change in stance at both companies over the acquisition According to an anonymous source of Bloomberg Nvidia doesn t believe the transaction will actually close Read more |
2022-01-25 12:13:05 |
Apple |
AppleInsider - Frontpage News |
Latin America Apple vendor cracking down on counterfeits |
https://appleinsider.com/articles/22/01/25/mercado-libre-warns-vendors-against-selling-counterfeit-apple-products?utm_medium=rss
|
Latin America Apple vendor cracking down on counterfeitsMercado Libre a popular online marketplace in Latin America plans to crack down on sales of counterfeit Apple products through its website Online sellers who use Mercado Libre also known as Mercado Livre in Brazil have begun receiving emails warning against peddling fake Apple products Sellers caught hawking counterfeit items such as AirPods will have all listings selling Apple products removed In addition Mercado Libre will ban that account from selling any Apple products in the future Read more |
2022-01-25 12:05:16 |
海外TECH |
Engadget |
Report suggests NVIDIA is preparing to walk away from its ARM acquisition |
https://www.engadget.com/nvidia-privately-admits-arm-deal-might-not-go-through-123542854.html?src=rss
|
Report suggests NVIDIA is preparing to walk away from its ARM acquisitionNVIDIA has reportedly made little to no progress in gaining regulatory approval for its billion purchase of ARM and is privately preparing to abandon the deal according to Bloomberg s sources Meanwhile current ARM owner SoftBank is reportedly advancing a program to take ARM public as an alternative to the acquisition said another person familiar with the matter NVIDIA announced the deal in September with CEO Jensen Huang proclaiming it would quot create a company fabulously positioned for the age of AI quot ARM s designs are used under license almost universally in smartphones and other mobile devices by companies like Apple Qualcomm Microsoft Samsung Intel and Amazon nbsp A backlash began soon after the announcement The UK where ARM is based launched an antitrust investigation into the acquisition in January and another security probe last November In the US the FTC recently sued to block the purchase over concerns it would quot stifle quot competition in industries like data centers and car manufacturing China would also reportedly block the transaction if other regulators don t Bloomberg s sources say nbsp We continue to hold the views expressed in detail in our latest regulatory filings ーthat this transaction provides an opportunity to accelerate Arm and boost competition and innovation Companies like Intel Amazon and Microsoft have reportedly given regulators enough information to kill the deal the sources say They previously argued that NVIDIA can t preserve ARM s independence because it s an ARM client itself As such it could also potentially become both a supplier and competitor to ARM licensees nbsp Despite the stiff headwinds both companies maintain that they re still pushing forward quot We continue to hold the views that this transaction provides an opportunity to accelerate ARM and boost competition and innovation quot NVIDIA spokesman Bob Sherbin told Bloomberg quot We remain hopeful that the transaction will be approved quot a SoftBank spokesperson added in a statement Despite the latter comment factions at Softbank are reportedly pushing for an ARM IPO as an alternative to the acquisition particularly while the semiconductor industry is so hot Others in the company want to continue pursuing the transaction given that NVIDIA s stock price has nearly doubled since it was announced effectively increasing the transaction price The initial agreement expires on September th but will automatically renew if approvals take longer NVIDIA predicted that the transaction would close in approximately months ーa deadline that now seems unrealistic |
2022-01-25 12:35:42 |
海外TECH |
Engadget |
The Morning After: Panasonic's higher-capacity Tesla battery could appear next year |
https://www.engadget.com/the-morning-after-panasonics-higher-capacity-tesla-battery-could-appear-next-year-121502013.html?src=rss
|
The Morning After Panasonic x s higher capacity Tesla battery could appear next yearPanasonic s relationship with Tesla has been a successful one Last year the Japanese electronics company was able to spin its million stake in Tesla into billion but the team up continues A higher capacity next gen battery for Tesla vehicles could go into production next year boosting EV ranges by over percent nbsp nbsp Although the battery is said to be twice as big as previous versions it may have a fivefold increase in energy capacity Panasonic is reportedly investing around billion yen million on new equipment to produce the cell ーjust a fraction of that windfall The new cell is also apparently cheaper to produce meaning it could well affect the pricing on future Teslas ーin a good way ーMat SmithThe biggest stories you might have missedGOG s New Year Sale includes deals on Cyberpunk and The Witcher Microsoft finally updates the original Surface Duo to Android The James Webb Space Telescope arrives at its final orbitWashington DC s AG sues Google for deceiving users and invading their privacy Engadget Deals Google s Nest Hub Max is down to for today onlyEngadget Deals Sony s WH XBN ANC headphones are percent off in Amazon s one day saleGoogle s next Chromecast with Google TV may be a budget modelIt ll have a remote but only stream at p Google is reportedly developing a new Chromecast aimed at folks who haven t yet splurged on a K TV According to Protocol the low end device will offer a maximum stream resolution of p The device which could be named Chromecast HD with Google TV is said to be capable of decoding the AV video codec something the K capable Chromecast with Google TV doesn t support at the hardware level Given the lower resolution output the device will cost less than the Chromecast with Google TV Continue reading Plaid must pay million to users of Venmo Robinhood and other appsIt reportedly collected quot more financial data than was needed quot from users Even if you ve never heard of a company called Plaid they may owe you part of a multimillion dollar lawsuit settlement The company connects consumer bank accounts to services like Venmo Robinhood Coinbase and other apps and was accused of collecting excessive financial data from consumers While denying any wrongdoing it agreed to pay million to all consumers with a linked bank account to any of its approximately client apps Continue reading AT amp T is rolling out multi gig fiber internet to more than citiesNew plans will offer symmetrical Gbps or Gbps data speeds starting at a month AT amp T is now upgrading its fiber based broadband service with two new plans that top out at Gbps and Gbps The company says its new multi gig fiber broadband will be available in more than metro areas including Dallas LA and Atlanta The new gig plan is set to start at per month plus tax or a month for a business fiber while the faster gig plan will cost per month or a month for businesses Continue reading Google s Pixel smartwatch could finally appear on May thThat d line up with Google I O EngadgetMore Google rumors There have been rumblings for years that Google has been making its own smartwatch Talk last month suggested a Google branded watch could arrive sometime in now the latest murmurs point to the end of May The smartwatch is expected to have a circular face like other Wear OS devices seen over the past few years It will likely have a heart rate sensor and other features adopted from Fitbit which Google bought last year But nothing s confirmed yet ーnot even that Pixel branding We ll share more when we hear more Continue reading Meta says its new AI supercomputer will be the world s fastest by mid It s using the AI Research SuperCluster to develop new experiences for the metaverse Meta has completed the first phase of a new AI supercomputer The company believes the AI Research SuperCluster RSC once finished will be the fastest AI supercomputer on the planet capable of quot performing at nearly exaflops of mixed precision compute quot Er what Well Meta says RSC will help researchers develop better AI models that can learn from trillions of examples Among other things the models will be able to build better augmented reality tools and quot seamlessly analyze text images and video together quot Continue reading nbsp |
2022-01-25 12:15:02 |
海外科学 |
NYT > Science |
‘In the End, You’re Treated Like a Spy,’ Says M.I.T. Scientist |
https://www.nytimes.com/2022/01/24/science/gang-chen-mit-china.html
|
In the End You re Treated Like a Spy Says M I T ScientistGang Chen was arrested a year ago on charges of hiding his links to China The charges were dismissed but he said the damage ーto him and to American science ーhas lingered |
2022-01-25 12:13:48 |
ニュース |
BBC News - Home |
Gray report delayed as police begin No 10 parties probe |
https://www.bbc.co.uk/news/uk-politics-60123850?at_medium=RSS&at_campaign=KARANGA
|
covid |
2022-01-25 12:32:13 |
ニュース |
BBC News - Home |
Holiday bookings jump as Covid travel tests axed |
https://www.bbc.co.uk/news/business-60124445?at_medium=RSS&at_campaign=KARANGA
|
rules |
2022-01-25 12:36:00 |
ニュース |
BBC News - Home |
London bus crash: Children injured as double-decker hits shop |
https://www.bbc.co.uk/news/uk-england-london-60125408?at_medium=RSS&at_campaign=KARANGA
|
incident |
2022-01-25 12:25:14 |
ニュース |
BBC News - Home |
ECB's Connor to lead dressing-room culture review |
https://www.bbc.co.uk/sport/cricket/60099676?at_medium=RSS&at_campaign=KARANGA
|
ECB x s Connor to lead dressing room culture reviewClare Connor will lead a review into dressing room culture in professional men s and women s cricket as part a bid to tackle racism and discrimination |
2022-01-25 12:21:08 |
北海道 |
北海道新聞 |
「少しでも想像を」伊藤さん訴え 被害者泣き寝入りしない社会に |
https://www.hokkaido-np.co.jp/article/637723/
|
泣き寝入り |
2022-01-25 21:17:00 |
北海道 |
北海道新聞 |
まん延防止で全道に飲食店時短要請 知事「医療逼迫の恐れ」 |
https://www.hokkaido-np.co.jp/article/637720/
|
新型コロナウイルス |
2022-01-25 21:15:00 |
北海道 |
北海道新聞 |
胆振2日連続100人超感染 新型コロナ |
https://www.hokkaido-np.co.jp/article/637721/
|
新型コロナウイルス |
2022-01-25 21:15:00 |
北海道 |
北海道新聞 |
「ミスおたる」→「コンシェルジュ」に名称変更 女性限定は変わらず |
https://www.hokkaido-np.co.jp/article/637706/
|
女性限定 |
2022-01-25 21:09:56 |
北海道 |
北海道新聞 |
函館の飲食店、時短「またか」 27日から「まん延防止」 |
https://www.hokkaido-np.co.jp/article/637714/
|
飲食店 |
2022-01-25 21:08:00 |
コメント
コメントを投稿