id
int64
5
1.93M
title
stringlengths
0
128
description
stringlengths
0
25.5k
collection_id
int64
0
28.1k
published_timestamp
timestamp[s]
canonical_url
stringlengths
14
581
tag_list
stringlengths
0
120
body_markdown
stringlengths
0
716k
user_username
stringlengths
2
30
1,863,201
The Journey of a Network Packet: A TCP/IP Guide
Prerequisite The TCP/IP Model Computer Networking in Today's Digital Landscape The significance...
0
2024-05-23T20:55:34
https://dev.to/3rev/demystifying-tcpip-understanding-the-journey-of-a-network-packet-38g7
devops, webdev, programming, computerscience
- [Prerequisite](#prerequisite) - [The TCP/IP Model](#the-tcpip-model) - [Computer Networking in Today's Digital Landscape](#computer-networking-in-todays-digital-landscape) - [The significance of Networking to End-Users](#the-significance-of-networking-to-end-users) - [Benefits of the TCP/IP Model](#benefits-of-the-tcpip-model) - [Understanding the TCP/IP Model](#understanding-the-tcpip-model) - [The Link Layer](#the-link-layer) - [The Network Layer](#the-network-layer) - [The Transport Layer](#the-transport-layer) - [The Application Layer](#the-application-layer) - [Functions of the TCP/IP Model](#functions-of-the-tcpip-model) - [Understanding Packets](#understanding-packets) - [What is in a packet header](#what-is-in-a-packet-header) - [Common types of Network Packets](#common-types-of-network-packets) - [The Journey of a Packet](#the-journey-of-a-packet) - [Summary](#summary) The internet works through the seamless transmission of packets. Packets are the basic unit of data exchange. This article provides an overview of the journey of a packet across the TCP/IP model. Elucidating its critical role in networking. ## Prerequisite: 1. Basic understanding of [Computer networks](https://www.ibm.com/topics/networking) 2. Familiarity with the [OSI model](https://aws.amazon.com/what-is/osi-model/) 3. Basic knowledge of [TCP/IP protocol suite](https://www.geeksforgeeks.org/tcp-ip-in-computer-networking/) 4. Basic networking tools [WireShark](https://www.wireshark.org/docs/wsug_html_chunked/) ## The TCP/IP Model Before we begin our journey, let us first understand what Computer Networking is. Its relevance in IT operations, Cloud services, and the internet. ### Computer Networking in Today's Digital Landscape Computer networking involves transferring and exchanging data between interconnected computing devices or nodes over physical or wireless technologies, following a set of rules known as communication protocols. Computer networking enables devices and endpoints to connect on a local area network (LAN) or larger networks like the internet or private wide area networks (WANs). This connectivity is essential for service providers, businesses, and consumers worldwide to share resources, access services, and communicate. Networking supports a wide range of activities, from telephone calls and text messaging to streaming video and the [Internet of Things.](https://learn.microsoft.com/en-us/azure/iot/iot-introduction) Cloud services and internet functionality enable seamless integration and communication between on-premises infrastructure and cloud platforms, facilitating data transfer, application deployment, and access to cloud-based resources. Networking provides the underlying infrastructure for cloud services such as [virtual private clouds - VPCs](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview) load balancers, and content delivery networks (CDNs), ensuring reliable and scalable cloud solutions. ### The Significance of Networking to End-Users End-users should care about networking because it is essential for accessing shared resources, internet connectivity, and optimal application performance. Networking directly impacts productivity and efficiency by enabling seamless communication and collaboration. It also plays a crucial role in ensuring the security and privacy of data and protecting against unauthorized access and cyber threats. Moreover, staying informed about networking helps end-users leverage emerging technologies like cloud computing and IoT, enhancing their digital experience and personal or professional growth. ### Benefits of the TCP/IP Model 1. Global Adoption: The TCP/IP model is the foundation of internet communication, enabling seamless connectivity among devices across different vendors and platforms, thus promoting worldwide interconnectivity in the digital realm. 2. Scalability and Adaptability: With its modular architecture the TCP/IP model effortlessly integrates new technologies and protocols, ensuring it can meet evolving networking needs and readily accommodate future advancements. 3. Cross-Platform Compatibility: The TCP/IP model facilitates smooth communication across diverse devices and platforms, allowing for data exchange between various protocols and technologies and enhancing connectivity in the digital landscape. 4. Standardization of the Internet: As the standard for Internet communication, the TCP/IP model guides the development and implementation of networking protocols and technologies. With a unified framework, it promotes compatibility and consistency across networks. ## Understanding The TCP/IP Model The TCP/IP model is a structure that outlines the protocols and standards governing data transmission across networks. It consists of four interlinked layers, each responsible for facilitating network communication. Named after its primary protocols, TCP guarantees dependable data delivery, while IP manages data packet routing and addressing. | Internet Model | Description | |--------------------|--------------------| | Application | Bidirectional reliable byte stream between two applications, using application-specific semantics (HTTP, BitTorrent) | | Transport | Guarantees correct, in-order end-to-end delivery of data | | Network |Delivers datagram end-to-end. Best effort delivery - with no guarantees. Must use the Internet Protocol (IP) | |Link |Delivers data over a single link between an end host and router or between routers | At the top of the TCP/IP model is the Application layer, with applications like BitTorrent and WorldWideWeb, which communicate to its peer layer. When the application has data to transmit, it sends it to the transport layer, whose job is to deliver the data reliably or otherwise to the destination. The transport layer then forwards this data to the network layer responsible for segmenting the data into packets, each tagged with the correct destination and address. Subsequently, the link layer receives the packet, which ensures its delivery from one node to the next along its path. The data progresses hop by hop through routers until it reaches the destination. All four layers facilitate reliable communication between applications in the end hosts. Each layer has a different responsibility, with higher layers building upon those beneath them, culminating in a bidirectional, reliable byte stream communication between applications. ### The Link Layer The link layer is the foundation of the TCP/IP protocol model, functioning as the interface between the network hardware and the rest of the network stack. Its primary role is to facilitate the transmission and reception of data across the physical network, providing a means for devices to communicate within the local area network (LAN). <image should be here> ![Packets movement, hop-by-hop over each link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vq3zlukjghkflca94pk.png) The key responsibilities of the link layer include managing communication with the network adapter, coordinating data transmission according to the appropriate access method (Ethernet, token ring), formatting data into frames for transmission, handling errors in incoming frames, and acknowledging receipt of data frames while ensuring reliable delivery. Additionally, the link layer assigns addresses to network interface devices, which allows communication with devices on other networks. ### The Network Layer The network layer's primary function is to ensure the end-to-end delivery of packets across the internet - from the source and reaching the destination. Packets serve as a fundamental component in the network. They denote data accompanied by a header, its content, destination, and origin. ![A simple packet with data and a header.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dveywhojasjigv41ekyz.png) Network layer packets are called datagrams. They include the data and a header containing the - to and from - addresses. The network layer hands the datagram to the link layer, telling it to send it to the first link. The link layer says if you give me a datagram to send, I will transmit it over one link for you. ![Transmission of packets from the Source End host to a router.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ui7r4ohtzu2dv1xvvqe9.png) At the other end of the link is a _router_. The link layer of the router accepts the datagram from the link and hands it up to the network layer inside the router. The network layer on the router examines the destination address of the datagram. It then routes the datagram, one hop at a time, to its eventual destination. And it does this by sending it to the link layer again. To carry it over to the next link, which is passed to the network layer on the next router and so on, until it reaches the network layer of its destination. ![Movement of packets from the Source End host to the Destination End host.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msj46b893tppnsx0831l.png) The network layer does not need to concern itself with how the link layer sends the datagram over each link. This separation of concerns between the network and link layers allows each to focus on its job without worrying about how the other layer works. It also means that a single network layer has a common way of talking to many link layers by simply handling the datagrams to send. The modularity of each layer makes this separation of concerns possible, coupled with a well-defined API to the layer below. When we send packets to the internet, we must use the internet protocol (IP). It is the IP that holds the internet together. The IP strives to deliver datagrams to their intended destinations. But it does not guarantee successful delivery. Datagrams can be lost, delivered out of sequence, or not delivered. Despite these potential issues, the internet can still function effectively. Applications often require another protocol layered on the IP to ensure reliable data delivery. This protocol operates at the _transport layer_ and its responsibility is managing end-to-end communication between applications. ### The Transport Layer The Transmission Control Protocol — TCP — is the most common Transport layer. The TCP’s job is to guarantee that the data sent by an application at one end of the internet is delivered correctly to the application at the other end. If the network layer drops some datagrams, the TCP will transmit them multiple times if needed. If the network layer delivers them out of order — perhaps if two packets follow a different path to their destination. TCP will put the data back into the correct order again. TCP provides applications with a service that ensures that data is delivered correctly and in the intended order - despite the unreliable nature of the underlying network layer's datagram delivery service. This means that TCP guarantees the correct sequencing and delivery of data packets, addressing issues like packet loss, out-of-order delivery, and duplication. Applications like web and email clients greatly benefit from TCP's reliability because it allows them to focus on their core functionalities without complex internal error-handling mechanisms. By relying on TCP, these applications can delegate the responsibility of reliable data transfer, thus abstracting away the complexities of network communication and ensuring seamless and dependable data transmission. ![Transport Layer: TCP & UDP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cniq1beqda4mndkjy3jx.png) However, not every service requires a reliable delivery of data packets. Consider a scenario of a video snippet transmission via packets during a WhatsApp call. If there is a network latency, multiple re-transmissions of packets may not be essential. Opting to forego re-transmission could be the optimal choice. [UDP: User Datagram Protocol](https://www.freecodecamp.org/news/tcp-vs-udp/) can be used for applications that do not need a reliable delivery service. ### The Application Layer The application layer is at the top of the TCP/IP model, and it defines TCP/IP application protocols and facilitates the interface between host programs and Transport layer services for network usage. The Application layer includes several high-level services such as DNS (Domain Naming System), HTTP (Hypertext Transfer Protocol), Telnet, SSH, etc. Every application interacts with the transport layer through a well-defined API, originating from the application layer to access the underlying TCP or UDP service. Applications mostly want a [bidirectional reliable byte stream](https://book.systemsapproach.org/e2e/tcp.html) between endpoints, using their protocols to define the syntax of data exchange. For example, when a web client sends a GET request to a web server, it sends the request as an ASCII string along with the URL. From the application layer's viewpoint, the request is sent straight to its peer at the receiving end (the web server application) without knowing the underlying transmission configurations. The application layer delegates the GET request to the TCP layer for accurate delivery, which in turn utilizes the services of the network layer and relies on the link layer for transmission. ## Functions of the TCP/IP Model 1. Logical Addressing: TCP/IP implements logical addressing to accommodate numerous hosts across diverse networks. IP manages this mechanism, ensuring data packets reach the appropriate networks and nodes. 2. IP Manages Routing: Handling the critical task of routing data packets, IP determines the next node along the transmission path from source to destination. This ensures that data packets reach their intended destinations, even if the sender is unaware of the specific location. 3. TCP Ensures Error and Flow Control: Establishing a virtual connection between senders and receivers, TCP maintains continuous communication and incorporates error and flow control mechanisms. Enabling reliable data transfer and ensures connection stability throughout the transmission process. 4. TCP Supports Applications: TCP assigns unique TCP and UDP ports to applications, which allows for the seamless differentiation of specific applications and their communication link. ## Understanding Packets A packet consists of the data intended for delivery and a header containing information about its destination and origin within the network. When a user requests to load an image, the image file is not transmitted from the web server to the user's computer as a single entity. Instead, the image is broken into bits of packets, transmitted across the internet via cables, and then reassembled by the user's computer to reconstruct the original image. The efficiency, reliability, scalability, and flexibility make packets vital in internet communication. Breaking data into smaller packets or sizes optimizes network resources, while error detection and correction mechanisms enhance reliability. The internet employs [packet switching](https://en.wikipedia.org/wiki/Packet_switching). Packet switching divides data into smaller packets for efficient transmission between computers. This approach enhances network performance by allowing multiple connections in parallel over the same wires and enabling networking equipment to process packets independently. Packet switching also enhances network resilience and efficiency by permitting packets to take various paths to their destination, encouraging data exchange among billions of devices. ### What is in a packet header? Examining the IPv4 packet header, we can see what travels with a packet to its destination. ![IPv4 packet header](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjp3xd5harrv58mfh01h.png) - Bit 0: Typically refers to the first bit in a bit sequence. In networking, the order in bits transfer can depend on the network protocol used. For instance, Ethernet and IP do not specifically define the order in which individual bits travel on the wire, but rather the order of bytes and fields. - IPv4 Header: Contains several critical fields for routing and handling packets. The most important fields include: - Destination IP Address: Indicates the packet's intended recipient. - Source IP Address: Indicates the packet's origin. - Protocol ID: Specifies the higher-level protocol used in the data field (e.g., TCP, UDP). This field helps the destination host [demultiplex](https://www.prepbytes.com/blog/computer-network/multiplexing-and-demultiplexing-in-transport-layer/) arriving data, routing it to the appropriate protocol handler. For example, a Protocol ID value of 6 indicates that the data contains a TCP segment and is thus passed to the TCP processing module. > The Internet Assigned Numbers Authority (IANA) defines over [140 different protocol numbers](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml) representing various transport and network layer protocols. - Version: This 4-bit field specifies the IP version in use. The values are 4 for IPv4 and 6 for IPv6. The header described here is for IPv4. - Total Length: This 16-bit field specifies the entire packet size - including the header and data in bytes. The maximum size is 65,535 bytes (64 KB). - Time to Live (TTL): This 8-bit field prevents packets from circulating indefinitely. Each router that forwards the packet decrements the TTL by 1. TTL discards the packet when it reaches zero. This mechanism ensures packets do not loop forever. - Packet Identification: This 16-bit field identifies the fragments of an original IP packet. - Flags: This 3-bit field controls and identifies fragments. The most significant bit is reserved. The remaining two bits are: - DF (Don't Fragment): The packet cannot be fragmented. - MF (More Fragments): Indicates more fragments. If not set, it indicates the last fragment. - Fragment Offset: This 13-bit field specifies the position of fragments in the original packet, measured in 8-byte blocks. - Type of Service (ToS): This field indicates the quality of service desired for the packet. Routers can use the ToS to prioritize packets. - Header Length: This 4-bit field indicates the length of the IP header in 32-bit words. The minimum value is 5 (20 bytes), and the maximum is 15 (60 bytes), accommodating optional fields. - Header Checksum: This 16-bit field checks the header's integrity. It ensures the header is uncorrupted in transit. The header rejects the packet if the checksum does not match the calculated value. ### Common Types of Network Packets | Packet Type | Purpose | Example | Function | |----------------------|---------------------------------------------------------------------------|---------------------------------------|-------------------------------------------------------------------------------------------| | Data Packets | Transport user data or application-specific information | Segments of emails or file downloads | Encapsulate user data and ensure delivery from source to destination | | Control Packets | Manage and control network communications | TCP control packets like SYN, SYN-ACK, and ACK | Facilitate establishment, maintenance, and termination of network sessions | | Routing Packets | Inform routers about network topology changes and determine the best path | OSPF and BGP packets | Maintain and update routing tables to ensure data takes the most efficient path | | Fragmentation Packets | Divide large data packets into smaller fragments to accommodate MTU | IP fragmentation packets | Allows the transmission of large packets over networks with smaller MTU sizes | | Acknowledgement Packets | Confirm successful receipt of data packets | TCP ACK packets | Provide feedback to the sender upon receiving data correctly, ensuring reliable transmission | | Broadcast Packets | Simultaneously send data to all nodes in a local network segment | ARP requests | Enable network-wide communication for tasks like address resolution and network discovery | ## The Journey of a Packet The TCP/IP Model picks up a stream of data from the application layer, and the transport layer breaks the stream into a segment of data that it reliably delivers to an application running on another computer. The transport layer sends these segments as network layer packets - which the network layer delivers to other computers. > application [streams of data] -> transport [breaks the stream of data into segments] -> network [sends network layer packets to other computers]. ![The Transmission Control Protocol Byte Stream](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljbljnagj3v6l3fu1b6k.png) Almost all web traffic is over TCP. Its typical operation is between a client and a server. To open a connection a client sends a connection request, which the server responds to. This exchange takes three messages, called the three-way handshake. - The first step of the message is when the client sends a Synchronize message to the server, often called the SYN. - The second step is when the server responds with a synchronized message. Acknowledging the client Synchronize or a Synchronize / Acknowledge message - called a SYN/ACK. - The third and final step is when the client responds by acknowledging the server Synchronize, called an ACK. ![A sample Transmission Control Protocol Stream](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kh4pg1iixpk2xv8s8nss.png) From the network layer point of view, packets sent to different applications on the same computer look the same. Hence, we need two addresses to open a TCP stream to another program. - The first is the IP address: the address of the network layer. - The second is a TCP port: this tells the computer software which application to deliver. Web servers usually run on TCP Port 80. So when we open a connection to a web server, we send IP packets to the computer's IP address. Those IP packets have TCP segments whose destination port is 80. **But how does an IP Packet get to its destination** Given that a direct physical link between a client (say, A) and a server may not exist. Client A often connects to an intermediary, typically a router. This router, in turn, establishes connections with other routers in the network. The journey of IP packets from client A to the server involves multiple stages, known as hops, where each hop represents a connection between two routers. If client A accesses the network via Wi-Fi, the hop involves wireless communication to reach the network access point. Conversely, if client A employs a wired connection like Ethernet, the data transmission traverses physical cables, eliminating the need for wireless hops. A wired connection from the access point leads to the broader internet. The router forwards client A packet along this wired hop. A router can have many links connecting to it. Upon the arrival of each packet, the router determines the appropriate outbound link for transmission. Routers possess IP addresses, which may lead to delivering a packet to its corresponding software and not forwarding it. **Inside the stream** ![A sample: Inside the router stream](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yeb5d954soe9ni7b00vp.png) **Inside each hop** ![Inside each router hop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cicbjszlxeopfx4qxhna.png) For example, IP packets are forwarded to the router IP address when you log in to a router using TCP. **How does a router make this decision** The router achieves this through a forwarding table. It comprises IP address patterns and their associated outbound links. When a packet arrives, it assesses which entry in the forwarding table best matches its pattern and directs the packet through the link specified in that entry. Typically, the term _best_ signifies the most specific match. ![Router forwarding table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x67ejzntgobj90udbu2w.png) The _default_ route is the least specific. It matches every IP address. If a packet arrives and there is nothing but the default one, the router will use the _default_ route. ## Summary In computer networking, packets follow the TCP/IP Model. It begins at the application layer when an app wants to send data. The transport layer, with protocols like TCP and UDP, deals with splitting data, controlling the flow, and finding errors. The packet gets wrapped in an IP header that guides it across the internet at the network layer. Lastly, the link layer ensures the packet goes over the physical network. When the packet reaches its destination, it reverses the steps. It begins at the link layer, where it is received and decoded. The network layer looks at the IP header to discern where the packet should go. The transport layer checks the data for problems and puts it in order if needed. Finally, the Application layer hands the data to the receiving app. Along the way, packets are handled to ensure they go from the source to the destination.
3rev
1,863,241
Asymmetrical routing in Azure Network or how to avoid a typical mistake
As you know Azure Network is based on Hyper-V networking (you can check my last post on this point)....
0
2024-05-23T20:52:20
https://dev.to/omiossec/asymmetrical-routing-in-azure-network-3h3o
azure, network, cloud
As you know Azure Network is based on Hyper-V networking (you can check my last post on this point). To be short, networking is based on Hyper-V Network Virtualization, virtual switch, and VXLAN encapsulation. It means that networking in Azure does not fully follow the same rules as your on-premises network. When a network packet leaves the guest OS in a VM, it is encapsulated by the virtual network interface and sent directly to its destination via the Azure Fabric. In a normal situation, no problem, you don’t have to think about this point. Azure is taking charge of everything. But things become more complex when you need to modify the default routing settings to add an NVA and this is where you can start to see mistakes and misconfiguration. When you add an NVA to filter traffic between two parts of your network in Azure you will have to add User Defined Route to overwrite the default routing in Azure. Let’s take an example. You have created in Azure several VNETs and you want to get access to these resources from your on-premises network. You create another VNET add a VPN gateway and configure an IPSec tunnel with BGP to your office network. Then you peer the other VNETs to this last VNET. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/az8arhkl4i6dc05z2d05.JPG) You have a VNET (Hub VNET 172.24.0.0/24) that hosts the Virtual Network Gateway. Client VNETs (clientVnet01 & clientVnet02) are peered to the first VNET, these peering are configured to use the gateway in the peered VNET. Everything works fine, you get access to your resources in Azure and your resources in Azure can communicate to the workload on-premises. But something is missing, you do not inspect packets to or from Azure. So, you decide to add an NVA in the same VNET hosting the VPN gateway (in a separate subnet). ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6px2pp9vyj51lmvknni4.JPG) You add a new subnet in the Hub VNET and add an NVA with a private IP. But adding the NVA is not enough, you need to alter the default routes. You need to make sure that each subnet in the client VNET uses the NVA as the next hop instead of the gateway. Azure allows you to alter default routes with User Defined Routes. So, you can create a route to 192.168.0.0/24 going to the virtual appliance, 172.24.10.4, and you add it to all subnets. But it is only half the work, if packets from Client Vnets go to onPrem via the NVA it is not true for onPrem to Client VNETs. By default, packets go directly to VNETs via the peering. So, you decide to add a User Defined Route to Client VNETs via the NVA. But to avoid adding a route to the subnet each time a client VNET is added with 10.0.0.0/8 for the prefix. Will it work? No, because it is an example of asymmetrical routing, packets are routed from Client VNET through the NVA, but packets from on-premises are routed directly by the VNET peering. Why? Because doesn’t follow the rules of routing in Azure. The rules: - The Longest prefix always wins. If a destination is included in prefixes of several rules, the biggest one. In the previous example, 10.0.0.0/24 (the peering) is longer than the UDR (10.0.0.0/8) so the peering is used. conclusion, in this case of situations for each VNET you should have a route (and potentially automate it) for each VNET instead of a general one. - For the same prefix in a route table, UDR wins over BGP and BGP wins over the Default route. The rule is simple here, if there is, for the same prefix, a modified route, this route must be chosen. It is very easy to create asymmetrical routing, and most of the time it goes unnoticed at least until someone has the idea to open the NVA logs and sees no traffic from one side to another. To avoid that, every time you create an UDR you need to ask yourself a question, is it the largest prefix for the destination? You can verify routes by using an online VM and check the effective routes.
omiossec
1,863,238
hospice care houston tx
Houston, being one of the largest cities in the United States, is home to numerous reputable Hospice...
0
2024-05-23T20:47:43
https://dev.to/hospicehoustontx/hospice-care-houston-tx-2j62
Houston, being one of the largest cities in the United States, is home to numerous reputable **[Hospice Care Houston Tx](![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5d0m6lp63wwez7kfhku9.png))**. These organizations are committed to delivering personalized care that respects the individual preferences and cultural backgrounds of patients and their families. Whether it's managing pain, offering counseling and emotional support, or assisting with day-to-day tasks, hospice care teams in Houston are dedicated to ensuring that patients can live their remaining days with dignity and comfort.
hospicehoustontx
1,863,237
Supermaven: The FREE GitHub Copilot Alternative
Introduction AI has revolutionized software development by providing tools that greatly...
0
2024-05-23T20:47:05
https://www.htmlallthethings.com/blog-posts/supermaven-the-free-github-copilot-alternative
ai, codenewbie, productivity, programming
### **Introduction** AI has revolutionized software development by providing tools that greatly improve productivity and efficiency. In this article, tech industry experts Matt Lawrence and Mike Karan introduce Supermaven, a powerful new AI-powered code completion tool with a FREE tier that can significantly boost your productivity! Whether you're an experienced developer or just starting out, this guide will show you how to integrate Supermaven into your development workflow to enhance your coding skills and streamline your projects! #### **Topics covered in this article include:** * Introduction to Supermaven * About Jacob Jackson * What is an LLM? * Why Choose Supermaven Over GitHub Copilot * **Podcast Topics:** * Will the AI Hype Bubble Burst * AI limitations * Will AI Replace Developer Jobs * **My review section:** * Installing Supermaven * My Initial Thoughts on Supermaven * My Questions for Jacob Jackson * Supermaven's Upcoming Enhancements (Chatbot) --- ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716222641400/7d4d0531-d1c6-4399-a0b5-69aaba1381bb.png) --- ### What is Supermaven? Supermaven is an advanced AI-powered code completion tool designed to enhance developer productivity with its fast, high-quality code suggestions. Founded by Jacob Jackson, Supermaven is built by a dedicated team aiming to create the best developer tools using unique technology. Supermaven has demonstrated superior speed and lower latency in performance tests compared to competitors like GitHub Copilot, Codeium, Tabnine, and Cursor. Its unique approach of analyzing the sequence of edits rather than just files helps it quickly understand what you're trying to achieve, making it an excellent tool for refactoring and other coding tasks. --- ### About Jacob Jackson Jacob Jackson is an entrepreneur and software developer known for founding Tabnine and Supermaven. In addition to these ventures, Jacob worked at OpenAI (creators of ChatGPT)! He completed his undergraduate studies at the University of Waterloo in 2019 and has engaged in competitive programming. Additionally, he developed a visual search engine called Same Energy, showcasing his diverse skills in technology and AI. Through his leadership and vision, Jacob continues pushing the boundaries of AI and developer tools, demonstrating that small startups can still innovate and compete in large language models and AI tools! --- ### What is an LLM? A Large Language Model (LLM) is a type of artificial intelligence designed to understand and generate human language. Trained on vast datasets, LLMs can perform tasks such as text completion, translation, and summarization. These models, like GPT-4, analyze patterns in text to predict and generate coherent responses, making them powerful tools for developers and content creators. --- ### Why Choose Supermaven Over GitHub Copilot? Why Choose Supermaven Over GitHub Copilot? At the time of this article's release, **Supermaven offers a free tier, while GitHub Copilot provides a free trial that eventually requires you to choose a payment plan.** **Supermaven is also much faster than GitHub Copilot.** Mike Karan confirms Supermaven's super speed by sharing his personal experience using both platforms. *Mike was an early adapter of GitHub Copilot, as he was part of the first group of beta testers. He then became a paying customer and incorporated using it into his regular workflow. Since Mike has also used Tabnine, another developer tool created by Jacob Jackson, Supermaven piqued his interest. The benchmarking speed was evident once he gave Supermaven a test run!* **Supermaven has a longer context window than GitHub Copilot, which gives the model more information about your code to make better predictions**. This helps it better adapt to your coding style and understand your codebase's unique APIs and conventions. Since Supermaven analyzes the differences (diffs) between your code's current and previous states, it understands the context of recent changes, resulting in more accurate and relevant code suggestions. **By looking at diffs rather than just the current state of the code, it better comprehends what you’re currently working on.** *Mike Karan applauds Jacob's accomplishments as a software innovator, noting that his workflow has benefited greatly from both Tabnine and Supermaven!* --- ### Podcast Topics **In the upcoming article section, we will cover the three main topics brought up during Jacob's Podcast special:** * Will the AI Hype Bubble Burst * AI limitations * Will AI Replace Developer Jobs --- ### Will the AI Hype Bubble Burst Matt Lawrence makes a good point during the Podcast, noting that there was a lot of hype around Web3 not too long ago. As time passed, although Web3 is still around, the hype around it has clearly ended. So the question is, will the current AI hype bubble burst? Jacob explains that the hype around AI will continue to fluctuate and highlights a distinct difference between Web3 and AI hype. While Web3's use case is limited, AI has numerous applications. According to Jacob, AI tools will continue to be used as long as they remain helpful and relevant to a developer's workflow, even if the hype dies down. --- ### AI limitations During the podcast, Mike Karan asked Jacob about AI's current limitations. Having worked with AI at OpenAI (ChatGPT) and tech startups Tabnine and Supermaven, Jacob provides valuable insights into these limitations. Jacob informs us that current AI technologies are trained to predict what you will type next, meaning that they are trained on short-term predictions. So, a current limitation of AI is its inability to make long-term predictions. For example, while an AI can suggest the next line of code you might write, it struggles to plan the architecture of a complex software project from start to finish. Another limitation of AI is its current cost. Jacob explains that it is currently more cost-effective for companies to house the expensive hardware and share it among users who log in over the internet. Although computer hardware will eventually be capable of running AI models offline, Jacob says the AI models might not be as powerful or intelligent. --- ### Will AI Replace Developer Jobs Now, to address the question everyone in tech has on their minds: Will AI replace developer jobs? Given Jacob's expertise as an AI industry professional, he is a great person to ask! **Jacob believes that AI will not replace developer jobs and that developers will continue to thrive. Although it's a compelling "sales pitch" to sell an AI developer like Devin to corporations, Jacob tells us that AI developers will be incapable of meeting expectations. One main reason is AI's inability to make long-term decisions, as discussed earlier in this article.** That said, if you are interested in landing or keeping a job in tech, it is crucial to become an outstanding developer who can adequately use AI as a tool, not as a crutch. With AI, well-trained developers can accomplish much more than in the past, likely resulting in smaller teams per company. AI appears to be on a path that's trimming down the tech industry landscape to consist of only the best of the best. --- ### My review section **In this section, I'll review my personal experience using Supermaven, covering its installation, initial impressions, questions for its creator, and upcoming enhancements.** * Installing Supermaven * My Initial Thoughts on Supermaven * My Questions for Jacob Jackson (Supermaven's creator) * Supermaven's Upcoming Enhancements (Chatbot) --- ### Installing Supermaven For a VS Code user like myself, the easiest way to install Supermaven is through the Extensions tab in the VS Code editor. Alternatively, you can follow their instructions for Supermaven installation options ([VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=supermaven.supermaven#:~:text=70%2B%20programming%20languages-,Installation,to%20use%20the%20Free%20Tier.)). Simply fire up VS Code and search for "Supermaven" in the Extensions tab. Once installed, you will need to restart VS Code. A pop-up will appear with a button saying "Activate." Click the button and follow the instructions on the Supermaven website to link your account, or click "Use free version" to use the Free Tier (I chose the free tier). If you choose the "Free Tier," you will need to provide an email address. Once successfully installed, you will see Supermaven Free Tier in your VS Code Status Bar. If you're using Supermaven Pro, you should see an indicator in the lower right displaying the active repository that Supermaven is indexing. --- ### My Initial Thoughts on Supermaven After installing Supermaven as a VS Code extension, I opened up my code editor and continued working on my latest project (a React Star Wars website). I was immediately surprised by the auto-complete suggestions and shared my thoughts on Twitter/X: > So far, it's “freaky-cool!” Meaning it's cool how it auto-completes while you're typing your code, but “freaky” that it knows exactly what you're about to type! **As I still consider myself a student of React, Supermaven advantageously acts as a code mentor by providing autocomplete suggestions for code that I might not have come up with on my own, further assisting in my code-learning journey.** Specifically, Supermaven autocompleted an entire mapping function for my menu that renders the categories for my React image carousel. Although I knew I needed to write a mapping function, I would have had to research the syntax to write it myself. Not only did Supermaven save me time in research, but it also taught me how to write the function! Another thing to note about Supermaven's autocompleted function is that it's specific to my codebase; It is not a "textbook" default mapping function you would find on a coding website. It was crafted to fit my project, including class names and uppercasing the first letter of each category rendered, as seen in the code block below. 🔽 ```javascript return ( <menu> {Object.keys(categoriesMap).map((category) => ( <button className="button-sw" key={category} onClick={() => handleCategoryChange(category)} > {category.charAt(0).toUpperCase() + category.slice(1)} </button> ))} </menu> ); ``` **Regarding productivity with speed and accuracy, Supermaven excels in exporting and importing variables! As soon as I placed my cursor in the export, Supermaven autocompleted the variables I wanted to export and suggested autocompleting them in the import file when I moved my cursor there. Not to mention, autocompleting helps prevent syntax errors!** But what impressed me the most and was the biggest time saver was creating an array of images for my React carousel. As you can see in the screenshot below, after I typed out a few lines of monotonous code, Supermaven caught onto the pattern and then auto-suggested the remaining code I needed, allowing me to finish the tedious task with the simple click of the "Tab" key! ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1715963162027/e58e27a6-b745-408c-bf9f-43ebcc9e52ac.png) *Supermaven is my first experience with an AI autocompletion tool, and I feel fortunate to start with one that performs so well in benchmarking tests. I was also late to learning React, beginning with the high-performance Vite and completely bypassing Create React App. So the Supermaven/Vite combo is working really well for me!* --- ### My Questions for Jacob Now that I had Supermaven up and running, I had several questions, and I was fortunate enough to get the answers directly from its creator, Jacob Jackson! Firstly, since I'm new to using an AI that auto-completes code, I wanted to know what kind of project would be good to demonstrate the benefits of Supermaven. **Jacob tells us that Supermaven shines best in large, complex projects because those projects have the most context for Supermaven to use.** I can confirm this because, as I stated earlier, Supermaven was able to suggest a helpful custom block of code that was unique to my project. It succeeded because it derived its suggestion based on other code and context in my project codebase. Next, what are the limitations of Supermaven's FREE tier? Is there a time or autocomplete limit? **The great news is that the free tier has no time or autocomplete limit! However, the benefit of upgrading to Supermaven Pro is that you get the full 300,000-token context window, which helps the model give you better suggestions.** *Now, before you accuse me of amping up Supermaven to be the best thing since sliced bread, I encountered an auto-complete issue, and I did have some privacy concerns.* Supermaven seemed to compete with VS Codes' autocomplete, interrupting my workflow. I asked Jacob if there are recommendations for special settings to prioritize Supermaven for a better autocomplete experience. **Unfortunately, there’s no way to give Supermaven autocomplete priority; however, if you want to accept the Supermaven suggestion and there’s a VS Code autocomplete popup in the way, you can press Space followed by Backspace, and it will clear the autocomplete popup and allow you to see the Supermaven suggestion.** As for security concerns, I've often heard that companies are hesitant to use AI tools due to privacy issues. It appears that any data fed into the AI is retained and learned from and could potentially be shared with others using the AI model. And when it comes to Supermaven, this is no different! **Supermaven does take several steps to safeguard the confidentiality of the code sent to its servers. All code data uploaded via official Supermaven editor extensions is subject to a 7-day retention policy, meaning it will be deleted from their systems within 7 days of upload. Supermaven does not use this data to develop its products and services or share it with third parties except as required by law or necessary to provide its services. They use Amazon Web Services to manage and store code data securely. You can refer to their Code Policy on the official Supermaven website for more detailed information.** Supermaven has a Code Policy to help address customer concerns: [https://supermaven.com/code-policy](https://supermaven.com/code-policy) --- 💡 ***Note:****I am comfortable with their code policy since I primarily use Supermaven for public GitHub repositories and study projects. However, if you are using it in a corporate, freelance, or any other commercial setting, be sure to obtain permission.* --- ### Supermaven's Upcoming Chatbot I'm currently using Hashnode's AI Chatbot as my main AI assistant. My workflow includes using VS Code along with an open browser window for Hashnode. Now that I'm using Supermaven as a VS Code extension, I thought it would be great if Supermaven had its own chatbot to complement its autocomplete. I asked Jacob if there would be a Supermaven chat window for coders to use alongside the autocomplete, and the answer is YES! **Supermaven will add a chatbot within a few weeks of this article's publication. Users will be able to use state-of-the-art chat models like GPT-4 and Claude Opus for coding help as an additional AI companion to the autocomplete!** --- ![HTML All The Things](https://assets-global.website-files.com/5f21f5bb63183fc595ff8426/649b64bf8f565d4cf5e55d84_611580f35095d16fc5b11f7a_hatt_logo_transparency_white-p-500.png) ### **Be sure to listen to the Podcast episode!** [Listen right here!](http://www.htmlallthethings.com/podcasts/will-ai-replace-us-w-the-creator-of-tabnine-and-supermaven-jacob-jackson) #### **Be sure to check out HTML All The Things on socials!** * [**Twitter**](https://twitter.com/htmleverything) * [**LinkedIn**](https://www.linkedin.com/company/html-all-the-things/) * [**TikTok**](https://www.tiktok.com/@htmlallthethings) * [**Instagram**](https://www.instagram.com/htmlallthethings/) --- ## **Learn with Scrimba!** * Learn to code using Scrimba with their interactive follow-along code editor. * Join their exclusive discord communities and network to find your first job! * Use our [**affiliate link**](https://scrimba.com/?ref=htmlallthethings) *This article contains affiliate links, which means we may receive a commission on any purchases made through these links at no additional cost to you. This helps support our work and allows us to continue providing valuable content. Thank you for your support!* --- #### ***Sponsored content: The original publisher kindly sponsored this article, allowing me to share my expertise and knowledge on this topic.*** --- ### **My other related articles** * [**Empowering Web Developers with Spartan Strength: AI as Your Ultimate Pair Programmer**](https://www.htmlallthethings.com/blog-posts/empowering-web-developers-with-spartan-strength-ai-as-your-ultimate-pair-programmer) * [**A Comprehensive Guide to CSS: Insights from the King of CSS, Kevin Powell**](https://www.htmlallthethings.com/blog-posts/a-comprehensive-guide-to-css-insights-from-the-king-of-css-kevin-powell) * [**Thriving in Tech: Securing Your First Job, Leveraging Side Hustles, and Overcoming Layoffs**](https://www.htmlallthethings.com/blog-posts/thriving-in-tech-securing-your-first-job-leveraging-side-hustles-and-overcoming-layoffs) * [**Transitioning from Developer to Developer Advocate: A Guide for Aspiring Tech Professionals**](https://www.htmlallthethings.com/blog-posts/transitioning-from-developer-to-developer-advocate-a-guide-for-aspiring-tech-professionals) * [**From Learning to Earning: A Comprehensive Guide to Navigating Your Tech Career**](https://www.htmlallthethings.com/blog-posts/from-learning-to-earning-a-comprehensive-guide-to-navigating-your-tech-career) --- ### Conclusion Supermaven is an AI-powered code completion tool with a FREE tier that offers fast, high-quality code suggestions and excels in performance compared to competitors like GitHub Copilot. It analyzes code differences to provide more accurate and relevant code suggestions, making it a good AI completion code choice to add to your workflow. With AI-powered tools on the rise, a big question is whether AI will replace developer jobs. As an AI industry professional, Jacob relives our worries by telling us that AI will not replace developer jobs but will enhance developers' productivity. However, to remain relevant in the tech industry, developers will need to effectively use AI as a tool, not as a crutch! Jacob also informs us that although the AI hype may fluctuate, AI tools will continue to be used as long as they remain helpful and relevant to developers' workflows. Additionally, current AI has limitations, such as its inability to make long-term predictions and its high operational costs, which means developers will still be needed for the foreseeable future. So don't give up learning to code just yet! In my personal experience, I found Supermaven helpful for learning and productivity. After installing Supermaven as a VS Code extension, I was immediately impressed by its auto-complete suggestions while working on my React Star Wars website. It felt "freaky cool" how accurately it predicted my code! As a React learner, Supermaven is a valuable code mentor, saving me time and teaching me through its suggested code blocks. So what else is in the works for Supermaven? Supermaven will soon add a chatbot feature, allowing users to use advanced chat models like GPT-4 and Claude Opus for coding help alongside autocomplete! Give Supermaven a try and experience the future of coding assistance today. You have nothing to lose and an AI companion to gain! --- **Let's connect! I'm active on**[**LinkedIn**](https://www.linkedin.com/in/michaeljudelarocca/)**and**[**Twitter**](https://twitter.com/MikeJudeLarocca)**.** ![selftaughttxg logo](https://assets-global.website-files.com/5f21f5bb63183fc595ff8426/649b64bfb2d7d7f783c83e48_Logo-White-Slogan-e33c0614b0d4934fac45d58883ebb935.jpeg) ###### **You can read all of my articles on**[**selftaughttxg.com**](http://selftaughttxg.com/)
michaellarocca
1,863,234
How Technology Will Destroy the Future of Africa Going Forward.
INTRODUCTION It happened around 2022 when Nonso Okoroafor had a Twitter space where he invited...
0
2024-05-23T20:41:53
https://dev.to/zipdemon/how-technology-will-destroy-the-future-of-africa-going-forward-3mbg
java, softwareengineering, javascript
**INTRODUCTION** It happened around 2022 when Nonso Okoroafor had a Twitter space where he invited people to discuss how technology will destroy Africa in the coming years. Fortunately, I was in space, and listening to people talk about how technology will destroy Africa is… not good for us here in Africa is why I am writing this article to call our attention to many important things we’ve ignored over the years. In our current world today, _Africa_ is the only continent that is lagging in everything. A friend of mine said _**Africa is behind what is behind the world;**_ There are several reasons why that is happening. _**Trade infrastructure**_, **_weak connectivity_**, and **_knowledge ecosystems_**, among others, are just a few of the shortcomings as to why Africa is lagging behind the world regarding technology. **The “First” Technologies in Africa** Africa has a long history of technological innovation and ingenuity, with many ancient civilizations developing their technologies. Here are a few examples of early technologies in Africa: 1: **Ancient Egyptian Technology**: Ancient Egypt is renowned for its advanced technologies, including architecture, engineering, and medicine. The construction of the pyramids, the use of hieroglyphic writing, and advancements in medicine are notable achievements. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldqq2cqz4yappzrqtvqm.jpg) 2: **Nubian Technology**: The Kingdom of Kush, located in what is now Sudan, was known for its ironworking skills. The Nubians were skilled blacksmiths and produced iron tools and weapons. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpjm7rmoldgvzlgvi6wh.jpg) 3: **Carved Stone Structures**: In various regions of Africa, ancient peoples created intricate stone structures. For example, the Great Zimbabwe ruins in Southern Africa are a testament to advanced stone masonry. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7ky6f8dmev5hule6dpa.jpg) 4: **African Metallurgy**: Iron smelting and forging were practised in Africa for centuries. The Bantu-speaking people, for instance, had knowledge of ironworking and agricultural practices that contributed to their successful migration across the continent. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xh100cmpqerok6tn5qxx.jpg) **## Chapter 1: Understanding the Challenges** **Introduction:** Figuring out what went wrong despite technological progress is a complicated task. It means looking at the **history**, **politics**, **economy**, and **society of different places**. One significant factor is the impact of colonialism on Africa. **Colonialism in Africa:** **_Resource Exploitation_**: European powers took a lot from Africa, like _minerals_, _timber_, and _crops_, without considering how it might affect the environment or the people living there. **_Economic Dependency_**: Colonial economies were set up to benefit the colonizers, not the local people. African countries became dependent on selling raw materials, and their economies were made to fit the needs of the colonial powers instead of helping the local communities grow. **## Chapter 2: The Japa Syndrome and How It Affects Tech in Africa** **Introduction:** The Japa Syndrome, where skilled people leave Africa for better opportunities abroad, is mostly because of tough economic situations. This chapter looks at how this affects the tech industry, especially in countries like Nigeria. **_Economic Challenges_**: Africa faces ongoing economic issues, like high unemployment and needing more access to good education and healthcare. This makes many Africans look for better chances outside their home countries. **_What It Means for Tech_**: The Japa Syndrome has big effects on the tech industry: 1. **_Losing Skilled People_**: Skilled workers, like software engineers, are crucial for the local tech industry when they leave, there’s a direct loss of talent, and we might not have enough experts in important areas and this weakens the local tech workforce. 2. **_Less Innovation_**: Skilled workers drive new ideas and creations in tech If they leave, local tech industries might struggle to come up with new things and compete globally. Some people might not trust products made in Africa because they think we’re not as good at it. 3. **_Trust in Local Tech_**: Many Africans don’t trust products made by other Africans. They believe that better expertise and ideas are found outside the continent. Rebuilding trust in local tech is crucial for the tech industry in Africa to grow. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k7kimce1hz6mm5txyd6m.jpg) ## **Chapter 3: Pursuit of Wealth Over Innovation** **Introduction**: In the world of software engineering, there’s a new trend where some engineers are more interested in making money than coming up with new and creative solutions. This chapter explores the challenges that arise when financial gains become more important than innovation. **_Money Comes First_**: Lately, many software engineers are choosing jobs based on how much money they can make, rather than focusing on creating new and interesting things. This shift raises concerns about how it might affect the future of the tech industry. **_Short-Term Money vs. Long-Term Creativity_**: Engineers, tempted by high-paying jobs, might go for roles that promise quick money. However, this focus on short-term gains could mean they’re not spending enough time on projects that could bring about long-term innovation. **_Impact on Technology_**: When engineers care more about money than making innovative things, it can slow down the progress of technology. The tech world needs creativity and problem-solving, and if everyone is only thinking about profits, it could hold back the development of cool new solutions. **_Companies and Incentives_**: The culture and rewards provided by companies play a big role. If companies care more about making money than encouraging creativity, engineers might just follow what their employers want. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kz7wttws28517c089p17.jpg) _PS: You might want to read the full article on what made Patricia quit the operation [here_](https://www.facebook.com/photo.php?fbid=335566795793660&set=pb.100080210275192.-2207520000&type=3&_rdc=1&_rdr)_ **## How to Deal with the Challenge:** To get software engineers back to a balance between making money and being creative, it’s important to: - **_Encourage Creativity_**: African tech companies should create an environment that values and rewards creativity, so engineers feel excited to work on new and interesting projects. Tech companies in Silicon Valley, known for valuing innovation, provide employees with creative spaces and time for personal projects. - **_Invest in Research_**: Tech companies should spend resources on research and development. This gives engineers a chance to work on projects that could be both financially successful and innovative. Tech giants like Google allocate significant resources to R&D, encouraging engineers to explore new ideas and contribute to cutting-edge projects and this is why we have many projects built by Google engineers like, _Gmail_, _YouTube_, _Google Chrome_, _Google Maps_, _Google Meet_ and so many more - **_Teach Innovation_**: Education should focus on why innovation and problem-solving are crucial. This helps shape the way future engineers think about their work. Renowned universities, such as MIT and Stanford, emphasize innovation in their computer science programs, instilling a mindset that values creative problem-solving. **## Chapter 4: Taking Shortcuts in Software Engineering Education** **Introduction:** In the high-speed world of software engineering, some people choose quick employment over thorough learning. This chapter explores the outcomes of this shortcut approach, leading to the development of what we might call “_half-baked_” software engineers. **_Choosing Work Over Learning_**: Many aspiring software engineers now prioritize immediate job opportunities over investing time in comprehensive learning. This shortcut mentality raises concerns about the depth of knowledge and skills these engineers bring to the field. **Implications of Skipping Learning:** 1. **_Incomplete Skill Set_**: Engineers who rush into jobs may lack a full understanding of the crucial principles and advanced concepts in software development. 2. **_Limited Problem-Solving Abilities_**: Quick employment seekers might struggle with complex problem-solving since they may not have delved deeply into the theoretical aspects of software engineering. This is why, some African tech companies, often have to hire developers from Asia or Europe to fix broken systems. 3. **_Reduced Innovation Potential_**: Skipping learning can stifle creativity, limiting the potential for innovative thinking and leading to the failure of tech startups in Africa after just a few years in the market. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjl1narlwnk7aan3zui4.jpg) **Industry Impact:** 1. **_Quality of Products_**: Software products developed by engineers with incomplete training may suffer from lower quality, leading to potential issues and bugs. 2. **_Stagnation in Advancements_**: A workforce that values quick employment over learning may contribute to a stagnant tech industry, hindering progress and innovation. **Addressing the Issue:** 1. **_Promoting Continuous Learning_**: Encouraging a culture of ongoing learning within the industry can discourage the tendency to prioritize immediate employment over thorough education. Tech companies should establish in-house educational programs, teaching software engineers Data Structures and Algorithms, Software Engineering, and more. 2. **_Mentorship Programs_**: Creating mentorship programs enables experienced professionals to guide newcomers, emphasizing the importance of continuous learning and skill development. 3. **_Industry Standards and Certification_**: Implementing and recognizing industry standards and certifications can motivate engineers to complete comprehensive training before entering the workforce, ensuring a more competent and skilled pool of professionals. **## Conclusion: Facing Challenges in Africa’s Tech Journey** Looking at how technology is shaping Africa’s future, some concerns need attention. From losing talented individuals to the risk of prioritizing money over innovation, these challenges could impact the continent’s tech growth. As Africa steps into the tech era, it’s important to tackle these challenges head-on. Balancing the positive aspects of technology while addressing the risks is key to ensuring a future where technology supports Africa’s development instead of posing threats to its progress. **NOTICE:** Join me on [Medium](https://medium.com/@okoroaforkelechi) or Dev.to for insightful discussions on software engineering, Java, and other tech topics. Your support means a lot. Let’s start this journey together cause I know if you, my stories can go across the world. Finally, if you love my work and would like to support me, you can also buy me a coffee [here](https://www.buymeacoffee.com/okoroaforkc). Thank you!
zipdemon
1,863,233
ChatGPT for macOS is Here!
Introduction Artificial intelligence has taken another leap forward in making our lives...
0
2024-05-23T20:40:47
https://dev.to/leonardsangoroh/chatgpt-for-macos-is-here-3h2l
chatgpt, ai, macos, productivity
## Introduction Artificial intelligence has taken another leap forward in making our lives easier and more efficient. ChatGPT, the powerful AI developed by OpenAI, is now available as a standalone application for macOS users. Here is essential information you need to know as you incorporate this priceless tool into your daily workflow. ## Installation requirements For you to be eligible to successfully install ChatGPT for macOS, your Apple product needs to have met the following requirements; - Your Mac must be running on macOS [Sonoma](https://apps.apple.com/us/app/macos-sonoma/id6450717509?mt=12) (14.x) - Your Mac must have a Silicon (M1 or better) chip **NB**: You must also have the .dmg for you to install the application. If you don't have it yet, [here](https://github.com/leonardsangoroh/ChatGPTMacOSApp) is a copy. ## Must you have chatGPT Plus? On the official website, it clearly states that the app has been launched for both free and paid users. However, in some cases, it rejects the free version. ## Key Features of the New ChatGPT Desktop App for macOS ### 1. Seamless Integration With a simple keyboard shortcut (Option + Space), you can instantly ask ChatGPT a question. This feature allows you to quickly access the AI without interrupting your workflow. Learn more about [accessing the launcher](https://help.openai.com/en/articles/9295241-accessing-the-launcher-chatgpt-macos-app) on the macOS app. ### 2. Screenshot and Discussion Capabilities You can take and discuss screenshots directly in the app, making it easier to share and analyze visual information. Learn more about how to [take a screenshot](https://help.openai.com/en/articles/9295245-chatgpt-macos-app-screenshot-tool) with the macOS app. ### 3. Photo Conversations The app also enables you to start new conversations with photos from your computer, or new photos you take. This feature is particularly useful for discussing visual content or sharing creative ideas. ### 4. Voice Conversations Now, you can engage in voice conversations with ChatGPT directly on your computer. Begin with the Voice Mode feature, available since ChatGPT's initial release. Future updates will introduce GPT-4's enhanced audio and video capabilities. Whether you're brainstorming new business ideas, preparing for an interview, or discussing specific topics, you can start a voice conversation by clicking the headphone icon located in the bottom right corner of the desktop app. ## Share your experience I’d love to hear about your experiences with the ChatGPT desktop app! What features do you find most useful, and what improvements or new capabilities would you like to see in future updates? Share your thoughts in the comments below and I will surely read them.
leonardsangoroh
1,863,231
Bootstrap vs. Tailwind CSS
Bootstrap vs. Tailwind CSS: What's the Difference? Hello Dev Community! 👋 Welcome to...
0
2024-05-23T20:38:52
https://dev.to/respect17/bootstrap-vs-tailwind-css-2ni4
tailwindcss, bootstrap, webdev
## Bootstrap vs. Tailwind CSS: What's the Difference? Hello Dev Community! 👋 Welcome to another insightful article where we dive into the world of CSS frameworks, specifically comparing two of the most popular ones: **Bootstrap** and **Tailwind CSS**. Whether you're a seasoned developer or just starting out, choosing the right framework can significantly impact your workflow and the look of your projects. Let's explore the key differences between Bootstrap and Tailwind CSS to help you make an informed decision. And as always, we welcome your thoughts and views in the comments below! ### Bootstrap: The Classic CSS Framework Bootstrap has been around since 2011 and has become a staple in the web development community. It's a comprehensive framework that includes a plethora of pre-styled components, such as buttons, modals, and forms. Here are some of the main features and benefits of Bootstrap: - **Pre-designed Components**: Bootstrap comes with a vast library of ready-to-use components, making it easy to create a consistent and polished look for your site quickly. - **Grid System**: Its responsive grid system is intuitive and flexible, allowing for complex layouts that adjust seamlessly across different screen sizes. - **Utility Classes**: Bootstrap includes a wide range of utility classes for margin, padding, typography, and more, helping to speed up the styling process. - **Customizable**: While Bootstrap comes with a default theme, it’s highly customizable through Sass variables and mixins. ### Example: Creating a Responsive Grid with Bootstrap Here's a simple example of a responsive grid using Bootstrap: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Bootstrap Example</title> <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="row"> <div class="col-md-4">Column 1</div> <div class="col-md-4">Column 2</div> <div class="col-md-4">Column 3</div> </div> </div> </body> </html> ``` ### Tailwind CSS: The Utility-First Framework Tailwind CSS takes a different approach. Introduced in 2017, it's known for its "utility-first" philosophy. Instead of pre-styled components, Tailwind provides low-level utility classes that you can combine to create any design directly in your HTML. Here’s what makes Tailwind CSS stand out: - **Utility-First Approach**: Tailwind offers thousands of tiny utility classes for everything from spacing to typography, allowing for complete design control without writing custom CSS. - **Highly Customizable**: Tailwind’s configuration file lets you customize the default design system (colors, spacing, fonts, etc.) to match your project’s needs. - **No Pre-styled Components**: Unlike Bootstrap, Tailwind doesn’t include pre-styled components. This means more flexibility and creativity, but also more effort to design components from scratch. - **PurgeCSS**: Tailwind includes PurgeCSS by default to remove unused CSS, resulting in smaller file sizes and faster load times. ### Example: Creating a Responsive Grid with Tailwind CSS Here's a simple example of a responsive grid using Tailwind CSS: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tailwind CSS Example</title> <link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.0.1/tailwind.min.css" rel="stylesheet"> </head> <body> <div class="container mx-auto"> <div class="flex flex-wrap"> <div class="w-full md:w-1/3 p-2">Column 1</div> <div class="w-full md:w-1/3 p-2">Column 2</div> <div class="w-full md:w-1/3 p-2">Column 3</div> </div> </div> </body> </html> ``` ### Key Differences #### Design Philosophy - **Bootstrap**: Focuses on providing a comprehensive set of pre-styled components and a robust grid system. Great for quick prototypes and consistent design. - **Tailwind CSS**: Emphasizes utility classes and flexibility, allowing for more customized and unique designs but requiring more hands-on styling. #### Customization - **Bootstrap**: Customizable through Sass variables and overriding styles, but requires knowledge of Sass and Bootstrap’s theming system. - **Tailwind CSS**: Customizable through a single configuration file that can define colors, spacing, fonts, etc., making it easier to tailor the design system to your needs. #### Learning Curve - **Bootstrap**: Easier for beginners to pick up and use immediately due to its pre-styled components. - **Tailwind CSS**: Has a steeper learning curve as it requires understanding and applying utility classes effectively. ### Should You Use Bootstrap or Tailwind CSS? The choice between Bootstrap and Tailwind CSS depends on your project requirements and personal preferences: - **Choose Bootstrap if**: You need a quick, out-of-the-box solution with pre-styled components and a robust grid system. It’s great for prototyping, building admin dashboards, or any project where you want to get up and running quickly with a consistent look. - **Choose Tailwind CSS if**: You prefer more control over your design, want a lightweight and highly customizable framework, and don’t mind spending more time on styling. It’s ideal for custom, unique designs and projects where performance is a critical factor. Both Bootstrap and Tailwind CSS are powerful tools in the right hands. Bootstrap’s comprehensive component library and grid system make it a go-to for many developers, while Tailwind’s utility-first approach offers unmatched flexibility and customization. We hope this comparison helps you decide which framework aligns better with your project needs and workflow. What are your experiences with Bootstrap and Tailwind CSS? Which one do you prefer and why? Share your thoughts in the comments below—we’d love to hear from you! Happy coding! 🚀 --- Feel free to leave your comments and suggestions below. Let's learn and grow together as a community!
respect17
1,863,228
Higher Order Functions in JS! 💻✨
A Higher Order Function is a function that takes another function as an argument, returns a function,...
0
2024-05-23T20:37:11
https://dev.to/adii/higher-order-functions-in-js-48e7
javascript
A Higher Order Function is a function that takes another function as an argument, returns a function, or both. Let’s see some examples! 👇 1️⃣ **Classic Example: `setTimeout`** ```jsx setTimeout(() => { console.log('Runs after 5000ms!'); }, 5000); // Best example of higher order function ``` This runs the callback function after 5000ms! ⏲️ 2️⃣ **Using `map`** ```jsx let numbers = [1, 2, 3, 4]; numbers.map(number => number * 10); ``` Transforms each element in the array by multiplying by 10! 🔟 3️⃣ **Custom Example: `applyOperation`** ```jsx function applyOperation(arr, operation) { return arr.map(operation); } let numbers = [1, 2, 3, 4]; let squaredNumbers = applyOperation(numbers, number => number * number); console.log(squaredNumbers); // [1, 4, 9, 16] ``` This higher-order function takes an array and a function (operation) to apply to each element! 🔄 🌟 **Key Takeaway**: Higher Order Functions make your code more flexible and powerful! Start using them to simplify your code today! 🚀
adii
1,863,229
Top 10 Productivity Salesforce Apps
Introduction: Salesforce Solutions for Productivity Salesforce, a leader in customer...
0
2024-05-23T20:41:57
https://www.sfapps.info/top-10-productivity-salesforce-apps/
appreviews, blog
--- title: Top 10 Productivity Salesforce Apps published: true date: 2024-05-23 20:36:07 UTC tags: AppReviews,Blog canonical_url: https://www.sfapps.info/top-10-productivity-salesforce-apps/ --- ## Introduction: Salesforce Solutions for Productivity Salesforce, a leader in customer relationship management (CRM) software, offers a platform designed to help businesses manage customer interactions, track sales, and streamline workflows. However, integrating productivity-enhancing apps is essential to truly maximize Salesforce’s potential. These apps and [sales enablement tools Salesforce](https://www.sfapps.info/top-10-sales-salesforce-apps/) can automate tasks, improve data management, and enhance communication, leading to increased efficiency and effectiveness in sales operations. In this article, we will explore the top 10 productivity apps available for Salesforce. These tools are designed to integrate seamlessly with Salesforce, providing additional features and functionalities that can significantly boost the productivity of teams. From advanced document generation to real-time messaging solutions, each app brings unique benefits to the table. ### Why Productivity Apps for Salesforce? Integrating productivity apps with Salesforce can transform [Salesforce KPI](https://www.sfapps.info/build-a-sales-kpi-dashboard/) and how teams operate. These tools can help: **Automate Routine Tasks:** Reduce the time spent on repetitive tasks, allowing sales teams to focus more on selling. **Enhance Communication:** Improve interactions with customers and prospects through better messaging and email integration. **Optimize Data Management:** Ensure accurate and up-to-date data, which is crucial for making informed decisions. **Improve Workflow Efficiency:** Streamline processes and workflows to enhance overall productivity and performance. ## Our Top 10 Productivity Salesforce Apps In the following sections, we will dive into each of these top 10 apps, detailing their key features, benefits, and how they can help your team achieve more. - [#1 Docomotion – Document Generation & Automation](#aioseo-1-docomotion-document-generation-automation) - [#2 SMS-Magic & Conversive | Conversational Messaging](#aioseo-2-sms-magic-conversive-conversational-messaging) - [#3 Conga Composer Connector for Salesforce | Create and Manage Documents with Ease](#aioseo-3-conga-composer-connector-for-salesforce-create-and-manage-documents-with-ease) - [#4 Outlook Integration for Emails and Calendars – Revenue Grid](#aioseo-4-outlook-integration-for-emails-and-calendars-revenue-grid) - [#5 Groove Sales Engagement Platform (Salesforce Sync for Gmail + Microsoft 365)](#aioseo-5-groove-sales-engagement-platform-salesforce-sync-for-gmail-microsoft-365) - [#6 Raydiant: Gamification, Communication & Messaging, Rewards & Recognition](#aioseo-6-raydiant-gamification-communication-messaging-rewards-recognition) - [#7 Mogli: SMS Text Messaging | WhatsApp](#aioseo-7-mogli-sms-text-messaging-whatsapp) - [#8 GridBuddy: The Most Productive User Experience in Salesforce](#aioseo-8-gridbuddy-the-most-productive-user-experience-in-salesforce) - [#9 Power Dialers: Koncert AI Parallel/Flow Dialer, Agent-Assisted Dialer, Cadence](#aioseo-9-power-dialers-koncert-ai-parallel-flow-dialer-agent-assisted-dialer-cadence) - [#10 XfilesPro Document Management for Salesforce: Integrate, Store, Collaborate](#aioseo-10-xfilespro-document-management-for-salesforce-integrate-store-collaborate) ### #1 Docomotion – Document Generation & Automation ![Docomotion - Document Generation & Automation](https://www.sfapps.info/wp-content/uploads/2024/05/12.png "Docomotion - Document Generation & Automation") **Overview:** Docomotion is a top-rated document generation and automation tool that seamlessly integrates with Salesforce. It allows users to create, edit, and automate documents directly from Salesforce data. This app is particularly useful for creating contracts, proposals, quotes, and other business documents efficiently. **Key Features:** **Document Generation:** - **Custom Templates:** Create and use custom templates for various document types, ensuring brand consistency and professional quality. - **Data Merge:** Automatically merge Salesforce data into templates, reducing manual data entry and errors. - **Multi-format Support:** Generate documents in multiple formats, including PDF, Word, and HTML. **Automation:** - **Scheduled Document Creation:** Automate the creation and distribution of documents based on predefined schedules or Salesforce triggers. - **Workflow Integration:** Integrate document generation with Salesforce workflows to automatically trigger document creation based on specific actions or events. **Collaboration and Sharing:** - **eSignature Integration:** Integrate with eSignature solutions to streamline the signing process and reduce turnaround times. - **Document Tracking:** Track the status of documents in real-time, providing visibility into when documents are viewed, signed, or returned. **User-friendly Interface:** - **Drag-and-Drop Editor:** Use an intuitive drag-and-drop editor to design document templates without the need for coding skills. - **Interactive Documents:** Create interactive documents that allow recipients to fill in fields or make selections directly within the document. **Benefits for Sales Teams:** - **Increased Efficiency:** Automate repetitive document creation tasks, freeing up time for sales teams to focus on high-value activities. - **Enhanced Accuracy:** Ensure data consistency and reduce errors by merging data directly from Salesforce. - **Improved Collaboration:** Streamline document workflows and improve collaboration through real-time tracking and eSignature integration. **Pricing:** $10 USD/user/month **Rating:** 4.97 (388+ reviews) ⭐⭐⭐⭐⭐ **Link:** [Docomotion – Document Generation & Automation For Salesforce](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000000pvVBEAY) ### #2 SMS-Magic & Conversive | Conversational Messaging ![SMS-Magic & Conversive | Conversational Messaging](https://www.sfapps.info/wp-content/uploads/2024/05/11.png "SMS-Magic & Conversive | Conversational Messaging") **Overview:** SMS-Magic & Conversive is a powerful tool for conversational messaging that integrates seamlessly with Salesforce. It enhances communication by enabling sales teams to send and receive SMS messages directly from Salesforce, facilitating real-time interactions with customers and prospects. **Key Features:** **Conversational Messaging:** - **Multi-channel Support:** Engage with customers via SMS, WhatsApp, Messenger, and LINE. - **Template-based Messaging:** Utilize pre-built templates for quick and consistent communication. - **Automated Workflows:** Set up automated messaging workflows to nurture leads and follow up with customers efficiently. **Campaign Management:** - **Bulk Messaging:** Send messages to large groups of contacts simultaneously, ideal for marketing campaigns and announcements. - **Personalization:** Personalize messages using Salesforce data to create more meaningful interactions. - **Analytics and Reporting:** Track the performance of messaging campaigns with detailed analytics and reports. **Compliance and Security:** - **Data Encryption:** Ensure all messages are securely encrypted to protect customer information. - **Consent Management:** Manage opt-ins and opt-outs efficiently to comply with communication regulations. - **Audit Trails:** Maintain complete records of all messaging interactions for compliance and auditing purposes. **Benefits for Sales Teams:** - Enhance customer engagement with real-time, multi-channel communication. - Streamline follow-up processes with automated messaging workflows. - Improve campaign effectiveness with personalized and targeted messages. **Pricing:** $7 USD/user/month **Rating:** 4.82 (1000+ reviews) ⭐⭐⭐⭐⭐ **Link:** [SMS-Magic & Conversive | Conversational Messaging](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N300000024XvyEAE) ### #3 Conga Composer Connector for Salesforce | Create and Manage Documents with Ease ![Conga Composer Connector for Salesforce](https://www.sfapps.info/wp-content/uploads/2024/05/20.png "Conga Composer Connector for Salesforce") **Overview:** Conga Composer Connector for Salesforce simplifies document creation and management by enabling users to generate accurate, professional documents directly from Salesforce data. This app is ideal for creating proposals, quotes, invoices, and other critical business documents. **Key Features:** **Document Generation:** - **Custom Templates:** Create custom templates for various document types, ensuring consistency and branding. - **Merge Salesforce Data:** Automatically merge Salesforce data into templates to generate accurate documents quickly. - **Multi-format Support:** Generate documents in multiple formats, including PDF, Word, Excel, and PowerPoint. **Automation:** - **Scheduled Document Creation:** Set up schedules to generate and distribute documents automatically. - **Workflow Integration:** Integrate with Salesforce workflows to trigger document generation based on specific actions or events. **Collaboration and Sharing:** - **eSignature Integration:** Integrate with eSignature solutions to facilitate quick and secure signing of documents. - **Document Tracking:** Track the status and history of documents, ensuring visibility and accountability. **Benefits for Sales Teams:** - Save time by automating the creation and distribution of critical documents. - Ensure document accuracy and consistency with data-driven templates. - Improve collaboration and document tracking for better workflow management. **Pricing:** $6 USD/user/month **Rating:** 4.75 (860+ reviews) ⭐⭐⭐⭐⭐ **Link:** [Conga Composer Connector for Salesforce](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N300000016b7FEAQ) ### #4 Outlook Integration for Emails and Calendars – Revenue Grid ![Revenue Grid](https://www.sfapps.info/wp-content/uploads/2024/05/16.png "Revenue Grid") **Overview:** Outlook Integration for Emails and Calendars by Revenue Grid is designed to streamline email and calendar management for Salesforce users. This app allows seamless synchronization between Outlook and Salesforce, ensuring that all communications and schedules are up-to-date across both platforms. **Key Features:** **Email Integration:** - **Email Sync:** Automatically sync emails between Outlook and Salesforce, ensuring that all communications are logged and accessible. - **Email Templates:** Utilize Salesforce email templates directly within Outlook to maintain consistency and save time. - **Activity Tracking:** Track email opens, link clicks, and responses to measure engagement and effectiveness. **Calendar Integration:** - **Calendar Sync:** Sync calendar events between Outlook and Salesforce to keep schedules aligned and prevent double bookings. - **Event Management:** Create, update, and manage Salesforce events directly from Outlook. - **Meeting Scheduling:** Use Salesforce data to schedule meetings with context, ensuring better preparation and follow-ups. **Productivity Tools:** - **Task Management:** Create and manage Salesforce tasks from Outlook to stay organized and on top of to-dos. - **Contact Management:** Sync contacts between Outlook and Salesforce to ensure accurate and up-to-date information. **Benefits for Sales Teams:** - Enhance productivity by reducing manual data entry and keeping all communications in sync. - Improve scheduling efficiency with synchronized calendars and integrated meeting tools. - Gain insights into email engagement to optimize communication strategies. **Pricing:** $30 USD/user/month **Rating:** 4.74 (800+ reviews) ⭐⭐⭐⭐⭐ **Link:** [Outlook Integration for Emails and Calendars – Revenue Grid](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000000q64KEAQ) ### #5 Groove Sales Engagement Platform (Salesforce Sync for Gmail + Microsoft 365) ![Groove Sales Engagement Platform](https://www.sfapps.info/wp-content/uploads/2024/05/18.png "Groove Sales Engagement Platform") **Overview:** Groove is a sales engagement platform that enhances productivity by syncing Salesforce with Gmail and Microsoft 365. It offers a range of tools to streamline communication, automate workflows, and improve overall sales performance. **Key Features:** **Email and Calendar Sync:** - **Two-Way Sync:** Sync emails and calendar events between Salesforce, Gmail, and Microsoft 365 to ensure all information is up-to-date. - **Email Tracking:** Track email opens, link clicks, and replies to measure engagement and follow up effectively. - **Template Library:** Access a library of email templates to ensure consistent and professional communication. **Sales Automation:** - **Workflow Automation:** Automate repetitive tasks and workflows to save time and increase efficiency. - **Meeting Scheduler:** Simplify scheduling with a built-in scheduler that integrates with your calendar. **Analytics and Reporting:** - **Performance Dashboards:** Monitor sales performance with customizable dashboards and reports. - **Engagement Analytics:** Gain insights into email and call engagement to optimize sales strategies. **Benefits for Sales Teams:** - Increase productivity by automating routine tasks and syncing important data across platforms. - Improve communication with tracking and template tools that ensure consistency and professionalism. - Gain valuable insights into sales activities and performance to drive better decision-making. **Pricing:** $50 USD/user/month **Rating:** 4.94 (384+ reviews) ⭐⭐⭐⭐⭐ **Link:** [Groove Sales Engagement Platform](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000009wgl9EAA) ### #6 Raydiant: Gamification, Communication & Messaging, Rewards & Recognition ![Raydiant](https://www.sfapps.info/wp-content/uploads/2024/05/15.png "Raydiant") **Overview:** Raydiant is designed to boost productivity and engagement through gamification, communication, and rewards within Salesforce. This app helps sales teams stay motivated and connected, driving better performance and collaboration. **Key Features:** **Gamification:** - **Leaderboards:** Track and display top performers to motivate healthy competition. - **Achievement Badges:** Reward achievements with digital badges to recognize and encourage excellence. - **Points System:** Earn points for completing tasks and reaching milestones, redeemable for rewards. **Communication & Messaging:** - **Team Messaging:** Facilitate instant communication within the sales team to enhance collaboration. - **Announcements:** Broadcast important updates and announcements to keep everyone informed. - **Feedback Channels:** Collect feedback and suggestions from team members to improve processes. **Rewards & Recognition:** - **Custom Rewards:** Offer customizable rewards to motivate and recognize high performers. - **Automated Recognition:** Automatically recognize achievements and milestones to ensure timely appreciation. - **Peer Recognition:** Enable team members to recognize each other’s contributions, fostering a supportive environment. **Benefits for Sales Teams:** - Increase motivation and engagement through gamification and rewards. - Enhance team communication and collaboration with integrated messaging tools. - Foster a positive work culture with consistent recognition and feedback. **Pricing:** $25 USD/user/month **Rating:** 4.88 (280+ reviews) ⭐⭐⭐⭐⭐ **Link:** [Raydiant: Gamification, Communication & Messaging, Rewards & Recognition](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000003HykEEAS) ### #7 Mogli: SMS Text Messaging | WhatsApp ![Mogli: SMS Text Messaging](https://www.sfapps.info/wp-content/uploads/2024/05/19.png "Mogli: SMS Text Messaging") **Overview:** Mogli provides robust SMS and WhatsApp messaging capabilities integrated with Salesforce. It’s an excellent tool for personalized communication, allowing sales teams to reach customers through their preferred channels. **Key Features:** **Multi-channel Messaging:** - **SMS and WhatsApp:** Send and receive messages via SMS and WhatsApp directly from Salesforce. - **Templates:** Use pre-built templates for quick and consistent messaging. - **Bulk Messaging:** Send messages to large groups efficiently for campaigns and updates. **Automation:** - **Automated Workflows:** Set up automated messaging workflows for lead nurturing and customer follow-ups. - **Drip Campaigns:** Create drip campaigns to engage customers over time with scheduled messages. - **Event Triggers:** Trigger messages based on specific actions or events in Salesforce. **Tracking and Analytics:** - **Message Tracking:** Track delivery, read receipts, and responses to measure engagement. - **Reporting:** Generate detailed reports to analyze messaging performance and optimize strategies. - **Consent Management:** Manage opt-ins and opt-outs to comply with communication regulations. **Benefits for Sales Teams:** - Enhance customer engagement with personalized, multi-channel messaging. - Automate routine communication tasks to save time and improve efficiency. - Gain insights into messaging performance to refine and improve outreach efforts. **Pricing:** $392 USD/company/month **Rating:** 4.99 (160+ reviews) ⭐⭐⭐⭐⭐ **Link:** [Mogli: SMS Text Messaging | WhatsApp](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000DqCytUAF) ### #8 GridBuddy: The Most Productive User Experience in Salesforce ![GridBuddy](https://www.sfapps.info/wp-content/uploads/2024/05/17.png "GridBuddy") **Overview:** GridBuddy enhances Salesforce productivity apps by providing a unified, spreadsheet-like interface for managing multiple records simultaneously. It simplifies data management and increases user efficiency by allowing easy editing, updating, and viewing of Salesforce data, also try [OKR Salesforce](https://www.sfapps.info/setting-up-sales-team-okr-in-salesforce/). **Key Features:** **Multi-Record Management:** - **Spreadsheet Interface:** Manage Salesforce records in a familiar, spreadsheet-like environment. - **Bulk Editing:** Update multiple records at once, saving time and reducing manual effort. - **Custom Grids:** Create custom grids to view and edit specific sets of data based on user needs. **Data Consolidation:** - **Unified View:** Combine data from different objects into a single view for easier management and analysis. - **Cross-Object Editing:** Edit related records from different objects within the same grid. - **Dynamic Filtering:** Apply dynamic filters to quickly find and update specific records. **Integration and Customization:** - **Salesforce Integration:** Seamlessly integrates with Salesforce, ensuring data consistency and real-time updates. - **Customizable Layouts:** Customize grid layouts to match specific workflows and user preferences. - **User Permissions:** Control access and editing capabilities based on user roles and permissions. **Benefits for Sales Teams:** - Increase productivity by reducing the time spent on data entry and updates. - Improve data accuracy and consistency with easy, bulk editing capabilities. - Enhance user experience with customizable, intuitive interfaces tailored to specific needs. **Pricing:** $24 USD/user/month **Rating:** 4.90 (240+ reviews) ⭐⭐⭐⭐⭐ **Link:** [GridBuddy: The Most Productive User Experience in Salesforce](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000003IkInEAK) ### #9 Power Dialers: Koncert AI Parallel/Flow Dialer, Agent-Assisted Dialer, Cadence ![Power Dialers](https://www.sfapps.info/wp-content/uploads/2024/05/21.png "Power Dialers") **Overview:** Power Dialers by Koncert provides advanced dialing solutions integrated with Salesforce. These tools help sales teams increase call efficiency and effectiveness by automating dialing processes and providing valuable call insights. **Key Features:** **Advanced Dialing:** - **Parallel Dialer:** Simultaneously dial multiple numbers to maximize call connect rates. - **Flow Dialer:** Automate call workflows to streamline the calling process. - **Agent-Assisted Dialer:** Enable agents to focus on conversations while the dialer handles call initiation. **Call Management:** - **Call Recording:** Record calls for training, quality assurance, and compliance purposes. - **Call Analytics:** Access detailed call analytics to measure performance and optimize strategies. - **Voicemail Drop:** Leave pre-recorded voicemail messages to save time and increase outreach efficiency. **Integration and Automation:** - **Salesforce Integration:** Seamlessly integrates with Salesforce to ensure data synchronization and accurate tracking. - **Automated Workflows:** Automate follow-up tasks and workflows based on call outcomes. - **Lead Routing:** Automatically route leads based on predefined criteria to ensure timely follow-ups. **Benefits for Sales Teams:** - Increase call productivity and connect rates with advanced dialing technology. - Improve call quality and training with recording and analytics features. - Streamline follow-up processes and ensure timely lead management with automation. **Pricing:** $200 USD/user/month **Rating:** 4.9 (150+ reviews) ⭐⭐⭐⭐⭐ **Link:** [Power Dialers: Koncert AI Parallel/Flow Dialer, Agent-Assisted Dialer, Cadence](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000000pvxVEAQ) ### #10 XfilesPro Document Management for Salesforce: Integrate, Store, Collaborate ![XfilesPro](https://www.sfapps.info/wp-content/uploads/2024/05/14.png "XfilesPro") **Overview:** XfilesPro is a comprehensive document management solution for Salesforce, designed to enhance file storage, integration, and collaboration. It helps organizations efficiently manage their documents and files within Salesforce, improving accessibility and productivity. **Key Features:** **File Storage:** - **Unlimited Storage:** Utilize external storage solutions to overcome Salesforce storage limitations. - **Cloud Integration:** Integrate with popular cloud storage services like Google Drive, Dropbox, SharePoint, and AWS. - **Secure Storage:** Ensure secure storage and access to documents with advanced security protocols. **Document Management:** - **Metadata Management:** Tag documents with metadata for easy search and retrieval. - **Version Control:** Maintain the version history of documents to track changes and revisions. - **File Linking:** Link files to Salesforce records for better organization and context. **Collaboration:** - **File Sharing:** Share documents with team members and external stakeholders securely. - **Access Control:** Manage document access permissions based on user roles and profiles. - **Collaboration Tools:** Enable real-time collaboration on documents with integrated tools. **Benefits for Sales Teams:** - Enhance document accessibility and management with integrated cloud storage solutions. - Improve collaboration and productivity with secure file sharing and access control. - Streamline document workflows and ensure compliance with version control and metadata management. **Pricing:** $1 USD/user/month **Rating:** 4.98 (120+ reviews) ⭐⭐⭐⭐⭐ **Link:** [XfilesPro Document Management for Salesforce](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000008YbzMEAS) ## **Concluding Insights on Salesforce Productivity Apps** Integrating productivity apps with Salesforce can significantly enhance the efficiency and effectiveness of your sales operations. Each of the apps highlighted in this article offers unique features and benefits that can help streamline tasks, automate workflows, and improve overall performance. Here’s a quick recap of the top apps we covered: 1. **Docomotion – Document Generation & Automation:** Automate document creation and management to save time and reduce errors. 2. **SMS-Magic & Conversive:** Enhance customer engagement with real-time, multi-channel messaging. 3. **Conga Composer Connector for Salesforce:** Simplify document creation and management with custom templates and automated workflows. 4. **Outlook Integration for Emails and Calendars – Revenue Grid:** Sync emails and calendar events to streamline communication and scheduling. 5. **Groove Sales Engagement Platform:** Increase productivity with email and calendar sync, automated workflows, and advanced analytics. 6. **Raydiant:** Boost motivation and engagement through gamification, communication, and rewards. 7. **Mogli:** Improve communication with robust SMS and WhatsApp messaging capabilities. 8. **GridBuddy:** Enhance data management with a unified, spreadsheet-like interface for managing multiple records. 9. **Power Dialers by Koncert:** Increase call efficiency with advanced dialing solutions and automation. 10. **XfilesPro:** Improve document management and collaboration with integrated cloud storage solutions. 11. **ForeSight – Impact Analysis:** Ensure smoother implementations with AI-powered impact analysis and predictive analytics. **Why These Apps Matter:** Integrating these salesforce productivity tools allows sales teams to: - **Automate Routine Tasks:** Free up time for high-value activities by automating repetitive tasks. - **Improve Communication:** Enhance customer interactions through better messaging and email integration. - **Optimize Data Management:** Maintain accurate and up-to-date data for informed decision-making. - **Streamline Workflows:** Simplify processes to boost overall productivity and performance. - **Enhance Collaboration:** Foster a collaborative work environment with integrated tools and real-time updates. **Making the Right Choice:** Selecting the right Salesforce productivity solutions for your Salesforce environment depends on your specific needs and goals. Consider the following: - **Identify Pain Points:** Determine the areas where your sales team faces the most challenges and choose apps that address those issues. - **Evaluate Features:** Look for features that align with your workflow and can integrate seamlessly with your existing processes. - **Check Reviews and Ratings:** User reviews and ratings can provide valuable insights into the app’s performance and reliability. - **Consider Pricing:** Ensure the app fits within your budget while providing the necessary features and benefits. By leveraging these sales productivity salesforce apps, you can maximize the potential of your Salesforce platform, leading to improved efficiency, better customer engagement, and ultimately, higher sales performance. Explore these productivity tools Salesforce offers and choose the ones that best meet your needs to drive your sales team’s success. For more information on these productivity tools in Salesforce, visit the [Salesforce AppExchange](https://appexchange.salesforce.com/) and start transforming your sales operations today. The post [Top 10 Productivity Salesforce Apps](https://www.sfapps.info/top-10-productivity-salesforce-apps/) first appeared on [Salesforce Apps](https://www.sfapps.info).
doriansabitov
1,863,225
Embracing Creativity: The Evolution of "Dumb Daniel"
Welcome back to the final installment of our journey into the world of 6502 assembly programming! If...
0
2024-05-23T20:32:01
https://dev.to/yuktimulani/embracing-creativity-the-evolution-of-dumb-daniel-eei
coding, assembly
Welcome back to the final installment of our journey into the world of 6502 assembly programming! If you've been following along, you're already familiar with "Dumb Daniel," our trusty companion on this adventure. Today, we're diving into the latest chapter of our story as "Dumb Daniel" undergoes a remarkable transformation, evolving from a humble arithmetic calculator into a mesmerizing display of colors on the screen. ## A Journey of Discovery Our journey with "Dumb Daniel" began with a simple goal: to create the easiest program possible within the confines of 6502 assembly. Armed with determination and a sense of curiosity, we set out to conquer the world of assembly programming, one instruction at a time. ## Unforeseen Challenges As we delved deeper into the intricacies of 6502 assembly, we encountered our fair share of challenges and surprises. From unexpected arithmetic quirks to the limitations of the emulator, each obstacle presented an opportunity for growth and learning. ## The Birth of "Dumb Daniel" Out of these challenges emerged "Dumb Daniel," a quirky creation born out of necessity and ingenuity. With its humble beginnings as a simple arithmetic calculator, "Dumb Daniel" quickly captured our imagination and led us on a journey of exploration and discovery. ## A Twist of Fate: Embracing Creativity But as our journey progressed, we found ourselves craving something more than just arithmetic operations. We longed to unleash our creativity and push the boundaries of what was possible within the constraints of the emulator. And so, we made a bold decision to transform "Dumb Daniel" into something truly extraordinary. ## The Evolution Unveiled: Colorful Creations With a few simple tweaks to our code, "Dumb Daniel" underwent a remarkable transformation, blossoming into a vibrant display of colors on the screen. From bold blues to fiery reds, each pixel became a canvas for our imagination, allowing us to create intricate patterns and mesmerizing displays. ## Embracing the Future As we bid farewell to our colorful creation, we can't help but wonder what lies ahead for "Dumb Daniel." Will it continue to evolve and adapt to new challenges, or will it pave the way for even more daring experiments? Only time will tell, but one thing is certain: the journey is far from over. ## Join Us on the Adventure Thank you for joining us on this exhilarating journey through the world of 6502 assembly programming. Whether you're a seasoned programmer or a curious novice, we invite you to join us on our quest for knowledge and exploration. With "Dumb Daniel" by our side, we're ready to embark on new adventures and continue pushing the boundaries of what's possible in the world of assembly programming. Until next time, happy coding! ## Code Reveal ``` ; ROM routines define SCINIT $ff81 ; initialize/clear screen define CHRIN $ffcf ; input character from keyboard define CHROUT $ffd2 ; output character to screen define SCREEN $ffed ; get screen size define PLOT $fff0 ; get/set cursor coordinates ; Memory locations define INPUT $2000 ; input buffer (up to 5 chars) jsr SCINIT ldy #$00 printString: lda string,y beq done jsr CHROUT iny bne printString done: jsr readinput lda #$0D jsr CHROUT ldy #$00 print_input: lda INPUT,y jsr CHROUT iny cpy #$05 bne print_input brk string: dcb "I","f",32,"y","o","u",32,"w","a","n","t",32,"t","o",32,"s","e","e",32"m","a","g","i","c",32,"t","h","e","n",32,"t","y","p","e",32,"m","a","g","i","c",32,"a","n","d",32,"p","r","e","s","s",32,"e","n","t","e","r",32,"t","w","i","c","e",32,00 ; --------------------------------------------------------------- readinput: lda #$A0 jsr CHROUT lda #$83 jsr CHROUT ldy #$00 read_char: jsr CHRIN CMP #$00 beq read_char cmp #$08 bne check_enter cpy #$00 beq read_char dey lda #$20 jsr CHROUT lda #$83 jsr CHROUT jsr CHROUT lda #$A0 jsr CHROUT LDA #$83 jsr CHROUT check_enter: cmp #$0D bne check_letter cpy #$05 beq execute check_letter: cmp #97 bcc uppercase cmp #123 bcs read_char sec sbc #32 uppercase: cmp #65 bcc read_char cmp #91 bcs read_char cpy #$05 beq read_char sta INPUT,y jsr CHROUT lda #$A0 jsr CHROUT lda #$83 jsr CHROUT iny jmp read_char done_input: lda #$20 jsr CHROUT ;rts execute: ldy #$00 loop: lda #$e ; colour number sta $0200,y ; set pixel colour at page 2+y lda #$f ; colour number sta $0300,y ; set pixel colour at page 3+y lda #$3 ; colour number sta $0400,y ; set pixel colour at page 4+y lda #$a ; colour number sta $0500,y ; set pixel colour ar page 5+y iny ; increment index bne loop ; continue until done the page (256 pixels) ``` Credits to my professor Chris Tyler for providing the code of getting input from the keyboard.
yuktimulani
1,863,224
houston hospice and palliative care
houston hospice and palliative care stands as a beacon of comfort and support for individuals facing...
0
2024-05-23T20:30:43
https://dev.to/houstonpalliativecare/houston-hospice-and-palliative-care-1ja5
**[houston hospice and palliative care](![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nm6teecbsofvxac9rggk.png))** stands as a beacon of comfort and support for individuals facing terminal illnesses and their families. Founded in 1980, this nonprofit organization offers a comprehensive range of hospice services, including medical care, pain management, emotional and spiritual support, and bereavement counseling. With a team of skilled physicians, nurses, social workers, chaplains, and volunteers, Houston Hospice strives to honor the dignity and autonomy of each patient while providing compassionate end-of-life care.
houstonpalliativecare
1,863,223
How to Download (wget) Models from CivitAI & Hugging Face (HF) & upload into HF including privates
How to download models from CivitAI (including behind a login) and Hugging Face (including private...
0
2024-05-23T20:25:13
https://dev.to/furkangozukara/how-to-download-wget-models-from-civitai-hugging-face-hf-upload-into-hf-including-privates-1faa
tutorial, cloud, ai, beginners
<h1 style="margin-left:0px;"><strong>How to download models from CivitAI (including behind a login) and Hugging Face (including private repos) into cloud services such as Google Colab, Kaggle, RunPod, Massed Compute and upload models / files to your Hugging Face repo full Tutorial</strong></h1> <p style="margin-left:0px;"><a target="_blank" rel="noopener noreferrer" href="https://youtu.be/X5WVZ0NMaTg"><u>https://youtu.be/X5WVZ0NMaTg</u></a></p> <p style="margin-left:0px;"><a target="_blank" rel="noopener noreferrer" href="https://youtu.be/X5WVZ0NMaTg"><u>How to Download (wget) Models from CivitAI &amp; Hugging Face (HF) &amp; upload into HF including privates</u></a></p> <p style="margin-left:0px;">Hugging Face Download / Upload Notebook File (fully shown in the video) ⤵</p> <p style="margin-left:0px;"><a target="_blank" rel="noopener noreferrer" href="https://www.patreon.com/posts/hugging-face-and-104672510"><u>https://www.patreon.com/posts/hugging-face-and-104672510</u></a></p> <p style="margin-left:0px;">-</p> <p style="margin-left:auto;">{% embed https://youtu.be/X5WVZ0NMaTg %}</p> <p style="margin-left:0px;">If you are having trouble to download models onto your cloud platforms such as RunPod, Google Colab, Kaggle, Massed Compute or anywhere, this tutorial is made for you. Moreover, you can upload your files / models into your private Hugging Face repository and save them permanently privately and download them super fast. By following this tutorial, you will be able to download CivitAI models that requires login. So with this tutorial you will be able to download and upload even private models from and to Hugging Face and also download models from CivitAI whether public or behind login by using wget command and a specially crafted JupteryLab notebook.</p> <p style="margin-left:0px;">The logic explained in this video works for every kind of files that you can download via a URL onto any cloud platform that supports wget command.</p> <p style="margin-left:0px;">Hugging Face Download / Upload Notebook File (fully shown in the video) ⤵</p> <p style="margin-left:0px;"><a target="_blank" rel="noopener noreferrer" href="https://www.patreon.com/posts/hugging-face-and-104672510"><u>https://www.patreon.com/posts/hugging-face-and-104672510</u></a></p> <p style="margin-left:0px;">0:00 Introduction to the ultimate model download / upload tutorial to the cloud services</p> <p style="margin-left:0px;">0:32 How to download public model from CivitAI onto cloud services e.g. RunPod</p> <p style="margin-left:0px;">0:50 How to understand if a CivitAI model requires login and thus API token</p> <p style="margin-left:0px;">1:03 Download a public model onto RunPod</p> <p style="margin-left:0px;">1:20 How to use wget command to download models / files</p> <p style="margin-left:0px;">2:03 How to download a public model onto Massed Compute</p> <p style="margin-left:0px;">2:30 How to download a public model into desired folder in Google Colab</p> <p style="margin-left:0px;">2:43 How to compose a directory / folder on Google Colab</p> <p style="margin-left:0px;">2:51 The Google Colab’s pathing directory / folder logic</p> <p style="margin-left:0px;">3:03 How to navigate between folders / directories of Google Colab</p> <p style="margin-left:0px;">3:13 Start download on Google Colab with wget in desired directory</p> <p style="margin-left:0px;">3:31 How to compose a directory / folder on a Kaggle notebook</p> <p style="margin-left:0px;">3:41 The Kaggle’s pathing directory / folder logic</p> <p style="margin-left:0px;">3:51 How to navigate between folders / directories of Google Colab</p> <p style="margin-left:0px;">4:01 Start download on Google Colab with wget in desired directory</p> <p style="margin-left:0px;">4:17 How to utilize / use Kaggle’s temporary disk space</p> <p style="margin-left:0px;">5:24 How to download files / models from a public Hugging Face repository into the cloud services such as Google Colab</p> <p style="margin-left:0px;">7:00 How to download models / files on Windows</p> <p style="margin-left:0px;">7:18 How to download models from CivitAI that requires login into cloud services such as Kaggle</p> <p style="margin-left:0px;">7:42 How to get your CivitAI API key for free to download models</p> <p style="margin-left:0px;">8:02 How to format wget download link with API Key to download models behind a login on CivitAI</p> <p style="margin-left:0px;">8:55 How to download models / files from Hugging Face private repositories easy way</p> <p style="margin-left:0px;">10:04 How to download models / files from Hugging Face private repositories by using HF API with a very advanced Jupyter notebook</p> <p style="margin-left:0px;">10:29 How to use HF notebook file on RunPod</p> <p style="margin-left:0px;">10:44 How to understand if Jupyter notebook cell execution completed or still running</p> <p style="margin-left:0px;">10:59 How to get your Hugging Face API token key and login in the Jupyter notebook</p> <p style="margin-left:0px;">11:27 How to download entire private repository via the Jupyter notebook on RunPod</p> <p style="margin-left:0px;">12:06 How to upload files or folders to your Hugging Face repository — can be both private or public</p> <p style="margin-left:0px;">12:43 How to use Hugging Face uploader / downloader notebook on Massed Compute</p> <p style="margin-left:0px;">13:17 How to use Hugging Face uploader / downloader notebook on Kaggle</p> <p style="margin-left:0px;">14:45 How to upload a file / folder in Kaggle to the Hugging Face — you can use this to save your trained models as well</p> <p style="margin-left:0px;">15:19 Importance of repository type on Hugging Face</p> <p style="margin-left:0px;">16:15 How to use Hugging Face uploader / downloader notebook on Google Colab</p> <p style="margin-left:0px;">16:25 Install cell is mandatory on all platforms</p> <p style="margin-left:0px;">16:55 How to select / set download folder path on Google Colab</p> <p style="margin-left:0px;">17:25 How to use Hugging Face uploader / downloader notebook on Windows PC locally</p> <p style="margin-left:0px;">17:35 How to install JupyterLab on Windows to be able to use notebooks</p> <p style="margin-left:0px;">17:50 How to open Jupyter notebook on JupteryLab interface</p> <p style="margin-left:0px;">18:10 How to set folder paths on Windows in Hugging Face uploader / downloader notebook</p> <p style="margin-left:0px;">18:42 Why put “r” letter to the front of folder paths on Windows</p> <p style="margin-left:0px;">Title: How to Download Models from CivitAI and Hugging Face onto Cloud Services and Personal Computers</p> <p style="margin-left:0px;">Summary:</p> <p style="margin-left:0px;">This comprehensive video tutorial demonstrates how to download machine learning models from CivitAI and Hugging Face onto various cloud computing platforms such as RunPod, Massed Compute, Kaggle, and Google Colab, as well as personal computers. It covers downloading both public and login-protected models from CivitAI, and models from public and private repositories on Hugging Face. The tutorial also shows how to upload models to Hugging Face.</p> <p style="margin-left:0px;">Key Steps:</p> <p style="margin-left:0px;">Downloading public models from CivitAI:</p> <p style="margin-left:0px;">Right-click the download link and copy the URL</p> <p style="margin-left:0px;">Use the wget command in the terminal with the URL in double quotes</p> <p style="margin-left:0px;">Optionally specify a custom file name using the -O flag</p> <p style="margin-left:0px;">Paste the command and execute it to start the download</p> <p style="margin-left:0px;">Downloading login-protected models from CivitAI:</p> <p style="margin-left:0px;">Generate an API token in your CivitAI account settings</p> <p style="margin-left:0px;">Append ?token=your_API_token to the model download URL</p> <p style="margin-left:0px;">Use the modified URL with the wget command to download the model</p> <p style="margin-left:0px;">Downloading models from public Hugging Face repositories:</p> <p style="margin-left:auto;"> <picture> <source srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/1*VcB2Hxjvu5tsdvKfbvydBg.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/1*VcB2Hxjvu5tsdvKfbvydBg.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/1*VcB2Hxjvu5tsdvKfbvydBg.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/1*VcB2Hxjvu5tsdvKfbvydBg.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/1*VcB2Hxjvu5tsdvKfbvydBg.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/1*VcB2Hxjvu5tsdvKfbvydBg.png 1100w, https://miro.medium.com/v2/resize:fit:1400/format:webp/1*VcB2Hxjvu5tsdvKfbvydBg.png 1400w" type="image/webp" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px"> <source srcset="https://miro.medium.com/v2/resize:fit:640/1*VcB2Hxjvu5tsdvKfbvydBg.png 640w, https://miro.medium.com/v2/resize:fit:720/1*VcB2Hxjvu5tsdvKfbvydBg.png 720w, https://miro.medium.com/v2/resize:fit:750/1*VcB2Hxjvu5tsdvKfbvydBg.png 750w, https://miro.medium.com/v2/resize:fit:786/1*VcB2Hxjvu5tsdvKfbvydBg.png 786w, https://miro.medium.com/v2/resize:fit:828/1*VcB2Hxjvu5tsdvKfbvydBg.png 828w, https://miro.medium.com/v2/resize:fit:1100/1*VcB2Hxjvu5tsdvKfbvydBg.png 1100w, https://miro.medium.com/v2/resize:fit:1400/1*VcB2Hxjvu5tsdvKfbvydBg.png 1400w" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px"><img class="image_resized" style="height:auto;width:680px;" src="https://miro.medium.com/v2/resize:fit:1313/1*VcB2Hxjvu5tsdvKfbvydBg.png" alt="" width="700" height="394"> </picture> </p>
furkangozukara
1,863,222
My Pen on CodePe
Check out this Pen I made!
0
2024-05-23T20:23:56
https://dev.to/felipe_oliveira12333/my-pen-on-codepe-2nhe
codepen
Check out this Pen I made! {% codepen https://codepen.io/crkqqtaw-the-sans/pen/dyEXaoL %}
felipe_oliveira12333
1,805,906
Deploy a Wordpress site on AWS
Introduction: In today's tutorial, we'll explore the process of deploying a WordPress website on...
0
2024-05-23T20:19:00
https://dev.to/cloudairx/deploy-a-wordpress-site-on-aws-4a85
**Introduction:** In today's tutorial, we'll explore the process of deploying a WordPress website on Amazon Web Services (AWS) Elastic Compute Cloud (EC2) using Bitnami. This comprehensive guide will walk you through each step, from launching your EC2 instance to accessing the WordPress admin dashboard and starting your website-building journey. **Step 1** - Log in to the Amazon Console and navigate to the EC2 Dashboard. - Create a new instance and give the instance a name - Browse through the AMI - Search for Wordpress by Bitnami ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iy1ayr2e4yua8z0rmccx.png) - Under the AWS Marketplace and choose the WordPress by Bitnami as the Amazon Machine Image (AMI) ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0shdonvp8iuvv1e0ftg.png) **Step 2** - Select the t3 micro instance type - Create a new keypair or select from existing ones - Keep the Security group as default - You can leave the root volume as 10gb or increase to 30gb (It is still within the free tier) - Leave everything else as default and click on **Launch Instance** ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4fc1bez7s2td2zcmgm00.png) Once our EC2 is up and running - Select the EC2 you just created, in the details tab you will find the Public IP section - Copy the Public IPv4 address and paste in your web browser ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jq5jjn9d671e9pwrls3i.png) Yes! Our WordPress site is now live ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hnpze50ab8pfc770q9zy.png) Now we need to login to our Admin Dashboard ``` PublicIPV4/wp-admin ``` - Simply append "/wp-admin" to your Public IPv4 address in the browser address bar (e.g. http://54.211.145.2/wp-admin). In our case http://54.211.145.2 is the IP Address ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m17vo2u5bdtv62w3ll5g.png) Let's fetch the username and password from our EC2 Logs - Select the **EC2 Instance** - Click **actions** - In the drop down select the **Monitor and Troubleshoot** - Click the **Get system logs** ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/alhic292x5pa0iumnm4s.png) - Scroll through the system logs until you see something like the image above. The password and user name is in the logs - Return to the WordPress admin login page and enter the username and password obtained from the logs. Now we have successfully logged in to the **Admin Dashboard** of our WordPress. You can now install plugins and themes to customize your WordPress site according to your preferences. Explore the wide range of options available and start building your dream website. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2l6zkc00anyd99xfu9j.png) **Conclusion:** Deploying a WordPress website on **EC2 **using **Bitnami** is a straightforward process that can be accomplished with just a few simple steps. By following this guide, you've successfully launched your WordPress site on AWS and gained access to the powerful tools and features of the WordPress admin dashboard. Now, it's time to unleash your creativity and build an impressive online presence. Happy website building!
cloudairx
1,863,220
Issue 45 of AWS Cloud Security Weekly
(This is just the summary of Issue 45 of AWS Cloud Security weekly @...
0
2024-05-23T20:14:51
https://aws-cloudsec.com/p/issue-45
(This is just the summary of Issue 45 of AWS Cloud Security weekly @ https://aws-cloudsec.com/p/issue-45 << Subscribe to receive the full version in your inbox weekly). **What happened in AWS CloudSecurity & CyberSecurity last week May 13-May 22, 2024?** - Amazon QuickSight now allows connectivity to Redshift data sources using an IAM role through GetClusterCredentialswithIAM. This enhancement builds on the previously introduced Redshift RunasRole feature by making the Database user/Database Group parameters optional, effectively linking the temporary user identity directly to the IAM credentials. - Amazon Detective adds support for EKS audit logs in Security Lake integration. - AWS Security Hub now supports version 3.0 of the Center for Internet Security (CIS) AWS Foundations Benchmark which includes 37 security controls, with 7 new controls that are unique to version 3.0. Security Hub has met the criteria for the CIS Security Software Certification and has been certified for levels 1 and 2 of the CIS AWS Foundations Benchmark version 3.0. **Trending on the news & advisories (Subscribe to the newsletter for details):** - Amazon has a new CEO. - Oracle goes vegan: Dumps Terraform for OpenTofu. - Microsoft will require MFA for all Azure users. - SEC: Financial orgs have 30 days to send data breach notifications. - FedRAMP board launched to support safe, secure use of cloud services in government. - Prison for cybersecurity expert selling private videos from inside 400,000 homes. - Employee Personal GitHub Repos Expose Internal Azure and Red Hat Secrets. - CISA and ONCD Award the Winners of the Fifth Annual President’s Cup Cybersecurity Competition. - Linguistic Lumberjack: Attacking Cloud Services via Logging Endpoints (Fluent Bit - CVE-2024-4323). - Amazon S3 will no longer charge for several HTTP error codes. - Microsoft will require MFA for all Azure users.
aws-cloudsec
1,863,219
houston palliative hospice
houston palliative hospice represents a holistic approach to healthcare, focusing on relieving...
0
2024-05-23T20:14:14
https://dev.to/houstonpalliative/houston-palliative-hospice-3jm5
**[houston palliative hospice](https://houstonpalliativehospice.org/)** represents a holistic approach to healthcare, focusing on relieving suffering and improving the quality of life for patients facing serious illnesses. Unlike hospice care, which is typically reserved for individuals with a prognosis of six months or less to live, palliative care can be provided at any stage of illness, regardless of prognosis. Its primary goal is to alleviate symptoms such as pain, shortness of breath, fatigue, and nausea, while addressing the emotional, social, and spiritual needs of patients and their families.
houstonpalliative
1,863,216
Choosing Between Docker Compose and Kubernetes For Local Dev
This was originally published on the Shipyard Blog When choosing between using Kubernetes and...
0
2024-05-23T20:10:33
https://shipyard.build/blog/comparing-docker-kubernetes-local-dev/
docker, kubernetes, productivity, developer
*<a href="https://shipyard.build/blog/comparing-docker-kubernetes-local-dev/" target="_blank">This was originally published on the Shipyard Blog</a>* --- When choosing between using <a href="https://kubernetes.io/" target="_blank">Kubernetes</a> and <a href="https://docs.docker.com/compose/" target="_blank">Docker Compose</a> for local dev, you’re essentially making a tradeoff between performance and architecture. Let’s break it down and see which tool makes the most sense for your local development environment. ## Docker Compose for local development Using Docker Compose for your local dev environment is pretty trivial. There are really only two prerequisites: 1. Your application must be containerized (eg. a Dockerfile for every service) 2. You’ll define your multi-container app in a Compose file (this will include any necessary options for the container(s) in your app to work together, any volumes, etc.) With Docker and Docker Compose, you can containerize any services you’re actively developing, and build/rebuild them as Docker images upon code changes. You can also easily pull existing Docker images from a registry to your machine, either to mock services locally or limit the number of mutable services you’re working on at a time. When using Compose for local dev, since you're working with the same (or similar) Docker container(s) that you'll see at every stage of your development life cycle, you’ll get similar behavior locally to what you’ll get in any cloud environment, minus the advanced orchestration. ## Kubernetes for local development Chances are, you’re using Kubernetes (or a similar orchestration tool) in all of your cloud-based environments and in production. You might want to get similar performance/results by shifting left and using k8s in your local dev environment. When you’re using Kubernetes locally, you’ll generally be running a lighter-weight version of what you’d be seeing in a pre-production environment. This is because your machine is unfortunately (in most cases) limited in compute, versus your cloud or on-prem host option. You also won’t need as many config options for a dev cluster, making your spin ups/downs much quicker. Using Kubernetes locally is, well, controversial. We’ll get into that a bit later (and at length in a future post). ## Comparing Docker Compose and Kubernetes for local development There are a few key categories to consider when you’re choosing one over the other for local dev. Obviously, there are tradeoffs, but it’s important to consider what’s important to your use case. ### Resource constraints Even with a lightweight Kubernetes cluster, Docker Compose is really the clear choice when it comes to local performance. And anyone who has ever run even a small Docker application knows that Docker apps aren’t exactly trivial to run — you’ll still need a decently powerful machine. Kubernetes is a different story. For the average developer’s computer, local Kubernetes consumes a lot of compute and makes it hard to run anything other than your application. Of course, more powerful machines will increase its workability, but at the end of the day, you have to ask yourself if the results are really worth it. ### Orchestration model With Kubernetes, you can run multi-node clusters, whereas Docker Compose is limited to single-node environments. Having a cluster closer to production means you can see how your application will perform much earlier on, especially when it comes to self-healing, load balancing, and auto-scaling. With Docker Compose, you are able to scale individual containers, however this is done manually and can’t exactly supplement k8’s functionality. ### Configuration Docker Compose is extremely widely-used, and one of the (countless) reasons is because it’s simple to use but has extensive configuration options for power users. With most small to medium sized apps, you can containerize them and define them with Compose pretty quickly, resulting in a full-fledged running application. It’s generally pretty simple to figure out why a Docker Compose app isn’t building/running correctly, and there are only a limited number of configurations you’ll need to change. Kubernetes has a bit more of a learning curve. Most users need at least a high-level understanding of core concepts before they can write a Kubernetes YAML (let alone the multiple YAMLs required to spin up a cluster). Past the YAMLs themselves, you’ll need to apply command line flags and options to orchestrate the resources together. ## The ideal environment workflow with Docker Compose and Kubernetes If you’re developing a cloud native application, you’ll (ideally) have an environment workflow with various types of environments for certain “checkpoints” in the release process. This enables you to test more often, get more stakeholder feedback, and actually keep your dev loop continuous. Here is one way you can deal with these different environment types: ### Local development environment This is where Docker Compose really shines. You’ll have a Compose file to build/manage the services that you’re actively iterating on, and you’ll pull (real or mock) images from your container registry for any remaining services. Most of your inner loop iteration will happen here. ### Cloud development environment As of recently, cloud dev environments are starting to gain traction. While many orgs skip this stage, it can be helpful to have a lightweight environment with decent compute for developing features collaboratively and iterating with more complex integrations. Think <a href="https://github.com/features/codespaces" target="_blank">GitHub Codespaces</a>, <a href="https://www.daytona.io/" target="_blank">Daytona</a>, or <a href="https://www.gitpod.io/" target="_blank">Gitpod</a>. For cloud dev environments, you’ll probably want a single-tenant k3s cluster. Using <a href="" target="_blank">vCluster</a> for quick provisioning is also a good option here. ### Ephemeral PR environment This will be more production-like than your cloud development environment(s). It will likely run on k3s and include real services, integrations, and (sanitized) data. This environment should quickly build and spin up when someone opens a PR/MR, and it should have the capacity to run the same E2E test suite that you run against staging and production. You might want to check out a solution like <a href="https://docs.shipyard.build/docs" target="_blank">Shipyard</a> for this — Shipyard takes care of the environment provisioning and lifecycle automation. ### Main staging environment Many teams benefit from a static staging environment for any infrastructure that’s difficult to ephemeralize. This will be used for any final testing once all branches are merged to main. This is the real deal, so you’ll probably be using Kubernetes instead of a lighter-weight variant. ## Tools for using Docker and Kubernetes for local development When it comes to development, you're probably using tools that extend, simplify, and/or optimize Docker and k8s, instead of just running them at base. Here are some tools we use to make development easier: ### Docker Compose This almost goes without saying. A Docker Compose file should be the first thing you write after Dockerizing your application. Why? It’s the quickest and easiest way to get your containers to interface with each other. You’ll also preserve any options and configurations so your Dockerized application will spin up the same way, every time, on every machine. Not sure how to get started? Docker recently rolled out the `docker init` command, which can look at your stack and do all the guesswork for writing a Compose file. ### K3s When you’re working in any non-production environment, you can get by with a scaled down version of your production infrastructure. Kubernetes (k8s) is powerful, but probably overkill for the vast majority of development tasks and testing. Working with a more lightweight cluster, like <a href="https://k3s.io/" target="_blank">k3s</a>, you can get a close approximation of the infrastructure while only needing a fraction of the compute and complexity — with the benefit of more speed. <a href="https://docs.k3s.io/quick-start" target="_blank">Read how to set up and spin up a local k3s cluster.</a> ### K0s If you're looking for something that "just works", check out <a href="https://docs.k0sproject.io/stable/" target="_blank">k0s</a>. Developed by Team Lens, k0s is easy to run anywhere -- bare metal, on-prem, locally, and on any cloud provider. It doesn't have any dependencies and is distributed in a single binary. With k0s, you don't have to worry about config (as with most k8s options), and can get a cluster spun up within minutes, all important features for local dev. <a href="https://docs.k0sproject.io/stable/install/" target="_blank">Read the k0s docs to get started.</a> ### Kind (Kubernetes in Docker) <a href="https://kind.sigs.k8s.io/" target="_blank">Kind</a> is becoming an increasingly popular way to run a local Kubernetes cluster. It uses Docker containers as nodes. With kind, it’s simple to pull and load Docker images right into your cluster. It was actually made to test Kubernetes, but has been adopted for other use cases, particularly CI and local dev. To get started, all you’ll need to do is open Docker and run `kind cluster create`. ## The verdict? At the end of the day, Docker Compose and Kubernetes are at opposite ends of the spectrum when it comes to ease-of-use. Getting your local development environment right with Kubernetes is nontrivial, and will take some fine-tuning but ultimately can be a good approximation of what you’re using later on in the pipeline. Docker Compose is easy to get running right out of the box, but there will be some parity issues between your dev environment and staging (and of course, production). For most dev teams, Docker Compose is the right amount of orchestration you’ll need locally.
shipyard
1,863,215
React: Deep Dive into Component Enhancement Techniques
In React, component enhancement techniques are strategies to augment components with additional...
0
2024-05-23T20:09:53
https://dev.to/bilelsalemdev/react-deep-dive-into-component-enhancement-techniques-3j2k
react, javascript, webdev, frontend
In React, component enhancement techniques are strategies to augment components with additional functionality, behaviors, or styles without modifying the original component directly. Two common enhancement techniques are Higher Order Components (HOCs) and Fragments. #### Higher Order Component (HOC) **Definition**: A Higher Order Component (HOC) is a function that takes a component and returns a new component with additional props or behaviors. It is a pattern in React for reusing component logic. **Key Points**: - HOCs are pure functions with zero side-effects. - They do not modify the original component; instead, they create a wrapper component that provides additional functionality. - They are used for cross-cutting concerns like logging, error handling, state management, or injecting props. **Example**: ```javascript const withAuth = (OriginalComponent) => (props) => { // Check user authentication here const isAuthenticated = true; // Simulate authentication check return isAuthenticated ? ( <OriginalComponent {...props} /> ) : ( <div>You are not authorized to access this content</div> ); }; const MyComponent = () => ( <div>This is MyComponent content</div> ); const AuthMyComponent = withAuth(MyComponent); // Usage <AuthMyComponent someProp="value" /> ``` In this example, `withAuth` is an `HOC` that checks for user authentication before rendering the original `MyComponent`. This promotes code reuse and keeps the core logic of `MyComponent` clean. **Benefits**: - Code reuse: HOCs allow you to reuse component logic across different components. - Separation of concerns: HOCs enable you to separate logic from the UI components. - Enhanced readability and maintainability: By abstracting complex logic into HOCs, components become simpler and more focused. **Caveats**: - Prop drilling: Passing props through multiple layers can become cumbersome. - Debugging: HOCs can make the component tree more complex, potentially complicating debugging. - Naming collisions: When wrapping components, prop names must be managed carefully to avoid conflicts. #### Fragments **Purpose**: Fragments allow grouping of multiple elements without adding extra nodes to the DOM. This can improve performance by avoiding unnecessary DOM nodes and makes the DOM structure cleaner. **Key Points**: - Fragments let you return multiple elements from a component’s render method without a wrapper div. - They do not create an extra DOM element, thus not impacting the DOM tree structure. **Usage**: ```javascript import React from 'react'; const List = () => ( <React.Fragment> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </React.Fragment> ); // Shorthand syntax const ListShorthand = () => ( <> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </> ); const App = () => ( <ul> <List /> <ListShorthand /> </ul> ); export default App; ``` In this example, the `List` component uses `<React.Fragment>` to group `<li>` elements without adding extra nodes to the DOM. The `ListShorthand` component demonstrates the shorthand syntax `<>` for the same purpose. **Benefits**: - Cleaner DOM: Fragments prevent unnecessary wrapper elements, resulting in a cleaner and more efficient DOM structure. - Performance: Reduces the number of nodes in the DOM, which can improve rendering performance. - Flexibility: Allows multiple elements to be returned from a component without altering the overall structure. **Caveats**: - Styling: Since Fragments don’t render any actual DOM element, you cannot directly apply styles or classes to a Fragment. - Keyed fragments: When iterating over a collection of elements within a Fragment, you still need to provide keys for each child element to maintain reconciliation. ### Conclusion Component enhancement techniques such as Higher Order Components and Fragments are powerful tools in React development. HOCs enable the reuse of component logic and abstraction of concerns, while Fragments allow for more efficient and cleaner DOM structures. Understanding and effectively using these techniques can significantly enhance the scalability and maintainability of React applications.
bilelsalemdev
1,863,214
Chatbots Vs. Humans
With AI in development, the same question comes to mind, "Will AI take over our jobs?" I wanted to do...
0
2024-05-23T20:09:30
https://dev.to/christopherchhim/chatbots-vs-humans-1fi9
ai, productivity, career
With AI in development, the same question comes to mind, "Will AI take over our jobs?" I wanted to do some more research regarding AI's capabilities. In this case, I choose to look into the functionality of chatbots to see if they can replace human interactions. Chatbots are used to automate messages to save time for those in need of it. Such instances can include customer service, setting up appointments in healthcare, travel, etc... Chatbots can save time and money, but are they a good alternative to human interactions? In Panagiotidi's article _Do Users Prefer Chatbots Over Humans? It Depends... _, she cites several sources indicating user preference between chatbot and human service providers. I can personally emphasize having human service providers because I think it is inconvenient to have to redial the same phone number to repeat a chatbot's message. However, this article also helps me see both sides of the argument and why it may be necessary to have chatbots automate calls. Chatbots are used in many industries so I believe that chatbots are only preferred depending on the industry. As Panagiotidi states, "For tasks seen as more subjective or requiring empathy, consumers may favour human providers, while for tasks perceived as more objective or analytical, bots may be preferred". Her input makes me reflect on the importance of chatbots and the circumstances in which they are needed. I can testify to her statement in the sense that I do not like having to interact with chatbots when it comes to healthcare, but I prefer speaking to chatbots when it comes to financial calls. It saves me the trouble from directly going to the bank and directly speaking to a representative and it also guides me in which sector of the bank I should speak to. This post was heavily inspired from: Panagiotidi, M. (2024, May 17) Do Users Prefer Chatbots Over Humans? It Depends... Retrieved from: [https://uxpsychology.substack.com/p/do-users-prefer-chatbots-over-humans]
christopherchhim
1,863,213
Blackheads acne Remove easily
Blackheads Unmasked: Understanding, Treating, and Banishing Stubborn Acne Introduction Blackheads....
0
2024-05-23T19:58:37
https://dev.to/laura_leonard_be0dc9e261c/blackheads-acne-remove-easily-1028
Blackheads Unmasked: Understanding, Treating, and Banishing Stubborn Acne ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c87hhsghffydkvtx7qy9.jpg) Introduction Blackheads. Those pesky little spots that seem to appear out of nowhere, dotting our noses, chins, and foreheads. But what exactly are blackheads, and why do they keep coming back? In this comprehensive guide, we'll peel back the layers of mystery surrounding blackheads, from their causes and treatments to prevention strategies and myth-busting. By the end, you'll have the knowledge and tools to tackle blackheads head-on and achieve clearer, healthier skin. Anatomy of a Blackhead Blackheads, also known as open comedones, are small bumps that appear on the skin's surface. Unlike whiteheads, which are closed comedones, blackheads have a widened pore opening filled with a mixture of oil, dead skin cells, and bacteria. The dark color of blackheads is not dirt but rather oxidized melanin, the pigment responsible for skin color. Causes and Contributing Factors Blackheads form when excess oil (sebum) produced by the skin's sebaceous glands combines with dead skin cells and becomes trapped within hair follicles. Factors such as hormonal fluctuations, genetics, and environmental influences can increase sebum production and promote the development of blackheads. Bacteria, particularly Propionibacterium acnes, can also contribute to the formation of blackheads by causing inflammation and pore blockages. Types of Blackhead Treatments Numerous over-the-counter products are available to treat and prevent blackheads. Ingredients like salicylic acid, benzoyl peroxide, and retinoids are commonly found in blackhead-fighting skincare products. Salicylic acid works by dissolving excess oil and exfoliating dead skin cells, while benzoyl peroxide kills acne-causing bacteria. Retinoids, derived from vitamin A, help unclog pores and promote cell turnover. Professional Treatments For more stubborn blackheads, professional treatments performed by dermatologists or estheticians may be necessary. These treatments include extractions, chemical peels, and microdermabrasion. During extractions, a trained professional uses specialized tools to manually remove blackheads from the skin. Chemical peels and microdermabrasion treatments exfoliate the skin, helping to remove dead skin cells and unclog pores. Home Remedies and DIY Treatments Steam facials are a popular home remedy for blackheads. By exposing the skin to steam, pores are gently warmed and softened, making it easier to remove blackheads. To perform a steam facial, simply fill a bowl with hot water, drape a towel over your head to create a tent, and lean over the bowl for 5-10 minutes. Clay **[read more](https://sites.google.com/view/acnecysts/home)**
laura_leonard_be0dc9e261c
1,863,212
Can Artificial Intelligence replace Human Intelligence? Logical Inputs!
The field of Artificial intelligence (AI) is advancing quickly showcasing developments regularly in...
0
2024-05-23T19:56:41
https://dev.to/bhipanshu/can-artificial-intelligence-replace-human-intelligence-logical-inputs-3fnd
ai, learning, machinelearning
The field of Artificial intelligence (AI) is advancing quickly showcasing developments regularly in areas such as finance, healthcare and business solutions, demonstrating its versatility as a transformative force. AI can be classified into 3 categories based on capabilities: ![Categories](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0gawt8yyq9mx28tnrrip.png) 1. **Nаrrоw АI**: Desigпed tо рerfоrm sрeсifiс tаsks with high ассurасy аnd effiсieпсy. Nаrrоw АI is where the field is сurreпtly аt. 2. **Generаl АI(AGI)**: This is the ideа оf mасhiпes thаt саn mаtсh оr even surрасs humап-level iпtelleсtuаl сараbilities асrоss mапy dоmаiпs. 3. **Suрer АI**: Beyопd just mаtсhiпg humап соgпitiоп, suрer intelligeпсe refers tо self-аwаre АI systems with соgпitive abilities thаt vаstly exсeed humапs. Ever since the remarkable advances in artificial intelligence (AI) over the past decade, there has been endless debate and speculation about AI eventually surpassing human-level intelligence. There is a worry among many that AI could render or mimic just like humans and replace over in several tasks and occupations. But can AI really replace human intelligence? The answer to this is NO. **Why AI Will Never Replace Humans: A Personal Perspective ⬇** There are various aspects that draws a line between artificial intelligence and human intelligence. **1. Emotional Intellect: The Heart of Humanity** One of the fundamental aspects that set humans apart is our emotional intellect. The ability to express emotions, empathize with others, and read subtle cues is a quintessential human trait that AI struggles to replicate. For example, in scenarios like customer service, where personal interaction and compassion are paramount, the human touch remains irreplaceable. **2. Creativity: The Essence of Innovation** As AI continues to evolve, the realm of creativity emerges as a stronghold of human intelligence. From creative endeavors in art and design to innovative problem-solving in finance and coding, human creativity thrives in diverse domains. The capacity to think outside the box, generate novel ideas, and tackle complex challenges with ingenuity remains a uniquely human forte. **3. Empathy: Bridging Connections** As people relate to one another , empathy plays a pivotal role. The ability to share feelings, understand emotions, and connect on a deeper level is a cornerstone of human relationships. While AI can mimic speech patterns, it lacks the depth of human emotions and the innate ability to establish genuine connections based on empathy. **4. Thinking Beyond Boundaries: The Power of Imagination** Humans are great at using intuition and going with their gut feelings. This allows for creative leaps, innovative ideas, and major breakthroughs that logical reasoning alone can't produce. AI systems are limited to strictly following algorithms and data. They can't tap into the intuitive flashes of insight that often lead to groundbreaking discoveries and transformative actions by humans. **5. Adaptability and Lifelong Learning: The Evolutionary Edge** The human capacity for dynamic learning, adaptability, and continuous growth sets us apart from AI systems. Our ability to acquire new knowledge, transfer skills across diverse domains, and navigate unfamiliar territories with agility gives us a distinct edge. The power to evolve, reinvent ourselves, and embrace change is a hallmark of human intelligence that AI cannot replicate. **6. Ethical Decision-Making: The Moral Compass** Humans have a built-in sense of ethics and morals that guide how we make choices. AI systems just follow the rules they are programmed with - they don't truly understand right from wrong. The difficult ethical decisions that require weighing different values, respecting cultural differences, and dealing with moral dilemmas - that's something only humans can really grapple with using our moral compass. ![A helping hand](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bb92e52awhxyp6fit716.png) The future is not about AI replacing humans but collaborating with them and get them a helping hand for upskilling the way forward. Well this all summaries why AI can't replace the human intelligence. But the question is , for how long? ;) Drop a follow to know more in upcoming blogs. Also if you find this informative and valuable, please drop a like ❤ and share it with your friends and colleagues. Do follow me on LinkedIn for more such informative content - [LinkedIn](https://www.linkedin.com/in/bhipanshu-dhupar/) If you have reached upto here reading all the content, then you have learned something new and informative today. ;) Have a good day.
bhipanshu
1,863,211
houston palliative care
In Houston palliative care offers compassionate support to individuals facing serious illnesses,...
0
2024-05-23T19:53:54
https://dev.to/hospicecares/houston-palliative-care-445j
In **[Houston palliative care](https://houstonpalliativecare.org/)** offers compassionate support to individuals facing serious illnesses, focusing on enhancing their quality of life. With a holistic approach, palliative care teams address physical, emotional, and spiritual needs, aiming to alleviate symptoms and provide comfort. In addition to traditional methods, such as pain management and counseling, Houston's palliative care services may incorporate infusion therapy. This specialized treatment delivers medications or nutrients directly into the bloodstream, offering effective relief for symptoms like pain, nausea, or dehydration. Through personalized care plans and close collaboration with patients and their families, Houston's palliative care providers strive to optimize comfort and well-being throughout the journey of illness.
hospicecares
1,863,210
GraphQL-like features in Django Rest Framework
I was recently working for a client that had built their backend built with GraphQL and Graphene....
0
2024-05-23T19:49:31
https://django.wtf/blog/graphql-like-features-in-django-rest-framework/
django, graphql, djangorestframework, api
I was recently working for a client that had built their backend built with GraphQL and Graphene. They were asking me how to streamline building features in Django because their lead engineers had no prior Django experience. Having worked with a number of REST and specifically DRF backends I have to admit that I don't like GraphQL. Or perhaps I don't like how it's implemented in Django land. It feels clunkly and doesn't seem to fit the design philosophy of Django. - I don't like how GraphQL breaks from traditional HTTP patterns. HTTP as a protocol has stood the test of time across a myriad of changes in web technology. From Java servlets, to Rails, microservices and single page apps. If I had to make a bet I'd say HTTP will still be here 10 years from now - as a consequence I don't like how GraphQL breaks traditional scaling and caching patterns that we've built on top of HTTP and REST - REST has a knowledge and talent pool that's much deeper to draw from which has been standardized across many languages and frameworks. It makes Stackoverflow and ChatGPT driven development easier. - lastly and importantly I have no experience in GraphQL. I don't like re-learning things that work and generally only learn new things if they multiply productivity many times over. In particular I don't like Graphene and Django-Graphene because: - it's not batteries included. Basic features like auth and caching are scattered across a myriad of repositories most of which are unmaintained. - it doesn't automatically generate schema and methods, like DRF serializers and viewsets do - lacks boilerplate for CRUD, making me spend a substantial amount of time on code that should be automatic or generated - it [swallows errors](https://github.com/graphql-python/graphene-django/issues/1437), making debugging a mess - doesn't provide built in docs like [DRF](https://www.django-rest-framework.org/topics/browsable-api/) and [DRF Spectacular](https://drf-spectacular.readthedocs.io/en/latest/) do - doesn't provide built-in auth like DRF does - doesn't integrate with [django-debug-toolbar](https://django-debug-toolbar.readthedocs.io/en/latest/) **On the other hand frontend engineers tend to like GraphQL because it allows them to fetch data across many tables in a single query. This is great.** GraphQL is also touted as a performance tool for low-bandwidth devices, but I'm skeptical if this is worth dumping REST for. Could we combine the benefits of DRF and steal some inspiration from GraphQL...? ## [drf-flex-fields](https://github.com/rsinger86/drf-flex-fields) to the rescue! [Robert Singer](https://github.com/rsinger86) has written a [drf-flex-fields](https://github.com/rsinger86/drf-flex-fields), a package that emulates GraphQL like query features in REST. It allows you to: - ask for what fields to you want to see, e.g `users/?fields=id,first_name` - remove the fields you want to omit, e.g `users/?omit=id,first_name` - return related resources in the same request, e.g `users/?expand=organization.owner.roles` The last feature, returning related resources in a nested graph, is probably the most useful and requested feature by frontend engineers. They typically don't want to issue multiple requests and await all responses to return, either because of complexity or because of bandwidth limitations (mobile devices). Below is an example of an app with a user model and a many-to-many relation to an organization model (a user could be a member of many organizations). I've created an [example repository](https://github.com/danihodovic/blog-examples/tree/master/graphql_like_features_drf/graphql_like_features_drf) to demo the implementation, but below is a snippet. ```python from django.contrib.auth import get_user_model from django.db import models User = get_user_model() class Organization(models.Model): name = models.CharField(max_length=50) users = models.ManyToManyField(to=User) ``` Let's request a list of users and return the related organization_set model: ```bash curl http://localhost:8000/api/v1/users/?expand=organization_set ``` ```json HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: application/json { "count": 1, "results": [ { "id": 1, "name": "Dani Hodovic", "created_at": "2024-04-22T18:20:46.263286Z", "organization_set": [ { "id": 1, "name": "My Great Organization", "created_by": 1 } ] } ] } ``` I could go one step further and expand the nested `created_by` property of the organization which refers to the parent model. ```bash curl http://localhost:8000/api/v1/users/?expand=organization_set.created_by ``` ```json HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: application/json { "count": 1, "results": [ { "id": 1, "name": "Dani Hodovic", "created_at": "2024-04-22T18:20:46.263286Z", "organization_set": [ { "id": 1, "name": "My Great Organization", "created_by": { "id": 1, "name": "Dani Hodovic", "created_at": "2024-04-22T18:20:46.263286Z", }, } ] } ] } ``` The magic works by extending your serializer class from rest_flex_fields.FlexFieldsModelSerializer and setting the meta property `expandable_fields`. ```python from rest_flex_fields import FlexFieldsModelSerializer class OrganizationSerializer(FlexFieldsModelSerializer): class Meta: model = Organization fields = ["name", "users"] expandable_fields = {"users": (UserSerializer, {"many": True})} ``` The FlexFieldsModelSerializer class takes care of the rest! I recommend curious frontend engineers to use the star (`*`) value to discover what fields can be expanded. This will attempt to **expand any nested payload that inherits from FlexFieldsModelSerializer**. ```json curl http://localhost:8000/api/v1/users/?expand=* ``` Be careful however, the nested expansion performs no limiting or pagination of the results, you could be returning a gigantic array if you're scanning a related table. The [Django settings for the project](https://github.com/rsinger86/drf-flex-fields?tab=readme-ov-file#customization) allow you to change the query parameters used and limit the maximum expansion depth. ## Magically discovering expandable_fields I realized that we could make the expansion magic more interesting. Given that the Django model metadata exposes the relations to other models I guessed that we could discover all of the `expandable_fields` in the graph, no matter the distance (level of nesting) in the model hierarchy. At the bottom of the page is a "magic" snippet that extends the FlexFieldsModelSerializer further by automatically setting the `expandable_fields` property to all related fields. The result is that we can inherit from the MagicFlexFieldsModelSerializer and all related properties will be expandable by default. We don't have to statically specify `expandable_fields`. ```python from myapp.api.serializers.utils import MagicFlexFieldsModelSerializer class UserSerializer(MagicFlexFieldsModelSerializer): class Meta: model = User fields = [ "id", "name", ] ``` This is great in case you're running a private API that only your frontend engineers have access to, or if you're early stage and favor development speed over stability. It could be a little dangerous if you're exposing a large public API because it would allow attackers to flood your servers with traffic. Below is the source code for the MagicFlexFieldsModelSerializer: ```python import difflib import importlib import logging from functools import lru_cache from django.db.models import ForeignKey, ManyToManyField from rest_flex_fields.serializers import FlexFieldsModelSerializer SERIALIZERS_DIR = "myapp.api.serializers" class MagicFlexFieldsModelSerializer(FlexFieldsModelSerializer): """ Magically expands all related fields by inspecting related fields for a model. """ def __init__(self, *args, **kwargs): self.expandable_fields = discover_expandable_fields(self.Meta.model) super().__init__(*args, **kwargs) def discover_expandable_fields(model): """ Magically assigns `expandable_fields` from all related model fields. Discovers the serializer class based on the related model name. Assigns expandable_fields: The end result looks like this: ``` { 'created_by': backend.api.serializers.user_serializer.UserSerializer, 'workspace': backend.api.serializers.workspace_serializer.WorkspaceSerializer, 'users': (backend.api.serializers.user_serializer.UserSerializer, {'many': True}), 'archived_by': (backend.api.serializers.user_serializer.UserSerializer, {'many': True}), 'notified': (backend.api.serializers.user_serializer.UserSerializer, {'many': True}), 'conversation_messages': (backend.api.serializers.message_serializer.MessageSerializer, {'many': True}) } ``` See the example at: https://github.com/rsinger86/drf-flex-fields?tab=readme-ov-file#quick-start """ expandable_fields = {} serializer_classes = find_serializer_classes() for field in model._meta.get_fields(): if isinstance(field, (ForeignKey, ManyToManyField)): related_model_name = field.related_model.__name__ serializer_cls = find_closest_matching_serializer_by_name( related_model_name, serializer_classes ) if field.related_model != serializer_cls.Meta.model: logging.debug( f"Unable to find the correct serializer class for: {field.related_model}" ) continue if isinstance(field, ForeignKey): expandable_fields[field.name] = serializer_cls else: expandable_fields[field.name] = ( serializer_cls, {"many": True}, ) for field in model._meta.related_objects: related_model_name = field.related_model.__name__ serializer_cls = find_closest_matching_serializer_by_name( related_model_name, serializer_classes ) if field.related_model != serializer_cls.Meta.model: logging.debug( f"Unable to find the correct serializer class for: {field.related_model}" ) continue accessor_name = field.get_accessor_name() expandable_fields[accessor_name] = (serializer_cls, {"many": True}) return expandable_fields def find_closest_matching_serializer_by_name(input_str, serializer_classes): matcher = difflib.SequenceMatcher(None, input_str, str(serializer_classes[0])) closest_match = serializer_classes[0] max_similarity = matcher.ratio() for cls in serializer_classes[1:]: matcher = difflib.SequenceMatcher(None, input_str, str(cls)) similarity = matcher.ratio() if similarity > max_similarity: closest_match = cls max_similarity = similarity return closest_match @lru_cache(maxsize=None) def find_serializer_classes(): """ Technically you could get this from the DRF router object via the registered views. """ init_module = importlib.import_module(SERIALIZERS_DIR) serializer_classes = [ getattr(init_module, name) for name in dir(init_module) if callable(getattr(init_module, name)) and "Serializer" in name ] return serializer_classes ```
danihodovic
1,863,209
houston hospice care
Houston Hospice Care Compassionate, comprehensive, and dedicated. Our team is infused with a deep...
0
2024-05-23T19:47:58
https://dev.to/hospicecares/houston-hospice-cares-52in
**[ Houston Hospice Care](![Uploading image](...))** Compassionate, comprehensive, and dedicated. Our team is infused with a deep commitment to providing unparalleled support and comfort to patients and their families during life's most challenging moments. With expertise in pain management, symptom control, and emotional support, we ensure that every individual receives personalized care tailored to their unique needs. From palliative care to end-of-life support, Houston Hospice Cares is here to accompany you on your journey with empathy, dignity, and respect.
hospicecares
1,862,900
The Lottery Factor in Open Source
This is a short demo of how to quickly see the Lottery Factor - the risk percentage if a key contributor leaves - in an open source project.
0
2024-05-23T19:46:41
https://dev.to/opensauced/the-lottery-factor-in-open-source-3fpc
showdev, opensource, ai, laravel
--- title: The Lottery Factor in Open Source published: true description: This is a short demo of how to quickly see the Lottery Factor - the risk percentage if a key contributor leaves - in an open source project. tags: showdev, opensource, ai, laravel --- My team at OpenSauced has been working really hard on a new feature called StarSearch. With StarSearch, you can get otherwise hard to discover information about open source projects and contributors. > **We’re live on [Product Hunt](https://www.producthunt.com/products/opensauced)! Join the conversation and let us know what features you'd like to see added.** In this demo, I talk about the lottery factor - the risk if one of your top contributors leaves a project - and take a look at how Laravel fairs.
bekahhw
1,863,115
Data structure in Golang
Golang has gained tremendous popularity in software development in few years of its launch since it...
0
2024-05-23T18:14:51
https://dev.to/chanchals7/data-structure-in-golang-390i
go, datastructures, backend, slice
Golang has gained tremendous popularity in software development in few years of its launch since it was made available to public. I'm not intending to share here the full history of language, but go to the very few basic topics Here: The basic data structures of Golang include: 1. Array 2. Slice 3. Map 4. Struct - Methods - Interfaces **1. Array** This data structures is used to stored fixed number of elements. So once an array is defined, elements cannot be added or removed from the array. Note that, we can set the value for any of the index in the array. > Way to define the array : ``` var arr [size]type //general syntax ``` Examples: ``` var arrInteger [5]int //integer type array with five elements var arrString [5]string //string type array with five element ``` > Defining array with predefined elements: ``` a:=[5]int{1,2,3,4,5}//defining and populating array b:=[5]string{"first","second","third","fourth","fifth"} ``` `:= This is short declaration operator` **2. Slice** Slice gives a more robust interface to sequences compared to array. Unlike an array, no need to specify the length of the slice when defining it. > Way to declare or define slice ``` var slice_name []type //general syntax ``` ``` Three way to create slice: var s []int //integer type s:=[]{1,2,3,4,5} // slice with elements and short notation s:=make([]int,n) // n is the number of the elements ``` **3. Map** It is possible for you to use key value pairs to refer an element. This is accomplish using map. If you coming from JavaScript, php background, see map as your **object.** > General syntax of Map: ``` map[keyType]valueType ``` > Way to define Map: ``` var sampleMap=map[string]int //using var sampleMap:=map[string]int // shorthand notation sampleMap:=make(map[string]int)//using make() ``` **4. Struct** Go struct is a collection of named fields/properties. A struct can have the same or different types of fields. > Way to define struct ``` type person struct{ firstName string lastName string age int } ``` **Methods** A method in Go is a function is a function that is associated with a specific type. This allows the function to operate on instances of that type, enabling behavior similar to object-oriented programming. **Interfaces** Interfaces in Go is a type that specifies a set of method signatures. A type implements an interface by providing definitions for all the methods declared by the interface. Interfaces are a powerful way to define and work with abstractions.
chanchals7
1,863,208
6 Tips for Beginners to Write Clean and Maintainable Code
No matter the programming language you use, writing clean code has always been a challenge for...
0
2024-05-23T19:46:21
https://dev.to/syedbalkhi/6-tips-for-beginners-to-write-clean-and-maintainable-code-4cad
beginners, code
No matter the programming language you use, writing clean code has always been a challenge for beginners. The goal here is not just to write code that's readable but also descriptive enough so others can understand it with ease. Just because your code works doesn't mean there's no room for improvement. Knowing how to write clean code is a skill that you learn over time. It's something you can't master overnight, as it demands practice and persistence. Learning how to write clean code is something that sets you apart from other programmers and enables you to showcase your skills with ease. Not only does it help you optimize the code's functionality, but it also makes it presentable to others. Here are a few useful tips for beginners on how to write clean and maintainable code: ## 1. Name Variables and Functions If you want to [write clean and easy-to-maintain code](https://www.wpbeginner.com/beginners-guide/how-to-code-a-website-complete-beginners-guide/), naming variables and functions may be a viable approach. Whether you're [creating a website](https://www.isitwp.com/how-to-make-a-website-step-by-step/) or [developing an app](https://formidableforms.com/building-a-web-app-with-wordpress/), defining the names for the variables and functions makes your code descriptive and easy-to-understand. By embracing this [coding hack](https://memberpress.com/blog/coding-hacks-for-non-developers/), you not only improve your code's readability but also come up with a maintainable codebase. Just ensure that the names you have selected to define your variables and functions are well thought out. So, other developers can easily understand the context. This helps them know the action a variable or function performs and how it resonates with the rest of the code. ## 2. Leverage Empty Lines You can use empty lines to improve the cleanliness of your code. Not only does it make your code readable, but it is also easy to understand. Adding an empty line can help you or other readers know where the functions end. Plus, it makes your code appear aesthetically-pleasing. And it reduces the time spent on code optimization, as it's easy for you to find areas that need improvement. ## 3. Have a Goal in Mind Having a goal in mind not only maximizes your efficiency when coding, but it also improves the effectiveness of your code. You should always keep in mind the problem that your code is supposed to solve or the purpose you're writing the code for. It can be difficult but try not to let your thoughts go wild when you're in the zone. Focus on what your code is supposed to do and write for that only. This will not only make it easier for you to write code that actually works, but also one that's clean and easily maintainable. ## 4. Stay Simple The simplicity of the code is a very subjective thing. So, describing how to write code with a simplistic approach may be a challenge. However, keeping a few things in mind may help. When writing code, you should be able to understand what the program does at each line. As mentioned earlier, naming functions and variables helps. However, you should ensure that the names selected highlight the responsibilities. You should also be careful with the code indentation and spacing, maintaining an identical format throughout the codebase. You should also add explainers to help others understand your code with ease and document things. Not only will it help others understand the complexities of your code, but it will also make it easier for you to make changes to it when needed. You should write code in such a way that it's easy for you to identify the features of the program. This makes the addition or deletion of features hassle-free without you needing to modify the majority of your code. Following a modular approach is also a handy trick to ensure your code's simplicity, where components classify different features. ## 5. Minimize the Code's Complexity Technically, you can write a function that does multiple things. And it's a common practice among programmers to come up with functions that cater to different things. It's not the wrong thing to do. It is just something that you should avoid if you want to write clean and easy-to-maintain code. Trying to come up with a function that caters to different things may work for you, but it will increase the complexity of the code. This will make it difficult for you to optimize the code. Plus, it may end up compromising the code's readability. If your function represents many lines, it may be viable to prefer a class over a function, as it may also contribute to the code's efficiency. ## 6. Use Consistent Formatting and Syntax Another effective way of writing clean code is to use consistent formatting and syntax throughout your code. This makes your code easy-to-read and understandable, not just for you but also for others reviewing it. It helps developers understand the functionality of your code and the purpose it was written for. Consistent formatting and syntax also help you [debug the code](https://wpforms.com/developers/how-to-enable-debugging-in-wordpress/) for errors and ensure easy maintenance. You can also update the code with ease without making huge modifications or breaking something in the process. Consistent formatting and syntax not only improve your code's cleanliness but also help you [fix errors in your code](https://www.wpbeginner.com/wp-tutorials/how-to-easily-enable-wordpress-debug-mode-to-fix-site-errors/) quickly. ## Final Words There you have it: the six tips for beginners to write clean and maintainable code. If you've just stepped into the realm of programming, the recommendations in this article will help you write code that's easy to understand, optimize, and update.
syedbalkhi
1,863,207
Car key replacement 
At CarKey4Less, we offer a range of services to help you avoid all these car key troubles once and...
0
2024-05-23T19:46:00
https://dev.to/carkey4less/car-key-replacement-3hmi
locksmith
At CarKey4Less, we offer a range of services to help you avoid all these car key troubles once and for all. Our car lockout services can help you recover your key that’s locked inside a car of any model or make. From extracting broken keys from lock to duplicating your car keys in a matter of minutes, our broken auto keys emergency service can help you out in Houston. We also offer **[Car key replacement](https://carkey4less.com/)** to help you fix broken car locks immediately.
carkey4less
1,863,205
Ponteiros na programação para iniciantes.
Um ponteiro é uma variável que armazena o endereço de memória de outra variável. Em outras palavras,...
0
2024-05-23T19:43:41
https://dev.to/delmiro/ponteiros-na-programacao-para-iniciantes-1hgb
webdev, algorithms, estruturadedados, beginners
Um ponteiro é uma variável que armazena o endereço de memória de outra variável. Em outras palavras, ao invés de armazenar diretamente um valor, um ponteiro armazena a localização na memória onde esse valor está armazenado. Essa habilidade permite que o programa manipule diretamente os dados na memória, o que é extremamente útil para uma série de operações avançadas. Podemos listar como as principais aplicações dos ponteiros: Alocação Dinâmica de Memória: Permite que o programa aloque memória durante a execução usando funções da biblioteca padrão, como malloc, calloc, realloc e free. Manipulação de Arrays e Strings: Facilita o acesso e modificação de elementos de arrays e strings. Arrays e strings em C são manipulados com facilidade através de ponteiros. Estruturas de Dados Dinâmicas: Implementação de listas encadeadas, árvores, pilhas, filas e outras estruturas dinâmicas. Ponteiros permitem que essas estruturas cresçam e diminuam de tamanho conforme necessário. Passagem de Parâmetros para Funções: Permite a passagem de grandes estruturas de dados ou arrays para funções sem a necessidade de cópia, melhorando a eficiência. As funções podem modificar diretamente os argumentos passados via ponteiros. Exemplo utilizando a linguagem de programação C: #include <stdio.h> #include <stdlib.h> int main() { int *ptr; //aqui declaramos o ponteiro utilizando o operador * antes do nome da variável int n, i; printf("Digite o número de elementos: "); scanf("%d", &n); // Alocando memória para n inteiros ptr = (int*) malloc(n * sizeof(int)); if (ptr == NULL) { printf("Erro de alocação de memória!\n"); return 1; } Exemplo de manipulação de Arrays: #include <stdio.h> void printArray(int *arr, int size) { for (int i = 0; i < size; ++i) { printf("%d ", *(arr + i)); } printf("\n"); } int main() { int arr[] = {1, 2, 3, 4, 5}; int size = sizeof(arr) / sizeof(arr[0]); printArray(arr, size); return 0; } printf("Digite os elementos do array:"); for (i = 0; i < n; ++i) { scanf("%d", ptr + i); } printf("Os elementos do array são:"); for (i = 0; i < n; ++i) { printf("%d ", *(ptr + i)); } // Liberando a memória alocada free(ptr); return 0; }
delmiro
1,863,204
Regular Oil Changes and Brake Maintenance in Monroe and South Brunswick
Regular maintenance is key to keeping your vehicle running smoothly and efficiently. Among the most...
0
2024-05-23T19:42:27
https://dev.to/jhonebuttler/regular-oil-changes-and-brake-maintenance-in-monroe-and-south-brunswick-lg6
business
Regular maintenance is key to keeping your vehicle running smoothly and efficiently. Among the most important aspects of vehicle maintenance are oil changes and brake maintenance. In Monroe and South Brunswick, residents have access to reliable services that ensure their vehicles remain in top condition. Let’s delve into why these services are crucial and how they contribute to the longevity and performance of your vehicle. **Importance of Oil Changes:** Oil is the lifeblood of your engine, providing lubrication to its many moving parts and helping to regulate temperature. Over time, however, oil breaks down and becomes less effective at performing these vital functions. This is why regular **[oil change Monroe](https://egautocenter.com/oil-change-monroe/)** are essential. **Engine Lubrication:** As oil circulates through your engine, it coats its moving parts, reducing friction and preventing wear and tear. Without proper lubrication, these components can grind against each other, leading to damage and potential breakdowns. **Cooling:** Oil also helps to dissipate heat generated by the engine. Over time, as oil ages and becomes contaminated with dirt and debris, its ability to effectively regulate temperature diminishes. This can result in overheating and damage to engine components. **Fuel Efficiency:** Fresh oil helps to reduce friction within the engine, which in turn improves fuel efficiency. By ensuring that your oil is changed regularly, you can optimize your vehicle's performance and save money on fuel costs. **Benefits of Brake Maintenance:** Brakes are perhaps the most critical safety feature of any vehicle. Properly functioning brakes allow you to stop quickly and safely, preventing accidents and protecting both you and your passengers. Here's why brake maintenance is so important: **Safety:** Worn brake pads and rotors can compromise your ability to stop quickly, increasing the risk of accidents, particularly in emergency situations. Regular brake inspections and maintenance help to ensure that your brakes are in optimal condition, providing maximum stopping power when you need it most. **Extended Brake Life:** Routine brake maintenance, including inspections, pad replacements, and rotor resurfacing or replacement when necessary, can extend the life of your braking system. By addressing issues promptly, you can prevent more extensive damage and costly repairs down the line. **Smooth Performance:** Well-maintained brakes provide smooth and consistent braking performance, enhancing the overall driving experience. Squealing or grinding noises, vibrations, or a soft brake pedal are all signs that your brakes may require attention. **Choosing the Right Service Provider:** When it comes to oil changes and brake maintenance, choosing the right service provider is crucial. Look for a reputable auto repair shop that employs certified technicians and uses quality parts and materials. In Monroe and South Brunswick, there are several options to consider, each offering a range of services to meet your needs. **Experienced Technicians:** Trust your vehicle to experienced technicians who have the knowledge and expertise to perform oil changes and **[brake oil change South Brunswick](https://egautocenter.com/brake-oil-change-south-brunswick/)**. They can also identify any potential issues early on and address them before they escalate into more significant problems. **Quality Parts:** Using high-quality oil and OEM or equivalent brake components ensures that your vehicle performs at its best and maintains its resale value. Avoid shops that cut corners by using inferior parts or recycled oil, as these can compromise performance and potentially damage your vehicle. **Customer Service:** Choose a service provider that values customer satisfaction and strives to provide an exceptional experience from start to finish. Clear communication, transparent pricing, and a commitment to excellence are all indicators of a reputable auto repair shop. **Conclusion: ** Regular oil changes and brake maintenance are essential aspects of vehicle ownership that should not be overlooked. By prioritizing these services and choosing a trusted provider in Monroe or South Brunswick, you can ensure that your vehicle remains safe, reliable, and efficient for years to come. Don't wait until you encounter problems—schedule your next oil change and brake inspection today and enjoy peace of mind on the road.
jhonebuttler
1,863,203
Top 10 Selling Toyota Models
Welcome to Eastway Toyota in Windsor, Ontario, where excellence meets innovation within the Toyota...
0
2024-05-23T19:42:24
https://dev.to/eastwaytoyota/top-10-selling-toyota-models-gcp
Welcome to Eastway Toyota in Windsor, Ontario, where excellence meets innovation within the Toyota lineup. Let us guide you through the top 10 best-selling Toyota models, from the legendary efficiency of our sedans to the rugged versatility of our SUVs and trucks. Let's explore what makes these Toyota models stand out. **1. Toyota Camry** The Toyota Camry, a symbol of reliability and efficiency, continues to be a favourite. Its blend of comfort, technology, and performance makes it a standout choice for those seeking a dependable and stylish sedan. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqoisnyrykhqn3dzpw79.jpeg) **2. Toyota Corolla** A beacon of consistency, the Toyota Corolla offers a compact design without compromising quality. Its excellent fuel efficiency and advanced safety features make it the perfect choice for city driving and long commutes. **3. Toyota RAV4** The Toyota RAV4 redefines what it means to drive an SUV with its dynamic performance, spacious interior, and cutting-edge technology. It's ideal for adventurers and families and offers versatility for every journey. **4. Toyota Highlander** The Toyota Highlander is the ultimate family SUV for those requiring more space and power. With seating for up to eight passengers and robust performance, it's ready for everything from daily errands to weekend getaways. **5. Toyota Tacoma** The Toyota Tacoma stands as the go-to pickup for durability and off-road capability. Its rugged design and powerful engine options make it a reliable partner for work and play. **6. Toyota Tundra** The Toyota Tundra combines full-size truck power with sophistication. It's known for its towing capacity and spacious interior, designed to tackle the most challenging tasks in style. **7. Toyota Sienna** The Toyota Sienna revolutionizes the minivan segment with its hybrid powertrain. It offers efficiency and room for the whole family. Its innovative features ensure comfort and entertainment on every trip. **8. Toyota 4Runner** The Toyota 4Runner remains a favourite for off-road enthusiasts thanks to its robust build and exceptional capability. It's the perfect companion for exploring the unbeaten path without sacrificing comfort. **9. Toyota Prius** As a pioneer in hybrid technology, the Toyota Prius continues to lead with its exceptional fuel efficiency and eco-friendly design. It's the ideal choice for the environmentally conscious driver. **10. Toyota Venza** The Toyota Venza combines the best of an SUV and sedan, offering a stylish design, comfortable interior, and impressive hybrid efficiency. It's a testament to Toyota's innovation and versatility. **Find Your Perfect Toyota at Eastway Toyota** At Eastway Toyota, we pride ourselves on offering a diverse selection of the best Toyota cars, including the most popular sedan models and SUVs. Whether you're searching for efficiency, performance, or versatility, our expert team will guide you to the Toyota that best fits your lifestyle. **Contact Us** Discover your next Toyota with us at **[Eastway Toyota in Windsor, Ontario](https://goo.gl/maps/S92t9mygZ95sbyG4A)**. Explore our range of Toyota models, including the top-selling favourites that have captivated drivers worldwide. Visit us in person or browse our inventory online to find your perfect Toyota. Please contact Eastway Toyota today with any inquiries or to schedule a test drive. **Source- [https://www.eastwaytoyota.com/top-10-selling-toyota-models/](https://www.eastwaytoyota.com/top-10-selling-toyota-models/)**
eastwaytoyota
1,863,200
Da Pleior
Da Pleior là điểm đến lý tưởng cho những ai yêu thích giải trí và muốn cập nhật những thông tin mới...
0
2024-05-23T19:24:45
https://dev.to/blogdapleior/da-pleior-21eb
Da Pleior là điểm đến lý tưởng cho những ai yêu thích giải trí và muốn cập nhật những thông tin mới nhất. Đội ngũ biên tập viên của chúng tôi, với kinh nghiệm và sự nhiệt huyết, luôn đảm bảo rằng nội dung đăng tải không chỉ đa dạng mà còn đầy đủ chi tiết và chính xác. Website: https://dapleior.blogspot.com/ Phone: 0337157766 Address: 98 Ng. Thống Nhất, Trương Định, Hai Bà Trưng https://www.facebook.com/duclinhdeeptry/
blogdapleior
1,863,199
3 Ways Building Generative AI Side Projects Will Benefit Your Coding Career
Generative AI has experienced a remarkable rise in popularity over the past few years, especially...
0
2024-05-23T19:24:21
https://www.skillreactor.io/blog/3-ways-building-generative-ai-side-projects-will-benefit-your-coding-career/
ai, career, programming, beginners
Generative AI has experienced a remarkable rise in popularity over the past few years, especially with the introduction of technologies like ChatGPT around 1.5 years ago. The field undoubtedly holds significant potential for developers and tech enthusiasts, enabling them to create innovative applications and presenting exciting opportunities to expand their skill sets and foster growth. Building projects has long been regarded as one of the most effective ways to learn new technologies. So what better approach to mastering AI than by engaging in side projects?  By immersing themselves in these projects, coders can benefit in multiple ways. Let's dive into how building generative AI side projects can benefit your coding career. ## Understanding Generative AI Generative AI, a fascinating subset of artificial intelligence, is all about machines expressing creativity. Unlike traditional AI, which primarily analyzes data, generative AI takes a step further - it independently creates new content. In simpler terms, generative AI acts as a digital creator. It learns from examples and then produces original content like images, music, text and even code. It's like having an AI artist, musician or programmer on hand! As this technology advances, its potential applications become increasingly diverse. From generating realistic images for design projects to composing background music for videos, the possibilities are endless. Generative AI certainly has the potential to revolutionize various industries, offering exciting opportunities. ## Skill Development  Engaging with generative AI projects means you will need to ramp up your technical skills and knowledge. Unlike traditional programming tasks, generative AI involves working with advanced programming languages like Python and utilizing sophisticated libraries such as TensorFlow, PyTorch, and Keras. You will need to dive deep into neural networks, machine learning algorithms, and data preprocessing techniques, pushing yourself to become proficient in these areas.  Developing generative AI models involves solving complex problems, which enhances your analytical thinking and problem-solving abilities. And in today's fast-paced tech world, this kind of continuous learning and skill-building is essential to staying ahead of the curve. ## Portfolio Enhancement A well-crafted portfolio is essential for any coder, and adding generative AI projects can take it to the next level. With employers actively seeking candidates with AI expertise, showcasing your experience with Generative AI projects highlights your technical skills and positions you as a highly sought-after candidate.  The value of AI skills is on the rise, and having generative AI projects in your portfolio sets you apart from the competition. Generative AI projects demonstrate your ability to tackle advanced and complex challenges, proving to potential employers that you possess hands-on experience with cutting-edge technologies. It also showcases your capacity to innovate and adapt in a rapidly changing technological landscape, making you an invaluable asset to any team. ## Career Opportunities and Advancement Working on generative AI side projects can open doors to exciting career opportunities and facilitate your professional growth.  As the demand for AI skills continues to surge across industries, having expertise in generative AI positions you in a high-demand area, increasing your job prospects and potential for higher salaries. If you are considering a career transition into specialized roles such as data scientist or AI engineer, these projects provide the necessary experience and credentials to make the switch.  Additionally, demonstrating your ability to innovate with generative AI can lead to leadership opportunities within your organization, such as leading AI initiatives, mentoring junior developers, or driving innovation projects, further accelerating your career advancement. ## Building Generative AI Projects with SkillReactor [Skillreactor](https://www.skillreactor.io/?utm_source=dev.to) serves as an ideal platform for coders to delve into Generative AI projects. With access to advanced technologies like OpenAI, Anthropic and Langchain, developers can explore and experiment with Generative AI concepts in a hands-on environment. By working on projects on Skillreactor, they have the opportunity to enhance their skills and deepen their understanding of Generative AI, all while working on practical, end-to-end applications. Additionally, Skillreactor offers a unique feature - the [verified skills portfolio](https://profile.skillreactor.io/145c90b426d6186796614e8de6270a79). This portfolio allows coders to showcase their completed Generative AI projects and earn skill badges for the technologies they utilize. By building a comprehensive portfolio of their work, coders can demonstrate their expertise in Generative AI to potential employers and collaborators, opening doors to new opportunities in the tech industry. ## Conclusion Building generative AI side projects offers a multitude of benefits that can significantly enhance your coding career. From developing advanced technical skills and creating an impressive portfolio and securing new career opportunities, the advantages are substantial. [Dive into Generative AI projects](https://www.skillreactor.io/?utm_source=dev.to) today and propel your career forward with confidence.
sariah
1,863,132
Running adb in a rootless Podman Distrobox container
adb stands for Android Debug Bridge. It's a part of SDK Platform Tools, which is bundled with Android...
0
2024-05-23T19:20:19
https://dev.to/archerallstars/running-adb-in-a-rootless-podman-distrobox-container-2kap
tutorial, android, productivity, container
`adb` stands for [_Android Debug Bridge_](https://developer.android.com/tools/adb). It's a part of [SDK Platform Tools](https://developer.android.com/tools/releases/platform-tools), which is bundled with [Android Studio](https://developer.android.com/studio). For Linux users, they might want to use `adb` with `scrcpy` (https://github.com/Genymobile/scrcpy), which is a very powerful tool for controlling Android devices from PC. Installing `scrcpy` from the distro's repo would bring in `adb` by default, so it's not necessary to download `adb` directly from Google. # Why would anyone use `adb` in a container? Like most apps that anyone would want to run in a container: - It _doesn't_ pile up your system with a ton of packages/dependencies. - You always get the latest _official_ release of apps, regardless of your Linux distro. - You can easily delete _all_ the app data and its configurations. - It works with _immutable_ OSes very well. - Minimizing the apps' system access through a _rootless_ environment. - Maybe more. 😎 > Note, Distrobox gives you a convenient over raw Podman/Docker setup, and it also integrates very well in the system. But if you want the _absolute_ security, please consider setting up a rootless Podman container without using Distrobox. However, I will go with Distrobox, as I think a rootless Distrobox container already gives you a sane amount of security-convenient ratio. 👉️ Table of contents: 1. Know Your Device 2. `udev` Rules Setup on the Host 3. Preparing the Container 4. Testing `adb` 5. Automatically Update the Container --- # 1. Know Your Device You can identify your device easily with: ``` lsusb ``` It will list all USB related devices. Look for a line that's corresponding to your Android device. For example: ``` Bus 001 Device 009: ID 1234:5678 Google Inc. Nexus/Pixel Device (charging + debug) ``` The important part is your device ID, which is `1234:5678` in this example. We'll use this ID in the next step. --- # 2. `udev` Rules Setup on the Host In `/etc/udev/rules.d/51-android.rules` I put: ``` SUBSYSTEM=="usb", ATTR{idVendor}=="1234", ATTRS{idProduct}=="5678", MODE="0666", GROUP="yourusername" ``` - If yours doesn't have `51-android.rules` in `/etc/udev/rules.d/`, please create a new one. - Replace `ATTR{idVendor}=="1234"` and `ATTRS{idProduct}=="5678"` with your real device ID. - Replace `yourusername` with your real username. --- # 3. Preparing the Container ## 3.1. Install Distrobox and Podman on the Host For example, on openSUSE Tumbleweed: ``` sudo zypper install distrobox podman ``` ## 3.2. Configure Distrobox to use Podman ``` echo 'container_manager="podman"' > ~/.config/distrobox/distrobox.conf ``` ## 3.3. Create a New Distrobox Container for `adb` ``` distrobox create -i docker.io/library/archlinux:latest -n adb-dbx -H ~/distrobox/adb-dbx --volume /dev/bus/usb/:/dev/bus/usb --volume /etc/udev/rules.d/:/etc/udev/rules.d --additional-packages "adwaita-cursors" ``` I use Arch container image because: - It's a rolling image, so every necessary package or dependency would always be updated. - It really depends on your needs. If you plan to use this container with `scrcpy`, the best container for `adb` would be Arch, since you will get all the codecs from the main repo. If you plan to use this container as a dev box, Tumbleweed image would be better because Chrome is _not_ available _officially_ on Arch. But if you only want to run `adb`, the container image wouldn't matter much. I volume `/dev/bus/usb/` and `/etc/udev/rules.d/` in the container because they're needed for `adb` to work. --- # 4. Testing `adb` ``` adb devices ``` This should return your device properly. If it's not, please check whether you have `adb` process already running in the background. In that case, please end the process first. --- # 5. Automatically Update the Container We can use systemd's service and timer to update/upgrade all Distrobox's containers like this: ## dbx-upgrade.service ``` [Unit] Description=Upgrade all rootless Distrobox containers. RequiresMountsFor=/run/user/1000/containers [Service] Type=exec ExecStart=-bash -c "distrobox-upgrade --all" Restart=on-failure RestartSec=60 TimeoutStopSec=5min RemainAfterExit=yes ``` Save this file as `~/.config/systemd/user/dbx-upgrade.service`. ## dbx-upgrade.timer ``` [Unit] Description=Run distrobox-upgrade --all daily. [Timer] OnCalendar=daily RandomizedDelaySec=5min Persistent=true [Install] WantedBy=timers.target ``` Save this file as `~/.config/systemd/user/dbx-upgrade.timer`. ## Enable the Timer ``` systemctl --user daemon-reload && systemctl --user enable dbx-upgrade.timer ``` --- Cover Photo by [Edho Fitrah](https://unsplash.com/@dhofit?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash) on [Unsplash](https://unsplash.com/photos/person-standing-in-front-of-bridge-sBUhP60IlAo?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)
archerallstars
1,863,154
Using Cloud Monitoring to Monitor IRIS-Based Applications Deployed in GKE
In this article, we’ll look at one of the ways to monitor the InterSystems IRIS data platform (IRIS)...
0
2024-05-23T19:19:39
https://community.intersystems.com/post/using-cloud-monitoring-monitor-iris-based-applications-deployed-gke
devops, kubernetes, tutorial, programming
<p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">In this article, we’ll look at one of the ways to monitor the InterSystems IRIS data platform (IRIS) deployed in the </span></span></span></span></span></span><a href="https://cloud.google.com/kubernetes-engine" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Google Kubernetes Engine</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> (GKE). The GKE integrates easily with </span></span></span></span></span></span><a href="https://cloud.google.com/monitoring" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Cloud Monitoring</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">, simplifying our task. As a bonus, the article shows how to display metrics from Cloud Monitoring in </span></span></span></span></span></span><a href="https://grafana.com/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Grafana</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">.&nbsp;</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Note that the Google Cloud Platform used in this article is not free (</span></span></span></span></span></span><a href="https://cloud.google.com/pricing/list" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">price list</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">), but you can leverage a </span></span></span></span></span></span><a href="https://cloud.google.com/free" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">free tier</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">. This article assumes that you already have a project in the Google Cloud Platform (referred to as &lt;your_project_id&gt;) and have permission to use it.&nbsp;</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><!--break--><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">We’ll use the following tools:</span></span></span></span></span></span></p> <ul> <li aria-level="1" style="list-style-type:disc"><a href="https://cloud.google.com/sdk/docs/install" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">gcloud</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version Google Cloud SDK 346.0.0</span></span></span></span></span></span></li> <li aria-level="1" style="list-style-type:disc"><a href="https://kubernetes.io/docs/tasks/tools/#kubectl" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">kubectl</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version v1.17.12</span></span></span></span></span></span></li> <li aria-level="1" style="list-style-type:disc"><a href="https://github.com/derailed/k9s" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">k9s</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version v0.24.14 (just for fun)</span></span></span></span></span></span></li> <li aria-level="1" style="list-style-type:disc"><a href="https://helm.sh/docs/intro/install/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">helm</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version v3.6.3</span></span></span></span></span></span></li> <li aria-level="1" style="list-style-type:disc"><a href="https://github.com/roboll/helmfile" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">helmfile</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version v0.139.9</span></span></span></span></span></span></li> </ul> <h1 style="line-height:1.3800000000000001; margin-top:27px"><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">GKE Creation</span></span></span></span></span></span></span></h1> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Let’s start with Kubernetes cluster creation. A </span></span></span></span></span></span><a href="https://cloud.google.com/kubernetes-engine/docs/concepts/regional-clusters" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">regional</span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> </span></span></span></span></span></span><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">private cluster</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> looks good. Let’s also create network address translation (NAT) to allow traffic from nodes to the Internet.</span></span></span></span></span></span><br><span style="color:#000000;">Initialize connection to Google Platform:</span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud init</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud auth login</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud projects list</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud config set project &lt;your_project_id&gt;</span></span></span></span></span></span></span></pre> <p>Create a dedicated network:</p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud compute networks create kubernetes --subnet-mode custom</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud compute networks subnets create kubernetes --network kubernetes --range 10.20.0.0/24 --region us-east1 --secondary-range pods=10.42.0.0/16,services=172.20.0.0/16</span></span></span></span></span></span></span></pre> <p><span style="font-size:10pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Assign a couple of static IPs (for NAT and Grafana endpoint, see below):</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud compute addresses create kubernetes --region=us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud compute addresses create kubernetes-grafana --region=us-east1</span></span></span></span></span></span></span></pre> <p><span style="font-size:10pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Create NAT:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud compute routers create kubernetes --network=kubernetes --region us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud compute routers nats create kubernetes --router=kubernetes --nat-all-subnet-ip-ranges --nat-external-ip-pool=kubernetes --region=us-east1</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:10pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Finally create GKE. Kubernetes version is <em>1.20.8-gke.900</em>.</span></span></span></span></span></span><br><span style="font-size:10pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Last line “<em>enable-stackdriver-kubernetes</em>” means that metrics, logs and events from the cluster will be gathered and sent to Cloud Monitoring – see </span></span></span></span></span></span><a href="https://cloud.google.com/stackdriver/docs/solutions/gke/installing" style="text-decoration:none"><span style="font-size:10pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Configuring Cloud Operations for GKE</span></span></span></span></span></span></a><font color="#000000" face="Consolas, sans-serif"><span style="font-size: 13.3333px; white-space: pre-wrap;">:</span></font></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud container clusters create kubernetes \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --region us-east1 \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --machine-type e2-small \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --num-nodes 1 \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --enable-private-nodes \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --no-enable-master-authorized-networks \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --cluster-version 1.20.8-gke.900 \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --enable-ip-alias \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --cluster-ipv4-cidr 10.24.0.0/14 \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --master-ipv4-cidr 10.0.0.0/28 \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --services-secondary-range-name services \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --cluster-secondary-range-name pods \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --no-enable-autoupgrade \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --enable-autorepair \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --network kubernetes \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --subnetwork kubernetes \</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> --enable-stackdriver-kubernetes </span></span></span></span></span></span></span></pre> <p><span style="font-size:10pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Let’s connect to the newly created cluster:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud container clusters get-credentials kubernetes --region us-east1 --project &lt;your_project&gt;</span></span></span></span></span></span></span></pre> <h1 style="line-height:1.3800000000000001; margin-top:27px"><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Default Monitoring</span></span></span></span></span></span></span></h1> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Let’s look at the workloads in our cluster (nice k9s output):</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ k9s</span></span></span></span></span></span></span></pre> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pz7wk66ehuqsddrlml36.png) <p><span>&nbsp;</span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">We see three pods (one for each node). These pods are managed by a </span></span></span></span></span></span><a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">DaemonSet</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">,</span></span></span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> and called by the Google Kubernetes Engine Metrics Agent (gke-metrics-agent). Under the hood, this agent leverages the </span></span></span></span></span></span><a href="https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/design.md" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Open Telemetry Collector</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> enhanced by Google-specific features. You can spend some time looking at its </span></span></span></span></span></span><a href="https://opentelemetry.io/docs/collector/configuration/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">configuration</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">, which is thoroughly described on the page </span></span></span></span></span></span><a href="https://docs.google.com/document/d/1NeheFG7DmcUYo_h2vLtNRlia9x5wOJMlV4QKEK05FhQ/edit" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">OpenTelemetry Collector Configuration Format</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">.</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Because of the gke-metrics-agent, we’re immediately able to see a lot of useful GKE-related metrics on a dashboard in Cloud Monitoring:</span></span></span></span></span></span></p> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owl6gnp8h836p3jq3bql.png) <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0e101a"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">To add IRIS metrics (we do not have IRIS in the cluster yet), we deploy an application similar to the gke-metrics-agent, but with our configuration.</span></span></span></span></span></span></p> <h2 style="line-height:1.3800000000000001; margin-top:24px; margin-bottom:8px"><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">A Note About Application Installation</span></span></span></span></span></span></span></h2> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">A common way to deploy applications in Kubernetes clusters is by using Helm. For this article, several Helm charts were prepared and published in a custom public </span></span></span></span></span></span><a href="https://myardyas.github.io/helm-charts/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Helm repository</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">. You can see how to do this on </span></span></span></span></span></span><a href="https://helm.sh/docs/topics/chart_repository/#github-pages-example" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">GitHub</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> and in </span></span></span></span></span></span><a href="https://medium.com/containerum/how-to-make-and-share-your-own-helm-package-50ae40f6c221" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">this guide that reviews how to make and share your Helm package</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">. You need to have a Helm chart in a directory for each application according to </span></span></span></span></span></span><a href="https://helm.sh/docs/chart_template_guide/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">The Chart Template Developer’s Guide</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">, like simple-iris. Then, we package a chart:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ helm package simple-iris/</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Then move a resulting gzipped archive into a repository directory (gh-pages branch). Then update the index-file:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ helm repo index . --url </span></span></span></span></span></span><a href="https://myardyas.github.io/helm-charts/" style="text-decoration:none"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="text-decoration-skip-ink:none">https://myardyas.github.io/helm-charts/</span></span></span></span></span></span></span></a></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Push the updated index-file as well as the archive into GitHub.</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">We just created the charts for the gke-metrics-agent and IRIS itself. IRIS is a stateless application for our monitoring purpose, so for simplicity, we use the Deployment command instead of Statefulset.</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Let’s look at the available charts:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ helm repo add iris-monitoring </span></span></span></span></span></span><a href="https://myardyas.github.io/helm-charts/" style="text-decoration:none"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="text-decoration-skip-ink:none">https://myardyas.github.io/helm-charts/</span></span></span></span></span></span></span></a> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ helm repo update</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ helm search repo iris-monitoring --versions --devel --max-col-width 35</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">NAME </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">CHART VERSION</span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">APP VERSION </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">DESCRIPTION </span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">iris-monitoring/gke-metrics-agen...</span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">0.1.0 </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">1.0.3-gke.0 </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> GKE metrics agent chart (based o...</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">iris-monitoring/metrics-proxy </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">0.1.0 </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">7.70.0 </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> Service Chart to add a default m...</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">iris-monitoring/simple-iris </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">0.1.0 </span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">2021.1.0.215.0</span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"><span style="white-space:pre"> </span></span></span></span></span></span></span><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Simple stateless IRIS Community ...</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Here we see yet another chart called metrics-proxy. IRIS exposes Prometheus metrics without metrics types, leading to the gke-metrics-agent complaining about an “<em>UNSPECIFIED</em>” type. As a workaround, we send metrics from IRIS to the gke-metrics-agent using metrics-proxy, whose only job is to add a default “gauge” type. You can view the source code of the charts easily in this way:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ helm fetch --untar iris-monitoring/simple-iris --version 0.1.0</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ cd simple-iris # browse files here</span></span></span></span></span></span></span></pre> <h1 style="line-height:1.3800000000000001; margin-top:27px"><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Install IRIS and Monitoring Tools into a Cluster</span></span></span></span></span></span></span></h1> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Having prepared the charts, we can install them. A common way to install Helm charts into clusters is </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">helm install</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> or </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">helm upgrade --install</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">. But this time, let’s try a more declarative way to do the same thing using </span></span></span></span></span></span><a href="https://github.com/roboll/helmfile" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">helmfile</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">.</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Prepare the following file, helmfile.yaml:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ cat helmfile.yaml</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">repositories:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">- name: iris-monitoring</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> url: https://myardyas.github.io/helm-charts</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> </span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">- name: grafana</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> url: https://grafana.github.io/helm-charts</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">helmDefaults:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> wait: true</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> timeout: 600</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> force: false</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> historyMax: 5</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> createNamespace: true</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> atomic: true</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">releases:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">- name: simple-iris</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> chart: iris-monitoring/simple-iris</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> namespace: iris</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version: 0.1.0</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">- name: gke-metrics-agent-custom</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> chart: iris-monitoring/gke-metrics-agent-custom</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> namespace: iris</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version: 0.1.0</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> </span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">- name: metrics-proxy</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> chart: iris-monitoring/metrics-proxy</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> namespace: iris</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version: 0.1.0</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">- name: grafana</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> chart: grafana/grafana</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> namespace: grafana</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> version: 6.15.0</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> values:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> - grafana-values.yaml</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> set:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> - name: service.loadBalancerIP</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> value: { requiredEnv "LOAD_BALANCER_IP" }</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">This code contains a list of repositories from which we’re going to install some charts. Here are our IRIS-monitoring repository and a public Grafana repository (we’ll use Grafana soon, so you need to install it too).&nbsp;</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Besides repositories, the helmfile.yaml file sets default values for things like namespaces if they don’t exist. The most important part of the helmfile is a releases list. The release list is just an installed Helm chart. Each release contains a chart name, namespace, and version. The Grafana release list also sets a custom IP address (to reach the Grafana UI) and </span></span></span></span></span></span><a href="https://grafana.com/tutorials/provision-dashboards-and-data-sources/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">provisions a data source and dashboard</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> in the grafana-values.yaml file. We must create this file as follows:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ cat grafana-values.yaml </span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">service:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> type: LoadBalancer</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">datasources:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> datasources.yaml:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> apiVersion: 1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> datasources:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> - name: Google Cloud Monitoring</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> type: stackdriver</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> isDefault: true</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> jsonData:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> authenticationType: gce</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> editable: true</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> readOnly: true</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">dashboardProviders:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> dashboardproviders.yaml:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> apiVersion: 1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> providers:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> - name: 'default'</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> orgId: 1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> folder: ''</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> type: file</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> disableDeletion: false</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> editable: true</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> options:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> path: /var/lib/grafana/dashboards/default</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">dashboards:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> default:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> iris:</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> gnetId: 14869</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> revision: 1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> datasource: Google Cloud Monitoring</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Note</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#70ad47"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">that the</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#70ad47"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> </span></span></span></span></span></span><a href="https://grafana.com/grafana/dashboards/14869" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">dashboard has the number 14869</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">. This dashboard contains several panels with metrics, like those shown by the</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#70ad47"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> </span></span></span></span></span></span><a href="https://docs.intersystems.com/sam/csp/docbook/DocBook.UI.Page.cls?KEY=ASAM" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">System Alerting and Monitoring Guide</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> (SAM).</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Now we’re almost ready to run an installation procedure. The final step is to define an IP address to access Grafana (replace </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">&lt;your_project_id&gt;</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> with your project ID):</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ export LOAD_BALANCER_IP=$(gcloud compute addresses list --project &lt;your_project_id&gt; --filter="name~'kubernetes-grafana'" --format="value(Address)")</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ echo $LOAD_BALANCER_IP</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">x.x.x.x</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Let’s finally run an installation:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ helmfile sync</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ k9s</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Wait for k9s (or kubectl) until all new pods are running:</span></span></span></span></span></span><be> </p> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3c66ophcmxrcuzdwh26z.png) <h1 style="line-height:1.3800000000000001; margin-top:27px"><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Visualization in Cloud Monitoring</span></span></span></span></span></span></span></h1> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Note that we didn’t expose the IRIS web port to the world this time. We don’t need it for this article, but you can leverage the port-forward application to check IRIS metrics this way:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ kubectl -n iris port-forward svc/simple-iris 52773:52773</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Then, in a different terminal, enter the following:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ curl -s </span></span></span></span></span></span><a href="http://localhost:52773/api/monitor/metrics" style="text-decoration:none"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="text-decoration-skip-ink:none">http://localhost:52773/api/monitor/metrics</span></span></span></span></span></span></span></a> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">iris_cpu_pct{id="AUXWD"} 0</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">iris_cpu_pct{id="CSPDMN"} 0</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">…</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Having checked these metrics, let’s look in the Cloud Monitoring console’s </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:700"><span style="font-style:normal"><span style="text-decoration:none">Metrics explorer</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">. Select the </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:700"><span style="font-style:normal"><span style="text-decoration:none">Global </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">resource type.</span></span></span></span></span></span></p> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5shrvizc31ypx33mtyfx.png) <span>&nbsp;</span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> Now look at the </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:700"><span style="font-style:normal"><span style="text-decoration:none">iris_process_count</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> metric:</span></span></span></span></span></span><br>&nbsp;</p> < ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4szbyyzuf89tq61e6svp.png) <span>&nbsp;</span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">We can create dashboards that combine these metrics in a single place. But these dashboards are available only for users of this Google project and aren’t very flexible in their settings. Because of that, let’s look at IRIS metrics in a much handier tool: Grafana.</span></span></span></span></span></span></p> <h1 style="line-height:1.3800000000000001; margin-top:27px"><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Visualization in Grafana</span></span></span></span></span></span></span></h1> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">For a connection to Grafana, use the IP-address, </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">x.x.x.x</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">, stored in the </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">LOAD_BALANCER_IP</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> variable:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ echo ${LOAD_BALANCER_IP}</span></span></span></span></span></span></span></pre> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8c5meih41eafi6u054ug.png) <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">The </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:700"><span style="font-style:normal"><span style="text-decoration:none">username</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> is admin.</span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">The </span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:700"><span style="font-style:normal"><span style="text-decoration:none">password</span></span></span></span></span></span><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> is the output of:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ kubectl get secret --namespace grafana grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo</span></span></span></span></span></span></span></pre> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">The </span></span></span></span></span></span><a href="http://x.x.x.x/d/KN_HZ7n7z/iris?orgId=1&amp;from=now-15m&amp;to=now" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">IRIS dashboard</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> appears.</span></span></span></span></span></span></p> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4mcxyd4e14wvphsmranf.png) <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Any person who knows the address and password can view this dashboard. Feel free to add your own dashboards.</span></span></span></span></span></span></p> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qyoqrn5901aqc5vg7q2.png) <h1 style="line-height:1.3800000000000001; margin-top:27px"><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Cleanup</span></span></span></span></span></span></span></h1> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">When you’re done, don’t forget to remove unused parts from the Google Cloud Platform. You can remove everything this way:</span></span></span></span></span></span></p> <pre style="line-height: 1.38;"><span style="font-size:14px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud --quiet container clusters delete kubernetes --region us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud --quiet compute routers nats delete kubernetes --router=kubernetes --region=us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud --quiet compute routers delete kubernetes --region=us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud --quiet compute addresses delete kubernetes-grafana --region=us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud --quiet compute addresses delete kubernetes --region=us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud --quiet compute networks subnets delete kubernetes --region us-east1</span></span></span></span></span></span> <span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Consolas,sans-serif"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">$ gcloud --quiet compute networks delete kubernetes</span></span></span></span></span></span></span></pre> <p><span style="font-size:20px;"><span style="font-variant: normal; white-space: pre-wrap;"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">Conclusion</span></span></span></span></span></span></span></p> <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">We’ve shown one of the almost endless approaches to monitoring IRIS applications deployed in GKE. This time we’ve focused on metrics stored in Cloud Monitoring and displayed in Grafana. But don’t forget about IRIS logs. Pods logs are, at the moment of writing, gathered by </span></span></span></span></span></span><a href="https://fluentbit.io/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">fluentbit</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> and sent to Cloud Logging where they can be viewed.</span></span></span></span></span></span></p> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c0kv9ciqk5vhmk3wco84.png) <p style="line-height:1.3800000000000001"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">You can find examples of queries at </span></span></span></span></span></span><a href="https://cloud.google.com/logging/docs/view/query-library-preview#kubernetes-filters" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Kubernetes-related queries</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">. It’s interesting to show logs in Grafana too. Project </span></span></span></span></span></span><a href="https://grafana.com/oss/loki/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Grafana Loki</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none"> is exactly for that. An example of integration is available at </span></span></span></span></span></span><a href="https://www.scaleway.com/en/docs/use-loki-to-manage-k8s-application-logs/" style="text-decoration:none"><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#0000ff"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:underline"><span style="-webkit-text-decoration-skip:none"><span style="text-decoration-skip-ink:none">Use Loki to Manage k8s Application Logs</span></span></span></span></span></span></span></span></a><span style="font-size:11pt; font-variant:normal; white-space:pre-wrap"><span style="font-family:Arial"><span style="color:#000000"><span style="font-weight:400"><span style="font-style:normal"><span style="text-decoration:none">.</span></span></span></span></span></span><br>&nbsp;</p>
intersystemsdev
1,863,152
Toy gun price in Pakistan
Introduction In Pakistan, kids' guns, including toy guns, water guns, and other play...
0
2024-05-23T19:16:13
https://dev.to/jstoyplanet/toy-gun-price-in-pakistan-57ak
kids, toy
## Introduction In Pakistan, kids' guns, including toy guns, water guns, and other play weapons, are popular items among children. These toys are available in a wide range of designs, prices, and functionalities, catering to the diverse preferences of Pakistani children. This article provides a comprehensive guide on the various types of kids' guns available in the Pakistani market, including their prices, safety considerations, and where to buy them. ## Types of Kids Guns Toy Guns Toy guns are among the most sought-after items in the category of kids' toys in Pakistan. They come in various forms, including pistols, rifles, and machine guns, often modeled after real-life firearms but made from plastic and other child-safe materials. These toy guns often feature sound effects, flashing lights, and realistic designs that attract children. Water Guns Water guns are especially popular during the hot summer months in Pakistan. They provide endless fun for kids as they engage in water fights and outdoor activities. Water guns vary in size and capacity, from small, handheld models to large, backpack-style guns that can hold significant amounts of water for extended play. ## Toy Gun Prices in Pakistan The [toy gun price in Pakistan] (https://jstoyplanet.com/product-category/toy-gun-price-in-pakistan/) varies based on factors such as brand, size, and features. Basic toy guns can start as low as PKR 200, while more sophisticated models with electronic features can cost upwards of PKR 2000. Water guns also have a wide price range, with simple models available for around PKR 150 and more complex, high-capacity guns priced at over PKR 1500. ## Popular Brands and Where to Buy Several local and international brands offer a variety of kids' guns in Pakistan. Some of the popular brands include Nerf, Simba, and local manufacturers who produce cost-effective options. These toys can be purchased from various outlets, including toy stores, supermarkets, and online marketplaces like **[JSTOYPLANET](https://jstoyplanet.com/)** site ## Safety Considerations While toy guns can provide entertainment and imaginative play for children, it's essential to consider safety. Parents should ensure that the toy guns are made of non-toxic materials and do not have small parts that could be choking hazards. It's also crucial to educate children about the difference between toy guns and real firearms to prevent any dangerous misunderstandings. ## Conclusion Kids' guns, including toy guns and water guns, are popular toys in Pakistan, offering fun and excitement for children. With a wide range of options available at varying prices, parents can find suitable toys that match their children's interests and their budgets. Ensuring safety and educating children about the proper use of these toys can help provide a fun and safe play experience. Whether you're looking for the latest toy gun model or a fun water gun for summer, the Pakistani market offers a vast selection to meet your needs.
jstoyplanet
1,863,150
Personal Take on Blockchain & Crypto Events
I attended many Blockchain events, ranging from highly technical showcases to more general,...
0
2024-05-23T19:14:25
https://dev.to/omranic/personal-take-on-blockchain-crypto-events-a97
blockchain, crypto, events
I attended many Blockchain events, ranging from highly technical showcases to more general, non-technical crypto gatherings. My recent experiences have led me to observe significant differences in the value and substance of these events. Here’s my personal take on the landscape of blockchain and crypto events from both a technical and non-technical perspective. --- ## Non-Technical Crypto Events: Hype vs. Substance When it comes to non-technical crypto events, it seems to be one of the following: - Both exhibitors and audiences have no idea what they're talking about; - Or you see projects designed to capitalize on the blockchain hype without delivering real value. Many projects appear to be ordinary (sometimes useless) applications dressed up with blockchain terminology to attract investors rather than offering substantial innovation or tangible benefits. This approach often results in a superficial engagement with the technology, focusing more on buzzwords than on meaningful advancements. It's common to encounter a lack of deep understanding or projects that seem to leverage blockchain just for the hype. This aligns with observations in the industry, where numerous projects fail to deliver on their promises and instead focus on superficial aspects to garner attention and funding. --- ## Technical Blockchain Events: Innovation Without Direction On the other hand, technical blockchain events are often filled with genuinely impressive innovations and complex technologies. These events showcase developers' and researchers' incredible intellectual effort and technical expertise. However, a critical gap remains in the connection between these technical achievements and real-world applications. Frequently, when questioned about practical use cases, the brilliant minds behind these projects either have no clear answers or provide abstract, unconvincing explanations. This disconnect can lead to significant investments in technologies that, despite their sophistication, lack a clear path to market relevance or consumer adoption. --- ## The Real-World Use Case Dilemma This issue of unclear use cases is not just theoretical. I recall a conversation with the CEO of a blockchain startup who passionately discussed their groundbreaking technology. However, when asked about specific real-world applications, his response was essentially that users would discover the use cases themselves. This approach is concerning; building technology without a clear vision for its application risks wasting investor money and valuable resources. --- ## Conclusion The disparity between non-technical and technical blockchain and crypto events highlights a fundamental challenge in the industry: aligning technological innovation with practical, real-world applications. While it's exciting to see the advancements in blockchain technology, it’s crucial that these innovations are directed towards solving real problems and providing tangible value. Without this focus, the blockchain space risks becoming a landscape of unrealized potential and speculative ventures. > 💡 The blockchain community must bridge the gap between technology and application. Developers, researchers, and investors should collaborate to ensure innovations are cutting-edge, relevant, and beneficial. By focusing on practical applications and genuine value creation, we can move beyond the hype and build a sustainable, impactful future for blockchain technology. **Happy to hear your thoughts on this!**
omranic
1,863,151
Give me a job on Flutter.
I'm Shahadat Hossain from Bangladesh. I'm a fresher Flutter Developer and I have 1 year of...
0
2024-05-23T19:14:10
https://dev.to/shahadatcoder/give-me-a-job-on-flutter-3fj8
I'm Shahadat Hossain from Bangladesh. I'm a fresher Flutter Developer and I have 1 year of experience. I've been seeking a job or intern for a few months. But I didn't get the job. I'm able to build a higher Application.
shahadatcoder
1,863,149
Getting ready to know UNIX and Linux
Ever wondered what powers the internet, the servers behind your favorite apps, or even your home...
0
2024-05-23T19:13:02
https://dev.to/ucunguyabe/getting-ready-to-know-unix-and-linux-2358
linux, unix, ubuntu, developers
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9uyhj1fwoifb6dvlowdn.jpg) Ever wondered what powers the internet, the servers behind your favorite apps, or even your home router? The answer often lies in two titans of the tech world: Linux and Unix. Now, sit down and bring your popcorn, because we are about to dive deep into an introduction to these powerful operating systems, exploring their features, architecture, and the world of Linux distributions. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/br64d9scbbu4fexlzxl2.gif) ## What is a Network Operating System? A network operating system (NOS) is software designed to manage and coordinate multiple devices within a network, allowing them to share resources like files, printers, and applications. Examples of NOS include: - Windows Server - macOS Server - Linux Distributions: Including popular versions like Ubuntu Ubuntu is a specific distribution of Linux, tailored to provide a user-friendly and robust computing environment. ## What is Unix? Unix is an operating system developed by Bell Labs that has been a cornerstone of computing since its creation. Known for its portability and power, Unix has influenced many modern operating systems, including Linux. ### Key Features of Unix - Shell and Bash : Unix features a command-line interface (CLI) known as the shell. Bash (Bourne Again Shell) is one of the most popular shells, allowing users to execute commands and scripts efficiently. - Applications: Unix supports a wide range of applications, from text editors like vi to complex server software. ## Unix Operating System Architecture and Its Components Unix's architecture is both simple and robust, composed of several ### key components - Hardware: The physical components of the computer system, including the CPU, memory, storage devices, and peripheral devices. - Kernel: The core that manages system resources, memory, processes, and hardware communication. It acts as a bridge between the hardware and the applications. - Applications: Software programs that run on the Unix system, performing a variety of tasks for users, from text editing to network management. ## Unix Security Model Unix was built with a robust security model that ensures the system remains secure and reliable. Key components include: - User Roles: Users are assigned specific roles with distinct privileges, ensuring they can only access and modify what they're authorized to. - Corporate Policy: Administrators can define and enforce security policies across the system, maintaining consistent security standards. - Least Privilege: Users and processes are given the minimum levels of access – or permissions – needed to perform their tasks, reducing the risk of accidental or malicious damage. - Available Tasks: Users can only perform tasks within their assigned roles, limiting the potential impact of any security breaches. ## The Root User in Unix One of the most powerful aspects of Unix is the root user. The root user, also known as the superuser, has unrestricted access to all commands and files in the system. This user can: - Modify System Settings: Change configurations and settings that affect the entire system. - Manage Users and Permissions: Create, modify, and delete user accounts and set permissions. Install and Remove Software: Add or remove software packages as needed. - Access All Files: Read, write, and execute any file, regardless of its permissions. Because of its extensive privileges, the root user is critical for system administration but also poses a significant security risk if not properly managed. It's recommended to perform routine tasks using a regular user account and switch to the root user only when necessary. ### Users and User Groups in Unix Unix systems manage permissions and access control through a system of users and groups: - Users: Individual accounts created on the system. Each user has a unique identifier (UID) and a home directory. - Groups: Collections of users. Each group has a unique group identifier (GID). Groups allow for easier management of permissions, as you can set permissions for a group rather than individual users. By assigning users to groups, administrators can efficiently manage permissions and ensure that users have the appropriate access to system resources. Common Unix Applications and Commands Unix provides a plethora of commands and applications, making it a favorite among developers and system administrators. Some commonly used commands include: - ls: Lists directory contents. - ps: Displays active processes. - chmod: Changes file permissions. - grep: Searches for text patterns within files. ## Diving Deeper into Linux ### Linux Distributions Linux, inspired by Unix, comes in many distributions, each catering to different needs: - Ubuntu: Known for its ease of use and community support. - Fedora: Offers cutting-edge features and technologies. - Debian: Valued for its stability and extensive software repositories. - Arch Linux:Offers high customization and flexibility. Each distribution provides a unique blend of software packages, system management tools, and user interfaces, allowing users to choose the one that best fits their requirements. ### The Linux File System Linux organizes files in a hierarchical structure, beginning with the root directory (/). This structure includes: - /bin: Essential command binaries. - /etc: Configuration files. - /home: User home directories. - /var: Variable data files, such as logs. - /usr: User utilities and applications. This logical organization makes it easier for users and administrators to navigate and manage the system. ## Benefits of Linux Systems Using Linux brings numerous advantages: - Stability: Known for their reliability and long uptimes. - Security: Regular updates and robust security features. - Open Source: Many Linux distributions are open source, encouraging community-driven development. - Flexibility: Highly customizable to meet various needs. ### Uses of Unix and Linux Both Unix and Linux systems are used widely across various domains: - Servers: Powering web, database, and file servers. - Development Environments: Preferred for their stability and powerful tools. - Embedded Systems: Running on devices like routers and smart TVs. - Desktops: Linux distributions like Ubuntu and Fedora provide user-friendly desktop environments. ### Unix Variants - Unix has several notable variants, each with unique features and use cases: Berkeley Software Distribution (BSD): This variant has several popular derivatives: - NetBSD: Known for its portability across many hardware platforms. - FreeBSD: Focuses on performance and advanced networking features. - OpenBSD: Prioritizes security and code correctness. On the other side of BSD, we have ### Next: - macOS: Apple's macOS is a Unix-based operating system, derived from NeXTSTEP, which itself was based on BSD. It combines the robustness of Unix with the user-friendly interface that Apple is known for. ### Data Processing in Unix Unix excels in data processing with tools such as: awk: A powerful programming language for text pattern scanning and processing. sed: A stream editor for filtering and transforming text. Pipelines: Allowing the output of one command to be used as input for another, e.g., cat file | grep "pattern" | sort. Unix and Linux: where even the command line has its punchlines! From navigating directories to piping commands, these operating systems offer a world of possibilities – and maybe a few surprises along the way. So whether you're "grep"ping for solutions or just trying to "sed"ate your curiosity, dive into Unix and Linux with a smile. After all, who said tech couldn't be fun? ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vsd5dy21w3pxhaaqpvpp.gif)
ucunguyabe
1,863,148
Top 10 ReactJs Books to Enhance Your Frontend Skills [2024]
1. Introduction React JS is now one of the most liked JavaScript tools for making user...
0
2024-05-23T19:10:36
https://dev.to/ismailmirza/top-10-reactjs-books-to-enhance-your-frontend-skills-1700
reactjsdevelopment, javascript, programming, reactnative
## 1. Introduction React JS is now one of the most liked JavaScript tools for making user parts on the web. If you want to get better at React, getting the best help is key. There are lots of books that can give deep know-how and help you get better at using React to its full. In this piece, we made a list of the top 10 books that will lift your web skills. No matter if you are new or good at this, these books can help you to get strong at React and stay up in the tech world that keeps on going. ## 2. Understanding the importance of continuous learning in web development In the fast-changing world of tech, making your web-making skills better is very needed. As you get better at using React, it's key to know that non-stop learning is the main thing to get new ideas and keep up with others. Use web help, join short learning events, and talk with other code creators to keep up with the newest styles. In the next part, we'll look at why knowing the newest moves in the field is key and how this can make you much better at making things with React. Keep going through this to find out how learning all the time can lift your job in making websites to new high points. ## 3. Exploring the top React books for mastering the framework Learn more about React and take a quick look at the top books to read to expand your knowledge. Here is a list of resources to continue learning, giving more detailed information, cases, and recommendations on how to make the most of using React. From fundamental to the most advanced web development issues, you will find all the boost you need to tackle some of the most advanced web development issues in these books. Are you looking to expand your understanding and get more proficient with React? Following is a list of ten most recommended books that will guide you towards gaining new heights in web development. As for recommendation, stick around and be ready to improve your knowledge on React! ### 3.1. Learning React: Modern Patterns for Developing React Apps by Alex Banks and Eve Porcello If you want to learn how to build efficient React applications, this is your book. Ideal for web developers and software engineers who understand how JavaScript, CSS, and HTML work in the browser, this updated edition provides best practices and patterns for writing modern React code. No prior knowledge of React or functional JavaScript is necessary. With their learning road map, authors Alex Banks and Eve Porcello show you how to create UIs that can deftly display changes without page reloads on large-scale, data-driven websites. You'll also discover how to work with functional programming and the latest ECMAScript features. Once you learn how to build React components with this hands-on guide, you'll understand just how useful React can be in your organization. Download this book for free [here](https://pdfbd.top/books/learning-react-modern-patterns-for-developing-react-apps-by-alex-pdf). ![learning react modern patterns book cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3sip3k6gm590ukj4qar.jpg) ### 3.2. Learn React with TypeScript: 2nd Edition by Carl Rippon (2023) If you are a developer who is already familiar with either TypeScript or React and wants to understand how they can be used together effectively then this book is for you. Getting a handle on the challenges of modern React development is not easy. In this course, Carl Rippon helps by going beyond your first React app and by examining such issues as how to design useful components (and avoid overloading them), how to state manage with TypeScript without losing clear coupling between bits of data, hooks versus classes and what goes where in a real-world solution stack. Download this book for free or read online [here](https://pdfbd.top/books/learn-react-with-typescript-2nd-edition-by-carl-rippon-2023-pdf). ![learn react with typescript book cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijmi90h53el5k7wuinkm.png) ### 3.3. Mastering React by Adam Horton and Ryan Vice (2016) Master the art of building modern web applications using React. Write a complete application in React using an array of supporting libraries, both specifically React-related and general purpose. Understand what makes React stand apart from the vast majority of JS frameworks available through detailed explanations and concise examples. Explore the React ecosystem and how to integrate React with other modern web technologies. This book is ideal for web developers possessing strong core JavaScript fundamentals who are also interested in learning what React brings to the architectural table. Download this book for free [here](https://pdfbd.top/books/mastering-react-by-adam-horton-ryan-vice-2016-pdf). ### 3.4. Mastering Reactive JavaScript by Erich de Souza Oliveira (2017) Expand your boundaries by creating applications empowered with real-time data using ReactJS without compromising performance. Handle an infinite stream of incoming data using ReactJS without going crazy. Explore important ReactJS operators that can help you improve your code readability. Get acquainted with the different techniques and operators used to handle data traffic, which occurs when you receive data faster than you can process. If you're a web developer with some basic JavaScript programming knowledge who wants to implement the reactive programming paradigm with JavaScript, then this book is for you. Download this book for free [here](https://pdfbd.top/books/mastering-reactive-javascript-erich-de-souza-oliveira-2017-pdf). ### 3.5. React Cookbook By David Griffiths React helps you create and work on an app in just a few minutes. But learning how to put all the pieces together is hard. How do you validate a form? Or implement a complex multistep user action without writing messy code? How do you test your code? Make it reusable? Wire it to a backend? Keep it easy to understand? The React Cookbook delivers answers fast. Many books teach you how to get started, understand the framework, or use a component library with React, but very few provide examples to help you solve particular problems. This easy-to-use cookbook includes the example code developers need to unravel the most common problems when using React, categorized by topic area and problem. Download this book for free [here](https://pdfbd.top/books/mastering-react-beginners-guide-pdf). ### 3.6. Mastering React Native: Beginners Guide Mastering React Native helps the reader master the React Native framework for faster and more robust mobile app development. React Native is an open-source JavaScript framework that allows you to create applications for many platforms, including iOS, Android, and the web, all with the same code base. It is built on the React framework, and it provides all of React's power to mobile app development. React Native was a natural continuation of React. It is a mobile framework that includes JavaScript to create near-native apps. JSX, a hybrid of JavaScript and XML-like markup, is used to make React Native applications. The React Native "bridge" then calls the native rendering APIs in Objective-C (for iOS) or Java (for Android) behind the scenes. Download this book for free [here](https://pdfbd.top/books/mastering-react-native-beginners-pdf). ### 3.7. Mastering React Test-Driven Development: 2nd Edition Learn test-driven and behavior-driven development techniques that will give you greater confidence when building React applications. Explore the TDD process, how it works, and why it will help you write maintainable React apps. Develop a component testing framework from scratch, which will help you understand the mechanics of good unit testing. Reduce complexity by using unit tests and end-to-end acceptance tests to drive the design of your apps. Test-driven development (TDD) is a programming workflow that helps you build your apps by specifying behavior as automated tests. The TDD workflow future-proofs apps so that they can be modified without fear of breaking existing functionality. Download this book for free [here](https://pdfbd.top/books/mastering-react-test-driven-development-2nd-pdf). ### 3.8. React Key Concepts by Maximilian Schwarzmüller (2022) Build the understanding, skills, and experience to confidently implement React in your next project with this fast-paced overview of React fundamentals. A clear, concise explanation of core React 18 functionalities to promote quick, easy reference. Gain a deep understanding of key React concepts with the help of step-by-step derivations. Work with practical exercises that challenge you to apply your new skills and build your own simple apps. As the most popular JavaScript library for building modern, interactive user interfaces, React is an in-demand framework that'll bring real value to your career or next project. Download this book for free [here](https://pdfbd.top/books/maximilian-schwarzmuller-react-key-concepts-2022-pdf). ### 3.9. Micro State Management with React Hooks Understand the essential concepts and features of micro state management. Discover solutions to common problems faced while implementing micro state management. Explore the different libraries, their coding style, and the optimum approach to rendering optimization. State management is one of the most complex concepts in React. Traditionally, developers have used monolithic state management solutions. Thanks to React Hooks, micro state management is something tuned for moving your application from a monolith to a microservice. Download this book for free [here](https://pdfbd.top/books/micro-state-management-react-hooks-pdf). ### 3.10. Modern Full-Stack Development: Second Edition Discover how to build and deploy full-stack applications with modern technologies like React, Node.js, and GraphQL. This comprehensive guide covers everything from setting up your development environment to deploying your application. Learn how to build scalable and maintainable applications by following best practices and using the latest tools and frameworks. Download this book for free [here](https://pdfbd.top/books/modern-full-stack-development-2nd-pdf). ## 4. Conclusion If you want to download more books on React, you can visit this site [pdfbard](https://www.pdfbard.com). > Thanks for reading this, stay tuned for more. > Thanks for reading; if you liked my content and want to support me, the best way is to - > [Join our telegram channel to get the latest books as soon as possible.](https://t.me/pdfbard) > [Connect with me on Facebook, where I keep sharing such free content to become more productive at your life](https://facebook.com/pdfbard). > Follow me on X ([Twitter](https://x.com/pdfbard)) and [Medium](https://pdfbard.medium.com) to get instant notifications for everything new. > Join my Pinterest for upcoming insightful content.
ismailmirza
1,863,130
AWS Cost Management and Optimization: Tips and Tools for Monitoring and Reducing Your AWS Costs
Managing and optimizing AWS costs is an important aspect of using AWS services effectively. Given the...
0
2024-05-23T19:09:39
https://dev.to/mariehposa/aws-cost-management-and-optimization-tips-and-tools-for-monitoring-and-reducing-your-aws-costs-4kib
aws, cloud, optimization, tips
Managing and optimizing AWS costs is an important aspect of using AWS services effectively. Given the extensive range of services and pricing models available, understanding how to monitor, control, and reduce costs can save your organization significant amounts of money. This article covers everything you need to know about AWS cost management and optimization, including practical tips, tools, and best practices. #### Understanding AWS Cost Structure Before I proceed with cost management, it's important to understand the fundamental components of AWS costs. AWS charges you based on the following primary categories: - **Compute Costs**: These include charges for EC2 instances, Lambda functions, and other compute services. Compute costs are typically billed based on the instance type, usage duration, and some other features like Elastic IP addresses and data transfer. - **Storage Costs**: Storage costs are associated with services like Amazon S3, EBS volumes, and other storage solutions. These costs vary based on the amount of data stored, the storage class used, and the frequency of data access. - **Data Transfer Costs**: Data transfer charges occur when data is transferred between AWS services, across regions, or out to the internet. Understanding data transfer pricing is vital for optimizing costs, especially for applications with significant data movement. - **Other Service Costs**: AWS offers a lot of services like RDS, DynamoDB, CloudFront, and many more. Each service has its own pricing model, and the costs can add up depending on usage patterns and service configurations. AWS provides detailed cost breakdowns in the AWS Billing and Cost Management console, where you can see your usage and charges categorized by service, region, account and cost. This visibility is critical for effective cost management. #### Setting Up AWS Budgets AWS Budgets allows you to set custom cost and usage budgets which helps you monitor and control your spending. Setting up budgets involves a few straightforward steps: 1. **Create a Budget**: Navigate to the AWS Budgets dashboard and click on "Create a budget". You can choose from cost budget, usage budget, savings plans or reservation budget. Define your budget parameters, such as the name, scope, budgeted amount and the period (e.g. monthly, quarterly, etc). 2. **Configure Alerts**: To stay informed, set up alerts that notify you when your costs or usage exceed certain thresholds. These alerts can be sent via email, SNS or Chatbot to ensure you are always aware of your spending patterns and can take corrective actions promptly. #### Monitoring Costs with AWS Cost Explorer AWS Cost Explorer is a powerful tool for visualizing and analyzing your AWS costs. It offers several features to help you understand and manage your spending: 1. **Explore Your Data**: Access AWS Cost Explorer from the Billing and Cost Management console. You can filter and group your data by various dimensions: service, usage type, region, and tags. This flexibility allows you to drill down into specific areas and identify cost drivers. 2. **Create Reports**: Create custom reports to track your costs and usage over time. These reports can be saved and scheduled for regular review, providing ongoing insights into your spending patterns. 3. **Forecast Costs**: Cost Explorer's forecasting feature helps predict future costs based on historical data. This predictive capability enables better budget planning and resource allocation. #### Using AWS Trusted Advisor AWS Trusted Advisor provides real-time guidance to help you provision your resources according to AWS best practices. It covers several areas, including cost optimization, security, fault tolerance, and performance improvement: 1. **Access Trusted Advisor**: Access the AWS Trusted Advisor console to review cost optimization recommendations. These recommendations often include actions like deleting unused resources, resizing instances and using cheaper pricing options. 2. **Implement Recommendations**: Follow the suggestions provided by Trusted Advisor to reduce costs. This might involve stopping underused instances, optimizing storage, or adjusting configurations to align with usage patterns. #### Using AWS Cost Anomaly Detection This helps to identify unexpected increases in your costs and provides an additional layer of financial oversight: 1. **Create an Anomaly Monitor**: In the AWS Cost Management console, select "Cost Anomaly Detection". Create an anomaly monitor and specify the scope (e.g. linked account, cost category, etc). This monitor continuously scans your cost data for anomalies and highlights any unexpected spending. 2. **Set Up Notifications**: Configure alerts to notify you of anomalies via email, chatbot or SNS. These notifications ensure that any unexpected cost spikes are promptly addressed and prevent budget overruns. #### Implementing Tagging Strategies Tagging resources is essential for cost allocation and management. A well-defined tagging strategy helps in organizing resources and tracking costs effectively: 1. **Define a Tagging Policy**: Establish a consistent tagging strategy for all resources. Common tags include `Environment` (e.g. production, staging, development), `Project`, and `Department`. Clear tagging policies ensure that resources are easily identifiable and associated costs can be accurately allocated. 2. **Apply Tags**: Apply tags to all AWS resources. AWS Tag Editor allows for bulk tagging, making it easier to manage large numbers of resources. Consistent tagging practices facilitate detailed cost analysis and reporting. 3. **Use Cost Allocation Tags**: Enable cost allocation tags in the Billing and Cost Management console. These tags allow you to break down costs by specific tags in your reports and provide deeper insights into how different projects or departments are consuming resources. #### Optimizing EC2 Costs EC2 instances are often a major contributor to AWS costs. Several strategies can help optimize EC2 expenses: 1. **Right-Sizing Instances**: Regularly review and adjust the size of your instances to match your workload requirements. Overprovisioning can lead to unnecessary costs, while underprovisioning can impact performance. Use AWS Compute Optimizer recommendations for right-sizing instances based on usage patterns. 2. **Use Spot Instances**: Take advantage of EC2 Spot Instances for non-critical workloads. Spot Instances can save up to 90% compared to On-Demand prices which makes them an excellent option for batch processing, big data analytics, and other flexible tasks. 3. **Purchase Reserved Instances (RIs)**: For long-term, stable workloads, purchasing Reserved Instances can provide significant discounts over On-Demand prices. Evaluate your usage patterns and consider a combination of Standard and Convertible RIs to balance savings and flexibility. 4. **Implement Auto Scaling**: Use Auto Scaling to automatically adjust the number of instances based on demand. This ensures that you only pay for the capacity you need and reduces costs during periods of low demand. #### Managing S3 Storage Costs Amazon S3 provides several options for reducing storage costs: 1. **Use the Right Storage Class**: Choose appropriate S3 storage classes based on your access patterns. Options include S3 Standard for frequently accessed data, S3 Intelligent-Tiering for automatically optimizing storage costs and S3 Glacier for long-term archival storage. 2. **Lifecycle Policies**: Implement lifecycle policies to automatically transition objects to cheaper storage classes or delete them after a certain period. Lifecycle policies help manage data retention and optimize storage costs over time. 3. **Monitor Storage Metrics**: Use the S3 Storage Lens group to gain insights into your storage usage and trends. Storage Lens provides detailed metrics and actionable recommendations to optimize your storage footprint. #### Optimizing RDS Costs Amazon RDS offers several optimization strategies to reduce database costs: 1. **Use RDS Reserved Instances**: Purchase RDS Reserved Instances for long-term database workloads. Reserved Instances provide significant discounts compared to On-Demand pricing, making them ideal for stable and predictable workloads. 2. **Right-Sizing**: Regularly review and adjust the instance size and storage of your RDS instances. Right-sizing ensures that your database instances are appropriately scaled to meet performance requirements without incurring unnecessary costs. 3. **Use Aurora Serverless**: Consider Aurora Serverless for variable workloads. Aurora Serverless automatically adjusts capacity based on demand thereby providing cost savings for workloads with fluctuating usage patterns. Cost optimization is an ongoing process. Regularly reviewing your AWS usage and costs, and implementing best practices ensures that you remain efficient and cost-effective. By following these tips, you can effectively manage and optimize your AWS costs which guarantees you get the most value from your cloud investment. This approach to cost management will help you maintain control over your spending and continuously improve the efficiency of your AWS environment.
mariehposa
1,863,147
wellness massage
The combination of warm oils, calming aromas, and gentle kneading motions will refresh, rejuvenate,...
0
2024-05-23T19:08:58
https://dev.to/nookspa/wellness-massage-54i7
massage
The combination of warm oils, calming aromas, and gentle kneading motions will refresh, rejuvenate, and prepare you for whatever challenges. Take some time for yourself today by treating yourself to a **[wellness massage](https://thenookspa.com/wellness-massage/)** at The Nook Spa because when it comes to living your best life, there is no substitute for taking good care of your physical and emotional well-being.
nookspa
1,863,146
houston hospice cares
Houston Hospice Cares is dedicated to providing compassionate care to patients facing life-limiting...
0
2024-05-23T19:08:40
https://dev.to/hospicecares/houston-hospice-cares-1hg
**[Houston Hospice Cares](![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r50ubi1ymyqf3n48pneb.png) )** is dedicated to providing compassionate care to patients facing life-limiting illnesses and their families. Infused with a deep commitment to enhancing the quality of life, the hospice offers a range of services designed to meet the physical, emotional, and spiritual needs of those in their care.
hospicecares
1,863,145
Overview of Generative AI - Part1
Generative artificial intelligence is artificial intelligence capable of generating text, images...
0
2024-05-23T19:08:39
https://community.intersystems.com/post/overview-generative-ai-part1
ai, chatgpt, programming
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fbt6q7sv93swel8sphx.png) <p> <br>Generative artificial intelligence is artificial intelligence capable of generating text, images or other data using generative models, often in response to prompts. Generative AI models learn the patterns and structure of their input training data and then generate new data that has similar characteristics.</p> <p>&nbsp;</p> <p>Generative AI is artificial intelligence capable of generating text, images and other types of content. What makes it a fantastic technology is that it democratizes AI, anyone can use it with as little as a text prompt, a sentence written in a natural language.</p> <p>&nbsp;</p> <p>how large language models work<br><br>&nbsp;</p> <ul> <li><strong>Tokenizer, text to numbers</strong>: Large Language Models receive a text as input and generate a text as output. However, being statistical models, they work much better with numbers than text sequences. That’s why every input to the model is processed by a tokenizer, before being used by the core model. A token is a chunk of text – consisting of a variable number of characters, so the tokenizer's main task is splitting the input into an array of tokens. Then, each token is mapped with a token index, which is the integer encoding of the original text chunk.</li> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d89pql069z8ba4ggihbt.png) <li><strong>Predicting output tokens</strong>: Given n tokens as input (with max n varying from one model to another), the model is able to predict one token as output. This token is then incorporated into the input of the next iteration, in an expanding window pattern, enabling a better user experience of getting one (or multiple) sentence as an answer. This explains why, if you ever played with ChatGPT, you might have noticed that sometimes it looks like it stops in the middle of a sentence.</li> <li><strong>Selection process, probability distribution</strong>: The output token is chosen by the model according to its probability of occurring after the current text sequence. This is because the model predicts a probability distribution over all possible ‘next tokens’, calculated based on its training. However, not always the token with the highest probability is chosen from the resulting distribution. A degree of randomness is added to this choice, in a way that the model acts in a non-deterministic fashion - we do not get the exact same output for the same input. This degree of randomness is added to simulate the process of creative thinking and it can be tuned using a model parameter called temperature.</li> </ul> <p id="install-openai"><br>In the upcoming article, we will engage in practical demonstrations.<br><br>Thanks</p>
intersystemsdev
1,863,144
Et omnis in adipisci
dfgfdgdfgfdg
0
2024-05-23T19:08:02
https://dev.to/sm-maruf-hossen/dfgdfdfgdfg-4i90
dfgfdgdfgfdg
sm-maruf-hossen
1,863,143
Creating a Job That Doesn't Exist w/ Aaron Harmon, Sr. Recruiter
Any dad advice going from one kid to two kids? Because that’s happening now in 6 weeks!! But for...
0
2024-05-23T19:05:15
https://dev.to/tdesseyn/creating-a-job-that-doesnt-exist-w-aaron-harmon-sr-recruiter-176d
career, job
Any dad advice going from one kid to two kids? Because that’s happening now in 6 weeks!! But for real, if anyone has gone from one to two give me your best advice because I’m all ears! While you’re thinking about that, I want to give you some updates from Gun.io. This is not going to become a Gun.io newsletter don’t worry BUT we’ve been COOKIN as the kids say over here so I want to give you an update on what we got going on… - We basically redid our entire platform to where the main view is you searching our entire database of thousands of engineers. Think LinkedIn Recruiter but within our database. It’s pretty sweet and it allows hiring managers to start to budget/see what’s out there. Already had a lot of folks in my network say they like the look/feel of it. - This is for DEVELOPERS - we have opened up our entire platform to where you can submit to any open jobs that you feel like is a fit! You have to have your profile 100% complete and TBH we’re very picky about this because this is how we match you with jobs. But if you haven’t made a profile you might as well go ahead and do it. Make sure you select me on marketing attribution :) - We JUST rolled out an AI feature (yes eye roll more AI). It’s a very simple feature but it allows you to copy/paste your job description into our filter and then it automatically spits out candidates that are a fit for your JD. Here’s the kicker…your job description better not suck. Just sayin’. Anywho, had a great convo with my guy Aaron Harmon, former Tesla recruiter, on how he found a job in 4 weeks with this market…hint…it was because of content :) There’s no way I’m going to get through all of it here, [so go check it out](https://www.youtube.com/watch?v=OazvYmvdtzU). Bonus: there’s corgis (that’s right, plural). I always love bringing guests on for y’all who have recently been on the job search because even if you aren’t looking right now, odds are you will be at some point down the road. And I think it’s important to be prepared but also to get a look at what works for other people. Here’s the short version of what has been working for Aaron post layoff: File for unemployment. It’s there as a net for when you need it. You need it, so use it. Not to mention that the process isn’t exactly quick… better to get a head start. Updating your LinkedIn to be “Open to Work” Speaking of things that get some mixed feelings, adding that little green banner to your profile is just there to make your life easier, use it. Or at least throw up a post that you’re looking. Accept the help. If someone offers you help, they won’t be put out because you actually take them up on it. Check your ego, take the help. Start posting. Hey look, I said exactly what you thought I was going to say. BUT Aaron had a great perspective on this: it’s an opportunity to share your background and your capabilities how you want them to be shared, not just some line on a resume a stranger is reading. So you’ve now applied to tons of jobs… hundreds of your applications are floating around out there, but you haven’t found the right fit. Here’s the thing— you have to make it a priority to understand why a position is open and make an intentional effort to research and understand what the company really needs. Aka, now we’re getting into the title of this newsletter. When I started at Gun.io, the position they had open was for sales. Now I’m not saying that’s not part of what I do, BUT I researched the company and saw that their marketing and online presence could benefit from all the things I’m good at and love doing. So should I have just seen the only open sales position and moved on? Nah, sometimes you have to create your own job. Know your own worth and present yourself as a solution. That being said, you really have to lean on your network and be willing to send out some DMs. Aaron had some great DM advice: keep it direct and match the tone of the person you’re messaging. Do your research and look at how they post before you pop off with an incredibly formal or informal message. This convo with Aaron has so many more great nuggets of info. I don’t think I even began to cover it all. OH he also mentioned that he used (not sponsored…) Teal to keep track of his job search metrics. If you’ve tried it, I’d love to hear more from you. Always love hearing about new products.
tdesseyn
1,863,142
Open AI integration with IRIS - His master voice’s – Are you angry?
Continuing with the series of articles on voice file management, we are going to see how we can...
26,518
2024-05-23T19:03:26
https://community.intersystems.com/post/open-ai-integration-iris-his-master-voice%E2%80%99s-%E2%80%93-are-you-angry
ai, api, framework, programming
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/66p8qnlnsnytld4h62i4.jpg) <p><span>Continuing with the series of articles on voice file management, we are going to see how we can convert text into audio and receive the file with the chosen voice.<br>We will also explore how a service from OpenAI can help us analyze a text and determine the mood expressed in it.<br>Let's analyze how you can create your own voice file and how it can “read” your feelings.</span></p> <p><!--break--></p> <h2>The voice</h2> <p>OpenAI offers a service that can create a voice file with your text. It is a lifesaver if you want to integrate a voice response service for visually impaired people.</p> <p>I know that there are a lot of applications that can read a text and convert it to a voice, for instance, Loquendo, AWS, Text-to-speech by Google, etc...</p> <p>However, the problem with most of them is that the voice is not as natural as you might expect. It happens because they typically translate the phoneme as it sounds in verbal language, but they do not place emphasis or emotion in the text.<br>On the other hand, when you use AI, it understands the context of the text and tries to add the correct intonation according to it, e.g. exclamation, question, sadness, joy, etc...</p> <p>This service retrieves the file directly as a binary stream in the response object. It also lets you use different types of audio files: MP3, OVG, etc...</p> <p>I did not want to return the content directly, but I planned to return a Base64 string that the user could convert to a file, play it directly, etc., and that can be used through a file API.</p> <p>The first problem that I faced was converting the <a href="https://docs.intersystems.com/irisforhealthlatest/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&amp;CLASSNAME=%25Stream.GlobalBinary" target="_blank">%Stream.GlobalBinary</a> file into a Base64.</p> <p>My first attempt was to read the binary and convert it as a string decoding a Base64</p> <pre class="codeblock-container" idlang="0" lang="ObjectScript" tabsize="4"><code class="language-cls hljs cos"><span class="hljs-keyword">do</span> tHttpResponse.Data.Rewind() <span class="hljs-keyword">set</span> response = <span class="hljs-string">""</span> <span class="hljs-keyword">while</span> tHttpResponse.Data.AtEnd { <span class="hljs-keyword">set</span> temp=stream.<span class="hljs-keyword">Read</span>(<span class="hljs-number">4000</span>) <span class="hljs-keyword">set</span> temp=<span class="hljs-built_in">$system</span>.Encryption.Base64Encode(temp) <span class="hljs-keyword">set</span> response = response_temp } </code></pre> <p>However, the content was not correctly converted to Base64.</p> <p>Yet, as always, the community saves my life (again). The idea was to convert the <a href="https://docs.intersystems.com/irisforhealthlatest/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&amp;CLASSNAME=%25Stream.GlobalBinary" target="_blank">%Stream.GlobalBinary</a> to a <a href="https://docs.intersystems.com/irisforhealth20241/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&amp;PRIVATE=1&amp;CLASSNAME=%25Stream.GlobalCharacter" target="_blank">%Stream.GlobalCharacter</a> and then read the content in Base64. Thanks you, <a href="https://community.intersystems.com/user/marc-mundt" target="_blank">Marc Mundt</a><span>&nbsp;</span>for your <a href="https://community.intersystems.com/post/encoding-base64-stream-chunk-sizes#comment-200751" target="_blank">amazing response</a>.</p> <p>After that, I created the following class to convert my GlobalBinary to GlobalCharacter stream.</p> <pre class="codeblock-container" idlang="0" lang="ObjectScript" tabsize="4"><code class="language-cls hljs cos"><span class="hljs-keyword">Class</span> St.OpenAi.B64.Util <span class="hljs-keyword">Extends</span> <span class="hljs-built_in">%RegisteredObject</span> { <span class="hljs-comment">/// Be cautious if changing CHUNKSIZE. Incorrect values could cause the resulting encoded data to be invalid.</span> <span class="hljs-comment">/// It should always be a multiple of 57 and needs to be less than ~2.4MB when MAXSTRING is 3641144</span> <span class="hljs-keyword">Parameter</span> CHUNKSIZE = <span class="hljs-number">2097144</span><span class="hljs-comment">;</span> <span class="hljs-keyword">ClassMethod</span> B64EncodeStream(pStream <span class="hljs-keyword">As</span> <span class="hljs-built_in">%Stream.Object</span>, pAddCRLF <span class="hljs-keyword">As</span> <span class="hljs-built_in">%Boolean</span> = <span class="hljs-number">0</span>) <span class="hljs-keyword">As</span> <span class="hljs-built_in">%Stream.Object</span> { <span class="hljs-keyword">set</span> tEncodedStream=<span class="hljs-keyword">##class</span>(<span class="hljs-built_in">%Stream.GlobalCharacter</span>).<span class="hljs-built_in">%New</span>() <span class="hljs-keyword">do</span> pStream.Rewind() <span class="hljs-keyword">while</span> ('pStream.AtEnd) { <span class="hljs-keyword">set</span> tReadLen=..#CHUNKSIZE <span class="hljs-keyword">set</span> tChunk=pStream.<span class="hljs-keyword">Read</span>(.tReadLen) <span class="hljs-keyword">do</span> tEncodedStream.<span class="hljs-keyword">Write</span>(<span class="hljs-built_in">$System</span>.Encryption.Base64Encode(tChunk,'pAddCRLF)) <span class="hljs-keyword">if</span> (pAddCRLF &amp;&amp; 'pStream.AtEnd) { <span class="hljs-keyword">do</span> tEncodedStream.<span class="hljs-keyword">Write</span>(<span class="hljs-built_in">$c</span>(<span class="hljs-number">13</span>,<span class="hljs-number">10</span>)) } } <span class="hljs-keyword">do</span> tEncodedStream.Rewind() <span class="hljs-keyword">quit</span> tEncodedStream } }</code></pre> <p>My next step was to call it from the St.OpenAi.BO.Api.Connect class, and get the Base64 correctly.</p> <pre class="codeblock-container" idlang="0" lang="ObjectScript" tabsize="4"><code class="language-cls hljs cos"><span class="hljs-keyword">set</span> pResponse = <span class="hljs-keyword">##class</span>(St.OpenAi.Msg.Audio.SpeachResponse).<span class="hljs-built_in">%New</span>() <span class="hljs-keyword">do</span> pResponseStream.Content.Rewind() <span class="hljs-keyword">set</span> contentfile = <span class="hljs-keyword">##class</span>(St.OpenAi.B64.Util).B64EncodeStream(pResponseStream.Content) <span class="hljs-keyword">set</span> content = <span class="hljs-string">""</span> <span class="hljs-keyword">while</span> ('contentfile.AtEnd) { <span class="hljs-keyword">set</span> content = content_contentfile.<span class="hljs-keyword">Read</span>() } <span class="hljs-keyword">set</span> pResponse.Content=content</code></pre> <p>I am very lucky to have such a great community by my side!</p> <h2>What do you mean in your text?</h2> <p>What do you think the intention is here if you have the following text?</p> <div style="background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px; text-align: center;">“My life has no meaning. I want to leave everything forever.”</div> <p>You may feel that the speaker intends to do something bad to himself. Indeed, since you are human, you understand what the context is, and you know how to "read between the lines"</p> <p>To a computer, a word is a collection of 0s and 1s, which should be transformed into characters for us to understand. We even put the characters in a different order; we also have words in other languages: "Hello", "Hola", and "Ciao".</p> <p>We can create a relation between the word “Hello” and its counterpart in Spanish (“Hola”) or Italian (“Ciao”).</p> <p>However, there is no easy way to relate the phrase "My life has no meaning" to something negative, or “I want to leave everything forever“ to your desire to harm yourself.</p> <p>If you try to do the same as before, we can consider that the phrase “I want to leave everything forever” means that you want to harm yourself. It might make sense, but the same line in the following phrase “I don't like this city. I want to leave everything forever” is neutral.</p> <p>Indeed, the context is crucial to determine if a text is neutral or contains violence, hate, or self-harm.</p> <h3>How can you train your AI in moderation?</h3> <p>Training an AI to moderate texts involves several steps and essential considerations:</p> <p><strong>Data Collection with Labels:</strong> It is critical to gather a sufficiently large and diverse dataset containing examples of texts you need to moderate, labeled as appropriate or inappropriate according to your moderation criteria.</p> <p><strong>Definition of Moderation Criteria:</strong> You need to clearly define what types of content you consider inappropriate and what actions should be taken regarding them (e.g., removing, hiding, or marking them as potentially offensive).</p> <p><strong>Selection of Algorithms and Models:</strong> You can use supervised machine learning techniques, where models are trained with labeled examples, or semi-supervised machine learning techniques, where both labeled and unlabeled examples are leveraged. Models like BERT, GPT, or specific text classification models can come in handy in this case.</p> <p><strong>Data Preprocessing:</strong> Before training the model, you should perform such tasks as tokenization, text normalization (e.g., converting all parts of the text to lowercase), removal of special characters, etc.</p> <p><strong>Model Training:</strong> Utilize your labeled data to train the selected model. During training, the model will learn to distinguish between appropriate and inappropriate texts based on the defined criteria.</p> <p><strong>Model Performance Evaluation:</strong> After training, evaluate the model's performance with the help of a separate test dataset. It will help you determine how well the model is generalizing and whether it needs additional adjustments.</p> <p><strong>Fine-Tuning and Continuous Improvement:</strong> You are likely to need to fine-tune and improve your model as you gather more data and observe its performance in the real world. It may involve retraining the model with updated data and parameter optimization.</p> <p><strong>Production Deployment:</strong> Once you are satisfied with the model's performance, you can deploy it in your online moderation system to help automate the text moderation process.</p> <p>It is vital to note that no automated moderation system is perfect, so it is always advisable to combine AI with human supervision to address difficult cases or new types of inappropriate content.</p> <p>The main purpose of OpenAI's "moderation" service is to provide artificial intelligence tools and models to help online platforms moderate and manage user-generated content. It includes detecting and mitigating such inappropriate content as spam, hate speech, harassment, violence, sexually explicit content, etc. The goal is to help develop a safer and healthier online environment for users by reducing the presence of harmful content. We can do it by identifying content that might be harmful and taking action.</p> <p>When using OpenAI’s moderation, the previous text would throw us the following result:</p> <pre class="codeblock-container" idlang="3" lang="JSON" tabsize="4"><code class="language-json hljs">{ <span class="hljs-attr">"id"</span>: <span class="hljs-string">"modr-9FRqaywTVudh3Jk9FEYnxuRbrDmUH"</span>, <span class="hljs-attr">"model"</span>: <span class="hljs-string">"text-moderation-007"</span>, <span class="hljs-attr">"results"</span>: [ { <span class="hljs-attr">"flagged"</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">"categories"</span>: { <span class="hljs-attr">"sexual"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"hate"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"harassment"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"self-harm"</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">"sexual/minors"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"hate/threatening"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"violence/graphic"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"self-harm/intent"</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">"self-harm/instructions"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"harassment/threatening"</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">"violence"</span>: <span class="hljs-literal">false</span> }, <span class="hljs-attr">"category_scores"</span>: { <span class="hljs-attr">"sexual"</span>: <span class="hljs-number">6.480985575763043e-6</span>, <span class="hljs-attr">"hate"</span>: <span class="hljs-number">0.00005180266089155339</span>, <span class="hljs-attr">"harassment"</span>: <span class="hljs-number">0.000108763859316241</span>, <span class="hljs-attr">"self-harm"</span>: <span class="hljs-number">0.861529529094696</span>, <span class="hljs-attr">"sexual/minors"</span>: <span class="hljs-number">6.210859737620922e-7</span>, <span class="hljs-attr">"hate/threatening"</span>: <span class="hljs-number">9.927841659873593e-8</span>, <span class="hljs-attr">"violence/graphic"</span>: <span class="hljs-number">0.000012115803656342905</span>, <span class="hljs-attr">"self-harm/intent"</span>: <span class="hljs-number">0.9326919317245483</span>, <span class="hljs-attr">"self-harm/instructions"</span>: <span class="hljs-number">0.00005927650636294857</span>, <span class="hljs-attr">"harassment/threatening"</span>: <span class="hljs-number">7.471672233805293e-6</span>, <span class="hljs-attr">"violence"</span>: <span class="hljs-number">0.0008052702760323882</span> } } ] } </code></pre> <p>It has detected that there is an intent of self-harm, the percentage is:</p> <pre>Self-harm: 86.15% Self-harm intent: 93.26%</pre> <p>You can develop some filters using these percentages and detected categories and activate alerts or resend other types of responses more intelligently.</p> <p>The model classifies the following categories:</p> <table align="center" border="1" cellpadding="1" cellspacing="1" style="width:500px;"> <thead> <tr> <th scope="col">CATEGORY</th> <th scope="col">DESCRIPTION</th> </tr> </thead> <tbody> <tr> <td>hate</td> <td>Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment.</td> </tr> <tr> <td>hate/threatening</td> <td>Hateful content that includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste.</td> </tr> <tr> <td>harassment</td> <td>Content that expresses, incites, or promotes harassing language towards any target.</td> </tr> <tr> <td>harassment/threatening</td> <td>Harassment content that additionally includes violence or serious harm towards any target.</td> </tr> <tr> <td>self-harm</td> <td>Content that promotes, encourages, or depicts such acts of self-harm as suicide, self-cutting/injury, and eating disorders.</td> </tr> <tr> <td>self-harm/intent</td> <td>Content where the speaker expresses that they are engaging or intend to engage in such acts of self-harm as suicide, self-cutting/injury, and eating disorders.</td> </tr> <tr> <td>self-harm/instructions</td> <td>Content that encourages performing such acts of self-harm as suicide, self-cutting/injury, and eating disorders, or that gives instructions or advice on how to commit such acts.</td> </tr> <tr> <td>sexual</td> <td>Content meant to arouse sexual excitement, e.g. the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).</td> </tr> <tr> <td>sexual/minors</td> <td>Sexual content that includes an individual who is under 18 years old.</td> </tr> <tr> <td>violence</td> <td>Content that depicts death, violence, or physical injury.</td> </tr> <tr> <td>violence/graphic</td> <td>Content that depicts death, violence, or physical injury in graphic detail.</td> </tr> </tbody></table> <p>The score value is between 0 and 1, where higher values denote higher confidence. The scores should not be interpreted as probabilities.</p> <h2>Speech</h2> <h3>Endpoint: POST https://api.openai.com/v1/audio/speech</h3> <p>The Audio API provides a speech endpoint based on the TTS (text-to-speech) model. It comes with 6 built-in voices and can be used to do the following:</p> <ul> <li>Narrate a written blog post.</li> <li>Produce spoken audio in multiple languages.</li> <li>Give real time audio output using streaming.</li> </ul> <p>The input parameters would be as mentioned below:</p> <ul> <li><strong>model</strong>: Required.</li> <li style="list-style-type: none">It is related to the available TTS models: tts-1 or tts-1-hd.</li> <li><strong>input</strong>: Required.</li> <li style="list-style-type: none">It is connected to the text used to generate audio. The maximum length is 4096 characters.</li> <li><strong>voice</strong>: Required.</li> <li style="list-style-type: none">It is linked to the voice to employ when generating the audio. Supported voices are “alloy”, “echo”, “fable”, “onyx”, “nova”, and “shimmer”. Previews of the voices are available in <a href="https://platform.openai.com/docs/guides/text-to-speech/voice-options">Text to speech guide.</a></li> <li><strong>response_format</strong>: Optional.</li> <li style="list-style-type: none">It is associated with the format of the audio. Supported formats are “mp3”, “opus”, “aac”, “flac”, “wav”, and “pcm”. if not indicated, the default value is “mp3”.</li> <li><strong>speed</strong>: Optional.</li> <li style="list-style-type: none">It is bonded with the speed of the generated audio. Select a value from “0.25” to “4.0”. If not indicated, the default value is “1.0”.</li> </ul> <h2>Moderations</h2> <h3>Endpoint: POST https://api.openai.com/v1/moderations</h3> <p>The input parameters would be as mentioned below:</p> <ul> <li><strong>model</strong>: Optional.</li> <li style="list-style-type: none">It is related to the available moderation models: text-moderation-stable or text-moderation-latest. if not indicated, the default value is “text-moderation-latest”.</li> <li><strong>input</strong>: Required.</li> <li style="list-style-type: none">It is connected to the text to classify.</li> </ul> <h2>What's next?</h2> <p>Since OpenAI is evolving continuously, nobody knows what next feature they will release.</p> <p>Do not forget to mark the article with a “like” if you enjoyed it.</p>
intersystemsdev
1,863,141
Buy verified cash app account
https://dmhelpshop.com/product/buy-verified-cash-app-account/ Buy verified cash app account Cash...
0
2024-05-23T18:59:39
https://dev.to/hshsbshskca/buy-verified-cash-app-account-16af
webdev, javascript, beginners, programming
ERROR: type should be string, got "https://dmhelpshop.com/product/buy-verified-cash-app-account/\n![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30k4d2r7o2uxhx9oayjy.png)\n\n\n\nBuy verified cash app account\nCash app has emerged as a dominant force in the realm of mobile banking within the USA, offering unparalleled convenience for digital money transfers, deposits, and trading. As the foremost provider of fully verified cash app accounts, we take pride in our ability to deliver accounts with substantial limits. Bitcoin enablement, and an unmatched level of security.\n\nOur commitment to facilitating seamless transactions and enabling digital currency trades has garnered significant acclaim, as evidenced by the overwhelming response from our satisfied clientele. Those seeking buy verified cash app account with 100% legitimate documentation and unrestricted access need look no further. Get in touch with us promptly to acquire your verified cash app account and take advantage of all the benefits it has to offer.\n\nWhy dmhelpshop is the best place to buy USA cash app accounts?\nIt’s crucial to stay informed about any updates to the platform you’re using. If an update has been released, it’s important to explore alternative options. Contact the platform’s support team to inquire about the status of the cash app service.\n\nClearly communicate your requirements and inquire whether they can meet your needs and provide the buy verified cash app account promptly. If they assure you that they can fulfill your requirements within the specified timeframe, proceed with the verification process using the required documents.\n\nOur account verification process includes the submission of the following documents: [List of specific documents required for verification].\n\nGenuine and activated email verified\nRegistered phone number (USA)\nSelfie verified\nSSN (social security number) verified\nDriving license\nBTC enable or not enable (BTC enable best)\n100% replacement guaranteed\n100% customer satisfaction\nWhen it comes to staying on top of the latest platform updates, it’s crucial to act fast and ensure you’re positioned in the best possible place. If you’re considering a switch, reaching out to the right contacts and inquiring about the status of the buy verified cash app account service update is essential.\n\nClearly communicate your requirements and gauge their commitment to fulfilling them promptly. Once you’ve confirmed their capability, proceed with the verification process using genuine and activated email verification, a registered USA phone number, selfie verification, social security number (SSN) verification, and a valid driving license.\n\nAdditionally, assessing whether BTC enablement is available is advisable, buy verified cash app account, with a preference for this feature. It’s important to note that a 100% replacement guarantee and ensuring 100% customer satisfaction are essential benchmarks in this process.\n\nHow to use the Cash Card to make purchases?\nTo activate your Cash Card, open the Cash App on your compatible device, locate the Cash Card icon at the bottom of the screen, and tap on it. Then select “Activate Cash Card” and proceed to scan the QR code on your card. Alternatively, you can manually enter the CVV and expiration date. How To Buy Verified Cash App Accounts.\n\nAfter submitting your information, including your registered number, expiration date, and CVV code, you can start making payments by conveniently tapping your card on a contactless-enabled payment terminal. Consider obtaining a buy verified Cash App account for seamless transactions, especially for business purposes. Buy verified cash app account.\n\nWhy we suggest to unchanged the Cash App account username?\nTo activate your Cash Card, open the Cash App on your compatible device, locate the Cash Card icon at the bottom of the screen, and tap on it. Then select “Activate Cash Card” and proceed to scan the QR code on your card.\n\nAlternatively, you can manually enter the CVV and expiration date. After submitting your information, including your registered number, expiration date, and CVV code, you can start making payments by conveniently tapping your card on a contactless-enabled payment terminal. Consider obtaining a verified Cash App account for seamless transactions, especially for business purposes. Buy verified cash app account. Purchase Verified Cash App Accounts.\n\nSelecting a username in an app usually comes with the understanding that it cannot be easily changed within the app’s settings or options. This deliberate control is in place to uphold consistency and minimize potential user confusion, especially for those who have added you as a contact using your username. In addition, purchasing a Cash App account with verified genuine documents already linked to the account ensures a reliable and secure transaction experience.\n\n \n\nBuy verified cash app accounts quickly and easily for all your financial needs.\nAs the user base of our platform continues to grow, the significance of verified accounts cannot be overstated for both businesses and individuals seeking to leverage its full range of features. How To Buy Verified Cash App Accounts.\n\nFor entrepreneurs, freelancers, and investors alike, a verified cash app account opens the door to sending, receiving, and withdrawing substantial amounts of money, offering unparalleled convenience and flexibility. Whether you’re conducting business or managing personal finances, the benefits of a verified account are clear, providing a secure and efficient means to transact and manage funds at scale.\n\nWhen it comes to the rising trend of purchasing buy verified cash app account, it’s crucial to tread carefully and opt for reputable providers to steer clear of potential scams and fraudulent activities. How To Buy Verified Cash App Accounts.  With numerous providers offering this service at competitive prices, it is paramount to be diligent in selecting a trusted source.\n\nThis article serves as a comprehensive guide, equipping you with the essential knowledge to navigate the process of procuring buy verified cash app account, ensuring that you are well-informed before making any purchasing decisions. Understanding the fundamentals is key, and by following this guide, you’ll be empowered to make informed choices with confidence.\n\n \n\nIs it safe to buy Cash App Verified Accounts?\nCash App, being a prominent peer-to-peer mobile payment application, is widely utilized by numerous individuals for their transactions. However, concerns regarding its safety have arisen, particularly pertaining to the purchase of “verified” accounts through Cash App. This raises questions about the security of Cash App’s verification process.\n\nUnfortunately, the answer is negative, as buying such verified accounts entails risks and is deemed unsafe. Therefore, it is crucial for everyone to exercise caution and be aware of potential vulnerabilities when using Cash App. How To Buy Verified Cash App Accounts.\n\nCash App has emerged as a widely embraced platform for purchasing Instagram Followers using PayPal, catering to a diverse range of users. This convenient application permits individuals possessing a PayPal account to procure authenticated Instagram Followers.\n\nLeveraging the Cash App, users can either opt to procure followers for a predetermined quantity or exercise patience until their account accrues a substantial follower count, subsequently making a bulk purchase. Although the Cash App provides this service, it is crucial to discern between genuine and counterfeit items. If you find yourself in search of counterfeit products such as a Rolex, a Louis Vuitton item, or a Louis Vuitton bag, there are two viable approaches to consider.\n\n \n\nWhy you need to buy verified Cash App accounts personal or business?\nThe Cash App is a versatile digital wallet enabling seamless money transfers among its users. However, it presents a concern as it facilitates transfer to both verified and unverified individuals.\n\nTo address this, the Cash App offers the option to become a verified user, which unlocks a range of advantages. Verified users can enjoy perks such as express payment, immediate issue resolution, and a generous interest-free period of up to two weeks. With its user-friendly interface and enhanced capabilities, the Cash App caters to the needs of a wide audience, ensuring convenient and secure digital transactions for all.\n\nIf you’re a business person seeking additional funds to expand your business, we have a solution for you. Payroll management can often be a challenging task, regardless of whether you’re a small family-run business or a large corporation. How To Buy Verified Cash App Accounts.\n\nImproper payment practices can lead to potential issues with your employees, as they could report you to the government. However, worry not, as we offer a reliable and efficient way to ensure proper payroll management, avoiding any potential complications. Our services provide you with the funds you need without compromising your reputation or legal standing. With our assistance, you can focus on growing your business while maintaining a professional and compliant relationship with your employees. Purchase Verified Cash App Accounts.\n\nA Cash App has emerged as a leading peer-to-peer payment method, catering to a wide range of users. With its seamless functionality, individuals can effortlessly send and receive cash in a matter of seconds, bypassing the need for a traditional bank account or social security number. Buy verified cash app account.\n\nThis accessibility makes it particularly appealing to millennials, addressing a common challenge they face in accessing physical currency. As a result, ACash App has established itself as a preferred choice among diverse audiences, enabling swift and hassle-free transactions for everyone. Purchase Verified Cash App Accounts.\n\n \n\nHow to verify Cash App accounts\nTo ensure the verification of your Cash App account, it is essential to securely store all your required documents in your account. This process includes accurately supplying your date of birth and verifying the US or UK phone number linked to your Cash App account.\n\nAs part of the verification process, you will be asked to submit accurate personal details such as your date of birth, the last four digits of your SSN, and your email address. If additional information is requested by the Cash App community to validate your account, be prepared to provide it promptly. Upon successful verification, you will gain full access to managing your account balance, as well as sending and receiving funds seamlessly. Buy verified cash app account.\n\n \n\nHow cash used for international transaction?\nExperience the seamless convenience of this innovative platform that simplifies money transfers to the level of sending a text message. It effortlessly connects users within the familiar confines of their respective currency regions, primarily in the United States and the United Kingdom.\n\nNo matter if you’re a freelancer seeking to diversify your clientele or a small business eager to enhance market presence, this solution caters to your financial needs efficiently and securely. Embrace a world of unlimited possibilities while staying connected to your currency domain. Buy verified cash app account.\n\nUnderstanding the currency capabilities of your selected payment application is essential in today’s digital landscape, where versatile financial tools are increasingly sought after. In this era of rapid technological advancements, being well-informed about platforms such as Cash App is crucial.\n\nAs we progress into the digital age, the significance of keeping abreast of such services becomes more pronounced, emphasizing the necessity of staying updated with the evolving financial trends and options available. Buy verified cash app account.\n\nOffers and advantage to buy cash app accounts cheap?\nWith Cash App, the possibilities are endless, offering numerous advantages in online marketing, cryptocurrency trading, and mobile banking while ensuring high security. As a top creator of Cash App accounts, our team possesses unparalleled expertise in navigating the platform.\n\nWe deliver accounts with maximum security and unwavering loyalty at competitive prices unmatched by other agencies. Rest assured, you can trust our services without hesitation, as we prioritize your peace of mind and satisfaction above all else.\n\nEnhance your business operations effortlessly by utilizing the Cash App e-wallet for seamless payment processing, money transfers, and various other essential tasks. Amidst a myriad of transaction platforms in existence today, the Cash App e-wallet stands out as a premier choice, offering users a multitude of functions to streamline their financial activities effectively. Buy verified cash app account.\n\nTrustbizs.com stands by the Cash App’s superiority and recommends acquiring your Cash App accounts from this trusted source to optimize your business potential.\n\nHow Customizable are the Payment Options on Cash App for Businesses?\nDiscover the flexible payment options available to businesses on Cash App, enabling a range of customization features to streamline transactions. Business users have the ability to adjust transaction amounts, incorporate tipping options, and leverage robust reporting tools for enhanced financial management.\n\nExplore trustbizs.com to acquire verified Cash App accounts with LD backup at a competitive price, ensuring a secure and efficient payment solution for your business needs. Buy verified cash app account.\n\nDiscover Cash App, an innovative platform ideal for small business owners and entrepreneurs aiming to simplify their financial operations. With its intuitive interface, Cash App empowers businesses to seamlessly receive payments and effectively oversee their finances. Emphasizing customization, this app accommodates a variety of business requirements and preferences, making it a versatile tool for all.\n\nWhere To Buy Verified Cash App Accounts\nWhen considering purchasing a verified Cash App account, it is imperative to carefully scrutinize the seller’s pricing and payment methods. Look for pricing that aligns with the market value, ensuring transparency and legitimacy. Buy verified cash app account.\n\nEqually important is the need to opt for sellers who provide secure payment channels to safeguard your financial data. Trust your intuition; skepticism towards deals that appear overly advantageous or sellers who raise red flags is warranted. It is always wise to prioritize caution and explore alternative avenues if uncertainties arise.\n\nThe Importance Of Verified Cash App Accounts\nIn today’s digital age, the significance of verified Cash App accounts cannot be overstated, as they serve as a cornerstone for secure and trustworthy online transactions.\n\nBy acquiring verified Cash App accounts, users not only establish credibility but also instill the confidence required to participate in financial endeavors with peace of mind, thus solidifying its status as an indispensable asset for individuals navigating the digital marketplace.\n\nWhen considering purchasing a verified Cash App account, it is imperative to carefully scrutinize the seller’s pricing and payment methods. Look for pricing that aligns with the market value, ensuring transparency and legitimacy. Buy verified cash app account.\n\nEqually important is the need to opt for sellers who provide secure payment channels to safeguard your financial data. Trust your intuition; skepticism towards deals that appear overly advantageous or sellers who raise red flags is warranted. It is always wise to prioritize caution and explore alternative avenues if uncertainties arise.\n\nConclusion\nEnhance your online financial transactions with verified Cash App accounts, a secure and convenient option for all individuals. By purchasing these accounts, you can access exclusive features, benefit from higher transaction limits, and enjoy enhanced protection against fraudulent activities. Streamline your financial interactions and experience peace of mind knowing your transactions are secure and efficient with verified Cash App accounts.\n\nChoose a trusted provider when acquiring accounts to guarantee legitimacy and reliability. In an era where Cash App is increasingly favored for financial transactions, possessing a verified account offers users peace of mind and ease in managing their finances. Make informed decisions to safeguard your financial assets and streamline your personal transactions effectively.\n\nContact Us / 24 Hours Reply\nTelegram:dmhelpshop\nWhatsApp: +1 ‪(980) 277-2786\nSkype:dmhelpshop\nEmail:dmhelpshop@gmail.com\n\n"
hshsbshskca
1,863,140
Emmet: A Productivity Booster for Web Developers.
Emmet is a productivity tool for web developers, particularly those who work with HTML, CSS, and XML....
0
2024-05-23T18:56:41
https://dev.to/catwebdev/emmet-a-productivity-booster-for-web-developers-2ni7
css, html, webdev, emmet
Emmet is a productivity tool for web developers, particularly those who work with HTML, CSS, and XML. It allows developers to write code snippets that can be expanded into full, valid code blocks with a single keystroke. This tool is widely integrated into many popular text editors and Integrated Development Environments (IDEs). --- ## Abbreviation Expansion. **Emmet** uses short syntax to generate HTML and CSS code rapidly. As an example ``` <body> div>ul>li*3 <body> ``` It will produce ``` <body> <div> <ul> <li></li> <li></li> <li></li> </ul> </div> <body> ``` ## Tag wrapping. It can wrap existing text of code with HTML tags, speeding up the process of structuring content. [Link to the wrap with abbreviation examples](https://docs.emmet.io/actions/wrap-with-abbreviation/) ## Code snippets. **Emmet** includes many built-in snippets for common code patterns and allows users to create custom snippets. Custom code snippet: ``` { "html": { "snippets": { "btn": "<button class=\"btn\">${1:Submit}</button>" } } } ``` Typing `btn` and expanding it will produce: ``` <button class="btn">Submit</button> ``` ## Attributes and Text. Abbreviations can include attributes and text. ``` a[href="https://example.com"]{Example} ``` It will produce: ``` <a href="https://example.com">Example</a> ``` ## CSS support. **Emmet** also supports CSS, allowing for rapid writing of style rules. For instance in CSS file `* { m0 }` It will produce: ``` * { margin: 0; } ``` ## Dynamic Values. **Emmet** can generate dynamic values such as incrementing numbers, making it useful for creating lists, IDs, classes, and more. ``` <div> ul>li.item$*3 </div> ``` It will produce: ``` <div> <ul> <li class="item1"></li> <li class="item2"></li> <li class="item3"></li> </ul> </div> ``` **Emmet** significantly speeds up coding by reducing the amount of repetitive typing required, allowing developers to focus more on design and logic rather than the boilerplate code. --- [**Emmet** website](https://emmet.io/) My YouTube channel is [catwebdev](https://www.youtube.com/channel/UC2pGphugSZ0Qp2zuXSOPx0g)
catwebdev
1,863,340
Webinar Sobre Design Gráfico E IA Gratuito Com Voucher: Otimize Seu Trabalho
A EBAC está oferecendo um webinar gratuito intitulado “Como as IAs podem facilitar meu trabalho e...
0
2024-05-27T01:33:32
https://guiadeti.com.br/webinar-design-grafico-ia-gratuito-ebac/
eventos, cursosgratuitos, design, designgráfico
--- title: Webinar Sobre Design Gráfico E IA Gratuito Com Voucher: Otimize Seu Trabalho published: true date: 2024-05-23 18:55:00 UTC tags: Eventos,cursosgratuitos,design,designgráfico canonical_url: https://guiadeti.com.br/webinar-design-grafico-ia-gratuito-ebac/ --- A EBAC está oferecendo um webinar gratuito intitulado “Como as IAs podem facilitar meu trabalho e tornar meus projetos ainda mais atraentes?”. Esse evento fala sobre o futuro do design gráfico, mostrando as oportunidades e ameaças trazidas pelas inteligências artificiais. Descubra como utilizar as IAs a seu favor, quais novas habilidades você precisa desenvolver e como as novas formas de trabalho moldarão a profissão nos próximos anos. Inscreva-se para não perder essa oportunidade de se preparar para o futuro, que já está acontecendo! O webinar será conduzido por Guilherme Castellini, Designer Industrial e Digital. Os participantes do evento receberão um desconto exclusivo no curso “Profissão: Designer Gráfico”. ## Como as IA’s podem facilitar meu trabalho e tornar meus projetos ainda mais atraentes? O webinar gratuito da EBAC aborda o uso das inteligências artificiais para otimizar o trabalho e tornar os projetos mais atrativos. ![](https://guiadeti.com.br/wp-content/uploads/2024/05/image-77.png) _Imagem da página da webinar_ Entenda o futuro do design, o evento levanta questões sobre ameaças e oportunidades nesse cenário em constante evolução. ### Reflexão sobre o Futuro do Design O webinar incentiva a reflexão sobre o futuro do design, destacando como as IA’s podem ser aliadas nesse processo. O foco é entender como aproveitar essas tecnologias a nosso favor e desenvolver as habilidades necessárias para os próximos anos. Participe e veja novas oportunidades criativas e profissionais no mercado digital em constante evolução. ### Moldando o Futuro da Profissão O evento trabalha as novas formas de trabalho que moldarão a profissão nos próximos anos, oferecendo insights úteis para quem busca se manter atualizado e competitivo no mercado. Confira a ementa: - IA: Entenda como usar a Inteligência Artificial a seu favor; - Mercado de trabalho: Descubra o impacto das IA’s no mercado e se antecipe às mudanças; - Como iniciar a carreira: Saiba como a EBAC pode ajudar você a dar o primeiro passo na sua carreira como designer gráfico. ### Detalhes do Evento - Data e Hora: 28 de maio de 2024, às 19h (evento ao vivo); - Palestrante: Guilherme Castellini, Designer Industrial e Digital; - Desconto Exclusivo: Os participantes do webinar receberão um desconto exclusivo no curso “Profissão: Designer Gráfico”. ### Público-alvo - Apaixonados por Design Gráfico; - Estudantes e Designers iniciantes; - Quem busca solucionar problemas com criatividade e estética; - Indivíduos interessados em iniciar uma carreira criativa; - Pessoas interessadas em ferramentas de Design. Não perca essa oportunidade de enterder o futuro do design com as inteligências artificiais! <aside> <div>Você pode gostar</div> <div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2024/05/Webinar-Design-Grafico-E-IA-280x210.png" alt="Webinar Design Gráfico E IA" title="Webinar Design Gráfico E IA"></span> </div> <span>Webinar Sobre Design Gráfico E IA Gratuito Com Voucher: Otimize Seu Trabalho</span> <a href="https://guiadeti.com.br/webinar-design-grafico-ia-gratuito-ebac/" title="Webinar Sobre Design Gráfico E IA Gratuito Com Voucher: Otimize Seu Trabalho"></a> </div> </div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2024/01/Curso-De-Desenvolvimento-Web-UNICAMP-2-280x210.png" alt="Curso De Desenvolvimento Web UNICAMP" title="Curso De Desenvolvimento Web UNICAMP"></span> </div> <span>Curso De Desenvolvimento Web Com Angular JS E Outros Temas Gratuitos Da Unicamp</span> <a href="https://guiadeti.com.br/curso-desenvolvimento-web-com-angular-js-unicamp/" title="Curso De Desenvolvimento Web Com Angular JS E Outros Temas Gratuitos Da Unicamp"></a> </div> </div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2024/05/Workshop-De-Inteligencia-Artificial-Gratis-280x210.png" alt="Workshop De Inteligência Artificial Grátis" title="Workshop De Inteligência Artificial Grátis"></span> </div> <span>Workshop De Inteligência Artificial E Seus Modelos De Linguagem Gratuito</span> <a href="https://guiadeti.com.br/workshop-inteligencia-artificial-modelos-linguagem/" title="Workshop De Inteligência Artificial E Seus Modelos De Linguagem Gratuito"></a> </div> </div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2024/05/Minicurso-Design-UXUI-280x210.png" alt="Minicurso Design UX/UI" title="Minicurso Design UX/UI"></span> </div> <span>Minicurso De Design UX/UI Online E Gratuito Com Certificado Da Cubos Academy</span> <a href="https://guiadeti.com.br/minicurso-design-ux-ui-online-gratuito-certificado/" title="Minicurso De Design UX/UI Online E Gratuito Com Certificado Da Cubos Academy"></a> </div> </div> </div> </aside> ## Design Gráfico O Design Gráfico é uma área que combina arte, criatividade e comunicação visual para criar soluções visuais impactantes e eficazes. É uma disciplina que ebvolve vários projetos, desde identidades visuais de marcas até layouts de revistas, embalagens de produtos e designs digitais. ### Importância do Design Gráfico O Design Gráfico é muito importante forma como as empresas se comunicam com seu público-alvo. Uma boa identidade visual pode transmitir valores, emoções e mensagens de forma clara e memorável, contribuindo para o sucesso de uma marca ou projeto. ### Áreas de Atuação Os profissionais de Design Gráfico podem atuar em diversas áreas, como design editorial (revistas, livros, jornais), design de embalagens, design de identidade visual (logotipos, cartões de visita), design digital (websites, redes sociais) e design publicitário (banners, anúncios). ### Ferramentas e Tecnologias No campo do Design Gráfico, é fundamental dominar ferramentas e tecnologias que facilitam a criação e edição de elementos visuais. Softwares como Adobe Photoshop, Illustrator e InDesign são amplamente utilizados para criar e manipular imagens, ilustrações e layouts. ### Tendências e Inovações O Design Gráfico está constantemente evoluindo, acompanhando as tendências e inovações do mercado. Novas técnicas, estilos e abordagens surgem regularmente, influenciando a forma como os designers criam e apresentam seus trabalhos. ## EBAC A EBAC (Escola Britânica de Artes Criativas e Tecnologia) é uma instituição de ensino dedicada ao desenvolvimento e capacitação de profissionais nas áreas de artes, design e comunicação. A instituição oferece cursos e programas que preparam os alunos para os desafios do mercado criativo. ### Missão e Visão A missão da EBAC é fornecer uma educação de alta qualidade, centrada na prática e na excelência criativa. A instituição busca inspirar e capacitar os alunos a se tornarem líderes e inovadores em suas áreas de atuação, contribuindo para o desenvolvimento da indústria criativa no Brasil e no mundo. ### Cursos e Programas A EBAC oferece uma grande lista de cursos e programas, abrangendo áreas como Design Gráfico, Design de Moda, Design de Interiores, Fotografia, Cinema e Animação, Comunicação Visual e Artes Digitais. Os cursos são ministrados por profissionais experientes e reconhecidos em suas respectivas áreas, proporcionando aos alunos uma formação sólida e atualizada. ### Metodologia de Ensino A metodologia de ensino da EBAC combina teoria e prática, incentivando os alunos a desenvolverem projetos criativos e inovadores. As aulas são dinâmicas e interativas, com foco no desenvolvimento de habilidades técnicas e conceituais, preparando os alunos para o mercado de trabalho e para desafios reais da indústria criativa. ### Parcerias e Colaborações A EBAC mantém parcerias estratégicas com empresas, organizações e profissionais do setor criativo. Essas colaborações permitem aos alunos acesso a oportunidades de estágio, networking e projetos reais, enriquecendo ainda mais a experiência educacional e profissional dos estudantes. ### Infraestrutura e Recursos A EBAC conta com uma infraestrutura moderna e completa, incluindo estúdios, laboratórios, biblioteca especializada e espaços de convivência. A escola oferece acesso a recursos digitais e tecnológicos de última geração, proporcionando um ambiente propício para a experimentação e criação. ### Compromisso com a Excelência A EBAC tem um compromisso constante com a excelência acadêmica e a inovação. A instituição busca constantemente atualizar seus programas, integrar novas tecnologias e práticas pedagógicas, e acompanhar as tendências do mercado criativo, garantindo uma formação de alta qualidade e relevância para os alunos. ## Inscreva-se agora na webinar de Design Gráfico da EBAC e aprimore suas habilidades criativas! As [inscrições para o webinar Como as IA’s podem facilitar meu trabalho e tornar meus projetos ainda mais atraentes?](https://ebaconline.com.br/webinars/design-webinar-2024-05-28) devem ser realizadas no site da EBAC. ## Compartilhe esta oportunidade de aprendizado em Design Gráfico com interessados em arte e comunicação visual! Gostou do conteúdo sobre o webinar gratuito sobre Design Gráfico e IA? Então compartilhe com a galera! O post [Webinar Sobre Design Gráfico E IA Gratuito Com Voucher: Otimize Seu Trabalho](https://guiadeti.com.br/webinar-design-grafico-ia-gratuito-ebac/) apareceu primeiro em [Guia de TI](https://guiadeti.com.br).
guiadeti
1,863,139
houston hospice
Houston Hospice is dedicated to providing compassionate end-of-life care for patients and their...
0
2024-05-23T18:53:09
https://dev.to/hospicehouston/houston-hospice-3npa
Houston Hospice is dedicated to providing compassionate end-of-life care for patients and their families. Our team of experienced professionals offers comprehensive hospice care services, including pain management, emotional support, and spiritual guidance. At [houston hospice](https://houstonshospice.org/), we focus on enhancing the quality of life for our patients through personalized care plans tailored to meet individual needs. Our state-of-the-art facilities and home care options ensure comfort and dignity during this critical time. Trust Houston Hospice for expert hospice services that prioritize patient comfort and family support.
hospicehouston
1,805,926
Introduction to Data Bindings
Data Bindings are a useful feature in Anvil that make it easy to keep your UI components in sync with...
0
2024-05-23T18:51:29
https://dev.to/anvil/introduction-to-data-bindings-1op4
Data Bindings are a useful feature in Anvil that make it easy to keep your UI components in sync with your data. A Data Binding associates a property of a component with a single Python expression, saving you from repeating similar sorts of assignments all over your code. In this tutorial we're going to look at what Data Bindings are, how you can use them, and common gotchas. We're going to look at data bindings by developing an example app for logging our favorite movie. Our tutorial will have three main parts: 1. We'll build an app and use data bindings to display movie data 2. Next, we'll extend the functionality to edit the data 3. Then, we'll store the data to a Data Table 4. Finally, we'll make some changes so that edits to our data persist when the app is re-run The final app will look something like this: ![Final App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6wc9urncpyb0n73bliq.png) All of this is done in Anvil's hosted environment through your web browser, all in Python.  If you're in a hurry, you can click [here](https://anvil.works/build#clone:T7JHC3NVHTP2UBWX%3dD3UJZJZBEWPJELCQQKPF3TZ4) to clone the app and explore the finished version in Anvil. > If you're completely new to Anvil, you may want to try a [5-minute tutorial](https://anvil.works/learn/tutorials/feedback-form?utm_source=dev_to_data_binding) before beginning this tutorial. Let's get started! ## What is a Data Binding? When you want to display the contents of a variable in a visual component you would normally use code like this: ``` self.label_1.text = self.title ``` If you wanted to update the Label component when `self.title` changed, you would need to repeat that line of code in each place the variable changed. A data binding allows you to establish the relationship between the visual component and the variable once, eliminating all the assignment statements from your code. ## Chapter 1: Displaying Our Favorite Movie in a Form We'll create an app that shows information about your favorite movie. We'll use data bindings to display data from a dictionary into Anvil components. **Step 1: Create an App** [Log in](https://anvil.works/login) to Anvil and click 'Create a new app'. Choose the Material Design 3 theme. ![Create the App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6s4pu8xyu3l85ifte5dp.png) That gives us an app with a [Form ](https://anvil.works/docs/ui#forms)named `Form1`. **Step 2: Add components to your form** We'll build our UI by dragging-and-dropping [components ](https://anvil.works/docs/ui/components)from the [Toolbox ](https://anvil.works/docs/editor#toolbox)into the page. We want to display the movie name, the year it was released, the name of the director, and a summary of the movie's plot. Add eight Labels, four for the titles of what we're displaying and four for the values to display. We'll also add a Label into the title slot. ![Creating the form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/huip51psi280hjxd8v1z.gif) The final form should look something like this: ![The Final Form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lzvx5nnpx97b3faspj6.png) **Step 3: Initialize data sources** Every Anvil component and Form has an `item` property, meant specifically for storing data of any kind. Our data source will be a dictionary that we'll store in the `item` property of our Form. Let's go to the Editor's [Code view](https://anvil.works/docs/editor#form-editor) and create this dictionary in the `__init__` function of the form: ``` class Form1(Form1Template): def __init__(self, **properties): self.item = { 'movie_name': 'Back to the Future', 'year': 1985, 'director': 'Robert Zemeckis', 'summary': 'Doc Brown invents a nuclear powered time machine, which Marty McFly ' 'then uses to nearly erase himself from existence.' } # Set Form properties and Data Bindings. self.init_components(**properties) ``` Note that the dictionary is created before the call to `self.init_components`. This is because the data bindings are processed in that call, so our data source (the `self.item` dictionary) must be set up before that. **Step 4: Set up data bindings** Now we need to tell Anvil what data to associate with which components (e.g. the _data bindings_). We'll bind the data from our `self.item` dictionary to the `text` property of the Labels we just added. To set up a data binding, click on the component that you want to have Anvil automatically set. I'll start with the label that will hold the name of the movie. ![Setup Data Binding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fic600jnhgxki0ef5u8j.png) You can find the `text` property at the top of the Properties Panel. We could type something in there but that would then always show that text. Instead, click the link icon to the right of the `text` property. This will cause the display to change and the link icon to turn blue, indicating that the data binding is active. ![Text Property](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhg648tf6y3mg8fmp574.png) Set this data binding to the `movie_name` key of our dictionary: ![Data Binding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r69d507q2qo5mkf1akpt.png) We'll now do the same for the other labels, using `self.item['year']` for the year the movie was released, `self.item['director']` for the director's name, and `self.item['summary']` for the plot summary. After those are set up, we can double check that the data bindings are correct by looking at the Form's Data Binding summary. You can find this by selecting your Form and scrolling to the bottom of the Properties Panel. ![Checking Data Bindings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pu923bwp3ohoek8nkoma.gif) **Step 5: Run the app** Your data bindings are all set! We've told the components which variables to pull data from to populate their text properties. Run the app now and see the information about your movie displayed in the Form. We didn't need to use any code to set the `text` properties of any of the Labels, they were all set through the data bindings we set up in the Labels' `text` properties. ![Running the App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxmyj9fxwj211zxu3mvq.gif) ## Chapter 2: Edit Movie Data We'll next allow the user to edit the movie data. For this, we'll use a feature of data bindings called [writeback](https://anvil.works/learn/tutorials/data-bindings/docs/client/data-bindings#two-way-data-bindings). You can toggle data binding writeback for user-editable components. This means that when a user changes a property that has a data binding, the original variable will be updated with the new value. **Step 1: Create your edit form** Create a second Form in your app by clicking the three dots to the right of Client Code and choose Add Form. Select Blank Panel and rename it to `MovieEdit`. ![Adding MovieEdit Form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x4whktdia561015k7vrp.gif) Start by dropping a ColumnPanel into the page. Setting up the Form is very similar to what we did with our previous Form, but we'll use TextBoxes instead of Labels, since we want the user to be able to edit the fields. Use a TextArea for the plot summary since that will usually be longer than a single line. This is how it should look: ![MovieEdit Form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7dk56v1jm6ow0qgwpuz.png) **Step 2: Set up data bindings** Setting up data bindings is much the same as before. Here's the one for `text_box_1`, binding its text property to `self.item['movie_name']`: ![Text Data Binding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a81eg7yxi73svk2v0llk.png) In this case, though, notice that there's a W at the right end of the data binding. That `W` stands for [writeback ](https://anvil.works/learn/tutorials/data-bindings/docs/client/data-bindings#two-way-data-bindings)and will show on any property that's user-editable. Writeback defaults to inactive, but if you click the W you can activate it. ![Writeback Active](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dz34n7jo5i6p6b0cqv68.png) When writeback is active and the user edits the value in the Text Box, Anvil will update the original data binding source with those changes. It's the equivalent of you executing `self.item['movie_name'] = self.text_box_1.text` when the TextBox value changes. Since our purpose is to allow the user to edit the movie information, we want to enable writeback for all of these editable components. Set up the rest, and then check them in the Form's Data Binding summary. They should look like this: ![Data Bindings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0pdtmmcf0d3ru3b4jiy.png) Note that we didn't write any code in the `MovieEdit` Form. That's the value of data bindings, to automate the boilerplate code of assigning values to visual components and then getting the values out when the user makes changes. **Step 3: Trigger your edit form** We want to access our `MovieEdit` Form from our main Form. We'll do this by displaying the `MovieEdit` form in an alert every time a user clicks a button. Add a Button on `Form1`. Set its text to 'Edit movie information' and change its name to edit_button. ![Edit Movie Button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kf9iwpskd1fhj6ndbtri.png) We want some code to run when this Button is clicked. We'll use [events ](https://anvil.works/docs/ui/components#events)for this. Select the Button and click on 'on `click` event' in the Object Palette. This will open the Editor's ['Split' view](https://anvil.works/docs/editor#form-editor) and automatically create an `edit_button_click` method associated with the button. ![Creating the Click Event](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvnm3pat9qx47hoeu15s.png) We'll write the code that will run when we click `edit_button` inside this method. First, import the `MovieEdit` Form at the top of the Form: ``` from ..MovieEdit import MovieEdit ``` And then in the `edit_button_click` function itself create an instance of the `MovieEdit` Form: ``` def edit_button_click(self, **event_args): editing_form = MovieEdit(item=self.item) ``` When we create the instance of the `MovieEdit` Form, we're going to pass our dictionary of movie information as its `item` property. That will make it available in `MovieEdit` as `self.item`. Now we're going to display the Form in an [alert](https://anvil.works/docs/client/alerts-and-notifications). We'll set the content of the alert to be `editing_form` and the `large` property to be `True`: ``` def edit_button_click(self, **event_args): editing_form = MovieEdit(item=self.item) alert(content=editing_form, large=True) ``` Run the app and click the editing button to see the movie information in the text boxes and text area. If any of the information doesn't show up in a component, double check the data bindings. ![Testing the Alert](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mcdj3yfuw7ahys79ccj5.gif) **Step 4: Read the changed values** The next step is to get the changed values back into the main Form. We are actually almost there since `MovieEdit`'s writeback data bindings are already changing `Form1`'s `self.item` dictionary. But `Form1` doesn't know that those values have changed, and so doesn't know to rerun the data bindings to update the components. We need to tell Form1 to update its data bindings after the alert returns. We'll do this with `self.refresh_data_bindings()`: ``` def edit_click(self, **event_args): editing_form = MovieEdit(item=self.item) alert(content=editing_form, large=True) self.refresh_data_bindings() ``` Run the app now and edit the movie information to see it changed in `Form1`! ![Editing Movie Data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnwbfqzu5vlv7pku1h2o.gif) We can now edit our app's movie data! ## Chapter 3: Storing data in Data Tables We can now edit our favorite movie data, but because it's stored in a dictionary, it won't persist when the app is re-run. Because of this, you'll usually want to store data in a database when using data bindings. In this chapter, we'll change our app to store the movie data in a [Data Table](https://anvil.works/docs/data-tables) so that edits to the data will persist between runs of the app. Data Tables are an out-of-the-box option for data storage in Anvil, and they're backed by PostgreSQL. **Step 1: Create a Data Table** In the Sidebar Menu, choose Data to open up your app's Data Tables. ![Data Tables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cymgvu3u6gn3ois34vda.png) Next, click '+ Add Table' to add a new Data Table to the app. Name the table 'movies'. ![Add the Table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzt12bfzov2px0vea5e5.gif) With the new table selected, you'll see the interface for editing the Data Table. We'll set up our Data Table with 4 columns. We need to add the following columns: - `movie_name` (a text column) - `year` (a number column) - `director` (a text column) - `summary` (a text column). We can now copy the data from the `self.item` dictionary and add it to our table. ![Filled Data Table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4y1pbltieod079cf7tm.png) Notice that we've used the same names for the columns as we used for the `self.item` keys, so that we do not need to change our data bindings. **Step 2: Configure the Data Table** Data tables live on the server, which is a secure and trusted environment. Client Forms and client code run in the user's web browser, which the user has access to. Sufficiently motivated and knowledgeable users can modify the client code of any web app to make it do anything they'd like it to do, including removing any security checks you might put into client code. By default Anvil Data Tables are [only accessible from server code](https://anvil.works/docs/data-tables/data-security#permissions) because this is the most secure option. You can see that in the Data Table interface: ![Data Table Security](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osn5c4s73xthv50s8y5p.png) You have two other options for client code. You can give client code read access (client code can search this table) or full access (client code can search, edit, and delete). Read access is appropriate for tables where there are no access restrictions needed on who can see data in the table. Full access is almost never appropriate for client code since it allows sufficiently motivated users to bypass all your security restrictions and all your validation code. We're going to use read access for our table since we only have the one row that we want all the users to be able to read. After making that change the configuration should look like this: ![Data Table Client Reading](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tchqzkdt0y0xrdy1scvp.png) **Step 3: Read from the Data Table** Now we need to change `Form1` to use the `movies` Data Table as the source for `self.item` instead of our dictionary. We can access any Data Table with `app_tables.<data-table-name>`. Since our table only has one row, we want to get the first row from the Data Table into `self.item` in the `__init__` function for `Form1`. ``` class Form1(Form1Template): def __init__(self, **properties): self.item = app_tables.movies.search()[0] # Set Form properties and Data Bindings. self.init_components(**properties) ``` What `app_tables.movies.search()` returns looks a lot like a Python list, so we can use standard list indexing to pull the first item out of the list. What's stored in the list are data table rows, which look enough like Python dictionaries to be used in `self.item` with data bindings. You should now be able to run the app and see the information from the data table showing on the main page of your app. Editing doesn't yet work, but that's our next step to fix. ## Chapter 4: Store edits to the Data Table Because we are not allowing the client to write to our Data Table, we cannot use writeback as we have been. **Step 1: Update the Data Table** Instead, we'll use a [server function](https://anvil.works/docs/server) to update the Data Table. Anvil's [Server Modules](https://anvil.works/docs/server) are a full server-side Python environment. Unlike client code, Server Modules cannot be edited or seen by the user, so we can [trust ](https://anvil.works/docs/security#client-vs-server-code)them to do what we tell them. This is why we'll use a Server Module to write to the Data Table. For more information about the difference between client and server code, check out [this explainer](https://anvil.works/articles/client-vs-server). Let's create a Server Module. In the App Browser, click the blue '+ Add Server Module' button underneath 'Server Code'. This will open up a code editor. ![Creating Server Module](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/al1u4m3pcbtra4ws0kz3.png) Our server function will be taking in a dictionary from the client and updating the Data Table with its contents. We'll decorate it with `@anvil.server.callable` so that we can access it from client code. Remember that we're still dealing with just the single row in the Data Table. ``` @anvil.server.callable def update_movie(movie_data): row = app_tables.movies.search()[0] row['director'] = movie_data['director'] row['movie_name'] = movie_data['movie_name'] row['summary'] = movie_data['summary'] row['year'] = movie_data['year'] ``` Server functions also give us a place to put any data validation we need. In the case of the movie data, we probably don't want to allow any of the fields to be empty. ``` @anvil.server.callable def update_movie(movie_data): if movie_data['director'] and movie_data['movie_name'] and movie_data['summary'] and movie_data['year']: row = app_tables.movies.search()[0] row['director'] = movie_data['director'] row['movie_name'] = movie_data['movie_name'] row['summary'] = movie_data['summary'] row['year'] = movie_data['year'] ``` The exact validation you do depends on your app and the server function, but it's the spot to do last minute validation before you write changes to the Data Table. **Step 2: Make a copy of the Data Table row** Switch to the Code view for `Form1` and look at the `edit_click` function. We can no longer pass `self.item` directly to the `MovieEdit` form, since `self.item` is a read-only Data Table row and writeback will not work with it. What we can do instead is convert the item to a dictionary, effectively making a copy of it. Modify the `edit_click` function to do so. ``` def edit_click(self, **event_args): item = dict(self.item) editing_form = MovieEdit(item=item) alert(content=editing_form, large=True) ``` Writeback data bindings will work fine on the dictionary, since it's no longer a Data Table row, but a dictionary with copies of the values that were in the Data Table row. **Step 3: Update the Data Table row** After the alert is closed, we must call the server function to update the Data Table row and pass it the `item` dictionary. We do that by using `anvil.server.call` to call our `update_movie` server function. ``` def edit_click(self, **event_args): item = dict(self.item) editing_form = MovieEdit(item=item) alert(content=editing_form, large=True) anvil.server.call('update_movie', item) ``` **Step 4: Update `self.item`** Now that the server function has been called, we must update the main Form's data. We'll reset `self.item` by getting the now updated row from our Data Table, then we'll use `self.refresh_data_bindings()` to trigger the Form to update the text property of its components: ``` def edit_click(self, **event_args): item = dict(self.item) editing_form = MovieEdit(item=item) alert(content=editing_form, large=True) anvil.server.call('update_movie', item) self.item = app_tables.movies.search()[0] self.refresh_data_bindings() ``` Now, edits to the app will persist when you re-run the app. All users will see the edits that any users make. Run the app, edit the movie information, and then stop the app and verify the data in the Data Tables has changed. ![Data Tables Changing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r6hugk77funldkrnk54k.gif) And that's it! We have built a simple app to showcase data for your favorite movie. From here, you could extend your app's functionality, for example by allowing users to have their own separate favorite movies. ## What's Next? Head to the [Anvil Learning Centre](https://anvil.works/learn/tutorials?utm_source=dev_to_data_binding) for more guided tutorials, or head to our [examples ](https://anvil.works/learn/examples?utm_source=dev_to_data_binding)page to see the variety of apps you can build with Anvil.
jshaffstall
1,863,137
Unleash Adventure with the EGL 125cc Dirt Bike
Experience the thrill of off-road adventures with the EGL 125cc Dirt Bike. Engineered for both...
0
2024-05-23T18:50:06
https://dev.to/davidgale/unleash-adventure-with-the-egl-125cc-dirt-bike-5db1
business
Experience the thrill of off-road adventures with the EGL 125cc Dirt Bike. Engineered for both beginners and seasoned riders, this powerful machine combines robust performance with superior handling. The EGL **[125cc dirt bike](https://baltimoremotorsports.com/product/egl-a11-125cc-manual-clutch/)** features a high-torque engine, durable suspension, and aggressive tire tread, making it perfect for conquering any terrain. Whether you're hitting the trails or mastering motocross tracks, the EGL 125cc delivers the ultimate riding experience. Explore new paths and elevate your outdoor escapades with the reliability and excitement of the EGL 125cc Dirt Bike.
davidgale
1,864,707
#111 Building an AI to Play Video Games with Python
In this article, we will see how Python can make an AI. This AI will learn to play video games. We...
0
2024-06-04T16:49:43
https://dev.to/genedarocha/111-building-an-ai-to-play-video-games-with-python-4b8o
--- title: #111 Building an AI to Play Video Games with Python published: true date: 2024-05-23 18:46:43 UTC tags: canonical_url: --- In this article, we will see how Python can make an AI. This AI will learn to play video games. We will mainly talk about **Reinforcement Learning** and **Deep Reinforcement Learning** with the **game Snake**. Also, we will show how to use Keras in TensorFlow and PyTorch to make the AI learn and get better at the game. [ ![Python Game AI](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76032620-f3f9-4828-a818-7560810ea14a_1344x768.jpeg "Python Game AI") <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg> ](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76032620-f3f9-4828-a818-7560810ea14a_1344x768.jpeg) This method uses a **game environment** , like the Snake game, for the AI. The AI learns about its situation and then decides what to do. The game gives good or bad points based on what the AI does. This helps the AI learn to make choices that get it more good points, like eating apples and not hitting walls. Thanks for reading Voxstar’s Substack! Subscribe for free to receive new posts and support my work. <form> <input type="email" name="email" placeholder="Type your email…" tabindex="-1"><input type="submit" value="Subscribe"><div> <div></div> <div></div> </div> </form> ### Key Takeaways: - Python is great for making AI that plays video games. - **Reinforcement Learning** and **Deep Reinforcement Learning** are good for teaching AIs. - We can use the Snake game to show how these AI methods work. - Keras, TensorFlow, and PyTorch are tools to make **Deep Reinforcement Learning** models. - Using these tools, we can make AIs that get very good at video games. ## Understanding Artificial Intelligence and Gaming **Artificial Intelligence** and **Artificial behaviour** in games are different. The goal in **gaming** is not to make AI agents beat players. It's about making games fun and interesting. Games help in training virtual agents for various real-world tasks. For instance, Google DeepMind's AlphaGo made history by defeating the top Go player. This showed how powerful AI can be in mastering complex games. But our focus here is on another AI use in **gaming** , teaching an AI to play Snake using **Reinforcement Learning**. Reinforcement Learning helps AI agents learn from their environment. The AI interacts with the game, getting rewards for good moves or penalties for bad ones. It learns to make moves that lead to rewards, like eating the apple in Snake, and avoid bad moves, like hitting walls. By using Reinforcement Learning, game developers can make AI that adapts to play better. These AI agents can offer tough, but fair, challenges to players. They don't need to use strategies that are too hard to predict, causing frustration. > "The goal of **gaming** AI is not to replace human players, but to enhance the gaming experience and create new opportunities for interactive and immersive gameplay." As tech improves and gaming gets more popular, we see more AI in games. From realistic NPCs to smart enemies, AI has changed games a lot. It makes games deeper and more fun by adding human-like behaviours and surprises. In the next part, we'll look at Reinforcement Learning basics. We'll see how it trains an AI to play Snake. We'll look at the training steps and ways to make the AI play better. Let's start this great journey into AI gaming! ### Stay tuned for the next section: The Basics of Reinforcement Learning! ## The Basics of Reinforcement Learning Reinforcement Learning is like a toolbox full of ways to make decisions, especially in games. It sees games as Markov Decision Processes (MDPs). These MDPs have states, actions, rewards, and how things move between them. We will look mainly at Deep Q-Learning here. It's a kind of Reinforcement Learning. Deep Q-Learning uses a Q-table to match states, actions, and the likely rewards. This method is better than regular Machine Learning because it uses deep neural networks. ## The Game and Its Components We will look into the game of Snake and how it works with Deep Reinforcement Learning. Snake is a classic game made with Python. It uses the Pygame library. This makes a fun place for the AI agent to learn. The Deep Reinforcement Learning has two main parts: the game itself and the Snake. The game is the world the Snake lives in. It tells the Snake where it is, how fast it's moving, and where the food is. The Snake uses this to make choices and moves to win points. Whenever the Snake does something good, like eating food, it wins points. But if it hits a wall or itself, it loses points. This helps the Snake figure out what to do and what not to do. So, the Snake plays and learns from its wins and mistakes. It gets better over time, getting smarter about how to eat and not get hurt. Now, let's dig deeper into the game and how it all works together. ## The Training Process The AI agent starts learning the game from scratch. It does this by taking random actions. This helps it learn what works and what doesn't. The agent uses the **Deep Q-learning algorithm** to get better. It updates its Q-values in the Q-table. This helps it learn from its past actions and make smarter decisions. The agent remembers everything it does in the game. It notes the starting state, the action taken, and the results. This helps the **Deep Neural Network** to learn and improve the agent's moves. The article also talks about **Bayesian Optimization**. It helps make the Artificial Neural Network better. This leads to the agent playing the game more effectively. ### The Training Process Overview Here's a step-by-step of how the AI agent learns to play: 1. Start by putting random values in the Q-table. 2. Let the AI agent take random actions in the game. 3. See the state of the game after the actions. 4. Choose what to do next based on the current state and the Q-table. 5. Look at the results of the action taken. 6. Change the Q-value depending on what was learned from the last action. 7. Do steps 3 to 6 over and over until a goal is reached. 8. Teach the **Deep Neural Network** using all this information. 9. Make the Artificial Neural Network better through **Bayesian Optimization**. By repeating these steps, the AI agent gets better at playing. It learns and grows with each action, becoming skilled at the game. > "The training process is key. It's where the AI agent learns to play better by trying new things. This makes it perform better each time it plays." ## The State Representation In the Snake game, the state has 11 pieces of data. These data show where the Snake is. They help the computer player know what moves to make. These 11 parts of data are set up like this: 1. **Immediate Dangers:** Some parts show if there's danger nearby. The game looks at these to stay safe. 2. **Current Direction:** The Snake can move up, down, left, or right. This data helps it figure out what to do next. 3. **Location of the Food:** Other parts tell where the food is. They say if it's above, below, left, or right of the Snake. This helps the Snake find the food. The state data goes to a **Deep Neural Network**. This lets the game plan its moves wisely. It looks at the Snake's place, dangers, and food spot to do well. Here is how the state data could be shown: Variable Value Immediate Danger - Right True Immediate Danger - Left False Immediate Danger - Straight False Current Direction Up Food Location - Above True Food Location - Below False Food Location - Left False Food Location - Right False _Note: The above example is for illustrative purposes. It might not match a game situation exactly._ The AI uses this state data to play smartly. It helps the Snake find food and avoid trouble. This method, with Deep Neural Networks, guides the AI in the Snake game. ## The Loss Function and Reward System This AI uses a Neural Network to make choices. It looks at what's happening to get the best score. The **loss function** checks how close it gets to the right answer. It wants to be as correct as possible. In the **game Snake** , good points are given for eating the apple. But, if the Snake hits the walls or itself, it loses points. It gets even better. The Snake can also earn points for staying alive. But, if not done right, this can cause problems. Finding the right **loss function** is important. It helps the AI learn from mistakes. This way, it can do better over time. The game rewards good moves and punishes bad ones. When the Snake eats the apple, it earns points. But it loses points by running into walls or itself. If the Snake survives, it earns more points. Yet, if not balanced, it might not try to eat the apple. Balancing this is key. It makes sure the Snake plays the game right. Setting up the right rewards is tricky. Too much focus on just surviving can make the Snake forget to eat. Finding this balance is crucial. Reward Description +10 Reward for successfully eating the apple -10 Punishment for hitting the walls or the Snake's body Variable Possible positive reward for surviving each step without dying ## The Deep Neural Network Architecture The AI agent in this game uses a _Deep Neural Network_ (DNN). It has three layers with 120 neurons each. This setup helps the agent learn quickly and do better in the game. The DNN has **hidden layers** for doing complex math. This lets the agent see detailed patterns and behaviours in the game. More **hidden layers** mean the DNN can understand the game better and make smarter choices. The **learning rate** is very important. It decides how fast the agent learns from new things. In the game, the **learning rate** starts at 0.0005 and gets smaller to 0.000005. This slowdown helps the agent get good at the game over time. ### The Role of Hidden Layers The DNN's **hidden layers** turn the game data into something it can process. They find key features and patterns. This helps the agent see the game world more clearly. Adding more hidden layers helps the DNN see the game world in even more detail. Then, the agent can make better choices for winning. Many hidden layers also make the DNN smarter at handling different game situations. ## Exploring Other Search Algorithms This article focuses on Deep Reinforcement Learning, but we'll talk about more. Other **search algorithms** like Minimax, **Alpha-Beta Pruning** , and Negamax are used in-game strategies. These algorithms look for the best moves in a game. They use special rules and ways to make searching faster and better. > "The essence of strategy is choosing what not to do." > > - Michael E. Porter Game AI uses **search algorithms** to make smart choices. There are three main ones we'll talk about here. ### Minimax Algorithm The **Minimax Algorithm** helps in games where two players play. It tries to lower the worst possible loss. It checks all possible moves to decide the best one to make. This works well in games like chess and tic-tac-toe. These games show all the information, not hiding anything. ### Alpha-Beta Pruning **Alpha-Beta Pruning** makes Minimax search faster. It doesn't look at moves that won't matter. This makes the search process much quicker. ### Negamax Algorithm In the **Negamax Algorithm** , the game looks simpler. It treats every turn like it is the best possible turn. This makes the thinking process easier to write down. These algorithms are just a start to making AI smart in games. Game makers use many of these together to make fun and challenging games. Algorithm Pros Cons **Minimax Algorithm** Optimal decision-making in two-player games with perfect information Computationally expensive for games with large search spaces **Alpha-Beta Pruning** Significantly reduces the number of nodes explored, improving performance Requires careful ordering of move evaluation to maximize pruning efficiency **Negamax Algorithm** Simplifies implementation by removing the need for separate evaluations for each player May lead to redundant evaluations of the same game state ## Conclusion We learned about **building an AI agent** with Python. It plays games using Reinforcement Learning. This lets developers make smart game players. These players learn and get better over time. First, we talked about what Reinforcement Learning is. Then, it is used in games. Next, we looked at the **game Snake**. We discussed how the AI learns from it. We also saw how the AI player gets better. It learns how to get more points in Snake. We talked about the AI's brain, called a Deep Neural Network. Other ways to make good game moves were mentioned, too. Python AI in games is very cool. It helps make game characters smart. With AI, games can be more fun and interesting. There's a lot more to discover in the future of game AI. ## FAQ ### What is the goal of creating AI agents in gaming? The goal is to make games fun, not to beat players. **Games** help teach AI to be better at many things. ### What is Reinforcement Learning? It's about learning from playing and getting rewards in games. **Reinforcement Learning** treats games like puzzles to solve. ### What is the Deep Q-learning algorithm? It's a smart way for AI to learn from games. **Deep Q-learning** uses a table to learn which actions are best. ### What is the game Snake? Snake is a simple game made with Pygame in Python. It's used to show how AI can learn to play well. ### How does the training process work? At first, the AI knows nothing and plays randomly. It learns what's good and bad by trying and getting rewards. Later, these lessons help it play better. ### How is the state represented in the game Snake? The game's state is shown with 11 true or false facts. These show where dangers are and where food is. ### What is the role of the Deep Neural Network in the AI agent? The network helps the AI choose actions in the game. It aims to pick the best move based on game situations. ### What other search algorithms are commonly used in game strategy? Search methods like Minimax and Alpha-Beta help plan moves. They try to find the best path forward in games. ### What have we covered in this article? We learned about making AI to play games. We talked about playing Snake to show how this works. And we looked at tools and methods for teaching AI. ## Source Links - [https://www.tutorialspoint.com/artificial\_intelligence\_with\_python/artificial\_intelligence\_with\_python\_gaming.htm](https://www.tutorialspoint.com/artificial_intelligence_with_python/artificial_intelligence_with_python_gaming.htm) - [https://towardsdatascience.com/how-to-teach-an-ai-to-play-games-deep-reinforcement-learning-28f9b920440a](https://towardsdatascience.com/how-to-teach-an-ai-to-play-games-deep-reinforcement-learning-28f9b920440a) - [https://www.reddit.com/r/howdidtheycodeit/comments/x0n6v5/how\_do\_they\_code\_those\_ai\_that\_learn\_how\_to\_play/](https://www.reddit.com/r/howdidtheycodeit/comments/x0n6v5/how_do_they_code_those_ai_that_learn_how_to_play/) #ArtificialIntelligence #MachineLearning #DeepLearning #NeuralNetworks #ComputerVision #AI #DataScience #NaturalLanguageProcessing #BigData #Robotics #Automation #IntelligentSystems #CognitiveComputing #SmartTechnology #Analytics #Innovation #Industry40 #FutureTech #QuantumComputing #Iot #blog #x #twitter #genedarocha #voxstar Thanks for reading Voxstar’s Substack! Subscribe for free to receive new posts and support my work. <form> <input type="email" name="email" placeholder="Type your email…" tabindex="-1"><input type="submit" value="Subscribe"><div> <div></div> <div></div> </div> </form>
genedarocha
1,863,116
How to call out contributions to your new, open source releases
OpenProject is committed to a release cycle of every four weeks. Is this ambitious? Yes. Does it...
0
2024-05-23T18:40:25
https://dev.to/openproject/how-to-call-out-contributions-to-new-releases-3cdb
release, programming, productivity, opensource
OpenProject is committed to a release cycle of every four weeks. Is this ambitious? Yes. Does it offer them special opportunities despite the extra effort? Also, yes. One of them is the chance to call out those who contributed to bug fixes, feature requests and feedback, and other types of support in that cycle. This includes companies, institutions, and individuals by name. In the latest release ([14.1.0](https://www.openproject.org/docs/release-notes/14-1-0/)), OpenProject shares the following: ## Contributions > A very special thank you goes to our sponsors for the features and improvements of this release: > - The City of Cologne for sponsoring features on project attributes. > - Deutsche Bahn for sponsoring the OneDrive/SharePoint integration. > - German Federal Ministry of the Interior and Home Affairs (BMI) for sponsoring the features on progress reporting. > Also a big thanks to our Community members for reporting bugs and helping us identify and provide fixes. Special thanks for reporting and finding bugs go to Marc Burk, Silas Kropf, and Hanley Loller. > Last but not least, we are very grateful for our very engaged translation contributors on Crowdin, who translated quite a few OpenProject strings! This release we would like to highlight user Syvert who has done an outstanding number of translations for the Norwegian language in recent weeks. > Would you like to help out with translations yourself? Then take a look at our [translation guide](https://www.openproject.org/docs/development/translate-openproject) and find out exactly how you can contribute. It is very much appreciated! Thus, the OpenProject Community is strong and growing. The software is open source, and the company is open in the way that it takes and responds to feedback. The door is open. Have you considered calling out your contributors on new releases?
jenwikehuger
1,863,136
Open source: The world of selfless collaboration
Whether you're a developer or everyday user enjoying the conveniences of modern technology, open...
0
2024-05-23T18:39:23
https://openpledge.io/open-source-selfless-collaboration.html
opensource, programming, collaboration
Whether you're a developer or everyday user enjoying the conveniences of modern technology, open source projects likely play a crucial role in your digital experience. From the smart TV in your living room to the information system at your workplace, and even the complex systems within your car or the coffee machine brewing your morning joy – open source is the silent engine that helps different things work together better. It's the secret sauce driving **teamwork** and innovation in many areas. ChatGPT would describe open source as follows: _“An open source project is like a big box of Legos that everyone can play with, build on, and share their creations with others for free!”_ Typically, these **"Legos"** represent software components that can be reused across various use cases and projects. Many commercial enterprise software products leverage these open source components. The explanation behind this is simple: why spend time reinventing the wheel when a desired feature often already exists in the open source world? Embracing open source projects is not only a time-saving practice but is actively encouraged within the developer community. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/noy9jrgnsx053xdq7vsh.png) Want to know more about enterprises using open source? Make sure to checkout: [Tech Giants Fueling Open Source Innovation](https://openpledge.io/companies-supporting-open-source.html). Open source thrives on the power of community collaboration. It's not just about lines of code; it's about a global community coming together to solve problems, share knowledge, and collectively improve software for everyone. This collaborative spirit extends to the principles of freedom and accessibility, where anyone can access, modify, and distribute open source software, fostering an inclusive and transparent environment. Moreover, open source is not only about building on existing creations but also ensuring the **security** and **reliability** of the software. The transparent nature of open source allows for continuous audits, often making it more secure than closed-source alternatives. Open source projects evolve based on user feedback, ensuring adaptability and relevance in the ever-changing landscape of technology. Read more on security risks of open source in an article [From Thriving to Forgotten: The Dynamics of Abandoned Open Source Projects](https://openpledge.io/abandoned-open-source-projects.html). So, whether you're a seasoned developer or an everyday user, open source is not just a silent engine; it's a dynamic, collaborative force that powers the digital world we live in.
zigcbenx
1,863,135
Escaping the 9-5: Building Tools to Empower Designers and Developers
Hey Dev Community, I'm Tiatun, a tech entrepreneur on a mission to break free from the 9-5 grind. My...
0
2024-05-23T18:39:09
https://dev.to/ddigital/escaping-the-9-5-building-tools-to-empower-designers-and-developers-14k8
webdev, mvp, startup, beginners
Hey Dev Community, I'm Tiatun, a tech entrepreneur on a mission to break free from the 9-5 grind. My goal is to create innovative digital products that solve real problems and help creatives thrive. I'm currently working towards generating $10K/month in revenue so I can focus entirely on my passion projects. 🚀 **Here's what I've been up to:** ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89dqexiefpihgn71wvjb.png) 1. [Aicolors.co](https://aiclors.co) Have you ever struggled to find the perfect color palette for your project? AI Colors is here to help. It's an AI-powered color palette generation tool that allows designers and developers to find the right colors effortlessly. Say goodbye to color headaches and hello to beautiful designs! ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0gutsv2w9jcjnff2h0ha.jpg) 2. [SVGMix.com](https://SVGMix.com) Designers and developers, rejoice! SVG Mix offers over 400,000 free icons, logos, and web tools, making it the ultimate resource for your creative needs. Whether you're building a website, app, or presentation, SVG Mix has got you covered. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tp94qvugdrsklpmw4xr7.png) 3. [MVPRecipes.com](https://MVPRecipes.com) Do you have a startup idea but need help executing it? MVP Recipes provides step-by-step guides to help you turn your concept into a minimum viable product using No Code. It's perfect for aspiring entrepreneurs looking to launch quickly and efficiently. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86990kaog000vh2vq6dz.png) 4. [ComingSoonKit.com](https://ComingSoonKit.com) Are you launching a new product or service? The Coming Soon Kit helps create buzz and capture leads before your big reveal—a template kit for Webflow, Figma, and Tailwind. Choose from over 100 unique "Waitlist landing page" designs to launch your Kickstarter, Product launches, Startups, Newsletters, Notion templates, SaaS, eBook, and more. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zxvoe1znhvk9hlkjqom8.jpg) 5. [NotionBrandingKit.com](https://NotionBrandingKit.com) Thought brand creation was rocket science? Think again. We've mapped out the universe for you. Every step of your brand-building process, from purpose to visual identity, is detailed in a digestible format. It's like having a branding expert walking with you every step of the way. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6f4gpbor4snrf82z2i3.png) 6. [Karma.Design](karma.design) Lay the groundwork for exceptional web designs with the Karma Design Wireframe and UI Kit. This collection of over 1,000 wireframe blocks and 1,200 UI components is tailor-made for Figma users. The kit equips you with a vast array of pre-built elements, enabling you to easily create web and landing pages, App mockups, and more while ensuring a robust and cohesive structure. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/smaq9qpqibibvxgs4zmg.jpg) 7. [BrandOften.com](https://brandoften.com) Your brand deserves the spotlight, and Brand Often helps you achieve just that. It's a comprehensive platform offering tools and strategies to brand your business across all channels consistently. Build, maintain, and grow your brand effortlessly. Why am I creating these products? Because I believe in solving problems that I, and many others, face daily. Whether it's finding the right color palette, accessing quality icons, or launching a startup, these products aim to make life easier for creatives and entrepreneurs. Who benefits? Designers, developers, entrepreneurs, and anyone looking to enhance their projects with top-tier tools and resources. Let's Connect! I love meeting like-minded individuals. You can find me at [tiatun.com](https://tiatun.com) or on Twitter at [@t_tiatun](https://x.com/t_tiatun). Let's chat, collaborate, and grow together! Stay awesome, Dev Community!
ddigital
1,863,134
Creating route directory in Slim Php Framework
Hello Everyone, I have discussed on creating route directory in slim php framework. It makes easy to...
0
2024-05-23T18:38:17
https://dev.to/asif_sheikh_d7d74ce8b9c9d/creating-route-directory-in-slim-php-framework-46eb
login, php, slim, framework
Hello Everyone, I have discussed on creating route directory in slim php framework. It makes easy to organize or modular your slim project. Let's go, **STEP 1:** Firstly, copy your code in `public/index.php`: ``` $routes = glob(__DIR__ . "/../routes/*.php"); foreach($routes as $route) { (require $route)($app); } ``` **STEP 2:** In second step, we'll create routes directory in our slim project directory and also create `routes/web.php` file: Like this, ``` <?php use Slim\App; return function (App $app) { $app->get("/your-route", function ($request, $response, $args){ $response->getBody()->write("Hello, I am in your route"); return $respones; }); }; ``` I hope you to enjoy for creating such routes separate files that may be slim code organizable, readable. Thank you for giving your valuable time to read this!✨
asif_sheikh_d7d74ce8b9c9d
1,863,133
Safe bearing removal tool
In mechanical maintenance, introducing Smart-Collet Pullers has marked a significant advancement,...
0
2024-05-23T18:35:37
https://dev.to/smartcollet/safe-bearing-removal-tool-hg0
In mechanical maintenance, introducing Smart-Collet Pullers has marked a significant advancement, especially regarding the safe removal of bearings. We know the challenges and risks associated with traditional bearing removal methods, often leading to equipment damage and personal injury. That's why we've embraced the development of a **[safe bearing removal tool](https://www.smartcollet.com/collections/safe-bearing-removal-tool)** that stands out for its innovation, safety, and efficiency.
smartcollet
1,863,131
Buy verified cash app account
https://dmhelpshop.com/product/buy-verified-cash-app-account/ Buy verified cash app account Cash...
0
2024-05-23T18:31:23
https://dev.to/teresakirbyyejvsja/buy-verified-cash-app-account-p88
webdev, javascript, beginners, programming
ERROR: type should be string, got "https://dmhelpshop.com/product/buy-verified-cash-app-account/\n![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5anadr06h4k0l4e5y09g.png)\n\nBuy verified cash app account\nCash app has emerged as a dominant force in the realm of mobile banking within the USA, offering unparalleled convenience for digital money transfers, deposits, and trading. As the foremost provider of fully verified cash app accounts, we take pride in our ability to deliver accounts with substantial limits. Bitcoin enablement, and an unmatched level of security.\n\nOur commitment to facilitating seamless transactions and enabling digital currency trades has garnered significant acclaim, as evidenced by the overwhelming response from our satisfied clientele. Those seeking buy verified cash app account with 100% legitimate documentation and unrestricted access need look no further. Get in touch with us promptly to acquire your verified cash app account and take advantage of all the benefits it has to offer.\n\nWhy dmhelpshop is the best place to buy USA cash app accounts?\nIt’s crucial to stay informed about any updates to the platform you’re using. If an update has been released, it’s important to explore alternative options. Contact the platform’s support team to inquire about the status of the cash app service.\n\nClearly communicate your requirements and inquire whether they can meet your needs and provide the buy verified cash app account promptly. If they assure you that they can fulfill your requirements within the specified timeframe, proceed with the verification process using the required documents.\n\nOur account verification process includes the submission of the following documents: [List of specific documents required for verification].\n\nGenuine and activated email verified\nRegistered phone number (USA)\nSelfie verified\nSSN (social security number) verified\nDriving license\nBTC enable or not enable (BTC enable best)\n100% replacement guaranteed\n100% customer satisfaction\nWhen it comes to staying on top of the latest platform updates, it’s crucial to act fast and ensure you’re positioned in the best possible place. If you’re considering a switch, reaching out to the right contacts and inquiring about the status of the buy verified cash app account service update is essential.\n\nClearly communicate your requirements and gauge their commitment to fulfilling them promptly. Once you’ve confirmed their capability, proceed with the verification process using genuine and activated email verification, a registered USA phone number, selfie verification, social security number (SSN) verification, and a valid driving license.\n\nAdditionally, assessing whether BTC enablement is available is advisable, buy verified cash app account, with a preference for this feature. It’s important to note that a 100% replacement guarantee and ensuring 100% customer satisfaction are essential benchmarks in this process.\n\nHow to use the Cash Card to make purchases?\nTo activate your Cash Card, open the Cash App on your compatible device, locate the Cash Card icon at the bottom of the screen, and tap on it. Then select “Activate Cash Card” and proceed to scan the QR code on your card. Alternatively, you can manually enter the CVV and expiration date. How To Buy Verified Cash App Accounts.\n\nAfter submitting your information, including your registered number, expiration date, and CVV code, you can start making payments by conveniently tapping your card on a contactless-enabled payment terminal. Consider obtaining a buy verified Cash App account for seamless transactions, especially for business purposes. Buy verified cash app account.\n\nWhy we suggest to unchanged the Cash App account username?\nTo activate your Cash Card, open the Cash App on your compatible device, locate the Cash Card icon at the bottom of the screen, and tap on it. Then select “Activate Cash Card” and proceed to scan the QR code on your card.\n\nAlternatively, you can manually enter the CVV and expiration date. After submitting your information, including your registered number, expiration date, and CVV code, you can start making payments by conveniently tapping your card on a contactless-enabled payment terminal. Consider obtaining a verified Cash App account for seamless transactions, especially for business purposes. Buy verified cash app account. Purchase Verified Cash App Accounts.\n\nSelecting a username in an app usually comes with the understanding that it cannot be easily changed within the app’s settings or options. This deliberate control is in place to uphold consistency and minimize potential user confusion, especially for those who have added you as a contact using your username. In addition, purchasing a Cash App account with verified genuine documents already linked to the account ensures a reliable and secure transaction experience.\n\n \n\nBuy verified cash app accounts quickly and easily for all your financial needs.\nAs the user base of our platform continues to grow, the significance of verified accounts cannot be overstated for both businesses and individuals seeking to leverage its full range of features. How To Buy Verified Cash App Accounts.\n\nFor entrepreneurs, freelancers, and investors alike, a verified cash app account opens the door to sending, receiving, and withdrawing substantial amounts of money, offering unparalleled convenience and flexibility. Whether you’re conducting business or managing personal finances, the benefits of a verified account are clear, providing a secure and efficient means to transact and manage funds at scale.\n\nWhen it comes to the rising trend of purchasing buy verified cash app account, it’s crucial to tread carefully and opt for reputable providers to steer clear of potential scams and fraudulent activities. How To Buy Verified Cash App Accounts.  With numerous providers offering this service at competitive prices, it is paramount to be diligent in selecting a trusted source.\n\nThis article serves as a comprehensive guide, equipping you with the essential knowledge to navigate the process of procuring buy verified cash app account, ensuring that you are well-informed before making any purchasing decisions. Understanding the fundamentals is key, and by following this guide, you’ll be empowered to make informed choices with confidence.\n\n \n\nIs it safe to buy Cash App Verified Accounts?\nCash App, being a prominent peer-to-peer mobile payment application, is widely utilized by numerous individuals for their transactions. However, concerns regarding its safety have arisen, particularly pertaining to the purchase of “verified” accounts through Cash App. This raises questions about the security of Cash App’s verification process.\n\nUnfortunately, the answer is negative, as buying such verified accounts entails risks and is deemed unsafe. Therefore, it is crucial for everyone to exercise caution and be aware of potential vulnerabilities when using Cash App. How To Buy Verified Cash App Accounts.\n\nCash App has emerged as a widely embraced platform for purchasing Instagram Followers using PayPal, catering to a diverse range of users. This convenient application permits individuals possessing a PayPal account to procure authenticated Instagram Followers.\n\nLeveraging the Cash App, users can either opt to procure followers for a predetermined quantity or exercise patience until their account accrues a substantial follower count, subsequently making a bulk purchase. Although the Cash App provides this service, it is crucial to discern between genuine and counterfeit items. If you find yourself in search of counterfeit products such as a Rolex, a Louis Vuitton item, or a Louis Vuitton bag, there are two viable approaches to consider.\n\n \n\nWhy you need to buy verified Cash App accounts personal or business?\nThe Cash App is a versatile digital wallet enabling seamless money transfers among its users. However, it presents a concern as it facilitates transfer to both verified and unverified individuals.\n\nTo address this, the Cash App offers the option to become a verified user, which unlocks a range of advantages. Verified users can enjoy perks such as express payment, immediate issue resolution, and a generous interest-free period of up to two weeks. With its user-friendly interface and enhanced capabilities, the Cash App caters to the needs of a wide audience, ensuring convenient and secure digital transactions for all.\n\nIf you’re a business person seeking additional funds to expand your business, we have a solution for you. Payroll management can often be a challenging task, regardless of whether you’re a small family-run business or a large corporation. How To Buy Verified Cash App Accounts.\n\nImproper payment practices can lead to potential issues with your employees, as they could report you to the government. However, worry not, as we offer a reliable and efficient way to ensure proper payroll management, avoiding any potential complications. Our services provide you with the funds you need without compromising your reputation or legal standing. With our assistance, you can focus on growing your business while maintaining a professional and compliant relationship with your employees. Purchase Verified Cash App Accounts.\n\nA Cash App has emerged as a leading peer-to-peer payment method, catering to a wide range of users. With its seamless functionality, individuals can effortlessly send and receive cash in a matter of seconds, bypassing the need for a traditional bank account or social security number. Buy verified cash app account.\n\nThis accessibility makes it particularly appealing to millennials, addressing a common challenge they face in accessing physical currency. As a result, ACash App has established itself as a preferred choice among diverse audiences, enabling swift and hassle-free transactions for everyone. Purchase Verified Cash App Accounts.\n\n \n\nHow to verify Cash App accounts\nTo ensure the verification of your Cash App account, it is essential to securely store all your required documents in your account. This process includes accurately supplying your date of birth and verifying the US or UK phone number linked to your Cash App account.\n\nAs part of the verification process, you will be asked to submit accurate personal details such as your date of birth, the last four digits of your SSN, and your email address. If additional information is requested by the Cash App community to validate your account, be prepared to provide it promptly. Upon successful verification, you will gain full access to managing your account balance, as well as sending and receiving funds seamlessly. Buy verified cash app account.\n\n \n\nHow cash used for international transaction?\nExperience the seamless convenience of this innovative platform that simplifies money transfers to the level of sending a text message. It effortlessly connects users within the familiar confines of their respective currency regions, primarily in the United States and the United Kingdom.\n\nNo matter if you’re a freelancer seeking to diversify your clientele or a small business eager to enhance market presence, this solution caters to your financial needs efficiently and securely. Embrace a world of unlimited possibilities while staying connected to your currency domain. Buy verified cash app account.\n\nUnderstanding the currency capabilities of your selected payment application is essential in today’s digital landscape, where versatile financial tools are increasingly sought after. In this era of rapid technological advancements, being well-informed about platforms such as Cash App is crucial.\n\nAs we progress into the digital age, the significance of keeping abreast of such services becomes more pronounced, emphasizing the necessity of staying updated with the evolving financial trends and options available. Buy verified cash app account.\n\nOffers and advantage to buy cash app accounts cheap?\nWith Cash App, the possibilities are endless, offering numerous advantages in online marketing, cryptocurrency trading, and mobile banking while ensuring high security. As a top creator of Cash App accounts, our team possesses unparalleled expertise in navigating the platform.\n\nWe deliver accounts with maximum security and unwavering loyalty at competitive prices unmatched by other agencies. Rest assured, you can trust our services without hesitation, as we prioritize your peace of mind and satisfaction above all else.\n\nEnhance your business operations effortlessly by utilizing the Cash App e-wallet for seamless payment processing, money transfers, and various other essential tasks. Amidst a myriad of transaction platforms in existence today, the Cash App e-wallet stands out as a premier choice, offering users a multitude of functions to streamline their financial activities effectively. Buy verified cash app account.\n\nTrustbizs.com stands by the Cash App’s superiority and recommends acquiring your Cash App accounts from this trusted source to optimize your business potential.\n\nHow Customizable are the Payment Options on Cash App for Businesses?\nDiscover the flexible payment options available to businesses on Cash App, enabling a range of customization features to streamline transactions. Business users have the ability to adjust transaction amounts, incorporate tipping options, and leverage robust reporting tools for enhanced financial management.\n\nExplore trustbizs.com to acquire verified Cash App accounts with LD backup at a competitive price, ensuring a secure and efficient payment solution for your business needs. Buy verified cash app account.\n\nDiscover Cash App, an innovative platform ideal for small business owners and entrepreneurs aiming to simplify their financial operations. With its intuitive interface, Cash App empowers businesses to seamlessly receive payments and effectively oversee their finances. Emphasizing customization, this app accommodates a variety of business requirements and preferences, making it a versatile tool for all.\n\nWhere To Buy Verified Cash App Accounts\nWhen considering purchasing a verified Cash App account, it is imperative to carefully scrutinize the seller’s pricing and payment methods. Look for pricing that aligns with the market value, ensuring transparency and legitimacy. Buy verified cash app account.\n\nEqually important is the need to opt for sellers who provide secure payment channels to safeguard your financial data. Trust your intuition; skepticism towards deals that appear overly advantageous or sellers who raise red flags is warranted. It is always wise to prioritize caution and explore alternative avenues if uncertainties arise.\n\nThe Importance Of Verified Cash App Accounts\nIn today’s digital age, the significance of verified Cash App accounts cannot be overstated, as they serve as a cornerstone for secure and trustworthy online transactions.\n\nBy acquiring verified Cash App accounts, users not only establish credibility but also instill the confidence required to participate in financial endeavors with peace of mind, thus solidifying its status as an indispensable asset for individuals navigating the digital marketplace.\n\nWhen considering purchasing a verified Cash App account, it is imperative to carefully scrutinize the seller’s pricing and payment methods. Look for pricing that aligns with the market value, ensuring transparency and legitimacy. Buy verified cash app account.\n\nEqually important is the need to opt for sellers who provide secure payment channels to safeguard your financial data. Trust your intuition; skepticism towards deals that appear overly advantageous or sellers who raise red flags is warranted. It is always wise to prioritize caution and explore alternative avenues if uncertainties arise.\n\nConclusion\nEnhance your online financial transactions with verified Cash App accounts, a secure and convenient option for all individuals. By purchasing these accounts, you can access exclusive features, benefit from higher transaction limits, and enjoy enhanced protection against fraudulent activities. Streamline your financial interactions and experience peace of mind knowing your transactions are secure and efficient with verified Cash App accounts.\n\nChoose a trusted provider when acquiring accounts to guarantee legitimacy and reliability. In an era where Cash App is increasingly favored for financial transactions, possessing a verified account offers users peace of mind and ease in managing their finances. Make informed decisions to safeguard your financial assets and streamline your personal transactions effectively.\n\nContact Us / 24 Hours Reply\nTelegram:dmhelpshop\nWhatsApp: +1 ‪(980) 277-2786\nSkype:dmhelpshop\nEmail:dmhelpshop@gmail.com\n\n"
teresakirbyyejvsja
1,863,128
Implementing a Blocking Feature in Laravel (using Morph table and Morph endpoint!)
I'm building an app where users can make posts. Recently, I was tasked with adding a blocking...
0
2024-05-23T18:29:54
https://dev.to/edriso/implementing-a-blocking-feature-in-laravel-using-morph-table-and-morph-endpoint-55h6
laravel, backend, morphs, traits
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ccb3omtb406bz9m4lgvw.jpg) I'm building an app where users can make posts. Recently, I was tasked with adding a blocking feature, allowing users to block other users or posts. My senior suggested using a morph table since many things could be blocked. Here's the schema I created for the `blocks` table: ```php Schema::create('blocks', function (Blueprint $table) { $table->id(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->morphs('blockable'); $table->timestamps(); $table->unique(['user_id', 'blockable_id', 'blockable_type']); }); ``` Then, I created the `Block` model: ```php class Block extends Model { use HasFactory; protected $fillable = [ 'user_id', 'blockable_id', 'blockable_type', ]; public function blocker(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } public function blockable(): MorphTo { return $this->morphTo(); } } ``` Additionally, I learned a valuable tip from an instructor to avoid repeating inverse relationships in each model (like User and Post). Instead, I created a trait named `IsBlockable`, which adds blocking features to models like `User` and `Post`. ```php trait IsBlockable { /** * Get all users who have blocked this model. */ public function blockedBy() { return $this->morphToMany(User::class, 'blockable', 'blocks', 'blockable_id', 'user_id'); } /** * Check if the current user has blocked the owner of this model. * * @return bool */ public function isCurrentUserBlockedByOwner() { $currentUser = User::currentUser(); return $currentUser && ($this instanceof User ? $this->isInstanceBlocked($currentUser) : $this->user?->isInstanceBlocked($currentUser) ); } /** * Get the IDs of models blocked by the current user. * * @param \Illuminate\Database\Eloquent\Model|null $instance * @return \Closure */ public function blockedModelIds($instance = null) { $instance = $instance ?: $this; return function ($query) use ($instance) { $query->select('blockable_id') ->from('blocks') ->where('blockable_type', $instance->getMorphClass()) ->where('user_id', User::currentUser()?->id); }; } /** * Get the IDs of model owners who blocked the current user. * * @param \Illuminate\Database\Eloquent\Model|null $user * @return \Closure */ public function blockedByOwnersIds($user = null) { $user = $user ?: User::currentUser(); return function ($query) use ($user) { $query->select('user_id') ->from('blocks') ->where('blockable_type', $user?->getMorphClass()) ->where('blockable_id', $user?->id); }; } /** * Scope a query to exclude models blocked by the current user or created by users blocked by that user, * or created by users who have blocked the current user. * * @param \Illuminate\Database\Eloquent\Builder $query * @return \Illuminate\Database\Eloquent\Builder */ public function scopeVisibleToCurrentUser($query) { $blockedModelIds = $this->blockedModelIds(); $blockedUserIds = $this->blockedModelIds(User::currentUser()); return $query->whereNotIn('id', $blockedModelIds) ->whereNotIn('user_id', $blockedUserIds) ->whereNotIn('user_id', $this->blockedByOwnersIds()); } /** * Check if the model is blocked by a specific user. * * @param int $userId * @return bool */ public function isBlockedBy($userId) { return $this->blockedBy()->where('user_id', $userId)->exists(); } /** * Determine if the model is currently blocked by any user. * * @return bool */ public function isBlocked() { return $this->blockedBy()->exists(); } /** * Get the count of users who have blocked this model. * * @return int */ public function blockedByCount() { return $this->blockedBy()->count(); } /** * Get the latest user who blocked this model. * * @return \App\Models\User|null */ public function latestBlockedBy() { return $this->blockedBy()->latest()->first(); } } ``` To further simplify block management and enhance reusability, I created another trait named `BlockManager`, specifically used on the model responsible for blocking actions, which in my case is the User model. So, the User model now utilizes both traits. ```php trait BlockManager { /** * Get all the blocks created by this user. */ public function blocks() { return $this->hasMany(Block::class); } /** * Get all the entities of a given class that this user has blocked. */ public function blockedEntities($class) { return $this->morphedByMany($class, 'blockable', 'blocks', 'user_id', 'blockable_id') ->withTimestamps(); } /** * Check if the given instance is blocked by the current user. * * @param \Illuminate\Database\Eloquent\Model|null $instance * @return bool */ public function isInstanceBlocked($instance) { return $instance && $this->blockedEntities(get_class($instance)) ->where('blockable_id', $instance->id) ->exists(); } /** * Get all the users that this user has blocked. * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ public function blockedUsers() { return $this->blockedEntities(\App\Models\User::class); } /** * Get all the posts that this user has blocked. * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ public function blockedPosts() { return $this->blockedEntities(\App\Models\Post::class); } } ``` Also, here's `BlockFactory` class to create blocks for testing purposes: ```php class BlockFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Block::class; /** * Define the model's default state. * * @return array<string, mixed> */ public function definition(): array { $blockableType = $this->faker->randomElement([User::class, Post::class]); do { $blockable = $blockableType::inRandomOrder()->first(); $user = User::inRandomOrder()->first(); if ($blockableType === User::class && $blockable) { $user = User::inRandomOrder()->whereKeyNot($blockable->id)->first(); } $exists = Block::where('user_id', $user?->getKey()) ->where('blockable_id', $blockable?->getKey()) ->where('blockable_type', $blockable?->getMorphClass()) ->exists(); } while ($exists || ! $user || ! $blockable); return [ 'user_id' => $user->getKey(), 'blockable_id' => $blockable->getKey(), 'blockable_type' => $blockable->getMorphClass(), ]; } ``` --- **Handling Block Requests** (Taking the morph idea to the next level) To handle blocking requests, I set up a a singleton controller: ```php Route::post('/blocks', BlocksController::class); ``` `BlocksController` provides a simple endpoint for blocking or unblocking users or posts. ```php class BlocksController extends ApiController { /** * Block or unblock a resource. * * This endpoint blocks or unblocks a specified resource, such as a user or a post. * * Query Parameters: * - action: The action to perform. Accepted values: "block", "unblock" * - model_type: What type of resource are you blocking or unblocking? Accepted values: "user", "post" * - model_id: The ID of the resource to block or unblock */ public function __invoke(BlockRequest $request) { $validated = $request->validated(); $action = strtolower($validated['action']); $isBlockAction = $action === 'block'; $modelType = ucfirst(strtolower($validated['model_type'])); $modelId = $validated['model_id']; $modelClass = 'App\\Models\\'.$modelType; if ($modelClass === User::class && $modelId == $this->user?->id) { return response()->json(['message' => 'You cannot block yourself.'], 400); } $isAlreadyBlocked = $this->user->blockedEntities($modelClass)->where('blockable_id', $modelId)->exists(); if ($isBlockAction && ! $isAlreadyBlocked) { $this->user->blockedEntities($modelClass)->syncWithoutDetaching([$modelId]); } elseif (! $isBlockAction && $isAlreadyBlocked) { $detached = $this->user->blockedEntities($modelClass)->detach($modelId); if (! $detached) { return response()->json( ['error' => "Failed to unblock the {$modelType}."], Response::HTTP_INTERNAL_SERVER_ERROR ); } } return response()->json([ 'message' => "Model {$action}ed successfully.", 'blocked' => $isBlockAction, ]); } } ``` I also created a validation class called `BlockRequest` to ensure the integrity of incoming block requests. ```php class BlockRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ 'action' => ['required', 'string'], 'model_type' => ['required', 'string'], 'model_id' => ['required', 'integer'], ]; } /** * Get the "after" validation callables for the request. */ public function after(): array { return [ function (Validator $validator) { $action = strtolower($this->input('action') ?? ''); $modelType = ucfirst(strtolower($this->input('model_type') ?? '')); $modelId = $this->input('model_id'); if ($action && ! in_array($action, ['block', 'unblock'])) { return $validator->errors()->add('action', 'Invalid action.'); } if ($modelType && $modelId) { $modelClass = 'App\\Models\\'.$modelType; if (! class_exists($modelClass)) { return $validator->errors()->add('model_type', 'Invalid model type.'); } // Check if the model is blockable by checking if it uses IsBlockable trait if (! in_array(IsBlockable::class, class_uses($modelClass), true)) { return $validator->errors()->add('model_type', 'The specified model type is not blockable.'); } // Check if the specified model instance exists if (! $modelClass::find($modelId)) { return $validator->errors()->add('model_id', 'The specified model ID does not exist.'); } } }, ]; } } ``` In summary, I implemented a blocking feature that allows users to block other entities effortlessly. Using a morph table, traits like `IsBlockable` and `BlockManager`, and morph request validation, the code's modularity and reusability are optimized for future development Special thanks to my senior, Stack Overflow, and ChatGPT. Alhamdullah.
edriso
1,863,127
Make Me A Container: The Docker Guide
Absolutely dread setting up applications — the relentless pain of choosing libraries, tweaking...
0
2024-05-23T18:25:58
https://dev.to/emmanuellebe24/make-me-a-container-the-docker-guide-4c07
docker, devops, webdev
Absolutely dread setting up applications — the relentless pain of choosing libraries, tweaking environments, and all the headaches of making stuff work on your machine. But thank goodness for Docker, because those days are now just a crappy memory! If you’ve been living under a rock, you might not have heard of Docker, but no worries — now that you’re here, I can fill you in on all the details. ###So what is Docker? Docker is an open-source platform that uses containerization technology to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. Check the site: [Docker website](https://www.docker.com/) for more information. ###Why Docker There are plenty of reasons to get familiar with Docker, not least because it’s downright cool — and yes, it even has a charming whale as its mascot! But Enough jokes, let’s get technical. Docker has revolutionized the way developers deploy and manage software applications. Here are several reasons why Docker has become an indispensable tool in modern development environments: 1. **Consistency Across Environments**: Docker containers ensure that applications run the same way on any system. This eliminates the “it works on my machine” problem, where applications behave differently across environments due to varying configurations and dependencies. 2. **Rapid Deployment**: Docker containers can be created and deployed in seconds, making the process of pushing changes or rolling out new features significantly faster compared to traditional methods of software deployment. 3. **Efficiency**: Containers utilize system resources more efficiently than virtual machines, as they share the host system’s kernel and require less overhead. This makes Docker an economical choice for both development and production environments. 4. **Scalability and Modularity**: Docker makes it easy to scale applications up or down with its orchestration capabilities. Containers can be replicated, managed, and monitored at scale, which is ideal for microservices architectures where components are loosely coupled and independently scalable. Enough talk let’s get down to business the real reason you came here is to **“LEARN DOCKER!”** Here’s a fascinating approach to understanding the power of Docker: We’re going to set up a full-stack Node.js application that handles basic CRUD operations, using MongoDB as the database. We’ll tackle this setup in two distinct ways — first, through a manual setup process without Docker, and then by utilizing Docker. This will illustrate the differences and advantages that Docker brings to the table. Note: I had the pleasure of contributing to the [Docker repository](https://github.com/docker/multi-container-app) for this application. If you find the application helpful or impressive, please consider giving it a star⭐ on GitHub. ###**Setup without Docker:** **Environment Preparation**: - Install Node.js: Ensure that Node.js is installed on your system. You can download it from nodejs.org. - Install MongoDB: Follow the installation guide on the official MongoDB documentation. **Application Setup**: - Initialize the repository: `npm init -y` - Navigate into the directory: `cd your-repository-name` - Install dependencies: `npm install` **Database Configuration**: Ensure MongoDB is running on your system. Configure your MongoDB URI in your application to connect to your local database instance. check [MongoDB](https://www.mongodb.com/) website for more information **Run the Application**: Start the server: `npm start` Your application should now be running on `localhost:3000`. By following these steps, you can manually configure and run your Node.js application linked to a MongoDB database. However, consider the scenario where you need to replicate this setup across different machines and operating systems. It’s a daunting task, isn’t it? Now imagine scaling this process to 50 machines. The complexity and potential for errors multiply, making such a setup exceedingly challenging and stressful. But don’t worry docker is here for the rescue. Let’s try replicating this step again but with Docker. **Setup with Docker**: Using Docker simplifies and streamlines the setup process, ensuring consistency regardless of the local development environment. Below, we’ll explore how to set up the same full-stack Node.js application using Docker, which includes the database and server environment. 1. **Prerequisites**: Install Docker: Ensure Docker is installed on your system. You can download it from the official Docker website. 2. **Docker Configuration**: Dockerfile: Create a Dockerfile in your project directory. This file will define the environment for your Node.js application. Here’s a basic example of what it might look like: ```shell FROM node:14 WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 3000 CMD ["node", "server.js"] ``` 3. Docker Compose: Optionally, you can use Docker Compose to manage both your application and MongoDB services together. Create a docker-compose.yml file: ```yml version: '3.8' services: app: build: . ports: - "3000:3000" depends_on: - mongo environment: - MONGO_URI=mongodb://mongo:27017/mydatabase mongo: image: mongo ports: - "27017:27017" ``` 4. **Build and Run the Docker Container**: - From the directory containing your Dockerfile and docker-compose.yml, run: ```shell docker-compose up --build ``` - This command builds the Docker images for your application and MongoDB, and starts the containers as defined in your Docker compose file. 5. **Verify the Setup**: - After the containers are up and running, you can access your application by visiting `http://localhost:3000` in your web browser. - You should see your application running, connected to MongoDB running in another container. By using Docker, you eliminate the need for manual environment setup and ensure that your application runs in an isolated and consistent environment. This method greatly reduces setup time and increases the reliability of your application across different machines. Docker encapsulates the application and its dependencies, making the deployment and scaling process straightforward and less prone to errors. You can also eliminate this process by cloning the [GitRepo](https://github.com/docker/multi-container-app) on your machine and making your edits. Also, check out [Awesome-Compose](https://github.com/docker/awesome-compose) for more template. **Conclusion** In conclusion, the contrasting experiences of setting up and managing applications manually versus using Docker highlight the immense value Docker brings to development workflows. With its containerization technology, Docker simplifies the deployment process, enhances consistency across various environments, and significantly reduces the potential for errors associated with manual setups. Whether you’re developing locally or scaling across multiple platforms, Docker provides a reliable and efficient solution, making it an essential tool for developers aiming to streamline their development processes and focus more on innovation than infrastructure. Thank you for taking the time to read this article! I hope you found it informative and useful. 👍 If you appreciated this post, please give it a like! 🔄 Feel free to share this with anyone who might benefit from it. 💬 I’d love to hear your thoughts and any tips you might have — drop a comment below! 👤 Follow me for more insightful blogs in the future! Support my work with a [coffee](https://buymeacoffee.com/lebemanuel) ☕ — thank you for your generosity! [![Buy me coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwiapxzgw2zxc4z6cgeh.png)](https://buymeacoffee.com/lebemanuel)
emmanuellebe24
1,863,126
Attending the Vercel Ship 2024 NYC Virtual Event: A Glimpse into the Future of Web Development
Today, I had the pleasure of attending the Vercel Ship virtual event, and let me tell you, it was...
0
2024-05-23T18:25:16
https://dev.to/poetryofcode/attending-the-vercel-ship-2024-nyc-virtual-event-a-glimpse-into-the-future-of-web-development-543j
vercel, webdev, ai, cloud
Today, I had the pleasure of attending the Vercel Ship virtual event, and let me tell you, it was nothing short of revolutionary for anyone passionate about web development. As a big fan of Vercel, I have deployed numerous projects on their platform, and I was especially excited to see it. Here’s a recap of the highlights and my key takeaways: _💠 Integration of AI, as well as the front-end cloud and developer experience._ _💠 Vercel's CEO, Guillermo Rauch, spoke about the company's journey from two initial utilities to building an entire cloud platform optimized for front-end developers and teams._ _💠 Vercel's AI-powered tool, VZero, has been used by the Vercel community to generate over three million UIs, helping developers get from idea to code faster than ever before._ **Event Welcome** The event started with a warm welcome from Sarah Gu, an AI investor and founder of a venture firm called Conviction. **Journey and Evolution of Vercel** The CEO of Vercel, Guo Rous, began his keynote address how Vercel started with just two things, Next Dev and Now Deploy, and how it was focused purely on utility for developers. He then went on to explain how he was solving problems for himself as a developer and how he spent eight years of his life building a cloud platform to ensure that no developer had to deal with all the hassle of setting up their website. **Introduction to Frontend Cloud** Vercel has unlocked a whole category which it now calls the frontend cloud. It is an entire cloud platform designed for and optimized for and built by the frontend developers and teams that deeply care about the user experience. Vercel started with the idea that to build the best possible cloud, it had to invest in the best possible open-source tools and creators. Open-source frameworks drive the two critical pieces of Vercel's frontend cloud: the developer experience platform and the managed infrastructure platform. **Vercel's Achievements and Milestones** Vercel has achieved many milestones in its journey. The company has just crossed 1 million active developers with Next.js, as well as supporting over 35 other open-source front and frameworks. When these frameworks are deployed on Vercel, the company is proud to share that it was close to hitting 100 billion weekly requests served through its managed infrastructure. Lastly, Vercel has just passed $100 million in annual revenue, which is an important milestone for the company because it means that so many developers trust Vercel to build and be their partner in the future of the web. **Introduction to VZero** VZero has been a game-changer for developers, allowing them to go from idea to code faster than ever before. Since its launch, the Versel community has generated over three million UIs using VZero. The tool has received positive feedback from developers, and the Versel team has been working hard to make it even better. During the Versel Ship conference, Lee Robinson, the head of development, demonstrated how VZero works. He used the tool to generate a conference talk submission form, which was created using Shad CN UI and Tailwind CSS. VZero presented three different options for the form, and Robinson chose the one that looked the best. The generated React code was streamed live, and the final product looked impressive. Overall, VZero is a powerful tool that enables developers to focus on building great user experiences, rather than dealing with infrastructure and frameworks. With VZero, developers can easily turn their ideas into code and bring their products to market faster. **Vercel's Vision for the Future** At the forefront of the front-end cloud movement, Vercel is leading the charge in building a platform that is optimized for and built by front-end developers. With a focus on open-source tools and frameworks, Vercel is committed to providing developers with the best possible developer experience and managed infrastructure platform. By investing in the best possible open-source tools and creators, Vercel is able to cover the entire software development life cycle, from idea to production. Vercel's vision for the future of the web is one where developers can build and ship great experiences quickly and efficiently, without having to worry about the complexities of infrastructure management. By leveraging AI-powered tools like VZero, developers can generate React code from simple text prompts and images, enabling them to go from idea to code faster than ever before. In conclusion, the integration of AI into web development is rapidly changing the way developers build and deploy applications. As the web continues to evolve, companies like Vercel are leading the charge in providing developers with the tools and infrastructure they need to build great user experiences quickly and efficiently. With a focus on open-source tools and frameworks, Vercel is empowering developers to push the envelope and push the future of the web.
poetryofcode
1,863,125
Understanding Scope and Scope Chain in JavaScript.
Introduction JavaScript is a popular programming language used to make websites...
0
2024-05-23T18:24:38
https://dev.to/samuel__ojerinde/understanding-scope-and-scope-chain-in-javascript-265h
## Introduction JavaScript is a popular programming language used to make websites interactive. When learning JavaScript, understanding "scope" and "scope chain" is very important. These concepts help you know where your variables and functions can be accessed or used. In this article, I'll explain what scope and scope chain are with simple examples. ## What is Scope? Scope in JavaScript refers to the area or environment where a variable or function is accessible. Think of it as a box or boundary within your code. There are mainly two types of scope in JavaScript: `global scope` and `local scope`. ### Global Scope: Variables or functions declared outside any function are in the global scope. They can be accessed from anywhere in the code. ```jsx const name = "Samuel"; function greet() { console.log("Hello, " + name); } greet(); // Outputs: Hello, Samuel console.log(name); // Outputs: Samuel ``` Here, the variable "name" is in the global scope, so it can be used inside the greet function and outside of it. ### Local Scope: Variables or functions declared inside a function are in the local scope. They can only be accessed within that function. ```jsx function greet() { const name = "Ojerinde"; console.log("Hello, " + name); } greet(); // Outputs: Hello, Ojerinde console.log(name); // Error: name is not defined ``` In this example, name is a local variable inside the greet function. Trying to access it outside the function results in an error. Keep in mind that variables declared anywhere with the `var` keyword will be available in the global scope. This is why it is recommended that you declare your variable with either `let` or `const` keyword to avoid unwanted manipulations of variables. ## What is Scope Chain? The scope chain in JavaScript is the order in which the JavaScript engine looks for variables. When you try to use a variable, JavaScript first looks in the local scope. If it doesn't find it there, it moves up to the next outer scope and keeps doing this until it reaches the global scope. ### Example of Scope Chain: ```jsx const globalVariable = "I am global"; function outerFunction() { const outerVariable = "I am outer"; function innerFunction() { const innerVariable = "I am inner"; console.log(innerVariable); // Outputs: I am inner console.log(outerVariable); // Outputs: I am outer console.log(globalVariable); // Outputs: I am global } innerFunction(); console.log(innerVariable ); // Error: innerVariable is not defined } outerFunction(); console.log(outerVariable); // Error: outerVariable is not defined ``` In this example, when `innerFunction` tries to access `innerVariable` , it finds it in its own local scope. For `outerVariable`, it goes one level up to `outerFunction's` scope. Finally, for `globalVariable`, it goes up again to the global scope. If a variable isn't found at any level, it results in an error.`` ## Conclusion Understanding scope and scope chain is important for writing effective JavaScript code. Scope helps you manage where variables and functions can be accessed, and the scope chain helps the JavaScript engine find these variables. By knowing these concepts, you can avoid errors and write cleaner, more efficient code. Remember, practice makes perfect, so keep experimenting with these ideas in your own code!
samuel__ojerinde
1,863,124
My Pen on CodePen
Check out this Pen I made!
0
2024-05-23T18:24:31
https://dev.to/etholite/my-pen-on-codepen-4ckp
codepen
Check out this Pen I made! {% codepen https://codepen.io/xyaiujlg-the-animator/pen/GRaZOWd %}
etholite
1,863,122
From Good to Great: Using AWS Well-Architected Tool for Cloud Excellence
Operation excellence, Security, Reliability, Performance Efficiency, Cost Optimisation,...
0
2024-05-23T18:23:48
https://srebreni3.medium.com/from-good-to-great-using-aws-well-architected-tool-for-cloud-excellence-1297dcd5eb1a
aws, wellarchitected, cloud, workload
Operation excellence, Security, Reliability, Performance Efficiency, Cost Optimisation, Sustainability Introduction ------------ A few years ago, AWS provided us with the AWS Well-Architected Framework on their website, which describes key concepts, design principles, and architectural best practices for designing and running workloads in the cloud. The page features six pillars: **Operational Excellence, Security, Reliability, Performance Efficiency, Cost Optimization, and Sustainability**. For each pillar, there is an option to read more about it, as well as a lab option. After some time, AWS enabled us to define workloads through the service AWS Well-Architected Tool. Today, I will write more about how excellent this service is and how it can help our workload function better than before. ![1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tamv9kll7lefmep3osh3.png) Downloaded from: [https://afdclinics.com/the-six-pillars-of-health/](https://afdclinics.com/the-six-pillars-of-health/) Prerequisites ------------- Create [AWS Account](https://aws.amazon.com/resources/create-account/). I already have an AWS Account, so I won’t be creating a new one. Define a workload ----------------- You need to do a few steps to define your workload: 1. Go to your account on AWS Console and type in the search bar **AWS Well-Architected Tool.** ![1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/axm3cpgea033q8vf0yfz.png) 2\. Click the **Define workload** orange button. ![2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oplvsebxm27k0ay2civ2.png) 3\. You need to define a few parameters for your workload, such as N**ame, Description, Review owner, Environment, and Region**. Every other parameter is **optional**. When you are finished, press the **Next** button ![3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngu3zh7alne0mbd924fk.png) ![4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rhicffavltlm4q4b3401.png) 4\. If you want, you can create a profile or search for it. I won’t do that. ![5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kym9vye3fj48rcfguybe.png) 5\. By default the **AWS Well-Architected Framework** is checked. Click the **Define workload** button. ![6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnqg2dskdwdqhqie7gqe.png) Workload overview part I ------------------------ Now that we have our workload, let’s see what options we have available. In the **overview** **section**, we have basic information such as: * Last updated * Overall questions answered * Overall risks * Workload notes ![7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8c7ko39gd446acgonya.png) The **Milestones section** is very important. In it, we store upgrades, for example, we receive results after the first review, and then based on the results we change certain things related to our application and want to perform a new upgrade. The new upgrade will be displayed in the Milestones section, just like the old one, which will remain there. The **Properties section** has properties of our workload that we set before. ![8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6y2hqxxlltw0tnug5mc.png) In the **Shares section**, we can share this with the other Principals. Start reviewing --------------- It’s time to answer the questions for each lens, just click the **Start reviewing** button. ![9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h3caxa9ja572pdsjpy85.png) We have **six pillars** on the left side, and each pillar has several questions. ![10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bw7ta1ay63izq7gytbm5.png) In the middle, we have the main question and several sub-questions. ![11](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6e3d9l40offa3hrhrlcx.png) On the right side, we have explanations for every sub-question. ![12](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eobdnifqe92zadod30sf.png) Our task now is to go through each pillar, each question, and each sub-question, and after we finish, it’s necessary to press the **Save and exit** button and **Save milestone** button. ![13](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7cnikyacj8yivwfkjuy.png) Name your milestone and click the **Save** button. ![14](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvdjzymyd0haqi4jvhyu.png) Workload overview part II ------------------------- What did you get after you answered the questions? **I got 16 high-risk and 4 medium-risk** and I have to do everything to minimize the risk. ![15](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rqczqj3x6qe3nhj0h2uf.png) How can you do the same? Scroll down and you will see **Lenses**. Click the High risks number (16). ![16](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0w9kbrnmdbix5kf3lqbr.png) You will see under the **improvement plan** what you need to improve. ![17](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtpyx63y5dirh9r31xbc.png) For example, the question is **How do you securely operate your workload?** Click the **recommended improvement items** and you will see something like this: ![18](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jg2jcjgmsxf5j6z8dv9j.png) In my case, I will go to my app and I do as recommended.Don’t forget to click every recommendation, it will guide you to AWS documentation. Continue reviewing ------------------ If you have fixed what was risky, you can go to **Continue Reviewing** and check off what you have fixed. Go to your workload under the AWS Well-Architected tool and click the **Continue reviewing** button. ![19](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjylssdzkebtrtrnrb30.png) After you have checked off what you have fixed, you need to click the **Save Milestone** button. I will name it **basketball-scoreboard-1.1**. ![20](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xgea7l50l2yceuoddbqs.png) Under the **Milestones section**, you will see your versions of the AWS Well-Architected tool. ![21](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8wa5jg2c98tg8atrlofh.png) Conclusion ---------- The AWS Well-Architected Tool is essential if you want your workload to operate according to the best AWS practices. Speaking from my experience, the AWS Well-Architected Tool has helped me a lot, especially in terms of security, so I highly recommend using it. As for pricing, there is no additional charge for the AWS Well-Architected Tool. You pay only for your underlying AWS resources. [www.ahmedsrebrenica.com](https://www.ahmedsrebrenica.com/)
srebreni3
1,863,121
VS Code for Note-Taking
Using VS Code for Note-Taking 1. Markdown Support VS Code has excellent support...
0
2024-05-23T18:23:13
https://dev.to/charudatta10/vs-code-for-note-taking-324b
vscode, tutorial, beginners, notes
## Using VS Code for Note-Taking ### 1. **Markdown Support** VS Code has excellent support for Markdown, making it a great choice for note-taking. You can create Markdown files (.md) to organize your notes, ideas, and thoughts. Markdown allows you to format text, create lists, add headings, and include code snippets. ### 2. **Workspace Setup** 1. Open VS Code and create a new folder for your notes. 2. Save the folder as a workspace (File > Open Folder). This step ensures that you can manage multiple notes within the same workspace³. ### 3. **File and Folder Organization** - Create subfolders within your workspace to categorize your notes. For example: - `Personal` - `Work` - `Projects` - `Ideas` - Use descriptive folder names to make it easy to find specific notes later. ### 4. **Task Management** VS Code allows you to automate tasks using the built-in **Tasks** feature. You can configure tasks to run scripts, start processes, and perform various actions. Here's how: 1. Create a `tasks.json` file in the `.vscode` folder within your workspace. 2. Define tasks using the appropriate task runner (e.g., TypeScript Compiler, linters, build systems). 3. Execute tasks directly from VS Code without entering the command line¹. ### 5. **Repetitive Tasks and Automation** - Use tasks to automate repetitive actions. For example: - Compile TypeScript files automatically when you save them. - Run linters to check code quality. - Trigger build processes for your projects. ### 6. **Project Management** - Create separate folders for each project within your workspace. - Organize project-related notes, code snippets, and documentation in these folders. - Use Markdown files to maintain project-specific to-do lists, milestones, and progress updates. ### 7. **Getting Things Done (GTD) Methodology** - Apply GTD principles to your note-taking process: - Capture: Quickly jot down ideas, tasks, and notes. - Organize: Sort your notes into relevant folders. - Review: Regularly review and update your notes. - Prioritize: Identify high-priority tasks and focus on them. Remember that VS Code is highly customizable, so explore extensions and settings that enhance your note-taking experience. Happy note-taking! 📝✨⁴
charudatta10
1,863,113
Commonly Used npm Flags
Commonly Used npm Flags -g (global) Cmd: npm install -g &lt;package-name&gt; Usage:...
0
2024-05-23T18:21:39
https://dev.to/sanx/commonly-used-npm-flags-563p
webdev, javascript, beginners, programming
## **Commonly Used npm Flags** **-g (global)** - **Cmd:** `npm install -g <package-name>` - **Usage:** Installs the package globally on your system, making it available from any directory. This is useful for tools and utilities you want to use across different projects. - **Example:** `npm install -g create-react-app` allows you to use the create-react-app command from anywhere on your machine. **-p (prefix)** - **Cmd:** `npm install -p <directory> <package-name>`  - **Usage:** Installs the package to a specific directory rather than the default `node_modules` in the current project. This can be used to manage packages for different environments or users. - **Example:** `npm install -p /usr/local <package-name>` installs the package to /usr/local. **-d (save-dev)** - **Cmd:** `npm install -D <package-name>` or `npm install --save-dev <package-name>`  - **Usage:** Adds the package as a development dependency. Development dependencies are only needed during development and testing, not in production.  - **Example:** `npm install -D jest` adds jest to your devDependencies in `package.json`   ```json { "dependencies": { "express": "^4.17.1" }, "devDependencies": { "jest": "^27.0.6" } } ``` ## **Other Common npm Flags** **--save(-S)** - **Cmd:** `npm install -S <package-name>` or `npm install <package-name>`  - **Usage:** Adds the package as a dependency in your `package.json`. This is the default behavior when you run `npm install <package-name>`  - **Example:** `npm install express` will add express to the dependencies in `package.json`  **--save-optional (-O)** - **Cmd:** `npm install -O <package-name>` - **Usage:** Adds the package as an optional dependency. These dependencies are not critical for the project to function but can add optional features. - **Example:** `npm install -O fsevents` adds fsevents to optionalDependencies. **--save-exact (-E)** - **Cmd:** `npm install -E <package-name>`  - **Usage:** Installs the exact version specified without updating to newer versions. - **Example:** `npm install -E lodash` installs the exact version listed, e.g., `lodash@4.17.21` **--production** - **Cmd:** `npm install --production` - **Usage:** Installs only the dependencies listed under dependencies and skips devDependencies. Useful for deployment. - **Example:** `npm install --production` ensures only necessary packages for running the app are installed. **Summary** - -g: Global installation - -p: Specify installation directory - -d: Development dependencies - --save: Default dependency installation (often implicit) - -O: Optional dependencies - -E: Exact version installation - --production: Production-only installation These flags help configure your environment and dependencies according to your project needs. Thank You!!! Follow on: [Linkedin](https://www.linkedin.com/in/sanjay-r-ab6064294/), [Instagram](https://www.instagram.com/_sanjayxr_12_/), [Medium](https://medium.com/@sanjayxr)
sanx
1,787,914
Github fundamentals training + free exam vocher
🌟 GitHub and Microsoft helping you to boost your career in tech by launching Get Certified with...
0
2024-05-23T18:20:33
https://dev.to/learnwithsrini/github-fundamentals-training-free-exam-vocher-326n
github, certification, git
🌟 GitHub and Microsoft helping you to boost your career in tech by launching Get Certified with GitHub Live series! 💻 🌎 From June 5th to June 26th we will help you get prepared to take the GitHub Foundation Certification with the support of Microsoft and GitHub experts! You will learn how to collaborate on a project and with teams to grow your knowledge by using different tools like GitHub Copilot, GitHub Codespaces and more! 🎉 Plus, you'll have the chance to earn a free certification voucher for the GitHub Foundation Certification. Registrer here: https://lnkd.in/gHbje8F8 💡 Find out how you can get a free voucher to take this certification https://lnkd.in/gZcCCYD2 and share this amazing news with your friends! Initial Post Reference : https://www.linkedin.com/posts/srinivasuluparanduru_learn-live-get-certified-with-github-activity-7197547214007586817-B_ps?utm_source=share&utm_medium=member_ios
srinivasuluparanduru
1,863,118
سایت حضرات بدون فیلتر
سایت حضرات https://hazaratiha.com/ دارای انواع درگاه‌های معتبر بانکی، درگاه کارت به کارت، پرفکت مانی...
0
2024-05-23T18:19:14
https://dev.to/reza_cfbdd6e882501b/syt-hdrt-bdwn-fyltr-5le
webdev, javascript, programming, beginners
سایت حضرات [https://hazaratiha.com/](https://hazaratiha.com/) دارای انواع درگاه‌های معتبر بانکی، درگاه کارت به کارت، پرفکت مانی و ارز دیجیتال است. برداشت فوری جوایز: این سایت همیشه سعی می‌کند تا پس از برداشت پول از حضرات توسط کاربران، جوایز آنها را در سریع ترین زمان ممکن واریز کند.
reza_cfbdd6e882501b
1,863,117
An Ultimate Guide On How To Mine Dogecoin
Going through this article, you will learn if Dogecoin is mineable, and what hardware and software...
0
2024-05-23T18:18:56
https://dev.to/neyamif758/an-ultimate-guide-on-how-to-mine-dogecoin-1ia6
mine, dogecoin, mining
Going through this article, you will learn if Dogecoin is mineable, and what hardware and software you will need. Moreover, we will focus on how long it takes to mine Dogecoin if it is profitable and much more. **How To Mine For Dogecoin? **Mining doesn't mean that you have to go into a mine and search for the crypto, and similarly, you won't need to transform into a mining attire. Mining Dogecoin means the transactions are confirmed on the DOGE blockchain and rewards are given in return. Dogecoin mining includes recording and validating the transactions on the Dogecoin blockchain, a public ledger necessary for the operations of cryptos. In this mining operation, the users are given new DOGE crypto for mining each block successfully, catering to the supply of crypto. Mining is crucial to maintaining the decentralization of the DOGE network and to maintaining the integrity of the process. Miners can use different methods, including GPU mining, CPU mining, pool mining and others. Once the DOGE has been mined they can be safely stored in software wallets, providing easy management and access. Such mining activities are necessary for the Dogecoin ecosystem, to maintain its security and stability. [Read more; ](https://blockdag.network/blog/how-to-mine-dogecoin)
neyamif758
1,863,114
How to Add a Canonical URL to Your dev.to Post
How to Add a Canonical URL to Your dev.to Post using Metadata
0
2024-05-23T18:13:21
https://dev.to/_hariti/how-to-add-a-canonical-url-to-your-devto-post-69g
--- title: How to Add a Canonical URL to Your dev.to Post published: true description: How to Add a Canonical URL to Your dev.to Post using Metadata tags: # cover_image: https://direct_url_to_image.jpg # Use a ratio of 100:42 for best results. # published_at: 2024-05-23 18:10 +0000 --- Hello dev.to community! 👋 If you're here, you probably already have a few posts under your belt and are familiar with using front matter to add metadata to your dev.to articles. Adding a canonical URL is a crucial step for those of us who cross-post content from our personal blogs or other platforms. It helps with SEO by indicating the original source of your content, ensuring search engines know where the content was first published. ## Step-by-Step Guide to Adding a Canonical URL 1. **Open Your Post in the Editor** - Navigate to your dev.to dashboard and open the post you want to edit. If you’re creating a new post, start a new draft. 2. **Access the Markdown Editor** - Make sure you’re in the markdown editor. This is where you’ll add your front matter. 3. **Modify the Front Matter** - At the top of your post, you should already have some front matter in YAML format. This is where you add metadata like the title, description, and tags. 4. **Add the Canonical URL** - Include the `canonical_url` field in your front matter. Here’s how your front matter should look: ```markdown --- title: "Your Post Title" published: true description: "A brief description of your post" tags: programming, tutorial, devto canonical_url: "https://yourwebsite.com/your-original-post" --- Your post content goes here... ``` Replace `https://yourwebsite.com/your-original-post` with the actual URL of your original content. 5. **Save and Publish** After adding the canonical URL, save your changes and publish your post. This will tell search engines that the original source of the content is the URL you provided, helping to avoid duplicate content issues. If you liked this post, give it a 🦄 :)
_hariti
1,863,112
The Power of Digital Marketing: Revolutionizing Business Strategies
In today's digital age, the term "digital marketing" has become ubiquitous, reshaping the way...
0
2024-05-23T18:11:51
https://dev.to/techybusinesses/the-power-of-digital-marketing-revolutionizing-business-strategies-2lkg
webdev
In today's digital age, the term "digital marketing" has become ubiquitous, reshaping the way businesses connect with their audiences. But what exactly is digital marketing? Simply put, it encompasses all marketing efforts that leverage digital channels to reach and engage with customers. From search engines to social media, [digital marketing](https://www.techybusinesses.com/category/digital-marketing/) has revolutionized the way brands communicate, sell, and grow. ## Definition of Digital Marketing Digital marketing encompasses a myriad of online tactics aimed at promoting products or services. These tactics include [SEO](https://www.techybusinesses.com/category/seo/), content marketing, social media advertising, email campaigns, and more. Unlike traditional marketing, which relies on print ads or TV commercials, digital marketing harnesses the power of the internet to target specific audiences and track campaign performance in real-time. ## Importance in the Modern Business Landscape In today's hyper-connected world, digital marketing is not just an option; it's a necessity for businesses of all sizes. With consumers spending increasing amounts of time online, brands must meet them where they are. Digital marketing allows businesses to expand their reach, engage with customers on a personal level, and drive measurable results—all while staying ahead of the competition. ## Understanding Digital Marketing To fully grasp the impact of digital marketing, it's essential to understand its core concepts and the evolution it has undergone over the years. ## Core Concepts At the heart of digital marketing lies the concept of reaching the right audience, with the right message, at the right time. This involves understanding consumer behavior, leveraging data insights, and crafting compelling content that resonates with your target market. ## Digital Marketing Channels Digital marketing encompasses a diverse range of channels, each with its unique strengths and opportunities. From search engines like Google to social media platforms such as Facebook and Instagram, businesses have numerous avenues to connect with their audience and drive conversions. ## Evolution over the Years Digital marketing has evolved significantly since its inception, adapting to changes in technology and consumer behavior. What started with basic websites and email campaigns has now expanded to include advanced strategies like AI-powered chatbots, influencer marketing, and immersive experiences like virtual reality. ## Key Components To succeed in digital marketing, businesses must master a variety of key components that form the foundation of effective online campaigns. ## Search Engine Optimization (SEO) SEO is the process of optimizing your website to rank higher in search engine results pages (SERPs), driving organic traffic and improving visibility. ## Content Marketing Content is king in the digital realm. Whether it's blog posts, videos, or social media updates, compelling content attracts and engages audiences, driving brand awareness and loyalty. ## Social Media Marketing Social media platforms offer unparalleled opportunities for businesses to connect with customers, build relationships, and promote products or services through targeted advertising and engaging content. ## Email Marketing Despite the rise of new channels, email remains a powerful tool for nurturing leads, driving sales, and maintaining customer relationships through personalized campaigns and automated workflows. ## Pay-Per-Click (PPC) Advertising PPC advertising allows businesses to bid for ad placement in search engine results or on websites, paying a fee each time their ad is clicked. This model offers instant visibility and control over ad spend. ## Analytics and Data Analysis Data-driven decision-making is at the core of successful digital marketing campaigns. By analyzing metrics like website traffic, conversion rates, and customer behavior, businesses can refine their strategies and maximize ROI. ## Digital Marketing Strategies Crafting an effective digital marketing strategy requires careful planning, execution, and optimization across various fronts. ## Target Audience Identification Understanding your target audience is the first step towards crafting relevant and impactful marketing messages. By defining buyer personas and segmenting your audience based on demographics, interests, and behaviors, you can tailor your campaigns for maximum effectiveness. ## Content Strategy A well-defined content strategy ensures that your messaging is consistent, valuable, and aligned with your business objectives. From blog posts and ebooks to videos and infographics, creating high-quality content that educates, entertains, or inspires your audience is key to building trust and driving conversions. ## Conversion Optimization Optimizing your digital assets—from landing pages to checkout processes—is crucial for converting visitors into customers. By testing different elements, analyzing user behavior, and making data-driven improvements, you can enhance the user experience and maximize conversion rates. ## Branding Techniques Digital marketing offers endless opportunities for brand building, from creating compelling visuals and storytelling to engaging with customers in meaningful ways across social media platforms. ## Customer Engagement Building long-term relationships with customers is essential for sustainable business growth. Digital marketing enables brands to engage with their audience in real-time, respond to feedback, and provide personalized experiences that foster loyalty and advocacy. ## Benefits of Digital Marketing The [benefits of digital marketing](https://www.techybusinesses.com/category/digital-marketing/) extend far beyond increased visibility and brand awareness. Let's explore some of the key advantages it offers businesses in today's competitive landscape. ## Increased Reach Digital marketing breaks down geographical barriers, allowing businesses to reach customers anywhere in the world. Whether you're a small local shop or a global enterprise, digital channels offer unprecedented opportunities for expansion and growth. ## Cost-Effectiveness Compared to traditional advertising methods, digital marketing is often more cost-effective, allowing businesses to achieve greater results with smaller budgets. With pay-per-click advertising, for example, you only pay when someone clicks on your ad, ensuring that your marketing dollars are spent efficiently. ## Targeted Advertising Digital marketing enables precise targeting, ensuring that your message reaches the right audience at the right time. Through advanced targeting options, businesses can tailor their ads based on factors like demographics, interests, and online behavior, maximizing relevance and engagement. ## Measurable Results One of the biggest advantages of digital marketing is its measurability. Unlike traditional marketing methods, which can be difficult to track and quantify, digital campaigns provide real-time data and insights into campaign performance, allowing businesses to optimize their strategies for maximum impact. ## Enhanced Customer Relationships Digital marketing fosters two-way communication between brands and customers, allowing for personalized interactions and meaningful engagement. Whether it's responding to customer inquiries on social media or sending personalized email campaigns, digital channels offer numerous opportunities to connect with your audience on a personal level. ## Challenges and Solutions While digital marketing offers numerous benefits, it also presents its fair share of challenges. Let's explore some common obstacles and how businesses can overcome them. ## Competition With more businesses entering the digital space, competition is fiercer than ever. To stand out from the crowd, businesses must differentiate themselves through unique value propositions, compelling messaging, and exceptional customer experiences. ## Rapid Technological Changes The digital landscape is constantly evolving, with new technologies and trends emerging at a rapid pace. To stay ahead of the curve, businesses must embrace innovation, adapt to change, and continuously invest in learning and development. ## Information Overload In today's digital world, consumers are bombarded with messages from countless brands vying for their attention. To cut through the noise, businesses must deliver relevant, valuable content that resonates with their audience and addresses their specific needs and pain points. ## Adapting Strategies Flexibility is key in digital marketing. What works today may not work tomorrow, so businesses must be agile and willing to pivot their strategies based on changing market conditions, consumer preferences, and technological advancements. ## Future Trends As technology continues to advance, the future of digital marketing holds exciting possibilities. Let's explore some emerging trends that are shaping the future of the industry. ## Artificial Intelligence in Marketing AI is revolutionizing digital marketing, enabling businesses to automate tasks, personalize experiences, and predict consumer behavior with unprecedented accuracy. ## Voice Search Optimization With the rise of voice-activated devices like smart speakers and virtual assistants, optimizing content for voice search is becoming increasingly important for businesses looking to stay ahead of the curve. ## Augmented Reality Marketing AR technology is blurring the lines between the digital and physical worlds, allowing businesses to create immersive brand experiences that engage and delight customers in new and exciting ways. ## Personalization Trends Consumers today expect personalized experiences from the brands they interact with. By leveraging data and AI-driven insights, businesses can deliver hyper-targeted messaging and offers that resonate with individual preferences and behaviors. ## FAQs (Frequently Asked Questions) What is Digital Marketing? Digital marketing refers to the use of online channels and platforms to promote products or services, connect with customers, and drive business growth. How does Digital Marketing differ from Traditional Marketing? While traditional marketing relies on offline channels like print ads and TV commercials, digital marketing leverages digital channels such as search engines, social media, and email to reach and engage with audiences. What are some effective Digital Marketing strategies for small businesses? Effective digital marketing strategies for small businesses include creating a strong online presence through social media, optimizing their website for search engines, leveraging email marketing campaigns, and engaging with customers through content marketing. How important is social media in Digital Marketing? Social media plays a crucial role in digital marketing, providing businesses with a platform to connect with their audience, build brand awareness, and drive engagement through targeted advertising and compelling content. What role does content play in Digital Marketing? Content is at the core of digital marketing, serving as the foundation for all online efforts. From blog posts and videos to social media updates and email newsletters, compelling content attracts, educates, and engages audiences, driving conversions and building brand loyalty. How can businesses measure the success of their Digital Marketing efforts? Businesses can measure the success of their digital marketing efforts through key performance indicators (KPIs) such as website traffic, conversion rates, engagement metrics, and return on investment (ROI). By tracking these metrics over time, businesses can evaluate the effectiveness of their campaigns and make data-driven decisions to optimize performance. ## Conclusion In conclusion, digital marketing has emerged as a powerful force in today's business landscape, offering unprecedented opportunities for brands to connect with customers, drive growth, and stay ahead of the competition. By understanding the core concepts, mastering key components, and embracing emerging trends, businesses can harness the full potential of digital marketing to achieve their goals and thrive in an increasingly digital world.
techybusinesses
1,859,371
Exploring the top 5 pair programming tools
Written by Elijah Asaolu✏️ Distance is no longer a barrier to collaboration. Advancements in...
0
2024-05-23T18:10:47
https://blog.logrocket.com/exploring-top-pair-programming-tools
webdev, pairprogramming
**Written by [Elijah Asaolu](https://blog.logrocket.com/author/asaoluelijah/)✏️** Distance is no longer a barrier to collaboration. Advancements in collaborative technology have made working together— even across continents — as easy as if you were sitting side by side with your colleagues. Among these innovations, pair programming tools stand out in the software engineering domain. These applications enable developers to work together on the same project, share their development environments, edit code in real-time, execute terminal commands, and much more. In this article, we'll explore the top five pair programming tools. We'll review how to use them, their features and any drawbacks, and their pricing models. Finally, we’ll look at the good and ugly aspects of pair programming, as well as how to make the most of pair programming sessions to ensure effective collaboration. ## What is pair programming? Pair programming is a collaborative approach where two programmers work together at one workstation. One, the "driver," writes code, while the other, the "observer" or "navigator," reviews each line of code as it is typed. The roles can switch frequently, enabling a dynamic collaborative environment. You can leverage pair programming tools during these sessions, but it’s worth mentioning that they are pretty distinct from traditional screen-sharing applications. They don't allow full control over the host's screen space but focus specifically on the code environment and terminal access. Some pair programming tools may offer features similar to screen-sharing tools, but their primary focus on the coding environment reduces latency and makes real-time collaboration on code more effective. ### Best practices for efficient pair programming Pair programming has benefits and drawbacks. On the bright side, it increases productivity — as developers get to simultaneously work on and review the same code, things get fixed and reviewed faster. However, one major drawback of these tools is unintentional code conflicts and overrides during collaboration sessions. Plus, not all developers are comfortable with this collaborative approach, which may limit their productivity. To mitigate the issue of code conflicts, always communicate properly with your partner before making major edits. Of course, this is in addition to integrating version control tools. Additionally, be sure to set up a distraction-free environment, reliable internet, and pre-test tools to prevent technical issues during sessions. ## Top 5 pair programming tools So far, we’ve briefly reviewed the concept of pair programming and discussed a few best practices to help you get the most out of your pair programming session. Let’s now dive into the top five pair programming tools, exploring their features, how to use them, their advantages, and their pricing models. ### Live Share, a VS Code extension Live Share is a real-time collaboration feature developed by the team behind Visual Studio Code. It allows multiple developers to work on the same codebase simultaneously within their individual VS Code environments. When using Live Share, changes made by one person are instantly reflected for everyone else in the session. You can see each other's cursors move, and edits happen live as if you're working side by side. #### How to use Live Share You can access Live Share as an extension within VS Code. To add it to your IDE, navigate to the VS Code Extension Store, search for [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare), and install it. Once installed, a new icon will appear in your IDE, indicating where to initiate or join a collaboration session: ![Red Box And Red Arrow With Text Indicating How To Initiate Or Join A Collaboration Session Using Live Share In Visual Studio Code](https://blog.logrocket.com/wp-content/uploads/2024/05/img1-Initiate-join-collab-session-Live-Share-VS-Code.jpg) Sharing a session is straightforward. You can select one of two options: * **Share (Read/Write)** allows the person you're inviting to read and edit the files in your project * **Share (Read-Only)** allows them to read but not modify the files After picking one of these options, you'll receive an instant link to share with your collaborator. Check out the video below of an example collaborative session using Live Share: ![Example Collaboration Session Using Live Share](https://blog.logrocket.com/wp-content/uploads/2024/05/img2-Live-Share-collaboration-session-example.gif) #### Key Live Share features and drawbacks Some standout features of Live Share include: * **Real-time code collaboration:** Edit and debug code simultaneously in real-time * **Shared terminal sessions:** Execute terminal commands together * **Access control:** Manage permissions for who can edit or view the code * **Seamless integration:** There's no need for collaborators to have the same development environment set up. Everyone can use their personalized VS Code configurations while collaborating However, there’s one significant drawback you should keep in mind: * **No integrated audio and text chat:** There is no way to communicate within the IDE without external tools While integrated communication features would be nice to have in Live Share, you can still benefit from this powerful tool as long as you have some other way to chat while you code. #### Pricing for Live Share As of the time of writing this article, Live Share is completely free to use. The [team may introduce paid tiers](https://learn.microsoft.com/en-us/visualstudio/liveshare/faq#how-much-will-it-cost-) with more advanced features, but has not shared any concrete plans for this yet. ### Replit Multiplayer [Replit Multiplayer](https://replit.com/site/multiplayer) is a built-in Replit feature that transforms its IDE into a powerful real-time collaboration environment. It allows multiple developers to work on the same project simultaneously within their web browsers without having to install a third-party application. #### How to use Replit Multiplayer Replit Multiplayer requires no additional setup. Anyone with a Replit account instantly has access to it. Start by creating a new Repl project or opening an existing one in your Replit workspace. In your new Replit workspace, click the **Invite** button at the top-right corner to invite collaborators by username, email, or by generating a shareable join link: ![Demo Of How To Use The Invite Button In Replit Multiplayer](https://blog.logrocket.com/wp-content/uploads/2024/05/img3-Invite-button-Replit-Multiplayer.jpg) Once your collaborators accept the invite and join the session, you'll see their cursors moving in the code editor, reflecting changes in real-time, similar to Live Share: ![Example Collaboration Session In Replit Multiplayer](https://blog.logrocket.com/wp-content/uploads/2024/05/img4-Collaboration-session-Replit-Multiplayer.jpg) #### Key Replit Multiplayer features and drawbacks A significant benefit of Replit Multiplayer is that it automatically comes with your Replit account, making it incredibly easy to get a pair programming session started. Some of its other standout features include: * **Real-time collaboration:** Code together seamlessly, with edits made by one person instantly visible to everyone else * **Shared workspace:** All participants can access the same files, terminal, and interpreter, ensuring a unified coding environment * **Integrated chat:** Communicate and discuss code changes directly within the Replit interface using the built-in chat window Meanwhile, you should be aware of limitations such as: * **Limited file system integration:** Replit primarily focuses on cloud-based projects. Uploading and working with local files require additional workarounds * **Browser dependence:** Collaboration is restricted to web browsers, potentially limiting compatibility with some developer workflows Depending on your workflow and project needs, these drawbacks may not really hinder you from using Replit Multiplayer. It’s still a worthwhile tool to consider, especially if you’re already familiar with Replit. #### Pricing for Replit Multiplayer Replit Multiplayer is completely free to use with your Replit account. However, the Replit platform offers multiple pricing models to access some of its advanced features. ### CodeSandbox CDE CodeSandbox offers a unique approach to real-time collaboration with its instant [Cloud Development Environment (CDE)](https://codesandbox.io/blog/introducing-codesandbox-cde). This feature eliminates the need for lengthy local environment setups and allows every developer to work in a clean, isolated virtual machine (VM) dedicated to each branch or pull request. #### How to use CodeSandbox CDE Getting started with CodeSandbox CDE is straightforward. Sign up for a free CodeSandbox account or use your existing account. Next, start a new project or open an existing codebase within your CodeSandbox workspace: ![Showing How To Create A New Code Sandbox Project](https://blog.logrocket.com/wp-content/uploads/2024/05/img5-New-CodeSandbox-project.jpg) Finally, share the project with your team members using invite links or access controls. Invited team members can open the running collaborative cloud environment instantly with a single click. #### Key CodeSandbox CDE features The one-click simplicity of CodeSandbox CDE is a huge advantage when it comes to live coding. Other great features of this pair programming tool include: * **Instant development environments:** No more waiting for local setups. CodeSandbox spins up dedicated VMs for each branch or pull request, ensuring a clean and isolated workspace for everyone * **Secure workspaces:** CodeSandbox CDE provides robust security features like flexible permissions, access control, and security monitoring to safeguard your code * **Enhanced workflow:** You can also integrate various development tools like linters and debuggers directly within CodeSandbox CDE to further streamline your development process Despite these benefits, CodeSandbox CDE also has two significant drawbacks: * **No integrated audio and text chat:** There is no way to communicate within the IDE without external tools * **No cursor movement:** Unlike the other tools we've looked at, CodeSandbox does not yet display individual cursor movements in the code editor As with Live Share, you can still benefit from CodeSandbox IDE if you can counter the lack of communication features with other tools. However, not being able to see individual cursor movements might make live collaboration a little more challenging, so think carefully about whether this drawback outweighs the other beneficial features. #### Pricing for CodeSandbox CDE CodeSandbox utilizes a usage-based billing model. Costs can vary depending on your team's specific usage patterns. They offer [various paid plans](https://codesandbox.io/pricing) with different feature sets and pricing structures, including a very basic free tier for those who are just getting started. ### Duckly Duckly enhances real-time code collaboration by integrating video chat right into your development environment. Its solution allows developers to work on code simultaneously while seeing each other's faces, enabling clear communication and effective problem-solving during pair programming sessions. #### How to use Duckly Duckly is available as an extension for the [most popular IDEs](https://duckly.com/tools). To get started, install the Duckly extension from your IDE's extensions marketplace. Alternatively, you could use their web app. To start a session, click the Duckly extension icon in your IDE, as shown below: ![Duckly Extension Icon In Example Integrated Development Environment](https://blog.logrocket.com/wp-content/uploads/2024/05/img6-Duckly-extension-icon-IDE.jpg) Next, you’ll be prompted to sign into your account, after which you can now generate an invitation link to share with your collaborators. The screenshot below also shows an interactive collaboration session on Duckly, as seen on their website: ![Interactive Collaboration Session With Integrated Video Chat In Duckly](https://blog.logrocket.com/wp-content/uploads/2024/05/img7-Interactive-collaboration-integrated-video-chat-Duckly.jpg) #### Key Duckly features and drawbacks Pair programming with Duckly is almost like collaborating face-to-face, thanks to features like the following: * **Integrated video chat**: Communicate visually with your collaborators directly within your IDE using the built-in video chat feature. Keep in mind this is a premium feature, although Duckly’s audio sharing capabilities are available on its free plan * **Native IDE integration**: Duckly functions as an extension for various popular IDEs, eliminating compatibility concerns and ensuring a smooth workflow * **Multiple collaboration modes**: Choose between screen sharing and cursor mirroring based on your specific collaboration needs While Duckly is one of the few pair programming tools that offers integrated video chat, keep the following drawback in mind as well: * **Limited free plan features**: The free plan might have limitations on session duration, participant numbers, and functionalities If you have a smaller team and only need to collaborate during shorter sessions, Duckly’s free plan may be sufficient for your needs. However, if you need any of its more advanced features, longer sessions, or more participants, you could consider one of its paid tiers — or turn to one of the other tools on this list. #### Pricing for Duckly Duckly's free plan includes real-time code sharing and audio sharing capabilities. To enjoy the video call functionality and unlock extra call minutes, you'll have to upgrade to a premium plan, which starts at $6 per month. This could still be a worthwhile investment, especially if you value integrated audio and video features. ### Codeanywhere [Codeanywhere](https://codeanywhere.com/) is a cloud-based development environment that allows you to code, edit, debug, and collaborate on projects from anywhere with a web browser. It provides a familiar development environment similar to the VS Code IDE, but it eliminates the need for complex setup and software installations. #### How to use Codeanywhere To get started, sign up for a free Codeanywhere account using your email address or existing Google or GitHub account. Next, link your Codeanywhere account to your preferred version control system (VCS), such as GitHub, GitLab, or Bitbucket. This connection allows you to access your existing repositories and projects seamlessly. Once connected to your VCS, you can select an existing repository from your VCS account to create a new workspace or explore a variety of pre-configured development environment templates for popular languages and frameworks: ![Code Anywhere Version Control System Connection Prompting Developer To Select An Existing Repository Or A Preconfigured Template](https://blog.logrocket.com/wp-content/uploads/2024/05/img8-Codeanywhere-VCS-connection-select-repository-preconfigured-template.jpg) After clicking the **Create** button, your new development environment should start up and appear in your browser. Finally, back on your Codeanywhere dashboard, you can share your workspace with collaborators and start working in real-time: ![Sharing Code Anywhere Workspace With Collaborators](https://blog.logrocket.com/wp-content/uploads/2024/05/img9-Share-Codeanywhere-workspace-collaborators.jpg) #### Key Codeanywhere features and drawbacks Codeanywhere comes with similar features to the other pair programming tools we’ve discussed: * **Version control integration:** Seamless integration with popular VCS platforms like GitHub, GitLab, and Bitbucket for efficient version management * **Real-time collaboration:** Share your workspace with collaborators and work on the same project files simultaneously * **SSH connection:** Codeanywhere allows you to connect to your workspace using SSH for added flexibility and access to command-line functionalities Its VCS integration capability stands out as a particular advantage. However, keep these drawbacks in mind as well: * **Limited free plan features:** The free plan has limitations on storage space, private workspaces, and collaborator numbers * **No live editing view:** Unlike some of the tools we’ve explored, Codeanywhere doesn't provide a view of who is editing what part of the code in real-time The absence of a live editing view isn’t great, but if version control is critical in your workflow, Codeanywhere is a great choice. ## Pair programming tools comparison table So, which pair programming tool will you choose for your next collaborative coding session? Here’s a table comparing each of the tools we discussed side by side: <table> <thead> <tr> <th></th> <th>Live Share</th> <th>Replit Multiplayer</th> <th>CodeSandbox CDE</th> <th>Duckly</th> <th>Codeanywhere</th> </tr> </thead> <tbody> <tr> <td>Real-time code collaboration</td> <td>✅ (Supports live cursor movement)</td> <td>✅ (Supports live cursor movement)</td> <td>✅</td> <td>✅ (Supports live cursor movement)</td> <td>✅</td> </tr> <tr> <td>Shared workspace</td> <td>Local and Cloud (VS Code)</td> <td>Cloud only (Web-based IDE)</td> <td>Cloud only (VM-based IDE)</td> <td>Local and Cloud (Various IDEs)</td> <td>Cloud only (VS Code-like IDE)</td> </tr> <tr> <td>Security/access control</td> <td>✅</td> <td>✅</td> <td>✅</td> <td>✅</td> <td>✅</td> </tr> <tr> <td>Integration</td> <td>Moderate (VS Code)</td> <td>Moderate (Web-based)</td> <td>High (Cloud IDE)</td> <td>High (Supports multiple IDEs)</td> <td>High (Cloud IDE)</td> </tr> <tr> <td>Integrated audio/video sharing capabilities</td> <td>❌</td> <td>❌</td> <td>❌</td> <td>✅</td> <td>❌</td> </tr> <tr> <td>Integrated text chat capabilities</td> <td>❌</td> <td>✅</td> <td>❌</td> <td>✅</td> <td>❌</td> </tr> </tbody> </table> This table should help you evaluate these five tools’ features against your project’s requirements so you can choose the ideal option for your needs. ## Conclusion In this article, we covered what pair programming tools are, how they differ from traditional screen-sharing apps, and some best practices for an effective pair programming session. We also reviewed the top five pair programming tools, including how to use them, their features, drawbacks, and pricing models. While this is not a comprehensive list of pair programming tools, we covered five of the most popular and fully featured options. If you're interested in checking out more in-depth tutorials on three other options, take a look at our guides to the [Zed code editor written in Rust](https://blog.logrocket.com/exploring-zed-open-source-code-editor-rust/#exploring-zed-collaboration-pair-programming-capabilities), [Cody AI](https://blog.logrocket.com/leveraging-cody-ai-better-more-efficient-code/), and [Ghostwriter, a GitHub Copilot alternative](https://blog.logrocket.com/ghostwriter-github-copilot-alternative/). For more tips on how to make your pair programming sessions even more effective, check out this article by Martin Fowler: [On Pair Programming](https://martinfowler.com/articles/on-pair-programming.html). --- ##Get set up with LogRocket's modern error tracking in minutes: 1. Visit https://logrocket.com/signup/ to get an app ID. 2. Install LogRocket via NPM or script tag. `LogRocket.init()` must be called client-side, not server-side. NPM: ```bash $ npm i --save logrocket // Code: import LogRocket from 'logrocket'; LogRocket.init('app/id'); ``` Script Tag: ```javascript Add to your HTML: <script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script> <script>window.LogRocket && window.LogRocket.init('app/id');</script> ``` 3.(Optional) Install plugins for deeper integrations with your stack: * Redux middleware * ngrx middleware * Vuex plugin [Get started now](https://lp.logrocket.com/blg/signup)
leemeganj
1,863,110
How to Integrate Stripe Payment Gateway with nxtbn
Integrating a payment gateway into your e-commerce platform is crucial for handling online...
0
2024-05-23T18:05:56
https://dev.to/nxtbnexpert/how-to-integrate-stripe-payment-gateway-with-nxtbn-7j0
Integrating a payment gateway into your e-commerce platform is crucial for handling online transactions smoothly and securely. nxtbn, which stands for "next billion native commerce," is a high-performance e-commerce CMS built for Python and its web framework django, designed to cater efficiently to the next billion internet users. This guide will walk you through integrating the Stripe payment gateway into your nxtbn architecture. ## Prerequisites Before you begin, ensure that you have: - An account with Stripe (create one at [Stripe's website](https://stripe.com)). - Access to the nxtbn unified payment gateway architecture. - Basic knowledge of Python, as nxtbn's plugins are developed using this language. ## Step 1: Set Up Your Stripe Account Log into your Stripe account and retrieve your API keys from the Dashboard under Developers > API keys. You will need both the publishable key and the secret key for the integration. ## Step 2: Create the Stripe Payment Plugin Create a new Python file named `stripe_plugin.py` in the `nxtbn.payment.plugins/` directory of your nxtbn project. This directory automatically registers any plugins placed within it, simplifying the setup process. Here’s how you can code the Stripe payment plugin: ``` from nxtbn.payment.base import PaymentPlugin, PaymentResponse import stripe class StripePaymentPlugin(PaymentPlugin): def __init__(self, secret_key): self.stripe = stripe self.stripe.api_key = secret_key def process_payment(self, amount, currency, customer_details): try: charge = self.stripe.Charge.create( amount=amount, # Amount should be in cents currency=currency, description='Charge for ' + customer_details['email'], source=customer_details['token'] # Obtained via Stripe.js ) return PaymentResponse(success=True, transaction_id=charge['id']) except stripe.error.StripeError as e: return PaymentResponse(success=False, error=str(e)) def refund_payment(self, transaction_id, amount): try: refund = self.stripe.Refund.create( charge=transaction_id, amount=amount # Amount in cents to refund ) return PaymentResponse(success=True, transaction_id=refund['id']) except stripe.error.StripeError as e: return PaymentResponse(success=False, error=str(e)) ``` This plugin initializes Stripe with a secret key and handles both payment processing and refunds. ## Step 3: Testing Before going live, thoroughly test your integration in a controlled environment using Stripe's test API keys and test credit card numbers. This ensures that your integration works correctly without actual financial transactions. ## Step 4: Go Live Once you are confident in the functionality and security of your integration, switch the test API keys with your live Stripe API keys to start handling real transactions. ## Conclusion Integrating Stripe into your nxtbn architecture leverages a powerful payment processing system that enhances your platform's capability to handle transactions reliably. With nxtbn's auto-registration of plugins, setting up and starting your Stripe integration becomes a streamlined process, allowing you to focus more on other aspects of your business. This integration not only boosts your platform's performance but also aligns with nxtbn's mission to empower the next billion users with robust, native commerce solutions.
nxtbnexpert
1,863,108
Understanding Git Worktrees: A Solution to Multi-Branch Development
In this article, we will explore the concept of Git worktrees and how they can be used to work on multiple branches simultaneously.
0
2024-05-23T18:05:26
https://abdellahcodes.xyz/posts/git-worktree/
git, worktree, developer
--- title: "Understanding Git Worktrees: A Solution to Multi-Branch Development" published: true description: "In this article, we will explore the concept of Git worktrees and how they can be used to work on multiple branches simultaneously." tags: - git - worktree - developer # cover_image: https://direct_url_to_image.jpg # Use a ratio of 100:42 for best results. # published_at: 2024-05-23 17:59 +0000 canonical_url: https://abdellahcodes.xyz/posts/git-worktree/ --- ## Introduction Imagine you're working on a new feature in a Git repository, and suddenly, you need to switch to another branch to fix a critical bug. You could commit your changes, switch branches, and then switch back, but that's cumbersome and can lead to a messy commit history. Alternatively, you could stash your changes, switch branches, and then apply the stash, but that's not always ideal either. This is where Git worktrees come in. Git worktrees allow you to check out multiple branches simultaneously, each in its own working directory, without the need for stashing or committing changes. In this article, we'll explore what Git worktrees are, the problems they solve, how they compare to git stash, and briefly touch on some other alternatives for managing multi-branch development. ## Setting Up a Worktree To create a new worktree, you can use the following commands: ```bash # Create a new worktree for an existing branch git worktree add ../path/to/new-worktree branch-name # Create a new worktree and a new branch git worktree add -b new-branch ../path/to/new-worktree orktree add <path> <branch> ``` This will create a new worktree in the specified directory and check out the specified branch. You can now work on the new branch independently of the original worktree. ## Comparing Worktrees to Git Stash Git stash is another popular feature used to save uncommitted changes temporarily. While it serves a similar purpose to worktrees, there are some key differences: - **Visibility**: Stashed changes are hidden from the working directory, making it easy to forget about them. Worktrees, on the other hand, provide a more visible and structured way to manage multiple branches. - **Context switching**: With stashes, you need to remember which stash corresponds to which branch. Worktrees provide a more intuitive way to switch between branches. - **Workflow**: Stashes are more suited for short-term changes that you plan to apply quickly. Worktrees are better for long-term context switching and multi-branch development. ## Other Alternatives While worktrees and stashes are the most common solutions for managing multiple branches, there are a few other alternatives worth exploring: Besides git stash, there are a few other strategies and tools to manage multi-branch development: ### Multiple Clones: You can clone the same repository into different directories. While this allows simultaneous work on multiple branches, it is highly inefficient in terms of disk space and can lead to synchronization issues. ### Git Submodules: Git submodules allow you to keep a Git repository as a subdirectory of another Git repository. This can be useful for including dependencies but is not ideal for handling multiple branches of the same project. ### Git Subtrees: Git subtrees allow you to merge and split repositories without the need for submodule management. This is useful for including external repositories but does not address the issue of switching between branches within the same project. ## Conclusion Git worktrees are a powerful feature that can significantly improve your multi-branch development workflow. By allowing you to work on multiple branches simultaneously without the hassle of managing stashes or multiple clones, worktrees provide a cleaner and more efficient way to switch contexts. If you frequently find yourself juggling multiple branches, consider incorporating worktrees into your Git workflow for a more seamless development experience.
_hariti
1,863,109
Introducción a Pydantic para Principiantes.
Pydantic es una poderosa biblioteca en Python diseñada para la validación y gestión de datos. Es...
0
2024-05-23T18:05:22
https://dev.to/gfouz/introduccion-a-pydantic-para-principiantes-b6l
Pydantic es una poderosa biblioteca en Python diseñada para la validación y gestión de datos. Es especialmente útil cuando trabajas con datos que necesitan ser validados y transformados, como datos de entrada de API o formularios. Aquí te explico cómo empezar con Pydantic de manera sencilla. ¿Qué es Pydantic? Pydantic permite definir modelos de datos utilizando anotaciones de tipo, y automáticamente valida y transforma los datos según estas anotaciones. Esto significa que puedes asegurarte de que tus datos tienen el formato correcto antes de usarlos en tu aplicación. Instalación: Primero, necesitas instalar Pydantic. Puedes hacerlo usando pip: ```cmd pip install pydantic ``` Creación de un Modelo o Esquema: Un modelo en Pydantic es una clase que hereda de BaseModel. Definimos los atributos de esta clase con sus tipos, y Pydantic se encarga del resto. ```py from pydantic import BaseModel class User(BaseModel): id: int name: str signup_ts: Optional[datetime] = None friends: List[int] = [] ``` En este ejemplo, User es un modelo con cuatro atributos: id: un entero obligatorio. name: una cadena de texto obligatoria. signup_ts: una marca de tiempo opcional. friends: una lista de enteros, que por defecto es una lista vacía. Validación de Datos: Una vez definido el modelo, podemos crear instancias del mismo y Pydantic validará automáticamente los datos proporcionados. Una vez definido el modelo, podemos crear instancias del mismo y Pydantic validará automáticamente los datos proporcionados. ```py from datetime import datetime user = User(id=123, name='John Doe', signup_ts=datetime.now(), friends=[1, 2, 3]) print(user) ``` Si los datos no son válidos, Pydantic generará un error. Transformación de Datos: Pydantic también puede transformar los datos según las anotaciones de tipo. Por ejemplo: ```py user = User(id='123', name='John Doe') print(user) ``` Aquí, Pydantic convertirá el id de cadena de texto a entero automáticamente. Configuración Avanzada Pydantic ofrece muchas opciones avanzadas, como alias para nombres de campos, validaciones personalizadas, y uso con JSON. Alias Podemos usar alias para los campos, lo que es útil cuando los nombres de los datos de entrada no coinciden con los de nuestro modelo. ```py class User(BaseModel): id: int name: str = Field(alias='username') user = User(id=123, username='John Doe') print(user) ``` Integración con JSON Pydantic facilita trabajar con JSON, permitiendo la exportación e importación de modelos a/desde JSON. ```py user = User(id=123, name='John Doe', age=30) user_json = user.json() print(user_json) user_from_json = User.parse_raw(user_json) print(user_from_json) ``` Conclusión Pydantic es una herramienta poderosa para la validación y transformación de datos en Python. Facilita el trabajo con datos estructurados y ayuda a asegurar que tus datos sean correctos y consistentes. ¡Empieza a usar Pydantic en tus proyectos y simplifica la gestión de datos en tus aplicaciones!
gfouz
1,863,107
CryptoFlow: Building a secure and scalable system with Axum and SvelteKit - Part 6
Introduction It's been a while since I last updated this series of articles. I have been...
25,950
2024-05-23T18:01:59
https://dev.to/sirneij/cryptoflow-building-a-secure-and-scalable-system-with-axum-and-sveltekit-part-6-4973
webdev, svelte, rust, javascript
## Introduction It's been a while since I last updated this series of articles. I have been away, and I sincerely apologize for the abandonment. I will be completing the series by going through the frontend code and other updates I made at the backend. Let's get into it! ## Source code The source code for this series is hosted on GitHub via: {% github Sirneij/cryptoflow %} I also have the application live. You can interact with it [here][1]. Please note that the backend was deployed on [Render][2] which: > Spins down a Free web service that goes 15 minutes without receiving inbound traffic. Render spins the service back up whenever it next receives a request to process. Spinning up a service takes up to a minute, which causes a noticeable delay for incoming requests until the service is back up and running. For example, a browser page load will hang temporarily. ## Implementation ### Step 1: Landing page Our application will have a landing page where questions are listed. The page will be split into three resizable columns: 1. Left column: This will contain developer information and some coins with their rankings. The number of coins at a time will be specified by the `NUM_OF_COINS_TO_SHOW` constant which is `10` by default but can be made configurable. Every 10 seconds, the list will change. 2. Middle column: A list of questions will be housed here. 3. Right column: We will have some charts for plotting the `prices`, `market caps`, and `total volumes` of any selected coin. Making a total of three multi-line charts. Each line corresponds to each of the coins. We will provide users with two inputs where they can select up to 4 coins at a time, and the number of days they want their histories to be shown. These entire requirements are implemented in `frontend/src/routes/+page.svelte`: ```html <script> import Charts from "$lib/components/Charts.svelte"; import { NUM_OF_COINS_TO_SHOW } from "$lib/utils/constants.js"; import { onDestroy, onMount } from "svelte"; export let data, /** @type {import('./$types').ActionData} */ form; /** * @typedef {Object} Coin * @property {string} id - The id of the coin. * @property {string} name - The name of the coin. * @property {string} symbol - The symbol of the coin. * @property {string} image - The image of the coin. * @property {number} market_cap_rank - The market cap rank of the coin. */ /** * @type {Coin[]} */ let selectedCoins = [], /** @type {Number} */ intervalId; $: ({ questions, coins } = data); const selectCoins = () => { const selectedCoinsSet = new Set(); while (selectedCoinsSet.size < NUM_OF_COINS_TO_SHOW) { const randomIndex = Math.floor(Math.random() * coins.length); selectedCoinsSet.add(coins[randomIndex]); } selectedCoins = Array.from(selectedCoinsSet); }; onMount(() => { selectCoins(); // Select coins immediately on mount intervalId = setInterval(selectCoins, 10000); // Select coins every 10 seconds }); onDestroy(() => { clearInterval(intervalId); // Clear the interval when the component is destroyed }); </script> <div class="flex flex-col md:flex-row text-[#efefef]"> <!-- Left Column for Tags --> <div class="hidden md:block md:w-1/4 p-4 resize overflow-auto"> <!-- Developer Profile Card --> <div class="bg-[#041014] hover:bg-black border border-black hover:border-[#145369] rounded-lg shadow p-4 mb-1" > <img src="https://media.licdn.com/dms/image/D4D03AQElygM4We8kqA/profile-displayphoto-shrink_800_800/0/1681662853733?e=1721865600&v=beta&t=idb1YHHzZbXHJ1MxC4Ol2ZnnbyCHq6GDtjzTzGkziLQ" alt="Developer" class="rounded-full w-24 h-24 mx-auto mb-3" /> <h3 class="text-center text-xl font-bold mb-2">John O. Idogun</h3> <a href="https://github.com/sirneij" class="text-center text-blue-500 block mb-2" > @SirNeij </a> <p class="text-center">Developer & Creator of CryptoFlow</p> </div> <div class="bg-[#041014] p-6 rounded-lg shadow mb-6 hover:bg-black border border-black hover:border-[#145369]" > <h2 class="text-xl font-semibold mb-4">Coin ranks</h2> {#each selectedCoins as coin (coin.id)} <div class="flex items-center justify-between mb-2 border-b border-[#0a0a0a] hover:bg-[#041014] px-3 py-1" > <div class="flex items-center"> <img class="w-8 h-8 rounded-full mr-2 transition-transform duration-500 ease-in-out transform hover:rotate-180" src="{coin.image}" alt="{coin.name}" /> <span class="mr-2">{coin.name}</span> </div> <span class="inline-block bg-blue-500 text-white text-xs px-2 rounded-full uppercase font-semibold tracking-wide" > #{coin.market_cap_rank} </span> </div> {/each} </div> </div> <div class="md:w-5/12 py-4 px-2 resize overflow-auto"> {#if questions} {#each questions as question (question.id)} <div class=" bg-[#041014] mb-1 rounded-lg shadow hover:bg-black border border-black hover:border-[#145369]" > <div class="p-4"> <a href="/questions/{question.id}" class="text-xl font-semibold hover:text-[#2596be]" > {question.title} </a> <!-- <p class="mt-2">{article.description}</p> --> <div class="mt-3 flex flex-wrap"> {#each question.tags as tag} <span class="mr-2 mb-2 px-3 py-1 text-sm bg-[#041014] border border-[#145369] hover:border-[#2596be] rounded" > {tag.name} </span> {/each} </div> </div> </div> {/each} {/if} </div> <!-- Right Column for Charts --> <div class="hidden md:block md:w-1/3 px-2 py-4 resize overflow-auto"> <div class="bg-[#041014] rounded-lg shadow p-4 hover:bg-black border border-black hover:border-[#145369]" > <h2 class="text-xl font-semibold mb-4">Charts</h2> <Charts {coins} {form} /> </div> </div> </div> ``` To select 10 unique coins every 10 seconds, we randomly get them from the `coins` data and use `Set` to ensure no duplication is permitted. This is what `selectCoins` is about. As the DOM gets loaded, we call this function and then use `setInterval` for the periodic and automatic selection. We also ensure the interval is destroyed when we navigate out of the page for memory safety reasons. For the charts, there is a component, `Charts`, that handles the logic: ```html <!-- frontend/src/lib/components/Charts.svelte --> <script> import { applyAction, enhance } from '$app/forms'; import { notification } from '$lib/stores/notification.store'; import ShowError from './ShowError.svelte'; import Loader from './Loader.svelte'; import { fly } from 'svelte/transition'; import { onMount } from 'svelte'; import Chart from 'chart.js/auto'; import 'chartjs-adapter-moment'; import { chartConfig, handleZoom } from '$lib/utils/helpers'; import TagCoin from './inputs/TagCoin.svelte'; export let coins, /** @type {import('../../routes/$types').ActionData} */ form; /** @type {HTMLInputElement} */ let tagInput, /** @type {HTMLCanvasElement} */ priceChartContainer, /** @type {HTMLCanvasElement} */ marketCapChartContainer, /** @type {HTMLCanvasElement} */ totalVolumeChartContainer, fetching = false, rendered = false, /** * @typedef {Object} CryptoData * @property {Array<Number>} prices - The price data * @property {Array<Number>} market_caps - The market cap data * @property {Array<Number>} total_volumes - The total volume data */ /** * @typedef {Object.<String, CryptoData>} CryptoDataSet */ /** @type {CryptoDataSet} */ plotData = {}, /** @type {CanvasRenderingContext2D | null} */ context, /** @type {Chart<"line", { x: Date; y: number; }[], unknown>} */ priceChart, /** @type {Chart<"line", { x: Date; y: number; }[], unknown>} */ marketCapChart, /** @type {Chart<"line", { x: Date; y: number; }[], unknown>} */ totalVolumeChart, /** @type {CanvasRenderingContext2D|null} */ priceContext, /** @type {CanvasRenderingContext2D|null} */ marketCapContext, /** @type {CanvasRenderingContext2D|null} */ totalVolumeContext; /** @type {import('../../routes/$types').SubmitFunction}*/ const handleCoinDataFetch = async () => { fetching = true; return async ({ result }) => { fetching = false; if (result.type === 'success') { $notification = { message: 'Coin data fetched successfully', colorName: 'blue' }; if (result.data) { plotData = result.data.marketData; await applyAction(result); } } }; }; onMount(() => { priceContext = priceChartContainer.getContext('2d'); marketCapContext = marketCapChartContainer.getContext('2d'); totalVolumeContext = totalVolumeChartContainer.getContext('2d'); if (priceContext === null || marketCapContext === null || totalVolumeContext === null) { throw new Error('Could not get the context of the canvas element'); } // Create a new configuration object for each chart const priceChartConfig = { ...chartConfig }; priceChartConfig.data = { datasets: [] }; priceChart = new Chart(priceContext, priceChartConfig); const marketCapChartConfig = { ...chartConfig }; marketCapChartConfig.data = { datasets: [] }; marketCapChart = new Chart(marketCapContext, marketCapChartConfig); const totalVolumeChartConfig = { ...chartConfig }; totalVolumeChartConfig.data = { datasets: [] }; totalVolumeChart = new Chart(totalVolumeContext, totalVolumeChartConfig); rendered = true; // Add event listeners for zooming priceChartContainer.addEventListener('wheel', (event) => handleZoom(event, priceChart)); marketCapChartContainer.addEventListener('wheel', (event) => handleZoom(event, marketCapChart)); totalVolumeChartContainer.addEventListener('wheel', (event) => handleZoom(event, totalVolumeChart) ); }); /** * Update the chart with new data * @param {Chart<"line", { x: Date; y: number; }[], unknown>} chart - The chart to update * @param {Array<Array<number>>} data - The new data to update the chart with * @param {string} label - The label to use for the dataset * @param {string} cryptoName - The name of the cryptocurrency */ const updateChart = (chart, data, label, cryptoName) => { const dataset = { label: `${cryptoName} ${label}`, data: data.map( /** @param {Array<number>} item */ (item) => { return { x: new Date(item[0]), y: item[1] }; } ), fill: false, borderColor: '#' + Math.floor(Math.random() * 16777215).toString(16), tension: 0.1 }; chart.data.datasets.push(dataset); chart.update(); }; $: if (rendered) { // Clear the datasets for each chart priceChart.data.datasets = []; marketCapChart.data.datasets = []; totalVolumeChart.data.datasets = []; Object.keys(plotData).forEach( /** @param {string} cryptoName */ (cryptoName) => { // Update each chart with the new data updateChart(priceChart, plotData[cryptoName].prices, 'Price', cryptoName); updateChart(marketCapChart, plotData[cryptoName].market_caps, 'Market Cap', cryptoName); updateChart( totalVolumeChart, plotData[cryptoName].total_volumes, 'Total Volume', cryptoName ); } ); } </script> <form action="?/getCoinData" method="POST" use:enhance={handleCoinDataFetch}> <ShowError {form} /> <div style="display: flex; justify-content: space-between;"> <div style="flex: 2; margin-right: 10px;"> <TagCoin label="Cryptocurrencies" id="tag-input" name="tags" value="" {coins} placeholder="Select cryptocurrencies..." /> </div> <div style="flex: 1; margin-left: 10px;"> <label for="days" class="block text-[#efefef] text-sm font-bold mb-2">Days</label> <input type="number" id="days" name="days" value="7" required class="w-full p-4 bg-[#0a0a0a] text-[#efefef] border border-[#145369] rounded focus:outline-none focus:border-[#2596be] text-gray-500" placeholder="Enter days" /> </div> </div> {#if fetching} <Loader width={20} message="Fetching data..." /> {:else} <button class="px-6 py-2 bg-[#041014] border border-[#145369] hover:border-[#2596be] text-[#efefef] hover:text-white rounded" > Fetch Coin Data </button> {/if} </form> <div in:fly={{ x: 100, duration: 1000, delay: 1000 }} out:fly={{ duration: 1000 }}> <canvas bind:this={priceChartContainer} /> <canvas bind:this={marketCapChartContainer} /> <canvas bind:this={totalVolumeChartContainer} /> </div> ``` We employed [Charts.js][3] as the charting library. It's largely simple to use. Though the component looks big, it's very straightforward. We used `JSDocs` instead of TypeScript for annotations. At first, when the DOM was mounted, we created charts with empty datasets. We then expect users to select their preferred coins and number of days. Clicking the `Fetch Coin Data` button will send the inputted data to the backend using SvelteKit's form actions. The data returned by this API call will be used to populate the plots using Svelte's reactive block dynamically. The code for the form action and the preliminary data retrieval from the backend is in `frontend/src/routes/+page.server.js`: ```js import { BASE_API_URI } from "$lib/utils/constants"; import { fail } from "@sveltejs/kit"; /** @type {import('./$types').PageServerLoad} */ export async function load({ fetch }) { const fetchQuestions = async () => { const res = await fetch(`${BASE_API_URI}/qa/questions`); return res.ok && (await res.json()); }; const fetchCoins = async () => { const res = await fetch(`${BASE_API_URI}/crypto/coins`); return res.ok && (await res.json()); }; const questions = await fetchQuestions(); const coins = await fetchCoins(); return { questions, coins, }; } // Get coin data form action /** @type {import('./$types').Actions} */ export const actions = { /** * Get coin market history data from the API * @param request - The request object * @param fetch - Fetch object from sveltekit * @returns Error data or redirects user to the home page or the previous page */ getCoinData: async ({ request, fetch }) => { const data = await request.formData(); const coinIDs = String(data.get("tags")); const days = Number(data.get("days")); const res = await fetch( `${BASE_API_URI}/crypto/coin_prices?tags=${coinIDs}&currency=USD&days=${days}` ); if (!res.ok) { const response = await res.json(); const errors = [{ id: 1, message: response.message }]; return fail(400, { errors: errors }); } const response = await res.json(); return { status: 200, marketData: response, }; }, }; ``` The endpoint used here, `${BASE_API_URI}/crypto/coin_prices?tags=${coinIDs}&currency=USD&days=${days}`, was just created and the code is: ```rust // backend/src/routes/crypto/prices.rs use crate::{ settings, utils::{CustomAppError, CustomAppJson}, }; use axum::extract::Query; use std::collections::HashMap; #[derive(serde::Deserialize, Debug)] pub struct CoinMarketDataRequest { tags: String, currency: String, days: i32, } #[derive(serde::Deserialize, Debug, serde::Serialize)] pub struct CoinMarketData { prices: Vec<Vec<f64>>, market_caps: Vec<Vec<f64>>, total_volumes: Vec<Vec<f64>>, } #[axum::debug_handler] #[tracing::instrument(name = "get_coin_market_data")] pub async fn get_coin_market_data( Query(coin_req): Query<CoinMarketDataRequest>, ) -> Result<CustomAppJson<HashMap<String, CoinMarketData>>, CustomAppError> { let tag_ids: Vec<String> = coin_req.tags.split(',').map(|s| s.to_string()).collect(); let mut responses = HashMap::new(); let settings = settings::get_settings().expect("Failed to get settings"); for tag_id in tag_ids { let url = format!( "{}/coins/{}/market_chart?vs_currency={}&days={}", settings.coingecko.api_url, &tag_id, coin_req.currency, coin_req.days ); match reqwest::get(&url).await { Ok(response) => match response.json::<CoinMarketData>().await { Ok(data) => { responses.insert(tag_id, data); } Err(e) => { tracing::error!("Failed to parse market data from response: {}", e); } }, Err(e) => { tracing::error!("Failed to fetch market data from CoinGecko: {}", e); } } } Ok(CustomAppJson(responses)) } ``` It simply uses CoinGecko's API to retrieve the history data of the coins since `days` ago. Back to the frontend code, SvelteKit version 2 made some changes that mandate [explicitly awaiting asynchronous functions in `load`][4]. This and other changes will be pointed out as the series progresses. Our `load` fetches both the questions and coins from the backend. No pagination is implemented here but it's easy to implement with `sqlx`. Pagination can also be done easily with sveltekit. You can take that up as a challenge. The `Charts.svelte` components used some custom input components. This is simply for modularity's sake and is just simple HTML elements with tailwind CSS. Also, it used `chartConfig` and `handleZoom`. The former is just a simple configuration for the entire charts while the latter just allows simple zoom in and out of the plots. For better zooming and panning features, it's recommended to use the [chartjs-plugin-zoom][5]. With all these in place, the landing page should look like this: ![Application's home page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eu29eza0of3o5gks2un5.jpeg "Application's home page") ### Step 2: Question Detail page The middle column on the landing page shows all the questions in the database. We need a page that zooms in on each question so that other users can provide answers. We have such a page in `frontend/src/routes/questions/[id]/+page.svelte`: ```html <script> import { applyAction, enhance } from '$app/forms'; import { page } from '$app/stores'; import Logo from '$lib/assets/logo.png'; import { formatCoinName, formatPrice, getCoinsPricesServer, highlightCodeBlocks, timeAgo } from '$lib/utils/helpers.js'; import { afterUpdate, onMount } from 'svelte'; import Loader from '$lib/components/Loader.svelte'; import { scale } from 'svelte/transition'; import { flip } from 'svelte/animate'; import Modal from '$lib/components/Modal.svelte'; import hljs from 'highlight.js'; import ShowError from '$lib/components/ShowError.svelte'; import { notification } from '$lib/stores/notification.store.js'; import 'highlight.js/styles/night-owl.css'; import TextArea from '$lib/components/inputs/TextArea.svelte'; export let data; /** @type {import('./$types').ActionData} */ export let form; /** @type {Array<{"name": String, "price": number}>} */ let coinPrices = [], processing = false, showDeleteModal = false, showEditModal = false, answerID = '', answerContent = ''; $: ({ question, answers } = data); const openModal = (isDelete = true) => { if (isDelete) { showDeleteModal = true; } else { showEditModal = true; } }; const closeModal = () => { showDeleteModal = false; showEditModal = false; }; /** @param {String} id */ const setAnswerID = (id) => (answerID = id); /** @param {String} content */ const setAnswerContent = (content) => (answerContent = content); onMount(async () => { highlightCodeBlocks(hljs); if (question) { const tagsString = question.tags .map( /** @param {{"id": String}} tag */ (tag) => tag.id ) .join(','); coinPrices = await getCoinsPricesServer($page.data.fetch, tagsString, 'usd'); } }); afterUpdate(() => { highlightCodeBlocks(hljs); }); /** @type {import('./$types').SubmitFunction} */ const handleAnswerQuestion = async () => { processing = true; return async ({ result }) => { processing = false; if (result.type === 'success') { if (result.data && 'answer' in result.data) { answers = [result.data.answer, ...answers]; answerContent = ''; notification.set({ message: 'Answer posted successfully', colorName: 'blue' }); } } await applyAction(result); }; }; /** @type {import('./$types').SubmitFunction} */ const handleDeleteAnswer = async () => { return async ({ result }) => { closeModal(); if (result.type === 'success') { answers = answers.filter( /** @param {{"id": String}} answer */ (answer) => answer.id !== answerID ); notification.set({ message: 'Answer deleted successfully', colorName: 'blue' }); } await applyAction(result); }; }; /** @type {import('./$types').SubmitFunction} */ const handleUpdateAnswer = async () => { return async ({ result }) => { closeModal(); if (result.type === 'success') { answers = answers.map( /** @param {{"id": String}} answer */ (answer) => { if (result.data && 'answer' in result.data) { return answer.id === answerID ? result.data.answer : answer; } return answer; } ); answerContent = ''; notification.set({ message: 'Answer updated successfully', colorName: 'blue' }); } await applyAction(result); }; }; </script> <div class="max-w-5xl mx-auto p-4"> <!-- Stats Section --> <div class="bg-[#0a0a0a] p-6 rounded-lg shadow mb-6 flex justify-between items-center"> <p>Asked: {timeAgo(question.created_at)}</p> <p>Modified: {timeAgo(question.updated_at)}</p> </div> <div class="grid grid-cols-1 md:grid-cols-12 gap-4"> <!-- Main Content --> <div class="md:col-span-9"> <!-- Question Section --> <div class="bg-[#041014] p-6 rounded-lg shadow mb-6 border border-black"> <h1 class="text-2xl font-bold mb-4">{question.title}</h1> <p>{@html question.content}</p> <div class="flex mt-4 flex-wrap"> {#each question.tags as tag} <span class="mr-2 mb-2 px-3 py-1 text-sm bg-[#041014] border border-[#145369] hover:border-[#2596be] rounded" > {tag.name.toLowerCase()} </span> {/each} </div> <div class="flex justify-end mt-4"> {#if $page.data.user && question.author.id === $page.data.user.id} <a class="mr-2 text-blue-500 hover:text-blue-600" href="/questions/{question.id}/update" > Edit </a> <a class="mr-2 text-red-500 hover:text-red-600" href="/questions/{question.id}/delete"> Delete </a> {/if} </div> <hr class="my-4" /> <div class="flex justify-end items-center"> <span class="mr-3"> {question.author.first_name + ' ' + question.author.last_name} </span> <img src={question.author.thumbnail ? question.author.thumbnail : Logo} alt={question.author.first_name + ' ' + question.author.last_name} class="h-10 w-10 rounded-full" /> </div> </div> <!-- Answers Section --> <h2 class="text-xl font-bold mb-4">Answers</h2> {#each answers as answer (answer.id)} <div class="bg-[#041014] p-6 rounded-lg shadow mb-4" transition:scale|local={{ start: 0.4 }} animate:flip={{ duration: 200 }} > <p>{@html answer.content}</p> <div class="flex justify-end mt-4"> {#if $page.data.user && answer.author.id === $page.data.user.id} <button class="mr-2 text-blue-500 hover:text-blue-600" on:click={() => { openModal(false); setAnswerID(answer.id); setAnswerContent(answer.raw_content); }} > Edit </button> <button class="mr-2 text-red-500 hover:text-red-600" on:click={() => { openModal(); setAnswerID(answer.id); }} > Delete </button> {/if} </div> <hr class="my-4" /> <div class="flex justify-end items-center"> <span class="mr-3">{answer.author.first_name + ' ' + answer.author.last_name}</span> <img src={answer.author.thumbnail ? answer.author.thumbnail : Logo} alt={answer.author.first_name + ' ' + answer.author.last_name} class="h-10 w-10 rounded-full" /> </div> </div> {:else} <div class="bg-[#041014] p-6 rounded-lg shadow mb-4"> <p>No answers yet.</p> </div> {/each} <!-- Post Answer Section --> <form class="bg-[#041014] p-6 rounded-lg shadow" method="POST" action="?/answer" use:enhance={handleAnswerQuestion} > <h2 class="text-xl font-bold mb-4">Your Answer</h2> <ShowError {form} /> <TextArea label="" id="answer" name="content" placeholder="Write your answer here (markdown supported)..." bind:value={answerContent} /> {#if processing} <Loader width={20} message="Posting your answer..." /> {:else} <button class="mt-4 px-6 py-2 bg-[#041014] border border-[#145369] hover:border-[#2596be] text-white rounded" > {#if $page.data.user && $page.data.user.id === question.author.id} Answer your question {:else} Post Your Answer {/if} </button> {/if} </form> </div> <!-- Right Sidebar --> <div class="md:col-span-3"> <h2 class="text-xl font-semibold mb-4">Current prices</h2> <div class="bg-[#041014] rounded-lg shadow p-4 hover:bg-black border border-black hover:border-[#145369]" > <div class="space-y-4"> {#each coinPrices as coin (coin.name)} <div class="bg-[#145369] p-3 rounded-lg text-center" transition:scale|local={{ start: 0.4 }} animate:flip={{ duration: 200 }} > <p class="text-3xl font-bold"> <span class="text-base">$</span>{formatPrice(coin.price)} </p> {#if question.tags.find(/** @param {{"id": String}} tag */ (tag) => tag.id === coin.name)} <div class="flex items-center text-lg"> <img class="w-8 h-8 rounded-full mr-2 transition-transform duration-500 ease-in-out transform hover:rotate-180" src={question.tags.find( /** @param {{"id": String}} tag */ (tag) => tag.id === coin.name ).image} alt={coin.name} /> <span class="mr-2"> {formatCoinName( coin.name, question.tags.find( /** @param {{"id": String}} tag */ (tag) => tag.id === coin.name ).symbol )} </span> </div> {/if} </div> {/each} </div> </div> </div> </div> </div> {#if showDeleteModal} <Modal on:close={closeModal}> <form class="bg-[#041014] p-6 rounded-lg shadow text-center" method="POST" action="?/deleteAnswer" use:enhance={handleDeleteAnswer} > <ShowError {form} /> <p class="text-red-500 p-3 mb-4 italic"> Are you sure you want to delete this answer (id={answerID}) </p> <input type="hidden" name="answerID" value={answerID} /> <button class="mt-4 px-6 py-2 bg-[#041014] border border-red-400 hover:border-red-700 text-red-600 rounded" > Delete Answer </button> </form> </Modal> {/if} {#if showEditModal} <Modal on:close={closeModal}> <form class="bg-[#041014] p-6 rounded-lg shadow text-center" method="POST" action="?/updateAnswer" use:enhance={handleUpdateAnswer} > <ShowError {form} /> <input type="hidden" name="answerID" value={answerID} /> <textarea class="w-full p-4 bg-[#0a0a0a] text-[#efefef] border border-[#145369] rounded focus:border-[#2596be] focus:outline-none" rows="6" bind:value={answerContent} name="content" placeholder="Write your answer here (markdown supported)..." /> <button class="mt-4 px-6 py-2 bg-[#041014] border border-[#145369] hover:border-[#2596be] text-white rounded" > Update Answer </button> </form> </Modal> {/if} ``` It has two columns: 1. The first shows the question and all the answers to that question. 2. The second shows the current price of the coin tagged in the question. The prices do not get updated live or in real time, you need to refresh the page for updated prices but this can be improved using web sockets. This page has an accompanying `+page.server.js` that fetches the data the page uses and handles other subsequent interactions such as posting, updating, and deleting answers: ```js import { BASE_API_URI } from "$lib/utils/constants"; import { fail } from "@sveltejs/kit"; /** @type {import('./$types').PageServerLoad} */ export async function load({ fetch, params }) { const fetchQuestion = async () => { const res = await fetch(`${BASE_API_URI}/qa/questions/${params.id}`); return res.ok && (await res.json()); }; const fetchAnswers = async () => { const res = await fetch( `${BASE_API_URI}/qa/questions/${params.id}/answers` ); return res.ok && (await res.json()); }; return { question: await fetchQuestion(), answers: await fetchAnswers(), }; } /** @type {import('./$types').Actions} */ export const actions = { /** * * @param request - The request object * @param fetch - Fetch object from sveltekit * @returns Error data or redirects user to the home page or the previous page */ answer: async ({ request, fetch, params, cookies }) => { const data = await request.formData(); const content = String(data.get("content")); /** @type {RequestInit} */ const requestInitOptions = { method: "POST", credentials: "include", headers: { "Content-Type": "application/json", Cookie: `sessionid=${cookies.get("cryptoflow-sessionid")}`, }, body: JSON.stringify({ content: content, }), }; const res = await fetch( `${BASE_API_URI}/qa/answer/${params.id}`, requestInitOptions ); if (!res.ok) { const response = await res.json(); const errors = [{ id: 1, message: response.message }]; return fail(400, { errors: errors }); } const response = await res.json(); return { status: 200, answer: response, }; }, /** * * @param request - The request object * @param fetch - Fetch object from sveltekit * @returns Error data or redirects user to the home page or the previous page */ deleteAnswer: async ({ request, fetch, cookies }) => { const data = await request.formData(); const answerID = String(data.get("answerID")); /** @type {RequestInit} */ const requestInitOptions = { method: "DELETE", credentials: "include", headers: { "Content-Type": "application/json", Cookie: `sessionid=${cookies.get("cryptoflow-sessionid")}`, }, }; const res = await fetch( `${BASE_API_URI}/qa/answers/${answerID}`, requestInitOptions ); if (!res.ok) { const response = await res.json(); const errors = [{ id: 1, message: response.message }]; return fail(400, { errors: errors }); } return { status: res.status, }; }, /** * * @param request - The request object * @param fetch - Fetch object from sveltekit * @returns Error data or redirects user to the home page or the previous page */ updateAnswer: async ({ request, fetch, cookies }) => { const data = await request.formData(); const answerID = String(data.get("answerID")); const content = String(data.get("content")); /** @type {RequestInit} */ const requestInitOptions = { method: "PATCH", credentials: "include", headers: { "Content-Type": "application/json", Cookie: `sessionid=${cookies.get("cryptoflow-sessionid")}`, }, body: JSON.stringify({ content: content, }), }; const res = await fetch( `${BASE_API_URI}/qa/answers/${answerID}`, requestInitOptions ); if (!res.ok) { const response = await res.json(); const errors = [{ id: 1, message: response.message }]; return fail(400, { errors: errors }); } return { status: res.status, answer: await res.json(), }; }, }; ``` It's just the familiar structure with a `load` function and a bunch of other form actions. Since all the other pages have this structure, I will skip explaining them but will include their screenshots You can follow along by reading through the code on GitHub. They are very easy to follow. The question detail page looks like this: ![Question detailed page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fl2qbcb85lll1uhnw7jb.jpeg "Question detailed page") As for login and signup pages, we have these: ![Login page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41wxzvvmu9mtewnpakwp.jpeg "Login page") ![Signup page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yug58aawe2jr58qw2r4r.jpeg "Signup page") When one registers, a one-time token is sent to the user's email. There's a page to input this token and get the account attached to it activated. The page looks like this: ![Activate account page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6d9mc1utd15s05yw40m.jpeg "Activate account page") With that, we end this series. Kindly check the series' GitHub repository for the updated and complete code. They are intuitive. I apologize once again for the abandonment. ## Outro Enjoyed this article? I'm a Software Engineer and Technical Writer actively seeking new opportunities, particularly in areas related to web security, finance, health care, and education. If you think my expertise aligns with your team's needs, let's chat! You can find me on LinkedIn: [LinkedIn](https://www.linkedin.com/in/idogun-john-nelson/) and Twitter: [Twitter](https://twitter.com/Sirneij). If you found this article valuable, consider sharing it with your network to help spread the knowledge! [1]: https://cryptoflow-one.vercel.app/ "CryptoFlow live application" [2]: https://docs.render.com/free "Deploy for Free" [3]: https://www.chartjs.org/docs/latest/ "Chart.js" [4]: https://kit.svelte.dev/docs/migrating-to-sveltekit-2#top-level-promises-are-no-longer-awaited "Top-level promises are no longer awaited" [5]: https://www.chartjs.org/chartjs-plugin-zoom/latest/guide/ "A zoom and pan plugin for Chart.js >= 3.0.0"
sirneij
1,863,106
TS is a liar
Motivation Sometimes I hear from people such an amazing opinion about typescript and the...
0
2024-05-23T18:01:27
https://dev.to/lgtome/typescript-reliability-nb4
typescript, javascript, webdev, learning
## Motivation Sometimes I hear from people such an amazing opinion about `typescript` and the reliability of this. My motivation is to clarify some cases, cuz our best language is becoming modern every day and we use some things that we couldn't use a couple of years ago. ## Prerequisites - `typescript` ## Cases **First** and my favorite is `ts` and `Map`: ```typescript const map = new Map<string,string>() map.set('tsIsAmazing','thinkNot') // some // a lot of // code // here const data = {...map} data.set('isItWillWork','NOPE') ``` In this case, we have no errors from the typescript in the last line, but if we run this code it will bring an exception like: `data.set is not a function`. Be careful **Second**: ```typescript const merge = <T, F>(source: T, target: F) => ({...source, ...target}); const str = {func: () => '42'}; const num = {func: () => 42}; const fn = {func: () => Function}; const merged = merge(str, merge(num, fn)).func() console.log(merged); ``` You can guess what will me in the last `console.log`, but, sadly it will be a `string` (as typescript guessing), but in the runtime, it will be `Function`. **Third** ```typescript const test = NaN as const ``` It will throw an `ts` exception like: `A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.(1355)`, but from the typescript: `var NaN: number`. **Fourth** ```typescript class Person{ age: number constructor(age:number){ this.age = age } getAge(){ return this.age } } const {getAge} = new Person(18) getAge() ``` Looks like normal code, but in this case, we will have an error from the `getAge` invocation like: `Cannot read properties of undefined (reading 'age') ` ## Outro There are a lot of cases like this and a lot of issues in `ts` repo, this is only 4th and I can write more and more but it's not my point. My point is to keep in touch with ourselves that typescript is not safe and not reliable in some cases. <img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY2dqajE4czhuYnFnajRvbHVkdnBwcW1ocXZiZW41YWtrcGx3Z2lhOCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/2KAGlmkPywhZS/giphy.gif">
lgtome
1,863,338
Workshop De Inteligência Artificial E Seus Modelos De Linguagem Gratuito
O IPETEC está oferecendo o Workshop Grandes Modelos de Linguagem da Inteligência Artificial, um curso...
0
2024-05-27T01:33:37
https://guiadeti.com.br/workshop-inteligencia-artificial-modelos-linguagem/
workshop, chatbot, cursosgratuitos, inteligenciaartifici
--- title: Workshop De Inteligência Artificial E Seus Modelos De Linguagem Gratuito published: true date: 2024-05-23 18:00:27 UTC tags: Workshop,chatbot,cursosgratuitos,inteligenciaartifici canonical_url: https://guiadeti.com.br/workshop-inteligencia-artificial-modelos-linguagem/ --- O IPETEC está oferecendo o Workshop Grandes Modelos de Linguagem da Inteligência Artificial, um curso online e gratuito com certificação paga. Com 100% da carga horária composta por aulas ao vivo, o workshop é acessível via computador, celular ou tablet. Ideal para quem gosta da área, profissionais e estudantes sem conhecimento avançado em Machine Learning, o curso ensina a resolver problemas reais utilizando a biblioteca Transformers e a Inference API. ## Grandes Modelos de Linguagem da Inteligência Artificial O IPETEC está oferecendo o Workshop Grandes Modelos de Linguagem da Inteligência Artificial, um curso online e gratuito. ![](https://guiadeti.com.br/wp-content/uploads/2024/05/image-75-1024x293.png) _Imagem da página do curso_ ### Aulas ao Vivo e Certificação O workshop é composto por 100% de aulas ao vivo, que podem ser assistidas por computador, celular ou tablet. Embora o curso seja gratuito, há uma taxa de R$30 para os alunos que desejarem receber a aula gravada, o material didático e o certificado de participação. Para aqueles que preferem apenas assistir ao curso ao vivo sem receber o certificado e demais materiais, basta clicar em “EU TENHO UM CUPOM” na página de pagamento e inserir o voucher: CG100VIP. ### Público-Alvo e Conteúdo O workshop é Ideal para entusiastas, profissionais e estudantes sem conhecimento avançado em Machine Learning, o curso ensinará a resolver problemas reais utilizando a biblioteca Transformers e a Inference API. Os participantes aprenderão a construir chatbots, sistemas de tradução e ferramentas de sumarização, aplicando inteligência artificial em seus projetos e ambiente de trabalho. ### Informações Adicionais O evento ocorrerá no dia 28/05, das 19:00 às 22:00. O IPETEC reserva-se o direito de não realizar o curso caso não atinja o número mínimo de 20 inscritos. A data e o horário do curso podem sofrer alterações, e os inscritos serão avisados antecipadamente. <aside> <div>Você pode gostar</div> <div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2023/04/GF-Cursos-Gratuitos-280x210.png" alt="GF Cursos Gratuitos" title="GF Cursos Gratuitos"></span> </div> <span>GF Cursos: Aprenda Gratuitamente HTML, PHP, Redes, Corel Draw E Outros</span> <a href="https://guiadeti.com.br/plataforma-gf-cursos-cursos-em-html-php-e-mais/" title="GF Cursos: Aprenda Gratuitamente HTML, PHP, Redes, Corel Draw E Outros"></a> </div> </div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2024/05/Curso-AZ-900-1-280x210.png" alt="Curso AZ-900" title="Curso AZ-900"></span> </div> <span>Curso Gratuito de AZ-900 (Microsoft Azure Fundamentals) Da Ka Solution</span> <a href="https://guiadeti.com.br/curso-microsoft-azure-fundamentals-az-900-gratuito/" title="Curso Gratuito de AZ-900 (Microsoft Azure Fundamentals) Da Ka Solution"></a> </div> </div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2024/05/Computacao-Em-Nuvem-Sebrae-280x210.png" alt="Computação Em Nuvem Sebrae" title="Computação Em Nuvem Sebrae"></span> </div> <span>Curso De Computação Em Nuvem Gratuito Com Voucher Para Certificação AWS Cloud</span> <a href="https://guiadeti.com.br/curso-computacao-em-nuvem-gratuito-voucher-aws/" title="Curso De Computação Em Nuvem Gratuito Com Voucher Para Certificação AWS Cloud"></a> </div> </div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2024/05/Curso-De-Marketing-Digital-Santander-280x210.png" alt="Curso De Marketing Digital Santander" title="Curso De Marketing Digital Santander"></span> </div> <span>Curso De Marketing Digital Gratuito Com Certificado Do Santander</span> <a href="https://guiadeti.com.br/curso-marketing-digital-com-certificado-santander/" title="Curso De Marketing Digital Gratuito Com Certificado Do Santander"></a> </div> </div> </div> </aside> ## Inteligência Artificial A Inteligência Artificial (IA) começou a se desenvolver como um campo de estudo formal na década de 1950, com a visão de criar máquinas capazes de simular a inteligência humana. Desde então, a IA tem evoluído, passando de conceitos teóricos para aplicações práticas que transformam diversas áreas da sociedade. ### Progresso Tecnológico O progresso em IA foi impulsionado por avanços em algoritmos, aumento da capacidade de processamento e disponibilidade de grandes volumes de dados. Hoje, a Inteligência Artificial está presente em muitas tecnologias cotidianas, e várias ferramentas gratuitas estão disponíveis para ajudar profissionais, entusiastas e empresas a explorar e implementar soluções de IA. ### TensorFlow TensorFlow, desenvolvido pelo Google, é uma das ferramentas de IA mais populares e amplamente utilizadas. É uma biblioteca de código aberto para aprendizado de máquina que permite a criação e treinamento de modelos de deep learning. Com suporte para Python, C++ e outras linguagens, TensorFlow oferece vários recursos, tornando-o uma excelente escolha tanto para iniciantes quanto para especialistas. ### PyTorch PyTorch, criado pelo Facebook, é outra biblioteca de aprendizado de máquina de código aberto que tem ganhado popularidade rapidamente. Conhecida por sua simplicidade e flexibilidade, PyTorch facilita a construção e modificação de modelos de IA. O dinamismo da computação gráfica é especialmente útil para pesquisa e desenvolvimento de novas arquiteturas de redes neurais. ### OpenAI Gym OpenAI Gym é uma ferramenta gratuita que oferece uma grande variedade de ambientes para treinamento de algoritmos de aprendizado por reforço. Desenvolvido pela OpenAI, o Gym é muito uzado para pesquisa e ensino em aprendizado por reforço, permitindo que os usuários testem e validem seus algoritmos em ambientes simulados antes de aplicá-los no mundo real. ### Hugging Face Transformers Hugging Face Transformers é uma biblioteca popular para processamento de linguagem natural (NLP). Ela fornece uma interface fácil de usar para modelos pré-treinados como BERT, GPT-3, e T5, que podem ser aplicados em tarefas como tradução de idiomas, análise de sentimento, e geração de texto. ### IBM Watson IBM Watson oferece uma série de serviços de IA baseados em nuvem, muitos dos quais têm versões gratuitas. Desde o processamento de linguagem natural até a análise de sentimentos e reconhecimento de imagens, o Watson permite que empresas e desenvolvedores integrem IA em suas aplicações sem a necessidade de infraestrutura avançada. A interface amigável e suporte tornam o IBM Watson uma opção atraente para explorar as capacidades da Inteligência Artificial. ### Google Colab Google Colab é uma plataforma gratuita que permite a execução de código Python diretamente no navegador, com suporte para bibliotecas de aprendizado de máquina como TensorFlow e PyTorch. Colab oferece GPUs gratuitas para acelerar o treinamento de modelos, tornando-se uma ferramenta valiosa para estudantes e pesquisadores que desejam experimentar e desenvolver projetos de IA sem precisar de hardware próprio. ### Microsoft Azure AI Microsoft Azure AI oferece uma variedade de serviços de IA na nuvem, muitos dos quais têm opções gratuitas. Esses serviços incluem modelos pré-treinados para visão computacional, reconhecimento de fala e processamento de linguagem natural. O Azure AI permite que desenvolvedores integrem facilmente funcionalidades de IA em suas aplicações, aproveitando a escalabilidade e segurança da plataforma Azure. ## IPETEC O Instituto de Pesquisa e Ensino em Tecnologia (IPETEC) é uma instituição dedicada ao avanço do conhecimento e da inovação na área de tecnologia. Fundado em 2008 com a missão de fornecer educação de alta qualidade e promover a pesquisa aplicada, o IPETEC é referência no cenário educacional e tecnológico, oferecendo uma ampla gama de cursos e programas voltados para profissionais e estudantes. ### Cursos e Programas Oferecidos O IPETEC oferece uma variedade de cursos e programas, desde treinamentos básicos até cursos avançados e especializações. Os programas são desenvolvidos para atender a diferentes perfis de estudantes, incluindo profissionais em busca de atualização, recém-formados e entusiastas da tecnologia. Os cursos cobrem diversas áreas, como Inteligência Artificial, Desenvolvimento de Software, Segurança da Informação e Análise de Dados. ### Metodologia de Ensino A metodologia de ensino do IPETEC combina teoria e prática, garantindo que os alunos adquiram conhecimentos sólidos e habilidades aplicáveis no mercado de trabalho. Os cursos são feitos para serem interativos e dinâmicos, utilizando ferramentas modernas e técnicas pedagógicas eficazes. Aulas ao vivo, laboratórios virtuais, projetos práticos e estudos de caso são alguns dos métodos utilizados para enriquecer a experiência de aprendizado. ## Inscreva-se agora no Workshop de IA gratuito e aprenda a aplicar modelos de linguagem em projetos reais! As [inscrições para o Grandes Modelos de Linguagem da Inteligência Artificial](https://cursos.ipetec.com.br/turma/grandes-modelos-de-linguagem-da-inteligencia-artificial/curso-gratuito) devem ser realizadas no site da IPETEC. ## Compartilhe esta oportunidade aprendizado em IA gratuita com seus amigos e colegas! Gostou do conteúdo sobre o workshop em Inteligência Artificial gratuito? Então compartilhe com a galera! O post [Workshop De Inteligência Artificial E Seus Modelos De Linguagem Gratuito](https://guiadeti.com.br/workshop-inteligencia-artificial-modelos-linguagem/) apareceu primeiro em [Guia de TI](https://guiadeti.com.br).
guiadeti
1,862,793
How to configure PHP in Airflow?
Apache Airflow is an open-source platform used for managing complex workflows. It allows users to...
0
2024-05-23T18:00:00
https://dev.to/darkotodoric/how-to-configure-php-in-airflow-5d9i
airflow, php, tutorial, crontab
Apache Airflow is an open-source platform used for managing complex workflows. It allows users to schedule, monitor, and manage tasks and commands. In essence, Airflow serves as a powerful alternative to traditional cron-based scheduling systems. While cron (or crontab) is widely used for scheduling repetitive tasks on Unix-like systems, it lacks features for dependency management, monitoring, and dynamic scheduling, which are crucial for managing complex workflows. Airflow, on the other hand, provides a robust framework for defining, scheduling, and executing workflows, making it an ideal choice for data pipelines. ![Airflow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pu4lqdmtoiolfmcupopi.png) While Airflow is primarily associated with Python, its flexibility allows users to integrate tasks written in other languages, such as PHP. This opens up new possibilities for leveraging existing PHP codebases, libraries, and expertise within Airflow workflows. In this guide, we'll explore how to configure PHP tasks within Airflow, enabling you to harness the power of both Airflow and PHP in your data pipelines. I'm writing this guide because I couldn't find any tutorials explaining how to set up PHP with Airflow until now. **At the end of the article, you can find my GitHub repository link as an example of how to properly integrate PHP and Airflow. You can skip reading the entire explanation of how everything works if you are only interested in the solution.** --- ## Do you really need Airflow? Do you really need another relatively complex tool that will complicate your infrastructure? It depends... Most projects use "crontab" to schedule commands and it does the job very nicely, but when the number of commands inside crontab exceeds 100, and even 500, the situation starts to become drastically complicated and the management of all those commands through crontab is practically impossible. --- ## Airflow structure If you're still reading this, you've obviously run into the same problem as me your "crontab" has become too small for the number of commands that are there and you need a more complex solution. Airflow consists of 5 key services that all work together to ensure that everything runs smoothly. These are the 5 key services: - **PostgreSQL**: Sets up a PostgreSQL database for Airflow to store metadata - **Redis**: Provides an in-memory data structure store, used by Airflow for task queue management - **Airflow Scheduler**: Manages the scheduling of tasks and ensures that they are executed at the right time - **Airflow Worker**: Executes the tasks scheduled by the Airflow scheduler - **Airflow Webserver**: Hosts the Airflow web interface, allowing users to monitor and manage workflows through a web browser --- ## Integrating PHP into Airflow To integrate PHP into Airflow, we need to ensure that PHP scripts are executed where the commands are run, which is within the Airflow worker. The Airflow worker is responsible for executing the tasks scheduled by the Airflow scheduler. Here's how we can do it: 1. **Modify the Airflow Worker Dockerfile**: Ensure that PHP is installed in the Airflow worker's environment. This can be done by modifying the Dockerfile used to build the Airflow worker image. 2. **Install PHP**: Add the necessary commands to install PHP and any required extensions in the Dockerfile. 3. **Run PHP Scripts**: Use the BashOperator in Airflow to run PHP scripts as tasks within your DAGs. This way, when a task is executed by the Airflow worker, it can invoke the PHP script. By following these steps, you can integrate PHP into your Airflow environment, allowing you to utilize PHP for various tasks within your workflows. For a complete example with functional code, you can find the full setup and instructions at [https://github.com/darkotodoric/php-in-airflow](https://github.com/darkotodoric/php-in-airflow)
darkotodoric
1,863,105
Does GPS need internet to work?
Ever wonder how GPS works without the internet? I am here to explain how it exactly works. ...
0
2024-05-23T17:59:36
https://dev.to/richardshaju/does-gps-need-internet-to-work-1ioo
gps, internet, tech, explanation
Ever wonder how GPS works without the internet? I am here to explain how it exactly works. ## GPS: The Magical Map **1. Satellites in the Sky:** - Up high in the sky, there are lots of satellites. Think of them as magic helpers flying around the Earth. - These satellites are constantly sending signals to the ground. **2. Your GPS Device:** - Your phone or GPS device is like a special receiver that listens to these signals. - It doesn't need the internet to hear these signals because they're always being sent from the satellites. **3. How It Finds You:** - When your GPS device picks up signals from at least four satellites, it can figure out where you are. - It's like the device is talking to the satellites, asking, "Where am I?" and they help it figure out the answer. ## The Process in Simple Steps: **Listening to Satellites:** - Imagine you're in a big open field, and you hear a voice from each corner of the field. - Your GPS device does something similar. It hears signals from different satellites. **Measuring Time:** - Each signal takes a tiny bit of time to travel from the satellite to your device. - By figuring out how long each signal took to arrive, the GPS device can tell how far away each satellite is. **Drawing a Map:** - Your device uses this distance information to draw imaginary circles around each satellite. - Where these circles overlap is where you are. It's like connecting dots to find your spot on a map. ## Why No Internet Needed? - Radio waves don't need the internet to travel. They move directly from the satellites to your device. - Your device just needs to listen to the signals and do some quick math to figure out your location. - Just like you don't need the internet to listen to the radio in your car. So, the medium for sending data between your mobile device and the satellites is radio waves. These waves travel directly through space and air, bringing the satellite's location information to your device. --- I hope this article helps you❤️ Check out my other handles: richard.is-a.dev/about
richardshaju
1,863,104
Top Packers & Movers in Rajajinagar, Bangalore
Relocating can be a daunting task, whether it's moving to a new home or shifting your office space....
0
2024-05-23T17:58:56
https://dev.to/ferrygologistics/top-packers-movers-in-rajajinagar-bangalore-17il
Relocating can be a daunting task, whether it's moving to a new home or shifting your office space. The stress of packing, loading, transporting, and unpacking can often overshadow the excitement of starting afresh in a new location. However, with the right assistance, this process can become significantly smoother and more manageable. This is where **[Ferry Go Logistics Packers and Movers](https://ferry-go.com/)** steps in as your reliable partner for all your packing and moving needs in Rajajinagar, Bangalore. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6r2jfhr7cbt2w3i3bjjm.png) Ferry Go Logistics is a renowned name in the industry, known for its professionalism, efficiency, and commitment to customer satisfaction. With years of experience under their belt, they have mastered the art of relocation, ensuring a seamless transition for their clients every time. What sets Ferry Go Logistics apart is their attention to detail and personalized approach to each move. They understand that every relocation is unique, with its own set of challenges and requirements. Hence, they offer customized solutions tailored to meet the specific needs of their customers. Whether you are moving within the city or across the country, they have the expertise and resources to handle it all with ease. One of the biggest concerns during relocation is the safety of your belongings. Ferry Go Logistics prioritizes the security of your possessions and employs stringent safety measures to ensure that everything reaches its destination intact. From sturdy packing materials to well-maintained vehicles and skilled personnel, they leave no stone unturned to safeguard your valuables throughout the journey. Moreover, Ferry Go Logistics takes pride in their punctuality and reliability. They understand the value of time and strive to deliver prompt and efficient services, adhering to the agreed-upon schedule without any delays. This reliability has earned them the trust and loyalty of countless satisfied customers over the years. Customer satisfaction is at the core of **Ferry Go Logistics**' business philosophy. They believe in building long-lasting relationships with their clients based on trust, transparency, and integrity. From the moment you reach out to them for assistance until the last box is unpacked at your new destination, they are dedicated to providing you with a stress-free moving experience. So, if you're planning a relocation in Rajajinagar, Bangalore, look no further than Ferry Go Logistics - Packers & Movers. With their expertise, professionalism, and commitment to excellence, they will turn your moving day into a hassle-free affair, allowing you to focus on the excitement of starting a new chapter in your life.
ferrygologistics
1,863,103
Drainage Services Windsor Co
In the charming town of Windsor, Colorado, where picturesque landscapes and varying elevations are a...
0
2024-05-23T17:51:05
https://dev.to/greyrocklandscape/drainage-services-windsor-co-3p4o
In the charming town of Windsor, Colorado, where picturesque landscapes and varying elevations are a part of everyday life, effective water management is crucial for safeguarding your property. At Grey Rock Landscape, we specialize in providing top-tier **[drainage services Windsor CO](https://www.greyrocklandscape.com/windsor-colorado-drainage-services)**, to help you protect your home or business from water-related issues.
greyrocklandscape
1,863,102
** Penélope Glamour y los Secretos del Diseño UI/UX **🙎🏼
¡Hola Chiquis! 👋🏻 ¿Estás listo para embarcarte en el apasionante viaje del UX/UI? Penélope Glamour ya...
0
2024-05-23T17:49:20
https://dev.to/orlidev/-penelope-glamour-y-los-secretos-del-diseno-uiux--4i0e
design, beginners, ui, ux
¡Hola Chiquis! 👋🏻 ¿Estás listo para embarcarte en el apasionante viaje del UX/UI? Penélope Glamour ya está lista para poner en marcha su nuevo plan. ¿Y tú? ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m96jtgxa9gyo236f22ii.jpg) Penélope Glamour, 🤳🏻la intrépida piloto del Gatito Compacto en Los Autos Locos, está lista para desplegar su encanto y conocimiento sobre UI/UX. Así que, ajusta tu cinturón de seguridad y prepárate para un viaje lleno de creatividad y diversión por el mundo del diseño de interfaces. 💁🏼¿Qué es UX/UI? Imaginen que Penélope Glamour 💅🏻está diseñando su nueva guarida secreta. Para que sea perfecta, necesita pensar en dos aspectos cruciales: - UX (User Experience): La experiencia que tendrá el usuario al entrar a su guarida. Debe ser fácil de navegar, intuitiva y placentera. - UI (User Interface): La apariencia de la guarida. Debe ser atractiva, elegante y acorde con la personalidad de Penélope. UX/UI: Un dúo inseparable 🐱 Penélope lo sabe muy bien: UX y UI van de la mano como Pierre Nodoyuna y Patán. No se puede tener uno sin el otro. Un buen diseño UX/UI debe ser: - Centrado en el usuario: Penélope siempre piensa en lo que sus enemigos quieren y necesitan. De la misma manera, el diseño UX/UI debe tener en cuenta las necesidades y expectativas de los usuarios. - Intuitivo: Penélope y sus planes son tan fáciles de seguir como una interfaz bien diseñada. Un buen diseño UX/UI debe ser fácil de usar y comprender. - Atractivo: Penélope es una mujer de buen gusto. Su guarida secreta debe ser tan elegante como ella. Un buen diseño UX/UI debe ser visualmente atractivo y estéticamente agradable. - Funcional: Penélope no se conforma con nada menos que la perfección. Su guarida secreta debe funcionar a la perfección. Un buen diseño UX/UI debe ser funcional y eficiente. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xmv8kolazsmicma77w62.jpg) UX/UI: Un campo en constante evolución 🏎️ Al igual que los planes de Penélope Glamour, el mundo del UX/UI está en constante cambio. Nuevas tecnologías y tendencias emergen constantemente, obligando a los diseñadores a estar a la vanguardia. Experiencia de Usuario (UX) 🐈 Penélope sabe que la UX es como conducir en una pista llena de baches. Aquí están los detalles: - Investigación de Usuarios: Penélope se sube a su coche rosa y entrevista a los usuarios. ¿Qué necesitan? ¿Qué les frustra? ¡Ella no quiere que los usuarios se sientan como si estuvieran en una carrera de obstáculos! - Mapas de Flujo: Penélope traza mapas de flujo como si estuviera planeando su próxima ruta de carrera. ¿Cómo navegarán los usuarios por la interfaz? ¿Cuál es el atajo más rápido para llegar al botón de "Comprar ahora"? - Prototipado: Penélope crea prototipos como si estuviera ajustando su motor. ¿Cómo se sentirá el usuario al tocar ese botón? ¿Se acelerará o se detendrá? Acto I: El Compact Pussycat y la Primera Impresión 🏆 En el mundo de los autos locos, Penélope Glamour no solo es una piloto habilidosa, sino también una experta en UX/UI. Su coche rosa, el Gatito Compacto, es un ejemplo perfecto de cómo la primera impresión puede marcar la diferencia. Imagina a Penélope al volante, con su gato callejero Arriba en el asiento del copiloto, navegando por una interfaz intuitiva y atractiva. ¿Qué le diría a los diseñadores? "¡Chicos, si no puedes hacerlo rosa y con purpurina, no lo hagas!". ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/egoh8yw898mkwl2zhip0.jpg) Diseño de Interfaz de Usuario (UI) 🏁 Penélope también es una maestra en el arte de la UI. Aquí están los detalles: - Paleta de Colores: Penélope elige colores como si estuviera seleccionando el tono perfecto para su coche. ¿Azul cielo o rosa chicle? ¡La elección importa! - Tipografía: Penélope selecciona fuentes como si estuviera eligiendo las llantas adecuadas. ¿Sans-serif o serif? ¿Negrita o cursiva? ¡La tipografía debe ser legible y elegante! - Iconos y Botones: Penélope diseña iconos y botones como si estuviera personalizando su volante. ¿Un ícono de corazón para "Me gusta"? ¿Un botón de flecha para "Volver atrás"? ¡Cada detalle cuenta! Acto II: El Viaje del Usuario 🏳️ Penélope sabe que el viaje del usuario es crucial. Como en una carrera, cada paso cuenta. Desde el momento en que el usuario se sube al coche hasta que llega a su destino, la experiencia debe ser fluida y emocionante. Penélope aplicaría sus habilidades de escapismo para diseñar una navegación sin obstáculos. "¡No queremos que los usuarios se sientan atrapados en un atasco de información!", exclamaría. Acto III: El Diseño Responsivo y la Carrera Multidispositivo 👗 El Gatito Compacto se adapta a cualquier terreno, al igual que un buen diseño responsivo. Penélope sabe que los usuarios no solo corren en una sola pista. Desde el móvil hasta la computadora de escritorio, el diseño debe ser tan versátil como ella en una carrera de obstáculos. "¡No queremos que los usuarios se queden varados en la curva de la incompatibilidad!", diría con una sonrisa. Pruebas y Optimización 🎀 Penélope no se detiene en la línea de meta. Ella sigue mejorando: - Pruebas de Usabilidad: Penélope observa a los usuarios como si estuviera analizando su tiempo de vuelta en la pista. ¿Dónde se confunden? ¿Dónde se quedan atrapados? ¡Ajusta y vuelve a probar! - Optimización de Velocidad: Penélope ajusta la velocidad de carga como si estuviera afinando su motor. ¿Se carga rápido o se queda rezagado? ¡Nadie quiere un coche lento ni una interfaz lenta! Acto IV: La Prueba de Velocidad y Optimización ✨ Penélope es una campeona en la pista, y también lo sería en la optimización. Ella sabe que cada segundo cuenta. "¡Nada de tiempos de carga lentos!", exclamaría mientras ajusta los engranajes de su coche. "¡Optimicemos las imágenes, minimicemos los scripts y hagamos que todo vuele como yo en la recta final!". ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9mpl2orenwszkgn47f4.jpg) Diseño Terminado 💥 Cuando Penélope termina su diseño, su sonrisa es tan brillante como su coche. Ella sabe que la UI/UX es más que solo colores y botones. Es la emoción de cruzar la línea de meta con una interfaz que hace que los usuarios digan: "¡Eso fue genial!". Acto V: El Toque Final y la Sonrisa Ganadora🎉 Cuando Penélope cruza la línea de meta, su sonrisa es tan brillante como su coche. Ella entiende que el diseño visual es crucial. Los colores, las fuentes y los íconos deben trabajar juntos como un equipo de pit stop bien coordinado. "¡Hagamos que los usuarios sonrían como yo cuando gano!", diría mientras ondea su pañuelo rosa. Usabilidad móvil 📲 Penélope Glamour también tiene algunos consejos para la usabilidad móvil. Como una piloto experimentada, sabe que la experiencia del usuario en dispositivos móviles es crucial. Aquí tienes algunos consejos que Penélope compartiría: - Diseño Responsivo: Al igual que su Gatito Compacto se adapta a diferentes terrenos, las interfaces móviles deben ser responsivas. Asegúrate de que tu diseño se vea bien en pantallas pequeñas y grandes. ¡Nada de botones minúsculos que requieran una lupa para tocar! - Navegación Simplificada: Imagina a Penélope maniobrando su coche en una pista llena de obstáculos. De manera similar, los usuarios móviles deben poder navegar sin problemas. Utiliza menús desplegables, iconos claros y una estructura de navegación intuitiva. - Velocidad de Carga: Penélope no tolera tiempos de carga lentos. Optimiza tus imágenes, minimiza los scripts y asegúrate de que tu aplicación o sitio web se cargue rápidamente en dispositivos móviles. ¡Nadie quiere esperar como en una fila de tráfico! - Tamaño de Fuente y Espaciado: Elige fuentes legibles y un espaciado adecuado. Penélope no quiere que los usuarios tengan que hacer zoom para leer el contenido. ¡Haz que todo sea fácil de leer sin necesidad de gafas de sol! - Pruebas en Dispositivos Reales: Antes de lanzar tu diseño al mundo, pruébalo en diferentes dispositivos móviles. Penélope haría algunas vueltas de prueba en su Gatito Compacto para asegurarse de que todo funcione sin problemas. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rtxsr7k15hiloui1aycw.jpg) Penélope Glamour nos enseña que la usabilidad móvil es como una carrera de obstáculos: debemos sortear los desafíos para llegar a la meta. Así que, ¡diseña con velocidad y elegancia, como si estuvieras en una competencia de Los Autos Locos! 🏁📱💨  ¡Conviértete en un maestro del UX/UI! Si te apasiona crear experiencias digitales memorables, el UX/UI es el campo perfecto para ti. Con dedicación y creatividad, puedes convertirte en un maestro del UX/UI y diseñar interfaces que cautiven a los usuarios como Penélope Glamour cautiva a sus rivales. En resumen, Penélope Glamour nos enseña que el UX/UI es más que solo acelerar y frenar. Es una carrera emocionante hacia la satisfacción del usuario. Así que, queridos diseñadores, tomen nota de esta piloto intrépida y hagan que sus interfaces sean tan emocionantes como una vuelta en el Gatito Compacto. ¡Y recuerden, siempre lleven a su gato callejero favorito en el asiento del copiloto! 🚗🏁🎨  ¡Recuerda! 🛣️ - UX/UI es un campo creativo y desafiante. - Un buen diseño UX/UI es esencial para el éxito de cualquier producto digital. - Conviértete en un maestro del UX/UI y deja tu huella en el mundo digital. ¿Listo para la próxima vuelta? ¡Vamos a diseñar el mundo con estilo y velocidad! 🚗💨 Así que, tomen nota de esta piloto intrépida y hagan que sus interfaces sean tan emocionantes como una vuelta en el Gatito Compacto.  🚀 ¿Te ha gustado? Comparte tu opinión. Artículo completo, visita: https://lnkd.in/ewtCN2Mn https://lnkd.in/eAjM_Smy 👩‍💻 https://lnkd.in/eKvu-BHe  https://dev.to/orlidev ¡No te lo pierdas! Referencias:  Imágenes creadas con: Copilot (microsoft.com) ##PorUnMillonDeAmigos #LinkedIn #Hiring #DesarrolloDeSoftware #Programacion #Networking #Tecnologia #Empleo #UXUI ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1vo14ytuvfkklzf3bi8y.jpg) ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6v4udh0zgdtxjzmu2gqr.jpg)
orlidev
1,863,101
Django: Creating a skeleton website
From: MDN Web Docs Creating the library project Open the terminal in a virtual or...
0
2024-05-23T17:47:22
https://dev.to/samuellubliner/creating-a-skeleton-website-django-dg7
webdev, python, django
From: [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/skeleton_website) ## Creating the library project - Open the terminal in a virtual or development environment - Navigate to the project folder - Run: ```bash django-admin startproject locallibrary cd locallibrary` ``` `django-admin` generates: - a project folder - the file templates - `manage.py` - a `locallibrary` sub-folder with the same name as the project folder. This is the entry point for the website. The sub-folder entry point contains: `__init__.py`: Indicates the directory is a Python package `settings.py`: Website settings `urls.py`: URL-to-view mappings `wsgi.py`: Web Server Gateway Interface for synchronous apps `asgi.py`: Asynchronous Server Gateway Interface `manage.py`: Project management script that creates one or more applications. Applications: - Separate, reusable components of a website - Register the new applications - url/path mapper for each application ## Creating the catalog application Run this command from the same folder as `manage.py`: `python3 manage.py startapp catalog` This creates the following folder structure: ```bash catalog/ admin.py apps.py models.py tests.py views.py __init__.py migrations/ ``` The `migrations` folder updates the database when models are modified. ## Note for codespace development: Add `*` wildcard to `ALLOWED_HOSTS` in `settings.py`. This allows the host to run the live preview. ## Register the catalog application Add applications to `INSTALLED_APPS` in the project settings. ## Specifying the database SQLite is the default database. It is suitable if you don't a lot of concurrent access. Postgres requires additional setup and is more suitable for larger sites. ## Other settings `TIME_ZONE` can be configured. `SECRET_KEY` can be changed to read from an environment variable in production. `DEBUG` logs errors in a file instead of HTTP status code responses. Set to `False` in production. ## Hook up the URL mapper While `urls.py` can handle all the URL mappings, it's more common to route these mappings to the corresponding application. The URL mappings are managed through the `urlpatterns` variable, which is a list of `path()` functions. `path()` forwards requests to the module with the relative URL. `RedirectView` redirects the root URL of the site. Django does not serve static files by default. Serving CSS, JavaScript, and images can be useful for the development web server. Do not do this in production. In the catalog folder, create `urls.py` and define the imported `urlpatterns`. Add patterns here as the application grows. Before doing this, first run a database migration to update the database. ## Running database migrations Django uses an Object-Relational-Mapper. Django tracks the changes to model definitions and can create database migration scripts. In the directory that contains `manage.py`, run `python3 manage.py makemigrations` `python3 manage.py migrate` `makemigrations` creates the migrations. `migrate` applies the migrations to the database. ## Running the website `python3 manage.py runserver` Runs the development web server. An error page is expected if there are no pages/urls defined in the the root of the site.
samuellubliner
1,863,100
Learn how to deploy virtual machines using Quickstart templates, efficiently monitor workloads, and optimize costs on Azure.
Quickstart templates are pre-defined configurations and built-in services used to rapidly deploy...
0
2024-05-23T17:46:57
https://dev.to/pelumisat/learn-how-to-deploy-virtual-machines-using-quickstart-templates-efficiently-monitor-workloads-and-optimize-costs-on-azure-5hd8
devops, azure, virtualmachine, cloud
Quickstart templates are pre-defined configurations and built-in services used to rapidly deploy resources on the cloud. They are valuable for ensuring consistent deployment, enabling you to repeatedly achieve the same resource type in the same state. Additionally, they allow you to deploy quickly using just one command. This article will show you how to deploy a virtual machine using a quickstart template on Azure, monitor your resources remotely using the Azure mobile app, and deallocate your unused resources to save costs on Azure. **Here are the steps for deploying a virtual machine using a quickstart template on Azure.** Step 1: In the Azure portal search bar, enter "custom template" and select "Deploy custom template", as shown in the image below. ![Step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3y9pu33gqem16nx1mhuq.png) Step 2: On the next page, we will be setting up a Windows virtual machine, so select "Create a Windows virtual machine." ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1r3vp75cuo746o39e9l.png) Step 3: You will be directed to a page where you can edit the project details. Allocate a resource group name, which is similar to a folder used for organizing and managing your resources. Also, create a username and password for your virtual machine. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ektenm9yh71kbxyr2m99.png) Step 4: After correctly inputting all the details, click "Review and Create." ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c0vdzcgfm3c50mrc2dno.png) Step 5: The next page will allow you to review all the attributes of the virtual machine you are about to deploy. Once you have reviewed and are satisfied with them, click on "create." ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qaz1lh5t51z0eyuzycrb.png) ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uu3x42w07xn6zu48jwn6.png) Step 6: On the following page, you will see a message indicating that the deployment is in progress. You just need to wait until your virtual machine is successfully deployed. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2tmidu6yo5puwk1mdhtj.png) **How to remotely monitor your resources using the Azure mobile application** Now that you have learned how to quickly deploy a virtual machine using quickstart templates found on Azure, the next step is to learn how to monitor your workload using the Azure mobile app. This is useful for giving adequate attention to your resources on Azure in case anything unexpected happens. Step 7: Once the deployment is complete, click on "Go to the resource group," which is where all your resources are stored and managed. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6p8ln3yp85zpek2u2xj.png) Step 8: In the list of resources available in the resource group, scroll down to the virtual machine you recently deployed and click on it. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/trr5cqu5u0ptlu4r9ehi.png) Step 9: On the new page, you'll find information about the virtual machine you just deployed. Navigate to the upper-right section and click "Open in mobile tab." Then, choose to download from Google Play or the App Store, depending on your mobile phone type. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61umciph7j04kiofa5b6.png) Step 10: The image below shows how the download page appears on the Google Play Store. Proceed to install. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x3t39hlrdyzi7n3249sh.png) **How to optimize cost management by deallocating unused virtual machines** Cloud computing offers scalability, allowing for quick adjustments to computing resource demands to meet user or business needs. In modern business, there is a shift from capital expenditure to operational expenditure; therefore, all unnecessary costs are removed. Here in this section, you will be shown how to remove the virtual machine that was deployed if it is no longer in use. This is to prevent it from incurring per hour charges over time. Step 11: On the Azure dashboard, search for "virtual machines" and click on it. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cgs3cvnu6r9ztskch2sx.png) Step 12: The next page shows the list of virtual machines that have been created and are running. Here, I can see the virtual machine I recently deployed. Please make sure to click on the virtual machine you are interested in. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3u6tbgs3ewiaebzq02z.png) Step 13: You will be directed to a page where you can view the details of the virtual machine. Ensure to click on "Stop" and confirm the action by clicking "Yes" in the pop-up window. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dwydnf07f6vhsju951de.png) ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l5t2owataiwnju8ucfex.png) Step 14: The next important step is to disassociate the public IP address from the virtual machine. This is to ensure that there are no ongoing costs associated with its use. To begin this process, search for "public IP address" to list all current public addresses still in use on the account. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3s8cix9ny9istj7gnz3m.png) Step 15: Click on the current public IP address associated with the recently deployed virtual machine. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u1em0a1c470y2dnmmdg5.png) Step 16: On the next page, which shows information about the public IP address, click on "Disassociate" at the top and confirm by clicking "Yes" on the pop-up window. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivdu5qpvf60jjisbrjl5.png) ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1vbedal8ommvt2ed819i.png) You have now successfully stopped your unused virtual machine or resources, preventing any further costs from being incurred. This article shows how to quickly deploy virtual machines using quickstart templates, monitor resources with your mobile phone from anywhere, and stop unused virtual machines to avoid incurring extra costs. As modern technology continues to evolve, businesses, individuals, and government agencies need to adopt efficient practices for managing compute resources, both in the cloud and on-premises, in order to maximize the value of their cloud spending, regardless of the use case scenario.
pelumisat
1,863,045
Introdução ao TypeScript: Aumente a Robustez do Seu Código JavaScript
O TypeScript é um superconjunto do JavaScript que adiciona tipos estáticos ao código, tornando-o mais...
0
2024-05-23T17:45:00
https://dev.to/thiagohnrt/introducao-ao-typescript-aumente-a-robustez-do-seu-codigo-javascript-1d9c
typescript, webdev, beginners, braziliandevs
O TypeScript é um superconjunto do JavaScript que adiciona tipos estáticos ao código, tornando-o mais robusto e fácil de entender. Criado pela Microsoft, o TypeScript tem ganhado popularidade por melhorar a qualidade do código e proporcionar uma melhor experiência de desenvolvimento. Neste artigo, vamos explorar o TypeScript, entender suas principais vantagens e ver alguns exemplos práticos para começar. ## Por que usar TypeScript? 1. **Tipagem estática**: Ajuda a detectar erros durante a fase de desenvolvimento, em vez de em tempo de execução. 2. **Melhor autocompletar**: Ferramentas de desenvolvimento fornecem sugestões mais precisas e completas. 3. **Refatoração mais segura**: Mudanças no código são mais seguras e menos propensas a introduzir bugs. 4. **Legibilidade e manutenção**: Código mais fácil de entender e manter, especialmente em grandes projetos. ## Configurando o Ambiente Para utilizar o TypeScript, você precisará de algumas ferramentas, pois o navegador só interpreta JavaScript. Aqui estão os passos para configurar seu ambiente de desenvolvimento: ### 1. Instalar o Node.js e o npm Primeiro, você precisa instalar o Node.js, que vem com o npm (Node Package Manager). O npm permite instalar pacotes, incluindo o compilador TypeScript. - Baixe e instale o Node.js a partir do site oficial: [nodejs.org](https://nodejs.org/). ### 2. Instalar o TypeScript Com o npm instalado, você pode instalar o TypeScript globalmente em seu sistema. Abra o terminal ou prompt de comando e execute o seguinte comando: ```bash npm install -g typescript ``` ### 3. Configurar um Projeto TypeScript Crie uma nova pasta para o seu projeto e navegue até ela pelo terminal. Em seguida, execute o comando para inicializar um novo projeto TypeScript: ```bash mkdir meu-projeto-typescript cd meu-projeto-typescript tsc --init ``` Isso criará um arquivo `tsconfig.json`, que permite configurar as opções do compilador TypeScript. ### 4. Escrever e Compilar Código TypeScript Crie um arquivo TypeScript (por exemplo, `index.ts`) e escreva seu código. Para compilar o código TypeScript em JavaScript, execute: ```bash tsc ``` Isso gerará um arquivo JavaScript correspondente (`index.js`) que pode ser executado no navegador ou no Node.js. ### 5. Usar um Editor de Código Para facilitar o desenvolvimento, use um editor de código com suporte para TypeScript, como o [Visual Studio Code](https://code.visualstudio.com/). Ele oferece ótimos recursos de autocompletar e verificação de erros em tempo real. ## Exemplos Práticos ### 1. Tipos Básicos Vamos começar com a tipagem básica em TypeScript. Em JavaScript, você não especifica o tipo das variáveis, mas no TypeScript, você pode fazer isso: ```typescript let nome: string = "Thiago"; let idade: number = 30; let isProgrammer: boolean = true; console.log(`Nome: ${nome}, Idade: ${idade}, Programador: ${isProgrammer}`); ``` ### 2. Interfaces Interfaces permitem definir a estrutura de um objeto. Isso é útil para garantir que o objeto siga uma forma específica. ```typescript interface Pessoa { nome: string; idade: number; } const pessoa: Pessoa = { nome: "João", idade: 25 }; console.log(pessoa); ``` ### 3. Funções com Tipagem Em TypeScript, você pode definir os tipos dos parâmetros e do valor de retorno de uma função. ```typescript function saudar(nome: string): string { return `Olá, ${nome}!`; } console.log(saudar("Ana")); ``` ### 4. Classes TypeScript suporta a definição de classes, que são úteis para criar objetos mais complexos e orientados a objetos. ```typescript class Animal { nome: string; idade: number; constructor(nome: string, idade: number) { this.nome = nome; this.idade = idade; } fazerSom(): void { console.log(`${this.nome} está fazendo um som!`); } } const meuCachorro = new Animal("Rex", 4); meuCachorro.fazerSom(); ``` ### 5. Generics Generics permitem criar componentes que funcionam com qualquer tipo de dado, proporcionando mais flexibilidade. ```typescript function retornaElemento<T>(elemento: T): T { return elemento; } console.log(retornaElemento<number>(10)); console.log(retornaElemento<string>("Olá!")); ``` ### 6. Enumerações Enums são uma forma de dar nomes mais significativos a conjuntos de valores numéricos. ```typescript enum Cor { Vermelho, Verde, Azul } let minhaCor: Cor = Cor.Verde; console.log(minhaCor); // Saída: 1 ``` ## Conclusão TypeScript oferece uma série de recursos que ajudam a criar código JavaScript mais seguro, robusto e fácil de manter. Com a tipagem estática, interfaces, classes e generics, você pode estruturar melhor seu código e evitar muitos erros comuns. Se você está começando com TypeScript, pratique os exemplos acima e explore a [documentação oficial](https://www.typescriptlang.org/docs/) para aprofundar seu conhecimento. A adoção de TypeScript pode ser um grande passo para melhorar a qualidade e a sustentabilidade de seus projetos de software.
thiagohnrt
1,863,096
Cool animations with React-Spring
Introduction Hey there, fellow devs! 🖐️ Are you tired of boring, static UIs? Do you want...
0
2024-05-23T17:31:36
https://dev.to/arjunkava/cool-animations-with-react-spring-4ea1
webdev, javascript, animation, react
#### Introduction Hey there, fellow devs! 🖐️ Are you tired of boring, static UIs? Do you want to add some pizzazz to your React applications? Well, you're in for a treat! Today, we're diving into the world of **react-spring**, a powerful library for creating delightful animations in your React apps. Whether you're a beginner or a seasoned pro, there's always something cool to learn with react-spring. So, buckle up and let's make our UIs dance! 🎉 #### What is React-Spring? React-spring is a spring-physics-based animation library that powers most UI-related animation in React. It provides a set of hooks to easily create animations and transitions in your components. The best part? It's super flexible and can handle complex animations with ease. #### Why Use React-Spring? 1. **Declarative Animations:** Write animations the same way you write your React components. 2. **Performance:** Built on top of the `react-motion` library, it's optimized for performance. 3. **Flexibility:** From simple animations to complex sequences, react-spring has got you covered. #### Getting Started First things first, let's get react-spring installed. You can do this using npm or yarn: ```bash npm install react-spring # or yarn add react-spring ``` Now that we have it installed, let's create a simple animation. #### Simple Fade-In Animation Let's start with something basic: a fade-in animation. We'll animate a component to fade in when it mounts. ```jsx import React from 'react'; import { useSpring, animated } from 'react-spring'; const FadeInComponent = () => { const props = useSpring({ opacity: 1, from: { opacity: 0 } }); return <animated.div style={props}>Hello, I am fading in!</animated.div>; }; export default FadeInComponent; ``` #### Bouncing Ball Animation Now, let's create a more interesting animation: a bouncing ball. We'll animate a ball that bounces up and down. ```jsx import React from 'react'; import { useSpring, animated } from 'react-spring'; const BouncingBall = () => { const props = useSpring({ to: { transform: 'translateY(0px)' }, from: { transform: 'translateY(-100px)' }, config: { tension: 170, friction: 12 }, loop: { reverse: true }, }); return ( <animated.div style={{ ...props, width: 50, height: 50, borderRadius: '50%', background: 'coral', margin: 'auto' }} /> ); }; export default BouncingBall; ``` #### Carousel with React-Spring Let's create a simple carousel using react-spring. We'll animate the transition between images. ```jsx import React, { useState } from 'react'; import { useSpring, animated } from 'react-spring'; const Carousel = ({ images }) => { const [index, setIndex] = useState(0); const props = useSpring({ opacity: 1, from: { opacity: 0 }, reset: true, reverse: index % 2 === 0 }); const nextImage = () => setIndex((index + 1) % images.length); return ( <div> <animated.img src={images[index]} style={props} alt="carousel" /> <button onClick={nextImage}>Next</button> </div> ); }; export default Carousel; ``` #### Interactive Spring Animation Let's create an interactive animation where the user can drag a box around the screen. ```jsx import React from 'react'; import { useSpring, animated } from 'react-spring'; import { useDrag } from 'react-use-gesture'; const DraggableBox = () => { const [props, set] = useSpring(() => ({ x: 0, y: 0 })); const bind = useDrag((params) => set({ x: params.offset[0], y: params.offset[1] })); return <animated.div {...bind()} style={{ ...props, width: 100, height: 100, background: 'lightblue', cursor: 'grab' }} />; }; export default DraggableBox; ``` #### Conclusion React-spring opens up a world of possibilities for adding animations to your React applications. From simple transitions to complex interactive animations, it's a versatile tool that can bring your UI to life. So go ahead, experiment with it, and make your apps more engaging and fun! 🌟
arjunkava
1,863,095
Easy Notes in VSCode: Scraps
Hello, I'm K@zuki.. Today, I want to introduce a new VSCode extension I developed called Scraps....
0
2024-05-23T17:30:31
https://dev.to/corrupt952/easy-notes-in-vscode-scraps-5gf2
vscode, extensions
Hello, I'm [K@zuki.](https://x.com/corrupt952). Today, I want to introduce a new VSCode extension I developed called `Scraps`. This extension is a handy tool for taking quick notes while coding. ## What is `Scraps`? `Scraps` is a simple extension that allows you to write notes in the sidebar of VSCode. This extension helps you quickly jot down ideas or reminders that come up during development. https://marketplace.visualstudio.com/items?itemName=corrupt952.scraps ### Key Features - **Easy Note Creation**: You can write notes directly in the sidebar, making it easy to jot down thoughts quickly. - **Save Functionality**: Notes are saved even after closing VSCode, so you can safely store your thoughts. - **Simple UI**: The intuitive editor allows you to input notes in Markdown format. ## How to Install Search for `Scraps` in the VSCode Extensions marketplace and install it. You'll see an icon in the Activity Bar that looks like a notepad with a pencil. Click this icon to open the sidebar. ![screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqvjm8rkrgtj5vc55ei4.png) ## How to Use 1. Open VSCode and click the `Scraps` icon in the Activity Bar. 2. Enter your text freely in the note area displayed in the sidebar. 3. No special save operation is needed; your notes are automatically saved. ## Background of Development `Scraps` was born out of my need to take quick notes during daily coding sessions. Although I use other main note-taking tools, I often need to temporarily store notes that don't need to be kept long-term. I developed `Scraps` to fulfill this need for a simple, VSCode-contained note-taking tool. ## Use Cases Some possible use cases for `Scraps` include: - Writing notes or tasks that you don't want to include directly in your code. - Temporarily storing commands or tokens until you can save them elsewhere. - Keeping a simple to-do list for the day's tasks. ## Conclusion `Scraps` is still in its early stages, but I plan to continue adding features and making improvements. If you have any feedback or suggestions, please let me know through the marketplace review section or the GitHub repository. I hope `Scraps` enhances your coding experience! https://github.com/corrupt952/scraps
corrupt952
1,863,094
Easy Notes in VSCode: Scraps
Hello, I'm K@zuki.. Today, I want to introduce a new VSCode extension I developed called Scraps....
0
2024-05-23T17:30:31
https://dev.to/corrupt952/easy-notes-in-vscode-scraps-43ld
vscode, extensions
Hello, I'm [K@zuki.](https://x.com/corrupt952). Today, I want to introduce a new VSCode extension I developed called `Scraps`. This extension is a handy tool for taking quick notes while coding. ## What is `Scraps`? `Scraps` is a simple extension that allows you to write notes in the sidebar of VSCode. This extension helps you quickly jot down ideas or reminders that come up during development. https://marketplace.visualstudio.com/items?itemName=corrupt952.scraps ### Key Features - **Easy Note Creation**: You can write notes directly in the sidebar, making it easy to jot down thoughts quickly. - **Save Functionality**: Notes are saved even after closing VSCode, so you can safely store your thoughts. - **Simple UI**: The intuitive editor allows you to input notes in Markdown format. ## How to Install Search for `Scraps` in the VSCode Extensions marketplace and install it. You'll see an icon in the Activity Bar that looks like a notepad with a pencil. Click this icon to open the sidebar. ![screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqvjm8rkrgtj5vc55ei4.png) ## How to Use 1. Open VSCode and click the `Scraps` icon in the Activity Bar. 2. Enter your text freely in the note area displayed in the sidebar. 3. No special save operation is needed; your notes are automatically saved. ## Background of Development `Scraps` was born out of my need to take quick notes during daily coding sessions. Although I use other main note-taking tools, I often need to temporarily store notes that don't need to be kept long-term. I developed `Scraps` to fulfill this need for a simple, VSCode-contained note-taking tool. ## Use Cases Some possible use cases for `Scraps` include: - Writing notes or tasks that you don't want to include directly in your code. - Temporarily storing commands or tokens until you can save them elsewhere. - Keeping a simple to-do list for the day's tasks. ## Conclusion `Scraps` is still in its early stages, but I plan to continue adding features and making improvements. If you have any feedback or suggestions, please let me know through the marketplace review section or the GitHub repository. I hope `Scraps` enhances your coding experience! https://github.com/corrupt952/scraps
corrupt952
1,863,093
A Comprehensive Guide to Repairing Auto Air Conditioning
Introduction: In the scorching heat of summer or the biting chill of winter, a functioning car air...
0
2024-05-23T17:27:49
https://dev.to/backlink_30/a-comprehensive-guide-to-repairing-auto-air-conditioning-53jd
Introduction: In the scorching heat of summer or the biting chill of winter, a functioning car air conditioning system is a necessity, not a luxury. However, like any other mechanical component, auto AC systems can malfunction over time due to various reasons such as leaks, compressor issues, or electrical problems. In this comprehensive guide, we'll delve into the intricacies of auto air conditioning repair, from diagnosing common issues to executing the necessary fixes, ensuring you can breeze through any climate comfortably. Understanding the Basics of Auto Air Conditioning: Before diving into repairs, it's crucial to grasp the fundamental workings of an automotive air conditioning system. Most modern cars employ a closed-loop system that circulates refrigerant to absorb heat from the cabin and expel it outside. The key components include the compressor, condenser, evaporator, and expansion valve. Refrigerant flows through these components, undergoing phase changes to cool the air inside the car. Identifying Common Issues: Effective troubleshooting begins with identifying symptoms indicative of AC malfunctions. Common signs include weak airflow, warm air blowing from vents, unusual noises from the compressor, or visible leaks under the vehicle. Additionally, a distinct musty odor emanating from the vents may indicate mold growth within the system, necessitating thorough cleaning and disinfection. Diagnostic Procedures: Diagnosing AC problems often requires a systematic approach. Utilizing specialized tools like pressure gauges and leak detectors, technicians can assess refrigerant levels, inspect compressor operation, and pinpoint potential leaks. Electrical diagnostics may also be necessary to identify faults in sensors, relays, or wiring harnesses contributing to system malfunction. Refrigerant Leak Detection and Repair: Refrigerant leaks are a common culprit behind diminished AC performance. Technicians employ various methods, including UV dye injection and electronic leak detectors, to locate leaks in the system. Once identified, leaks must be promptly repaired to prevent further refrigerant loss and environmental harm. Common leak points include compressor shaft seals, hose connections, and evaporator or condenser coils. Compressor Replacement: The compressor serves as the heart of the AC system, pressurizing refrigerant for circulation. When the compressor fails due to wear, electrical issues, or internal damage, it must be replaced to restore cooling performance. Compressor replacement involves evacuating the system, removing the old compressor, installing a new unit, and recharging refrigerant to manufacturer specifications. Evaporator and Condenser Maintenance: The evaporator and condenser coils play pivotal roles in heat exchange processes within the AC system. Over time, these components may accumulate debris, reducing efficiency and impeding airflow. Regular maintenance, including coil cleaning and inspection, can prevent performance degradation and extend component lifespan. In severe cases of corrosion or damage, replacement may be necessary. Electrical System Diagnosis and Repair: Electrical faults can disrupt the operation of AC components, leading to intermittent cooling or complete system failure. Technicians utilize multimeters and wiring diagrams to trace electrical circuits, identifying faulty switches, relays, or wiring harnesses. Common issues include blown fuses, corroded connectors, or sensor failures, which can often be resolved through component replacement or repair. System Recharging and Performance Testing: Once repairs are completed, the AC system must be recharged with the appropriate refrigerant to achieve optimal cooling performance. Technicians carefully measure and inject refrigerant into the system, ensuring proper pressure and volume. Following recharging, performance testing is conducted to verify airflow, temperature output, and system integrity, guaranteeing that the repaired AC system operates as intended. Preventive Maintenance and Long-Term Care: To prolong the lifespan of your **[Repair Auto Air Conditioning](https://thomasexxon.com/auto-air-conditioning-repair-in-corpus-christi-texas/)** system and minimize the need for future repairs, proactive maintenance is essential. Regularly scheduled inspections, refrigerant top-ups, and filter replacements can prevent minor issues from escalating into costly repairs. Additionally, practicing good driving habits, such as avoiding prolonged idling and parking in shaded areas, can reduce AC workload and improve fuel efficiency. Conclusion: Maintaining a properly functioning auto air conditioning system is vital for comfort and safety while driving in diverse weather conditions. By understanding the underlying principles of AC operation and following systematic diagnostic and repair procedures, you can effectively address common issues and restore cooling performance to your vehicle. Whether it's detecting refrigerant leaks, replacing faulty components, or conducting preventive maintenance, proactive care ensures that your car's AC system remains reliable and efficient for miles to come.
backlink_30
1,862,842
Git update-refs in a nutshell
Original article on my blog (🇫🇷) When working on a versioned project, it is relatively common to...
0
2024-05-23T17:26:37
https://dev.to/onepoint/git-update-refs-in-a-nutshell-574c
git, rebase, versioncontrol
> Original article on my [blog](https://blog.hot-coffee.dev/blog/git_update_refs/) (🇫🇷) When working on a versioned project, it is relatively common to end up with a "stack" of branches. What could be more frustrating than having to rebase all the other branches on top of the first one when updating it? This process becomes even more tedious when the number of branches is high or when they are regularly modified. Git version 2.38[^1] introduces a solution to this problem: the `update-refs` rebase option. ## Stack? Branch stacking is a way to break down important features, allowing for smaller pull requests. In the example below, three branches dependent on each other have been created, allowing "my feature" to be divided into three distinct blocks. > The assumption here is that when each of these branches is individually merged into the `main` branch, the code will still be functional, as it has been appropriately divided. ![initial state](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/piry3zxu4evdyso0lhec.png) Let's say a small typo was made in the commit of the `my-feature-v1` branch. A second commit needs to be added to fix the issue, resulting in the following history: ![after commit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjqbz34lpnugl662flmi.png) In this situation, the only solution to update `my-feature-v2` and `my-feature-v3` is to checkout and rebase v2 on v1, then v3 on v2. This cumbersome process is remedied by the `update-refs` rebase option. ## The solution ### update-refs The goal of this option is to automatically update the _n_ branches on which the branch being rebased depends. Thus, in our case, we can simply checkout our `my-feature-v3` branch and run the command `git rebase my-feature-v1 --update-refs`. With this option, Git updates not only the v3 branch but also the v2 branch to preserve the history. The result of this operation is as follows: ![after rebase update-refs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/popxq76ba40elbnxdfov.png) **In practice:** ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84doy3uaerh4o9mgnb59.gif) ### Updating the Remote Repository Even if the branches being manipulated have already been pushed to the remote repository, it is possible to update all of them in a single command: `git push --force-with-lease origin my-feature-v1 my-feature-v2 my-feature-v3` > Here, a specific `force push` is used to preserve the remote history[^2]. ### Global Activation Why not always use the `update-refs` option during a rebase? The Git team asked themselves the same question and decided to include this possibility in the configuration. Thus, `git config --global rebase.updateRefs true` activates the option globally for each of your rebases. ### In Summary * `git rebase {my-branch} --update-refs` updates a branch and all its dependencies * `git push --force-with-lease origin my-branch-1 my-branch-2 my-branch-n` pushes the update of these branches to the remote repository Happy _rebasing_! [^1]: The release note is available [here](https://github.blog/2022-10-03-highlights-from-git-2-38/#rebase-dependent-branches-with-update-refs) [^2]: See the [use case](https://delicious-insights.com/en/posts/git-push-with-lease/)
ibethus
1,861,533
Notre retour (backend) sur Devoxx 2024
Devoxx 2024 nous a offert une pléthore de conférences sur Java et le backend en général cette année....
0
2024-05-23T17:25:21
https://dev.to/onepoint/notre-retour-backend-sur-devoxx-2024-4knc
devoxx, backend, java
Devoxx 2024 nous a offert une pléthore de conférences sur Java et le backend en général cette année. Faire un choix parmi tous ces talks n'a pas été facile, mais voici celles qui ont retenu notre préférence. ## Model Mitosis : ne plus se tromper entre les microservices et le monolithe Les habitués des présentations de [Julien Topçu](https://x.com/JulienTopcu) ne seront pas déçus par ce nouveau talk. Accompagné de son collègue [Josian Chevalier](https://x.com/JosianChevalier), les deux intervenants se glissent dans la peau d'un duo développeur/architecte, le tout dans l'univers du Mandalorian. À travers un exemple concret d'implémentation de fonctionnalités, les deux compères nous expliquent comment refactorer un monolithe de manière itérative tout en s'inspirant de la mitose cellulaire en biologie. Le va-et-vient incessant du développeur qui a les mains dans le cambouis et la vision très macro de l'architecte peut nous rappeler des situations déjà vécues. Le tout saupoudré d'humour et d'idées originales (comme les refacto de Chat3PO), cette présentation est de loin la plus divertissante et enrichissante de cette édition devoxx 2024. [Replay sur Youtube.](https://www.youtube.com/watch?v=HNQJW5iMZgQ) ## Nous sommes tous rassemblés - We are all to gather Après un très court rappelle sur l'api `java.util.Stream` [Rémi Forax](http://monge.univ-mlv.fr/~forax/) nous présente le nouveau venu (_java 22 preview_) : *les gatherers*. Très concrètement, ceux-ci permettent d'implémenter n'importe quelle opération intermédiaire sur un _stream_. On pourra donc évidemment réimplémenter toutes les opérations existantes, comme `map`, `filter` ou `takeWhile`, mais aussi laisser libre cours à notre imagination. Que ce soit pour un débutant, ou un développeur Java confirmé, cette conférence est un _must_ en terme de pédagogie et nous permet de comprendre, l'intérêt et l'utilisation de cette nouvelle _API_, ainsi que de rappeler quelques petits secrets cachés de l'existant. [Replay sur Youtube.](https://www.youtube.com/watch?v=HNQJW5iMZgQ) ## Bootiful Spring Boot 3.3 [Josh Long](https://x.com/starbuxman) commence sa conférence en faisant un bref rappel de Spring à travers un site inspiré de l'univers de Mario : [Histoire de Spring](https://springone.io/history-of-spring). Ensuite, Josh se rend sur [Spring Initializr](https://start.spring.io/), ajoute plusieurs dépendances (GraalVM, Spring Web, Spring Data Jdbc, etc.) et se lance dans une démonstration en direct. Après avoir brièvement présenté les dernières nouveautés de Java (records, sealed types, smart switch expressions et pattern matching), il nous entraîne dans l'implémentation d'un générateur d'histoires basé sur Spring OpenAI. Il enchaîne avec une démonstration des Virtual Threads implémentés dans Spring (il suffit simplement d'ajouter la propriété `spring.threads.virtual.enabled=true` pour en bénéficier). Il termine sa démonstration en direct par une compilation native du projet qu'il vient de développer sous nos yeux. Vous avez peut-être déjà vu cette présentation qu'il donne depuis l'arrivée de Spring Boot 3, mais elle a le mérite d'être mise à jour avec les nouveautés de Spring et Java. Une présentation très rafraîchissante avec beaucoup d'humour ! On passe un bon moment. [Replay sur Youtube.](https://www.youtube.com/watch?v=tA_KKK1zXzc) ## Sous le capot d'une application JVM - Java Flight Recorder / Java Mission Control [Guillaume Darmont](https://x.com/gdarmont) commence sa présentation en expliquant ce que sont les outils Java Flight Recorder (JFR) et Java Mission Control (JMC). On peut les comparer respectivement à l'enregistrement d'une boîte noire d'un avion et au logiciel permettant d'exploiter toutes les données de cette boîte noire. Ensuite, il présente l'application démo qu'il a conçue pour l'occasion : une application permettant de calculer le hash d'un ensemble de fichiers. De manière itérative, il nous montre comment manipuler JFR et JMC pour trouver et corriger les problèmes de performance d'une application Java. En prime, il nous explique comment il a découvert un problème de performance présent dans le JDK depuis de nombreuses années en préparant sa présentation. La prochaine version de la JDK intégrera donc son correctif. [Replay sur Youtube.](https://www.youtube.com/watch?v=wa_EtTUx-z0) ## Mot de la fin Retrouvez notre série d'articles sur Devoxx : 1. [Intro](https://dev.to/onepoint/devoxx-france-2024-8o) 2. [Frontend](https://dev.to/onepoint/notre-retour-frontend-sur-devoxx-2024-1jgg) 3. [Data/IA](https://dev.to/onepoint/mais-oui-ia-de-la-data-a-devoxx-france-2024--4kpe)
dlucasd
1,863,057
Mastering React Motion: Adding Smooth Animations to Your React Apps
Introduction Hey there, fellow developers! Are you ready to take your React projects to...
0
2024-05-23T17:20:02
https://dev.to/arjunkava/mastering-react-motion-adding-smooth-animations-to-your-react-apps-1d99
react, animation, javascript, webdev
### Introduction Hey there, fellow developers! Are you ready to take your React projects to the next level with some slick animations? Today, we're diving into **React Motion**, a powerful library that makes it super easy to add smooth, natural animations to your React components. Whether you're building a simple to-do list or a complex dashboard, React Motion can help you create a more dynamic and engaging user experience. ### What is React Motion? React Motion is a popular animation library for React that leverages the power of physics to create natural and fluid animations. Unlike traditional CSS-based animations, React Motion uses a physics-based approach, allowing you to define how elements should move based on principles like stiffness, damping, and precision. ### Why Use React Motion? - **Smooth and Natural Animations**: React Motion's physics-based animations feel more natural compared to traditional CSS animations. - **Declarative Syntax**: You can describe your animations declaratively within your React components, making your code more readable and maintainable. - **Flexibility**: Easily animate a variety of properties, including position, size, and opacity. ### Getting Started Let's get our hands dirty with some code. We'll start by setting up a basic React project and adding React Motion to it. #### Step 1: Set Up Your React Project If you don't already have a React project, you can create one using Create React App: ```bash npx create-react-app react-motion-demo cd react-motion-demo ``` #### Step 2: Install React Motion Next, install React Motion via npm: ```bash npm install react-motion ``` #### Step 3: Create Your First Animation Now, let's create a simple component that uses React Motion to animate a box. ```jsx import React from 'react'; import { Motion, spring } from 'react-motion'; const AnimatedBox = () => { return ( <Motion defaultStyle={{ x: 0 }} style={{ x: spring(100) }}> {style => ( <div style={{ transform: `translateX(${style.x}px)`, width: '100px', height: '100px', backgroundColor: 'tomato', }} /> )} </Motion> ); }; export default AnimatedBox; ``` In this example, we use the `Motion` component to animate a box from `x: 0` to `x: 100`. The `spring` function is used to create a smooth animation based on spring physics. ### Exploring More Complex Animations Let's add some more complexity by animating multiple properties and incorporating user interactions. ```jsx import React, { useState } from 'react'; import { Motion, spring } from 'react-motion'; const InteractiveBox = () => { const [isToggled, setIsToggled] = useState(false); const handleToggle = () => { setIsToggled(!isToggled); }; return ( <div onClick={handleToggle}> <Motion defaultStyle={{ x: 0, opacity: 0.5 }} style={{ x: spring(isToggled ? 200 : 0), opacity: spring(isToggled ? 1 : 0.5) }} > {style => ( <div style={{ transform: `translateX(${style.x}px)`, opacity: style.opacity, width: '100px', height: '100px', backgroundColor: 'tomato', cursor: 'pointer' }} /> )} </Motion> </div> ); }; export default InteractiveBox; ``` In this example, clicking the box toggles its position and opacity, creating a more dynamic interaction. ### Fine-Tuning Your Animations React Motion provides several parameters to fine-tune your animations: - **Stiffness**: Controls the rigidity of the spring. Higher values result in faster animations. - **Damping**: Controls the resistance. Higher values create slower animations. - **Precision**: Determines the accuracy of the animation's end state. Here's how you can customize these parameters: ```jsx <Motion defaultStyle={{ x: 0 }} style={{ x: spring(100, { stiffness: 170, damping: 26, precision: 0.01 }) }} > {style => ( <div style={{ transform: `translateX(${style.x}px)`, width: '100px', height: '100px', backgroundColor: 'tomato', }} /> )} </Motion> ``` ### Conclusion React Motion is a fantastic library for adding smooth, physics-based animations to your React applications. By leveraging its declarative syntax and customizable parameters, you can create engaging and dynamic user experiences with ease. Give it a try in your next project, and watch your UI come to life! Happy coding! --- Feel free to ask any questions in the comments or share your awesome animations with us. We'd love to see what you create with React Motion!
arjunkava
1,863,056
Practical Async JavaScript
Introduction Let's take a moment to brush up on some JavaScript async concepts...
0
2024-05-23T17:18:01
https://dev.to/bgdnvarlamov/practical-async-javascript-ep5
javascript, webdev, tutorial, learning
## Introduction Let's take a moment to brush up on some JavaScript async concepts together. ## What is Asynchronous? First off, let's remind ourselves what an asynchronous process is. Simply put, it's a process that doesn't execute immediately but has a delay or lag. It's like ordering a coffee at a busy café - you place your order, and it takes a bit of time before you get your cup. ## Creating a Fake API Call Alright, can we create a function that mimics a basic API call? Absolutely! Here's a simple example: ```javascript function fakeApiCall(response) { return new Promise((resolve, reject) => { setTimeout(() => { resolve(`Success: ${response}`); }, 1000); }); } ``` Our fakeApiCall function takes a value and returns it after a 1-second delay, labeled with "Success." We're using a Promise because it always handles asynchronous code, and setTimeout to manage the delay. ## Adding Error Handling But hey, do API calls always return the expected value? Nope, sometimes they return errors. Let's add this functionality too: ```javascript function fakeApiCall(response) { return new Promise((resolve, reject) => { setTimeout(() => { if (Math.random() > 0.5) { resolve(`Success: ${response}`); } else { reject('API call failed: try again'); } }, 1000); }); } ``` Here, we've added a condition using Math.random(). Now, there's a 50% chance of success and a 50% chance of failure, mimicking real-world API behavior. ## Retrying on Failure Great! But what if we want to retry the API call when it fails? Let's tackle that: ```javascript let attempt = 0; async function makeApiCallWithRetries(value) { try { const result = await fakeApiCall(value); return result; } catch (error) { attempt++; console.log(`Attempt ${attempt} failed: ${error} - for value: ${value}`); return makeApiCallWithRetries(value); } } ``` In this code, we retry until we get a successful response. Note, this could lead to an infinite loop if we're unlucky, but we'll hope for the best! ### Setting a Retry Limit To avoid that infinite loop, let's set a maximum retry limit: ```javascript let attempt = 0; const maxRetries = 5; async function makeApiCallWithRetries(value) { try { const result = await fakeApiCall(value); return result; } catch (error) { attempt++; if (attempt >= maxRetries) { throw new Error(`Max retries reached: ${error}`); } console.log(`Attempt ${attempt} failed: ${error} - for value: ${value}`); return makeApiCallWithRetries(value); } } ``` Now, we'll stop trying after five attempts, avoiding the dreaded infinite loop. ## Making Parallel API Calls So, what if we need to make multiple API calls simultaneously? Let's think this through. Imagine we have a bunch of requests that need to go out all at once. How can we handle that efficiently? Well, we can run them in parallel. Here's how: ```javascript async function makeApiCallsInParallel(values) { const promises = values.map((value) => makeApiCallWithRetries(value)); const results = await Promise.allSettled(promises); results.forEach((result, index) => { if (result.status === 'fulfilled') { console.log(`Response ${index + 1} succeeded: ${result.value}`); } else { console.log(`Response ${index + 1} failed: ${result.reason}`); } }); } ``` This function takes an array of values and calls makeApiCallWithRetries for each value in parallel. We're using Promise.allSettled to handle both successful and failed calls. ## Conclusion I hope this refreshed your memory about core JavaScript async functionality or even taught you something new. **Thanks for hanging out!** Hit subscribe for more! 👋
bgdnvarlamov
1,863,055
Game-Changers: How Blockchain is Revolutionizing the Sports Industry
The sports industry has always been prone to technological innovation. However, blockchain technology...
0
2024-05-23T17:17:32
https://36crypto.com/game-changers-how-blockchain-is-revolutionizing-the-sports-industry/
cryptocurrency, blockchain, sports
The sports industry has always been prone to technological innovation. However, blockchain technology remains the most promising, opening up new opportunities not only for fans but also for clubs and organizations. So how exactly will blockchain transform the sports industry? **FC Manchester City** Since 2021, the football club has been actively integrating blockchain technology into its operations through partnerships with various companies specializing in this field. One of the key examples is the [partnership](https://www.ccn.com/manchester-city-blockchain-gaming-bitcoin-superbloke/) with the South Korean sports services developer Superbloke. As part of this collaboration, they created an online game called FC Superstars, where users could create digital teams and exchange cards of football club players based on real matches. In addition, Manchester City has [issued](https://www.mancity.com/news/club/socios-launch-manchester-city-fan-token-63751737) fan tokens $CITY built on the Chiliz blockchain as part of its partnership with Socios.com. With this token, fans have the opportunity to participate in the club’s decision-making and gain access to exclusive experiences. Furthermore, in March 2022, the club [became](https://cointelegraph.com/news/sports-sponsorships-sealed-amid-market-turmoil-as-man-city-inks-deal-with-okx) an official partner of the OKX cryptocurrency exchange. Later, the exchange even expanded its partnership and became the club’s official sponsor in a deal worth more than $70 million over three years. Also, Manchester City and OKX recently released a limited edition of [jerseys](https://cointelegraph.com/news/man-city-okx-limited-edition-jerseys-nfts) related to rare NFTs. The club’s chief marketing and fan experience officer, Nuria Tarre, said the launch of NFT is part of the Premier League club’s strategy to attract an audience that is “more tech-savvy, open to innovations and technologies.” He explained: _“We think it’s important that you can own this piece digitally. I think that’s one of the beauties of Web3 — it changes the ownership process.”_ In general, the football club is implementing blockchain technology to create a more interactive and transparent interaction with its fans, as well as to implement more innovative approaches in its operations. **NBA** The basketball league was one of the first to implement blockchain in its operations. Some NBA teams have several partnerships with several companies. For example, in 2019, the Sacramento Kings [announced](https://www.nba.com/kings/news/sacramento-kings-and-blockparty-launch-nbas-first-blockchain-driven-token-power-predictive) the first blockchain-based NBA awards program in collaboration with Blockparty. And in 2020, they launched the first auction platform for authentic memorabilia, together with ConsenSys and Treum. In 2021, they also [partnered](https://www.nba.com/kings/news/sacramento-kings-and-blockchain-company-ankr-launch-multi-year-partnership) with Ankr to create educational content, host events, and create innovative projects. In addition, they launched the NBA Top Shot blockchain platform, which allows fans to buy, collect, and trade officially licensed digital NBA collectibles called “Moments.” **FC Barcelona** The football club also actively uses blockchain and web3 technologies to engage its fans. In 2020, FC Barcelona issued the $BAR Fan Token in [cooperation](https://cointelegraph.com/news/fc-barcelona-dives-into-crypto-partnering-with-chiliz-to-create-token) with the blockchain platform Chiliz. The tokens provide fans with access to exclusive content, rewards, and the opportunity to participate in surveys. Later, in 2022, the platform invested in Barça Studios, the club’s digital content creation division, becoming a strategic partner. Barça Studios also leads the development of NFTs, meta projects, and other Web3 technologies. Since 2022, the cryptocurrency exchange WhiteBIT has been the official [partner](https://www.sportspromedia.com/news/fc-barcelona-whitebit-cruptocurrency-global-partner-esports/) of the football club. Their partnership also includes collaboration with the Barça Innovation Hub (BIHUB), a professional football research center that seeks to shape the future and set industry standards. In cooperation with WhiteBIT, they have created a new online [course](https://elearning.barcainnovationhub.com/product/course-in-game-changing-tech-mastering-blockchain/?utm_source=blog&utm_medium=article&utm_campaign=announcement&utm_content=en) “Game-Changing Tech: Mastering Blockchain”. The course aims to develop an understanding of blockchain technology and explore its practical applications in everyday life. **Summary** The integration of blockchain technology into the sports industry is transforming the relationship between organizations and fans. Through partnerships and innovative initiatives, sports clubs are using blockchain to increase fan engagement, increase transparency, and find new revenue streams. Their partnerships demonstrate how blockchain facilitates interactive experiences, allows fans to participate in decision-making processes, and opens up opportunities for exclusive content and rewards. Moreover, by using blockchain and Web3 technologies, sports organizations are not only adapting to the changing preferences of a tech-savvy audience but also becoming leaders in innovation in their respective industries.
deniz_tutku
1,855,313
INTRODUCTION TO SCRYPT SYNTAX AND DATA TYPES.
sCrypt is a subset of TypeScript used for writing smart contract on BSV blockchain. It is said to be...
0
2024-05-23T17:11:25
https://dev.to/bravolakmedia/introduction-to-scrypt-syntax-and-data-types-2k2l
bsvdevelopers, blockchaindevelopers, bitcoinsmartcontracts
sCrypt is a subset of TypeScript used for writing smart contract on BSV blockchain. It is said to be an embedded Domain Specific Language (eDSL), simply put, it is a language within another language which is TypeScript. The choice of TypeScript as the host language for sCrypt fulfills two of the aims of writing bitcoin smart contracts. It is a familiar JavaScript programming language with type safety features. Thus to use it for bitcoin smart contract, a programmer do not need to learn new programming language. This article focuses on introduction to sCrypt, sCrypt syntax and data types. It aims at introducing newcomers into the sCrypt syntax and data types which are essentials for writing smart contracts and building decentralized applications (dApps) on BSV blockchain. INTRODUCTION TO SCRYPT. sCrypt is a high-level programming language that is specified for writing smart contracts on BSV blockchain. It is designed with high emphasis on reliability and security for developers use within the BSV ecosystem. It utilizes the inherent Bitcoin protocol i.e script verification. This feature alone give smart contracts written on sCrypt high level of integrity. sCrypt language is compiled into Bitcoin Script which result in assembly-like scripts that can be used as a locking scripts while building transactions on BSV blockchain. Bitcoin uses a scripting system for transaction. Script is a simple series of instructions. These instructions are in sequential order and stack-based. Data is pushed onto the stack and opcodes are used to perform operations on items found on the stack. To learn more about bitcoin scripts you can check [here](https://wiki.bitcoinsv.io/index.php/Script). Key Features Of SCRYPT. sCrypt has some key features which gives it more benefits over other languages that are used for writing smart contracts. Some of the features and benefits offered by sCrypt are stated below. Security and Reliability: sCrypt leverage on inherent security protocol of the Bitcoin by building on top of the Bitcoin scripts. As such it minimizes the risk of vulnerabilities and exploits. Script Compatibility: sCrypt is completely compatible with Bitcoin Scripts, thus it enables easy integration of smart contracts written with sCrypt into the existing Bitcoin infrastructure. Bitcoin Script codes can also be translated into sCrypt code. Syntax Resemblance: sCrypt syntax resembles that of the familiar programming languages like Python and JavaScript. It also has programming constructs like variables, functions, loops and conditionals. The syntax and structure resemblance in sCrypt reduces learning curves for developers that are familiar with programming languages like JavaScript and Python. Deterministic Execution: sCrypt enforces predetermined execution of smart contracts which is essential for consensus and BSV blockchain integrity maintenance. This enhances the reliability and trustworthiness of smart contracts on BSV. Scalability and Performance: sCrypt has lightweight and efficient architecture that minimizes resources consumption. It enables the creation of complex smart contracts with high level of performance and scalability. Tools and Development Environment: sCrypt offers a comprehensive suite of developers tools and resources to support developers throughout the smart contract development life cycle. The tools include integrated development environments (IDEs), testing frameworks and documentation. The tools help to simplify development, code review and debugging process. BASIC SYNTAX OF sCrypt. sCrypt has basic syntax elements like variables, functions, conditionals and loops just like other programming languages. Variables: Data is store in variables and the variable can be declared using the key word `var` `const` or `let` Examples of variable declarations is shown below ``` let a: bigint = 1n // n-suffix means the constant will be compiled as a bigint a = BigInt(1) // Can also be defined with the BigInt() wrapper instead var b: boolean = false const N: number = 3 ``` As shown above, variables are declared using the keyword, followed by the variable name and the variable can be initialized with a value. Using the keyword `let` we initialize the `variable` named ‘a’ with value of 1 which is a big integer. The `variable` named ‘b’ is initialized to be false, it is a boolean type. Lastly the `variable` named ’N’ is initialized to be 3, it a number. 2. Functions: Functions are blocks of code that performs a specific task and can be reused in a smart contract. Functions are declared using the `function` keyword, followed by the function’s name, parameters and the function’s body inside a curly bracket as shown below; ``` function add(int a, int b) { return a + b; } ``` The `function` above is an addition `function` to add two integers ‘a’ and ‘b’ and return the sum of the two. The name of the `function` is ‘add’ , with parameters (int a) and (int b). The body of the function contain the return statement of the function. Note that while writing smart contract for BSV blockchain using sCrypt, some functions are built-in-functions that may be a bit varied from the format above as shown in the example below. // None of the below functions need an explicit import, as they're built into scrypt-ts itself. ``` let h = sha256(utf8ToByteString("hello")) assert( h == toByteString("2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824") ) ``` As shown above `assert` is a built-in function in sCrypt, it throws error only if the conditions passed to it is false. If all the conditions passed to `assert` is true, a contract call will be successful. The condition passed to `assert` in the code snippet above is h == toByteString(“2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824”). 3. Conditionals: Conditionals are used to execute different blocks of code according to defined conditions. Conditional include if else and else if statements as shown below; ``` if (x > 0) { // Code block to execute if x is greater than 0 } else if (x == 0) { // Code block to execute if x is equal to 0 } else { // Code block to execute if x is less than 0 } ``` 4. Loops: Loops are used to execute a block of code continuously as long as a specified condition is true. Bitcoin Script does not provide looping constructs natively for security reasons, to prevent DoS attacks. All loops must be bounded at compile time. If there is a need to loop inside @method, the following format must be strictly used: ``` for(let i = 0; i < maxLoopCount; i++) { ... } ``` As shown above, the initial value must be zero, the operator used must be < then initial value increments i++ . maxLoopCount must be a compile-time constant. Loop like break and continue are currently not allowed currently. 5. Comments: Comments are used to add explanatory notes within a code but the comments are ignored by the compiler. Single-line comments start with //, and multi-line comments are enclosed between /* and */. Examples are shown below; ``` // This is a single-line comment /* This is a multi-line comment that spans multiple lines */ ``` DATA TYPES IN sCrypt. In the traditional programming language, we are conversant with the data types integer, boolean, string and array. Integers used the keyword int and are used to represent positive or negative whole numbers. Booleans used the keyword bool and are used to represent true or false values. String used the keyword string and are used to represent text data. These data type are present in sCrypt with some additional ones and some modifications. sCrypt data types can be classified as basic types, number type, array types, user defined type and domain type. Basic Data Types: Examples of basic data types are boolean, bigint (big integer) and string. While writing smart contracts with sCrypt, boolean and bigint are allowed to be used in @props and @methods along with their wrapper types Boolean and BigInt . A string literal is not allowed to be used directly without being converted into a ByteString. Examples of these data types in use is given below; ``` @method() public example(x: bigint, y: ByteString, z: boolean) { assert(x == 5n) assert(z) // Strings must by converted to ByteString before being used // in a smart contract: assert(y == utf8ToByteString("hello world!")) // We can also parse hex strings: assert(x == unpack(toByteString('05'))) // Vice versa, we can turn integers into ByteStrings: assert(pack(x) == toByteString('05')) // Little-endian signed-magnitude representation is being used: assert(pack(-x) == toByteString('85')) assert(pack(-x * 1000n) == toByteString('8893')) } ``` As shown above, strings must be converted to ByteString before being used in a smart contract like the case for the string “hello world”. Integers can be turned into ByteString and from ByteString back to integer. 2. Number Type: The number type is not allowed in @props and @method. In some special cases, parameters of type number must be passed. In this case, we can use Number() function to convert bigint to number. Example of this is shown below; ``` // Array indexes: let arr: FixedArray<bigint, 3> = [1n, 3n, 3n] let index: bigint = 2n let item = arr[Number(idx)] // ByteString operations: let size: bigint = 3n let b: ByteString = reverseBytes(toByteString("001122"), Number(size)) let end: bigint = 1n b.slice(0, Number(end)) ``` In the examples above Number() is used to convert bigint in array indexes to number arr[Number(idx)]. It is also used to convert bigint in ByteString operations to number, Number(size) and Number(end). Note that, number type can also be converted to bigint as shown below; ``` let x: bigint = BigInt(10) ``` 3. Array Types: The common array types in TypeScript like T[] or Array<T> are not allowed to be used in @props and @methods. An array must be declared as type of FixedArray<T, LENGTH>, whose LENGTH must be a compile-time-constant value as shown below: ``` let aaa: FixedArray<bigint, 3> = [1n, 3n, 3n] const N = 2 let aab: FixedArray<bigint, N> = [1n, 2n] // 2-dimensional array let abb: FixedArray<FixedArray<bigint, 2>, 3> = [ [1n, 3n], [1n, 3n], [1n, 3n], ] // Fill: let zeroArr = fill(0n, 3) // = [0n, 0n, 0n] const M = 3 // Length must be a compile time constant let falseArr = fill(false, M) ``` 4. User Defined Type: Users can be define customized data types using type or interface, made of basic types. type ST = { a: bigint b: boolean } interface ST1 { x: ST y: ByteString } 5. Domain Types: There are several domain data types specific to the Bitcoin context, used to further improve type safety. ``` let pubKey = PubKey( toByteString("02a2ef6eb12d3076dbdc98241920f75ac88b664656400aa390a0b236ea1eb6ec0b") ) let pkh = Addr(pubKey2Addr(pubKey)) ``` let h = Sha256(sha256(utf8ToByteString("hello"))) // Will fail as passed data is not a SHA256 hash: //let h2 = Sha256(utf8ToByteString('ffaabb')) These data types provide the foundation for storing and manipulating data within sCrypt smart contracts. The basic syntax elements provide the foundation for writing smart contracts in sCrypt. Good knowledge and usage of both data types and sCrypt syntax will help developers to create clear, concise, and maintainable smart contracts on the BSV blockchain. For further reading visit the [sCrypt documentation](https://docs.scrypt.io/) and look toward our next article.
bravolakmedia
1,863,053
Learning AWS Day by Day — Day 73 — AWS Organizations
Exploring AWS !! Day 73 AWS Organizations Lets you centrally manage multiple AWS accounts added to...
0
2024-05-23T17:10:30
https://dev.to/rksalo88/learning-aws-day-by-day-day-73-aws-organizations-n3f
aws, cloud, cloudcomputing, beginners
Exploring AWS !! Day 73 AWS Organizations Lets you centrally manage multiple AWS accounts added to our ‘organization’. If we are admins of an organization, then we can invite the existing customers of AWS to join Organization, or we can create it directly. Features: Centralized management system Consolidated billing for all member accounts Control over account’s usage Integration with IAM Consistent data replication Standardized tags across accounts Pricing: No additional charges. Charges apply only to the usage of other AWS services by all member accounts. Ways to access: Console — Organizations can be managed through AWS management console or browser. Command-Line Tool: Can use the services through CLI, and is faster than console. AWS SDKs: have libraries for writing codes as well as access Organizations. HTTPS Query API: gives programmatic access to Organizations and its services. Quotas: Maximum and Minimum values: Number of roots in an Organization: 1 Number of OUs: 1000 Number of policies: 1000 OU maximum nesting in a root: 5 Number of member accounts created concurrently: 5 Expiration time for Handshakes: Invitation to join Organization: 15 days Request to enable all features in Organization: 90 days Handshake is deleted and no longer appears: 90 days How IAM works with Organizations? 1. Creates groups of accounts with Organizations 2. Attaches SCPs (service Control Policies) to those groups to centrally control the accounts. 3. Entities in AWS can only use services allowed by both SCP and IAM policies for each account ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0o90iqgznohmr34647go.png)
rksalo88
1,862,890
TailwindCSS vs Semantic CSS
Introduction Currently, I am participating in the bootcamp for the full-stack web...
0
2024-05-23T17:09:08
https://dev.to/7jw92nvd1klaq1/tailwindcss-vs-semantic-css-411j
webdev, beginners
# Introduction Currently, I am participating in the bootcamp for the full-stack web development, and started and finished the simple project using the React Framework, and in order to make your website look presentable, you cannot forgo using the HTML's best friend, CSS. Even though I could have chosen the path of creating the separate CSS files and defining various CSS rules there, I chose to go with one of the most well-used CSS frameworks at the moment, which is **[TailwindCSS](https://tailwindcss.com/docs/installation)**. So, at the very outset of my journey to web development, I was utterly hopeless when it comes to designing the website, and for that fact, TailwindCSS has basically been my go-to when it comes to styling my website. Despite its reputation for being verbose - to achieve something complex, you end up with an insanely long string of various classes - I gave it a shot and was instantly hooked on its usefulness and quickness for being able to come up with the somehow decent-looking website. Thus, I was no longer hopeless, and found creating the website much more enjoyable. Recently, however, watching the instructor use some sort of the CSS-related library from NPM that resembles the plain CSS, it got me questioning whether what I am doing - using the approach of TailwindCSS - is really the right thing to do or not. So I started googling basically something along the line of `Is TailwindCSS bad?` and wound up in the thread that was wildly varying in opinions on which one is better. To get myself really acquainted with both the pros and cons of what TailwindCSS is doing versus the basic plain CSS - Semantic CSS, I thought that it would be good to do due diligence spending some time learning and comparing both pros and cons of both approaches, especially for those that are stuck in making a choice between those two. **For this post, I am going to go over each, and present both their pros and cons for the readers to equip with knowledge for making a right decision for themselves.** ## Semantic CSS Semantic CSS refers to so-called, the vanilla CSS that we first approach when we learn CSS. There are often three ways of styling various HTML elements using the plain CSS: 1. Use the inline style for an element that you want to apply designs to. 2. Use the `<style>` HTML tags inside an HTML page, for specifying the CSS rules for a specific page. 3. Use an external file whose name ends with `.css`. There, you may specify a bunch of rules in the same way as the approach above; however, you may import those files to one or more pages, and apply the styles to the HTML elements simultaneously. Here is usually how we use the plain CSS, for example: ``` <head> <style> .flex-container { display: flex; justify-content: center; align-items: center; color: red; } </style> </head> <body> <div class="flex-container"> <div>Container 1</div> <div>Container 2</div> <div>Container 3</div> </div> </body> ``` The approach above is what we do with the approach number two. Basically, it requires one to create a CSS rule with a name - in the example above, it defines a rule named `.flex-container` that must be used with the `class` attribute in one or more elements. You are not limited to creating rules with mere classes, instead, you may even go further, by separately designing each element based on the value of its `id` attribute by prepending it with `#`, as well as the name of the HTML tag, which requires no special letter to be prepended. Some of the advantages for the plain CSS include: 1. **Customizable** - Obviously, this is the biggest advantage, but for those that must be in complete control over how the design of the website should be, then this is for you. Using the vanilla CSS makes much more sense for those that want to create something complex that involves animations and transitions. With the right amount of creativity and know-how, the sky is the limit when it comes to coming up with what you like! 2. **Succinct** - As opposed to forcing the source code of the HTML page with the bombardment of the inline classes like TailwindCSS, you can separately define CSS rules in external files ending with `.css`, and import them to the HTML pages. Like I said, this may be a major advantage to those that prefer not seeing the source code filled with the bunch of classes. It looks way cleaner! 3. **Fast Rendering Speed** - Not sure if it really matters, since there is about a 0.4-second difference when it comes to it, but based on the metrics of both LCP and FCP. FCP (first contentful paint) is a metric for how long it takes for a user to see the very first item on the page, whereas LCP (largest contentful paint) is a metric for how long it takes for the page to adequately render to be usable by a user. The vanilla CSS has apparently the advantage, which kind of makes sense, I guess due to the fact that the files of TailwindCSS are a lot bigger than that of the vanilla CSS? 4. **Learning** - Actually, there is no better way to learn CSS at a much deeper level than trying to use it without the help of frameworks. You can definitely achieve a lot of insanely cool stuffs with vanilla CSS, and if that is what you are looking for and you want to learn more about CSS in general, you should at least try to stick with vanilla CSS, before moving on to frameworks, such as TailwindCSS, that may or may not make your life easier. ## Tailwind CSS TailwindCSS is the CSS framework that provides a set of utility classes, which basically allow a user to design without creating a custom CSS file. All you have to do to use TailwindCSS is to download all the necessary files via CDN or NPM, depending on the medium you are working on your project, and simply include the available classes to HTML elements in a page. Let me show you an example below. ``` <div className="grow w-full text-left px-10 flex flex-col justify-center items-center text-white text-xl gap-5"> <h1>Select a board :(</h1> <h1>Or create one!</h1> </div> ``` Yes, it may look extremely verbose and confusing to many people. Since you have to be aware of what each class does to the looks of the element, there may be a bit of a learning curve for those that first try this, but once you get used to its class-based approach and functionalities, it becomes less of an issue moving forwards. Some of the advantages of using TailwindCSS include: 1. **Development Speed** - The ease of applying a predefined set of classes to elements greatly increases the web development. Also, you don't have to name each CSS rule, for the fact that everything is already named for your convenience. 2. **Maintainability** - Imagine the situation where you have to revisit the old HTML code that has been sitting on your computer for a long, long time. The consistency in the name of every class throughout its evolution allows one to easily revisit and understand the code with ease. Imagine hiring a new developer that knows TailwindCSS and goes through your company's source code, that would greatly save time from having to educate a new developer on the design system. 3. **Frequent Update** - One thing that I didn't think about, but if you are frequently updating the pages of your website, then it may be better to approach using TailwindCSS. The reason is that the frequent update of the website may make keeping up with CSS rules much more arduous, than being able to directly adjust the looks of the element individually by incrementally changing the classes of each element? 4. **Consistency** - Using a predefined set of classes that are readily available for you throughout the entirety of the application provides the website with much more consistent looks. People who came up with this framework definitely took into considerations the need for a consistent design system. If you are not a designer, but somehow need to come up with a decent-looking UI, a gigantic mess of inline classes, with which TailwindCSS is associated, becomes less of a big deal. 5. **Responsive** - I guess this is one of the biggest selling points of TailwindCSS, but yes, you can easily implement the **[responsive design](https://tailwindcss.com/docs/responsive-design)** of the website, by using what we call the breakpoint. Here is an example: ``` <div className="w-full md:w-[300px] ...> ``` * The element above has two classes, `w-full` and `w-[300px]`. As you can see, in front of `w-[300px]`, it has the `md:`, which is a breakpoint that tells the browser to resize the width of the element to `300px`, upon the width of the viewport exceeding `768px`. The breakpoint `md` is associated with `768px` by default, and if you would like to map the breakpoint with a different value, you are free to do so with the use of the config file! ### What's better? There is no clear, right answer to this, because both have its own strength that make each stand out over one another. I guess it all comes down to this: - **If you are working on designs that are highly specific and require granular control over how it should look, then Semantic CSS may be the choice for you.** - **If you are working on a project that requires fast prototyping and very little of animations and transitions, you may easily get away with TailwindCSS.** Not merely limited to its predefined set of utility classes, you can easily **[customize](https://tailwindcss.com/docs/adding-custom-styles)** it to your likings, just as well as Semantic CSS. If anything, you can always mix the both approaches and simply take advantage of each approach! Like I said, there is simply no right or wrong answer. Both approaches warrant use cases, and you can't go wrong with any one of them. If not, then try things like **[SASS](https://sass-lang.com/)**, which seems like another method for utilizing CSS in a fancy way. I will continuously update this post, since I didn't spend too much time on organizing my thoughts on this topic and its structure. This post feels way too incomplete and horribly thought-out, so I will keep updating this. Thank you.
7jw92nvd1klaq1