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,867,058
Macao game tax revenue is $3.7 billion through April
Total tax collections so far this year are up 98.2% compared to the previous year. In April alone...
0
2024-05-28T00:23:41
https://dev.to/baccaratsite_win_39faa529/macao-game-tax-revenue-is-37-billion-through-april-dg9
바카라사이트윈, 카지노사이트
Total tax collections so far this year are up 98.2% compared to the previous year. In April alone this year, the government collected about 7.93 billion in gaming tax revenue, up 11.2% from the previous month. Taxes from gaming brought in 83.5% of the Macau government's total revenue in the four months to April 30, with the latter reaching nearly MOP35.77 billion. Under Macau's 10-year gaming subsidy scheme, which took effect on January 1 last year, the effective tax on casino gross gaming revenue (GGR) is 40%. Tax collection figures for a particular calendar period and the GGR of urban casinos for those periods are not directly comparable for a number of reasons. These include the fact that there is usually a delay between when the GGR is recorded in Macau casino operations and when the Macau government registers as paying taxes. According to the government's 2024 budget plan, revenue from the gaming tax is expected to reach nearly MOP 83.61 billion this year. Revenue for the first four months of the year is 35.7% of that figure. Macao authorities collected MOP652.6 billion in revenue from the gaming tax for all of 2023, achieving a surplus of 28.3% in last year's budgeted gaming tax revenue. BY: **[바카라사이트윈](https://www.baccaratsite.win/)**
baccaratsite_win_39faa529
1,867,053
Getting Started with TanStack Query
If you've ever found yourself tangled in the web of managing server state in your React applications,...
0
2024-05-28T00:20:13
https://dev.to/john_dunn_ec1dda9d69d5743/getting-started-with-tanstack-query-5b58
react, tanstackquery, webdev, beginners
If you've ever found yourself tangled in the web of managing server state in your React applications, you know how challenging it can be. Thankfully, TanStack Query, formerly known as React Query, is here to simplify data fetching, caching, synchronization, and more in your React applications. The best part is it's easy to set-up. # Why TanStack Query ### Simplified Data Fetching TanStack Query abstracts away the complexities of data fetching and caching, allowing you to focus on building your application. It handles everything from caching to background updates and refetching on intervals, providing a powerful yet simple API. ### Automatic Caching and Refetching One of the standout features of TanStack Query is its ability to automatically cache and refetch data. This means your app will always have the latest data without you having to write additional code. ### Synchronized Data TanStack Query ensures your data is synchronized across your application, making it easier to manage and reducing the risk of stale data. It also provides tools for optimistic updates, background synchronization, and automatic retries. ### Developer Experience By combining TanStack Query's built in dev tools with the community package React Query Rewind, you'll receive insights into your queries, mutations, and cache. This helps in debugging and optimizing your data fetching strategies. # Getting Started ### Installation To get started with TanStack Query, you need to install the library: ```bash npm install @tanstack/react-query ``` Install the dev tools as dev dependencies: ```bash npm install -D react-query-rewind @tanstack/react-query-devtools ``` Install the [React Query Rewind Chrome Extension](https://chromewebstore.google.com/detail/react-query-rewind/jfljppnfglpckkgkpmdpgagnffloboel). ### Code In your application, you need to set up the QueryClient and provide it to your application using the QueryClientProvider. ```typescript import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { ReactQueryRewind } from 'react-query-rewind'; const queryClient = new QueryClient(); ReactDOM.createRoot(document.getElementById('root')!).render( <QueryClientProvider client={queryClient}> <App /> <ReactQueryRewind /> <ReactQueryDevtools initialIsOpen /> </QueryClientProvider> ); ``` ### Fetching Data with useQuery Now, let's fetch some data using the useQuery hook. Here's an example of fetching user data from an API. ```typescript import { useQuery } from '@tanstack/react-query'; const fetchUser = async () => { const response = await fetch('https://api.example.com/user'); if (!response.ok) { throw new Error('Network response was not ok'); } return response.json(); }; const UserComponent = () => { const { data, error, isLoading } = useQuery(['user'], fetchUser); if (isLoading) return <div>Loading...</div>; if (error) return <div>Error: {error.message}</div>; return ( <div> <h1>{data.name}</h1> <p>{data.email}</p> </div> ); }; ``` ### Mutations with useMutation For performing mutations, such as creating or updating data, you can use the useMutation hook. ```typescript import { useMutation } from '@tanstack/react-query'; const createUser = async (newUser) => { const response = await fetch('https://api.example.com/user', { method: 'POST', body: JSON.stringify(newUser), headers: { 'Content-Type': 'application/json', }, }); if (!response.ok) { throw new Error('Network response was not ok'); } return response.json(); }; const CreateUserComponent = () => { const mutation = useMutation(createUser); const handleSubmit = async (event) => { event.preventDefault(); const newUser = { name: event.target.elements.name.value, email: event.target.elements.email.value, }; mutation.mutate(newUser); }; return ( <form onSubmit={handleSubmit}> <input type="text" name="name" placeholder="Name" required /> <input type="email" name="email" placeholder="Email" required /> <button type="submit">Create User</button> </form> ); }; ``` # Debugging Once you've started your application, open the Chrome developer tools and click on the React Query Rewind tab. This tab will show a visual representation of your state data and allow you to see how this data is modified over time. The other devtools will appear in the bottom half of your screen and show when state data is fresh or stale. For a complete overview of TanStack query and these dev tools, check out the complete docs: - [tanstack.com/query/latest](https://tanstack.com/query/latest) - [reactqueryrewind.com](https://reactqueryrewind.com/)
john_dunn_ec1dda9d69d5743
1,867,055
Eight Chinese cities added to Macau's individual visit plan
China's State Council has added eight mainland cities to its list of places where people can apply...
0
2024-05-28T00:07:42
https://dev.to/racesite_pro_a1ac55efd5c8/eight-chinese-cities-added-to-macaus-individual-visit-plan-4pmf
경마사이트프로, 사설경마사이트, 온라인경마사이트, 실시간경마사이트
China's State Council has added eight mainland cities to its list of places where people can apply for an Individual Visit Plan (IVS) departure visa to travel to Macau and Hong Kong. The information was confirmed by the National Immigration Service on Saturday and has increased the number of IVS-eligible locations to 59 from 51 previously. The changes will take effect on May 27. The newly added cities are all members of the borough: Taiyuan in Shaanxi Province, Hohat in Inner Mongolia Autonomous Region, Harbin in Heilongjiang Province, Lhasa in Tibet Autonomous Region, Lanzhou in Gansu Province, Xining in Qinghai Province, Yinchuan in Ningxia Hui Autonomous Region, and Urumqi in Xinjiang Uyghur Autonomous Region. This is the second time in less than three months that the Chinese State Council has added a new city to its list of cities where people can apply for an IVS departure visa to travel to Macau and Hong Kong. In late February, the State Council announced that it had added two mainland population centers, Xi'an and Qingdao, to its IVS list. The recent expansion of the IVS list, along with other positive visa policy measures related to business visas, multiple entry visas and Hungchin-Macao group visas announced in late April, "will have a more marginal impact on visits and gaming gross revenue in the short term, but in the long run, it is a positive driver for continuing to increase visitor numbers," Vitali Umanski, an analyst at Seaport Research Partners, said in a note on Sunday. He added: "The policy action is a clear indication of the Chinese government's continued support for Macau and the more short-term impact of the announcement will reinvigorate sentiment as there is no negative connection with the gaming industry." The news of the IVS update came just before the start of the seven-day Macau "inspection tour," which begins today (13th), and is the director of the Hong Kong and Macau Affairs Bureau of the Central Committee of the Chinese Communist Party and the director of the Hong Kong and Macau Affairs Bureau of the State Council. The announcement in February that Xi'an and Qingdao had been added to the IVS list coincided with Xi'a visit to Hong Kong. In his note, Mr. Umanski pointed out that "the expansion of IVS" will help increase the number of mainland "middle market and luxury tourists" to Macau, as mainland "middle market and luxury tourists" visiting Macau travel primarily via IVS rather than group visas. "However, aircraft capacity will need to increase from these cities to Hong Kong, Guangdong, Zhuhai and Macau airports in order to have a real impact on visitor numbers," Mr. Umanski said, The IVS system was first implemented in four cities in Guangdong Province, the mainland just next to Macau and Hong Kong, and was expanded several times between July 2003 and January 2007. BY: **[사설경마사이트](https://www.racesite.pro/)**
racesite_pro_a1ac55efd5c8
1,867,252
Effective Error Handling in Go
One part of why I like Go is how it forces me to handle errors. It has panic mechanizm but most of...
0
2024-05-29T06:57:16
https://hiro.one/blog/2024-05-28/
go
--- title: Effective Error Handling in Go published: true date: 2024-05-28 00:00:00 UTC tags: Go canonical_url: https://hiro.one/blog/2024-05-28/ cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31220y2iq2wof98btg6r.jpg --- One part of why I like Go is how it forces me to handle errors. It has panic mechanizm but most of the time a callee returns an error, and a caller handles it. However in practical cases, returning an error isn't enough to handle for caller. For example, let's imagine we have the following signup http handler: ```go func HandleSignUp(us UserService) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // ...decode r.body, etc. userLoggedIn, err := us.SignUp(userSigningUp) if err != nil { encodeJson(w, http.StatusBadRequest, Response{ Message: "bad request" }) return } // ... respond HTTP 201 }) } ``` And here is SignUp method in UserService: ```go func (s *UserService) SignUp(user *domain.UserSigningUp) (*domain.UserLoggedIn, error) { if u, _ := s.repository.Get(user.Email); u != nil { return nil, errors.New("user already exists") } hash, err := bcrypt.GenerateFromPassword([]byte(user.Password), 5) if err != nil { return nil, err } udb := user.ToUserInDB(hash, time.Now()) if err = s.repository.Add(udb); err != nil { return nil, err } return udb.ToLoggedIn(), nil } ``` Here is a problem - `UserService.SignUp()` method could return two kinds of error: - invalid user input error - or, database error And we want to respond HTTP 400 when the server receives invalid user input, otherwise, HTTP 500. So, how to do that?? One way to achieve it is to check error message: ```go userLoggedIn, err := us.SignUp(userSigningUp) if err != nil { if err.Error() == "user already exists" { encodeJson(w, http.StatusBadRequest, Response{ Message: "bad request" }) return } encodeJson(w, http.InternalServerError, Response{ Message: "internal server error" }) return } ``` This case is somehow straight forward, but obviously not a good solution. For example, the above approach is prone to code update. If we make a change to the error message in `UserService.SingUp()` we might need to change our HTTP handler too. One better approach is to implement custom error. As you might know everything that has `Error()` method will be regarded as of type `error`. Also, you can add `Is()` method to your custom error struct so that you can validate it using `errors.Is()`. Here is an example of how to implement it: First let's create our custom error structs: ```go package util type AppError struct { Status int detail string } func (e AppError) Error() string { return e.detail } func (e AppError) Is(target error) bool { t, ok := target.(*AppError) if !ok { return false } return t.Status == e.Status && t.detail == e.detail } var BadRequestError = AppError{Status: 400, detail: "bad Request"} var InternalServerError = AppError{Status: 500, detail: "internal server request"} ``` Now, let's update our `UserService.SignUp()`: ```go func (s *UserService) SignUp(user *domain.UserSigningUp) (*domain.UserLoggedIn, error) { if u, _ := s.repository.Get(user.Email); u != nil { fmt.Println("invalid user input") return nil, util.BadRequestError } hash, err := bcrypt.GenerateFromPassword([]byte(user.Password), 5) if err != nil { fmt.Println("error generating new hashed password: ", err) return nil, util.BadRequestError } udb := user.ToUserInDB(hash, time.Now()) if err = s.repository.Add(udb); err != nil { fmt.Println("error storing user data: ", err) return nil, util.InternalServerError } return udb.ToLoggedIn(), nil } ``` Here, you can see, instead of returning `err`, we return `util.BadRequestError` or `util.InternalServerError` depending on how we want to handle it. Then, let's update our handler function too: ```go func HandleSignUp(us UserService) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // ...decode r.body, etc. userLoggedIn, err := us.SignUp(userSigningUp) if err != nil { if errors.Is(err, util.BadRequestError) { encodeJson(w, http.StatusBadRequest, Response{ Message: "bad request", }) } else { encodeJson(w, http.StatusInternalServerError, Response{ Message: "internal server error", }) } return } // ... respond HTTP 201 }) } ``` Thanks for reading ✌️
hiro_111
1,866,656
Google Closed Testing Reject ~Tienes que pensar en cómo conseguir probadores~
Este es un artículo para aquellos que se han registrado o pueden registrarse como nuevos...
0
2024-05-28T00:00:00
https://dev.to/zmsoft/google-closed-testing-reject-tienes-que-pensar-en-como-conseguir-probadores-1d0p
googleplay, pruebascerradas, androiddev, productivity
Este es un artículo para aquellos que se han registrado o pueden registrarse como nuevos desarrolladores tras el cambio de política de Google. Estoy publicando [una aplicación gratuita(DevsPayForward)](https://play.google.com/store/apps/details?id=com.andro.zm.tools.androidtesterspayforward) para que dichos desarrolladores cooperen entre sí. Si usted lee el artículo y está interesado, por favor úselo. La prueba de 14 días de 20 personas ha sido ordenada por Google. Como desarrollador independiente, esto ya de por sí es duro, pero parece que a algunos desarrolladores les han rechazado recientemente sus resultados tras completar la prueba y tienen que empezarla de nuevo. Si esto ocurre, puede llevar mucho tiempo, y el desarrollador puede quedar exhausto. Los desarrolladores deben protegerse. - [Rechazo de Google](#rechazo-de-google) - [Qué debemos hacer para evitar que nos rechacen](#qué-debemos hacer-para-evitar-que-nos-rechacen) - [Al inicio de la fase de evaluación](#al-inicio-de-la-fase-de-evaluación) - [Durante la evaluación](#durante-la-evaluación) - [Al finalizar la evaluación](#al-finalizar-la-evaluación) - [Asegurar un comprobador](#asegurar-un-comprobador) - [Por último](#por-último) ## Rechazo de Google ![Descripción de la imagen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nwkat2i6ov6wgutz9ce.png) La siguiente es una lista de rechazos. * Los evaluadores no se involucraron con la aplicación durante la prueba cerrada. * No se siguieron las mejores prácticas de prueba, que pueden incluir la recopilación de comentarios de los usuarios y la actuación en consecuencia mediante actualizaciones de la aplicación. * Tus respuestas a las preguntas de la aplicación sobre tu aplicación, la prueba cerrada o la preparación para la producción fueron incompetentes o insuficientes. Esto es lo que se describe, y no sé cuál es el problema claro. Pero supongo que la conclusión es que fueron rechazados porque no ven el sentido de mejorar la calidad, que es el propósito de las pruebas cerradas. # Qué debemos hacer para evitar que nos rechacen Posibles acciones de rechazo y posibles soluciones¿Qué puedo hacer para que se den cuenta de que la prueba funciona lo suficientemente bien como para evitar el rechazo? * Al principio de la fase de evaluación * Durante la evaluación * Al finalizar la evaluación ## Al inicio de la fase de evaluación Fase de inicio de la evaluaciónEn primer lugar, lo más importante es conseguir probadores que puedan realizar pruebas fiables. Hay lagunas en las normas actuales de Google. No voy a entrar en detalles aquí, pero es posible hacer que parezca que ha completado la prueba sin tener que preparar 20 cuentas o incluso instalar la aplicación. Y la dificultad de este problema es que, aunque un desarrollador siga las normas, no hay garantía de que sus probadores las sigan. Conseguir probadores fiables es muy difícil. La forma más fácil es utilizar un servicio de pago, pero esta puede ser una elección difícil para un desarrollador que no sabe si será capaz de generar muchos ingresos. Esto es un poco largo y se tratará con más detalle más adelante. ### Durante la evaluación Durante la evaluaciónDurante el período de prueba, incluso los errores menores deben ser corregidos y actualizados. Esto aclarará su compromiso con las pruebas. ### Al finalizar la evaluación Al final de la evaluaciónResponde a las preguntas de Google al final de la prueba. Yo mismo he presentado varias aplicaciones y no escribí mucho en mis respuestas, pero afortunadamente no me rechazaron. Es probable que haya muchos factores al principio y durante el proceso de evaluación, pero lo que describes aquí puede ayudarte si estás a punto de ser juzgado como objetivo de rechazo. ## Asegurar un comprobador Esta sección describe cómo proteger a los evaluadores libres. Por favor, consulte mi [artículo anterior](https://dev.to/zmsoft/comparacion-de-5-metodos-para-reunir-a-20-probadores-y-que-utilizar-57d6) comparando métodos para asegurar probadores. Ahora bien, no hay una forma perfecta de asegurar a los probadores en la que se pueda creer. Mientras los desarrolladores se sobornen unos a otros para realizar pruebas, la única manera es encontrar un desarrollador en el que puedas confiar o comprobar el estado de sus pruebas, pero desafortunadamente no puedes saber si están mintiendo. Lo menos que puedes hacer es confirmar que han hecho la instalación. Puedes pedirles que comenten la aplicación de una forma que no sabrías a menos que la instalaras, o conseguir una captura de la misma. Es una molestia, pero al menos evita el comportamiento opt-in only. Además de facilitar a los evaluadores el envío de comentarios sobre las aplicaciones que están probando, mi aplicación también comprueba el estado de las aplicaciones de prueba. Lo importante es dar también a otros desarrolladores lo que necesitan. Para obtener algo, debe haber un precio. Se puede sistematizar para que los desarrolladores no pierdan su tiempo y esfuerzo, pero eso no cambia el número absoluto de pruebas. Si un sistema devuelve resultados que superan con creces las acciones realizadas, hay que determinar si se trata de un sistema en el que se puede confiar. Instalar y probar una aplicación, en sí mismo, es un acto importante y que requiere mucho tiempo. Por otro lado, actualmente, si sólo se quiere conseguir que 20 personas se inscriban, es fácil hacerlo. Sin embargo, si el sistema requiere muy poco dinero o pruebas, o no requiere muchas pruebas, es posible que se esté utilizando un método de este tipo. ![Descripción de la imagen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p23n6rt4fi3r0xty5d7b.png) **Todo buen negocio tiene su reverso, y es a usted a quien le pedirán que vuelva a hacer la prueba de los 14 días. Debes ser precavido.** ¿Cuál es la estructura del método que elijas para operar y cómo puedes validar al probador? Piense en ello a la hora de elegir su método. ## Por último I do not like Google's policy. But they are saying that this test is necessary to improve quality. I don't know if that is Google's intention, but in the end, all developers have to do is to improve quality. Si los desarrolladores cooperan entre sí, debería ser fácil conseguirlo. [Me encantaría que mi aplicación pudiera utilizarse como uno de esos métodos para ayudarles a conseguirlo](https://zmsoft.org/apps-info/androiddeveloperspayforward/). Trabajemos juntos para superar la prueba. Hasta el final Gracias por leer. Si lo desea, puede leer otros artículos. <a href='https://play.google.com/store/apps/details?id=com.andro.zm.tools.androidtesterspayforward&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/></a>
zmsoft
1,898,804
What is a CIDR trie and how can it help you?
In this post, we will explore the CIDR trie data structure and how it can help you manage IP...
6,868
2024-06-24T11:17:22
https://d34dl0ck.me/rust-bites-cidr-trie/index.html
datastructures, algorithms, rust, beginners
--- title: What is a CIDR trie and how can it help you? published: true date: 2024-05-28 00:00:00 UTC tags: datastructures,algorithms,rustlang,beginners series: practical rust bites canonical_url: https://d34dl0ck.me/rust-bites-cidr-trie/index.html cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y090z7l0q5m8pe84hvbg.png --- In this post, we will explore the CIDR trie data structure and how it can help you manage IP addresses and subnets in your Rust project. <!-- more --> As usual in this series, we will take a tiny piece of Rust out of a real project and explain it in a very practical way. ## Problem Imagine that your Rust service should only be available from specific IP addresses. This may be desirable for limiting access to certain geographical regions (similar to geo-fencing) or other services you control. This service should not be slowed down by the need to check every incoming request's IP address against a list of allowed IP addresses. Let's have a look at the size of the [geo-whois-asn-country-ipv4.csv](https://github.com/sapics/ip-location-db/blob/main/geo-whois-asn-country/geo-whois-asn-country-ipv4.csv) file that only contains ipv4 addresses: it contains 243K entries and is about 7.13 MB in size. Simply checking every incoming request against this list with `Vec::contains` is obviously too inefficient. Furthermore, the problem is that we don't have the list of all single IP addresses that we can search, but we have a list of IP ranges, for example: - from `1.10.10.0` to `1.10.10.255` belongs to `IN`/India - from `1.5.0.0` to `1.5.255.255` belongs to `JP`/Japan and so on. Now when a client connects to our service we have to check a single IP to those given ranges and decide if the client is allowed to connect or not. ## Solution Let's first introduce a slightly different format for those IP ranges, the CIDR notation. [CIDR stands for Classless Inter-Domain Routing](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation), and it is a compact way to represent an IP address range. For example: - `1.10.10.0` to `1.10.10.255` will be represented as `1.10.10.0/24` - `1.5.0.0` to `1.5.255.255` will be represented as `1.5.0.0/16` So the suffix `/24` or `/16` tells us how many leading bits of the IP address are fixed. Keep in mind that a full ipv4 address has 32 bits. That means if `24` bits are fixed, the remaining `8` bits are variable, and as we will see later, not important to us. For the post we will assume we already have an efficient way of converting the range format above to the CIDR notation. We now want to find a data structure that is well-suited to searching for the country of a given IP address. We ultimately want to use the data structure in our service like this: ```rust // usage example let mut country_ip_list = CidrCountryMap::new(); country_ip_list.insert("1.10.10.0/24", "IN"); country_ip_list.insert("1.5.0.0/16", "JP"); // search for the country of the given IP address assert_eq!(country_ip_list.search("1.10.10.1"), Some("IN")); assert_eq!(country_ip_list.search("1.10.10.22"), Some("IN")); assert_eq!(country_ip_list.search("1.5.0.1"), Some("JP")); // not in the list assert_eq!(country_ip_list.search("10.1.1.1"), None); ``` > Note: this code is pseudo code. In production we would likely not use strings for the IP addresses, but the `std::net::Ipv4Addr` [type of the std lib](https://doc.rust-lang.org/std/net/struct.Ipv4Addr.html). ## The `CidrCountryMap` One data structure we could base the `CidrCountryMap` on is a specialized trie. In it's most generic form, it can be used to search based on the prefix of an element (e.g. the first few letters of a string). But let's first look at what a trie is and it's use case. [According to wikipedia](https://en.wikipedia.org/wiki/Trie), a trie is also called *digital tree* or *prefix tree*. To quote: > Unlike a binary search tree, nodes in the trie do not store their associated key. Instead, a node's position in the trie defines the key with which it is associated. This distributes the value of each key across the data structure, and means that not every node necessarily has an associated value. So the gist is, we would not store full values on nodes, but the data (that we want to store) will distribute on several nodes in the tree on a path. A path starting at the root (usally visualized on the top) leading down to a leaf (last not in the tree) or a *terminal* node. This data distribution on paths comes with some very neat properties: the time it takes to search for an item, depends only on the key length, not on the amount of stored items. The same is true for inserting items. ### The CIDR trie specifics In the CIDR trie we represent a bit of the IP address as a node on the path. The complete path from the root to a (terminal) leaf node therefore represents the fixed bits of the IP address (without the trailing masked bits). The leaf node furthermore stores the country code associated with the IP address range. For example let's look at the IP range `1.10.10.0/24` and their single bytes: ```raw 1 -> 00000001 10 -> 00001010 10 -> 00001010 0 -> 00000000 ``` and the `/24` suffix tells us that the first 24 bits are the ones we are taking into account. That means we don't store the last 8 bits of the IP range. So we can build a trie just as we would read those binary numbers, that looks like this (showing only the first 2 bytes): ![][image_ref_1] In the illustration we can see path that the first 16 bit of the IP address would span. The nodes of the 3rd byte are not shown, to keep the illustration simple. But just imagine a continued path down to the leaf node. The leaf node would contain the country code and also would be marked as a terminal node. That means when we want to search for the country of the IP address, we must just process the bits of the given IP address and follow the path in the trie. If we reach a terminal node, we have found the country code. That is the basic idea of the CIDR trie. Let's implement this trie in Rust now. ## Implementation Let's introduce the `CidrCountryMap` struct that holds the trie and the methods to insert and search for a given IP address. ```rust #[derive(Default)] pub struct CidrCountryMap { root: Node, } ``` The `Node` struct represents a single node in the trie. It holds the country code, the child nodes and it keeps the information if it's a terminal node in the whole trie or not. ```rust #[derive(Default)] struct Node { is_terminal: bool, children: [Option<Box<Node>>; 2], value: Option<String>, } ``` > Note: we're using a fixed size array of for 2 Nodes (`children: [Option<Box<Node>>;2]`) to represent the child nodes. This is a common pattern in Rust to represent a tree structure. This avoids further allocations when inserting nodes. Just in case, could also use a `Vec` instead of an array. Also this is specific to a binary trie, e.g. for storing arbitrary ASCII characters we would have to (pre-)allocate 256 children (one per character). In that case it would be better to use a `HashMap` insteaf of a fixed size array. We have to use `Box` because Rust does not allow recursive types that are not on the heap. Let's implement the `CidrCountryMap` insert method. ```rust impl CidrCountryMap { pub fn insert(&mut self, cidr: &str, data: impl Into<String>) -> Result<()> { let (cidr, take_bits) = cidr .split_once('/') .ok_or(CidrCountryMapError::SplitError)?; let mut take_bits = take_bits .parse::<usize>() .map_err(|err| CidrCountryMapError::ParseIntError(err))?; let mut current_node = &mut self.root; for byte in cidr.split('.').flat_map(|octet| octet.parse::<u8>()) { for bi in (0..8).rev() { if take_bits == 0 { break; } let index = (byte >> bi) & 1; current_node = current_node.children[index as usize].get_or_insert(Box::default()); take_bits -= 1; } } current_node.is_terminal = true; current_node.value = Some(data.into()); Ok(()) }} ``` - it splits the CIDR notation into the IP address and the number of bits - it iterates over the bytes of the IP address and the bits of the CIDR notation - it processes the bits from left to right by using bit shifting and masking `(byte >> bi) & 1` (bi is the amount of bits we shift to the right) - first we shift by 7 bits, then by 6 bits, then by 5 bits and so on - after shifting the bits to the right we select the right-most bit with the mask `1` - by doing so we iterate through the bits of the byte from left to right - this gives either true or false (1 or 0) and we use this as an index to access the child array - we take or insert a new node in the trie for each bit - after all `current_node` is the leaf node and we set the country code and mark it as terminal > Note: You might wonder about the the use of `Result<()>` and `CidrCountryMapError`. I kept it out on purpose to keep the code simple and not use `.unwrap()`. You can find the full code in playground link on the References section. The search method is quite similar to the insert method. We just have to iterate over the bits of the IP address and follow the path in the trie. ```rust impl CidrCountryMap { pub fn search(&self, cidr: &str) -> Option<&str> { let mut current_node = &self.root; for byte in cidr.split('.').flat_map(|octet| octet.parse::<u8>()) { for bi in (0..8).rev() { let index = byte >> bi & 0b1; if let Some(node) = &current_node.children[index as usize] { current_node = node; } else if current_node.is_terminal { break; } else { return None; } } } current_node.value.as_deref() } } ``` - we break the loop if we reach a terminal node - we return `None` if we reach a node that has no children - we return the country code of the end node, the leaf node, if we reach the end of the IP address ## Conclusion Searching an IP Address in the CIDR trie is done in `O(k)` time complexity. Where `k` is the number of bits in the IP Adress to look up, so `O(32)`. It may also take less than `O(k)` time when the IP is not present in the trie. The CIDR trie is a very efficient data structure to search for IP addresses in a given range. > Note: For other more complex use cases it might be better to roll the `trie_rs` crate, which provides a more generic trie implementation. However, I want to encourage you to mind a clean and small dependency list in your projects. Be aware that every external dependency comes with the cost of maintenance and less control over security and stability. Improvement ideas: - we could store the whole trie Nodes in a single `Vec` to avoid multiple allocations and to improve cache locality - we could compress the trie by combining nodes that have only one child, this approach is then called to be a [Radix Trie][wiki/radixtrie] - we could store the country code in a separate vector and use the index as a reference in the trie nodes, to save memory and to avoid storing the country code multiple times Special thanks to Jonas and David for providing feedback and improvement suggestions to this post 🙏 🦀 🚀 ## References - [Full Code on the Rust-Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=040d97e3ee3e38ec5b5e4ca34adedbf7) - [Introduction to trie](https://www.geeksforgeeks.org/introduction-to-trie-data-structure-and-algorithm-tutorials/#what-is-trie-data-structure) - [Insert and search for Trie](https://www.geeksforgeeks.org/trie-insert-and-search/) - [For more complex tries is a crate available: trie_rs](https://docs.rs/trie-rs/latest/trie_rs/) [wiki/radixtrie]: https://en.wikipedia.org/wiki/Radix_tree 'More about the Radix Trie 2' [image_ref_1]: https://d34dl0ck.me/cidr-trie.png
5422m4n
1,867,050
SUNUCU İŞLETİM SİSTEMLERİ
Sunucu İşletim Sistemleri: Bilgisayar Ağlarının Yönetiminde Temel Rol Bilgisayar ağlarında, iletişimi...
0
2024-05-27T23:35:48
https://dev.to/teknikbilimler/sunucu-isletim-sistemleri-49en
**Sunucu İşletim Sistemleri:** Bilgisayar Ağlarının Yönetiminde Temel Rol Bilgisayar ağlarında, iletişimi yöneten ve kaynakları paylaşımını sağlayan anahtar bileşenlerden biri sunucu işletim sistemleridir. Sunucular, ağ üzerindeki bilgisayarlara hizmet veren ve veri alışverişini düzenleyen yazılımlardır. **Windows Tabanlı Sunucu İşletim Sistemi** Microsoft'un geliştirdiği Windows tabanlı sunucu işletim sistemi, geniş bir kullanıcı kitlesi tarafından tercih edilmektedir. Grafik arayüzleri ve kullanıcı dostu özellikleri sayesinde işletim sistemi üzerinde uygulamaları çalıştırmak kolaylaşmıştır. Windows tabanlı sunucu işletim sistemi, genellikle büyük ölçekli işletmeler ve kurumsal ağlar tarafından kullanılmaktadır. **Linux Tabanlı Sunucu İşletim Sistemi** Linux, açık kaynak kodlu ve esnek bir işletim sistemidir. Unix tabanlı olan Linux, sunucu ortamlarında sıkça tercih edilmektedir. Kullanıcılar, Linux'un kaynak kodunu değiştirip dağıtabilirler, bu da özelleştirme ve optimize etme imkanı sağlar. Debian ve Red Hat gibi farklı dağıtımlar, farklı kullanıcı ihtiyaçlarına yönelik seçenekler sunar. **Debian (GNU/Linux)** Özgür bir işletim sistemi olan Debian, Linux çekirdeği üzerine inşa edilmiştir. Sunucu işletim sistemi olarak yaygın olarak kullanılan Debian, aynı zamanda masaüstü bilgisayarlar için de uygundur. Açık kaynak kodlu ve topluluk tarafından desteklenen bir yapıya sahiptir. **Red Hat ve Fedora** Red Hat, önde gelen açık kaynaklı yazılım şirketlerinden biridir. Red Hat Linux, kullanıcıların ihtiyaçlarına yönelik olarak özelleştirilebilir bir yapıya sahiptir. 2004 yılında, Red Hat Linux'un yerine Fedora dağıtımı geliştirilmiştir. Fedora, geniş bir özgür yazılım topluluğu tarafından desteklenmekte ve sürekli olarak güncellenmektedir. **Mac OS X Sunucu İşletim Sistemi** Apple tarafından geliştirilen Mac OS X, Unix tabanlı bir işletim sistemidir. Özellikle Macintosh bilgisayarlar için tasarlanmıştır. Kullanıcı dostu arayüzü ve güçlü performansıyla bilinir. Mac OS X, genellikle küçük ve orta ölçekli işletmelerin tercihi olmakla birlikte, bazı büyük kurumsal ağlarda da kullanılmaktadır. **Kaynakça:** https://www.sisbim.com https://tr.wikipedia.org https://www.isnet.net.tr https://www.debian.org https://tr.wikipedia.org https://www.kimnezamanicatetti.com
burcuatmn
1,867,049
C# 13 dagi yangiliklar!!!
Qisqacha c# dasturlash tili haqida malumotlar C#(si sharp) multi-paradigmik, dinamik hamda C...
0
2024-05-27T23:35:45
https://dev.to/farkhadk/c-13-dagi-yangiliklar-3e7i
csharp, news, dotnet
Qisqacha **c#** dasturlash tili haqida malumotlar > C#(si sharp) multi-paradigmik, dinamik hamda [`C`](https://en.wikipedia.org/wiki/List_of_C-family_programming_languages) dasturlash tillari oilasiga mansub dasturlash tili bo'lib Microsoft kompaniyasidan [Anders Hilsberg](https://en.wikipedia.org/wiki/Anders_Hejlsberg) tomonidan ishlab chiqilgan bolib va keyinchalik 2002 yilda [Ecma](https://ecma-international.org/)([ECMA-334](https://ecma-international.org/publications-and-standards/standards/ecma-334/)) tomonidan xalqaro standard sifatida tastiqlangan. > **_Xalqaro standard sifatida tastiqlandi_** degani, qisqacha qilib aytganda ushbu texnologiya(yoki produkt, yoyinki biron servis vaho kazo...) dunyo tanolgan mutaxasislar, korporatsiyalar hullas kazo-kazolar tomonidan ushbu texnologiyani tekshirilib, turli-xil testlar o'tgazib va shu texnologiya uchun qollanma yozib chiqgan degani. > Hozirda C# dasturlash tilini 13-ta versiyasi bor. 13-chi versiyasi `21/05/2024` yilda **preview** versiyasi taqdim etildi. Va yana bir etibor talab qiladigon tarafi hozirda ushbu versiyadagi C# ni qanday yangiliklari va qulayliklari borligini ko'rib chiqmoqchishimiz uchun, avval bizga ProjectName **.csproj** faylimizga quyidagi kodni kiritib qo'yishimiz kerak: ``` <PropertyGroup> <LangVersion>preview</LangVersion> </PropertyGroup> ``` > Aks holda bazi yangi xususiyatlar(feature)larni ishlata olmaymiz!!! **Yangi feature larni ro'yxati**: > 1.[`param` kalit so'zi(key word)](https://dev.to/farkhadk/params-key-word-16n8) > 2.Yangi `lock` obyekti. <- Bu featureni o'zi uncha tushuna olmadim😅 > 3.[Yangi escape ket-maketligi`\e`](https://dev.to/farkhadk/yangi-escape-ketma-ketligi-e-4apg) > 4.[Metod guruhining tabiiy tipini yaxshilanishi](https://dev.to/farkhadk/natural-type-of-method-group-4kp0) > 5.[`yashirin indekserga` kirish](https://dev.to/farkhadk/obektni-initsializatorlarida-yashirin-indekserga-kirish-17i7) **P.S.** Yangi feature larni alohida postlarga bo'lib chiqishga qaror qildim, chunki bitta post uchun juda uzunlik qilar ekan. Ro'yhatdagi havolalarga bosib, o'zingizni qiziqtirgan feature ni alohida misollari bilan birga tanishib chiqishiz mumkin. :)
farkhadk
1,867,047
[Game of Purpose] Day 9
Today I was playing around with scene backgrounds. The whole scene is surrounded by mountains and...
27,434
2024-05-27T23:32:15
https://dev.to/humberd/game-of-purpose-day-9-bch
gamedev
Today I was playing around with scene backgrounds. The whole scene is surrounded by mountains and volcanos. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5c4htz0yutpuyvp6l54w.png) I placed rock assets around steep edges of the hill ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/klf6qcxg0lz4qkhhrw1u.png) I downloaded tree assets from Unreal Marketplace. Previously everything was downloaded from Quixel Bridge. I can control the appearance of trees globally using Global Foliage Actor. In the screenshot I made them autumny. However, this Global Foliage Actor controls only assets from package BlackAlder, but not from PN_interactiveSpruceForest and I don't know why. Global Foliage Actor seems to be somehow connected with one meshes, but not with others. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7v8gyza7t0gpe917gjpb.png)
humberd
1,867,046
Azure Storage
A post by irewamide
0
2024-05-27T23:23:32
https://dev.to/irewamide/azure-storage-231e
azurestorage, storagewale
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idxcjjbdfccnriwda715.png)
irewamide
1,867,045
Quick Beauty Boost: Biotin Results in One Week
In the pursuit of radiant hair, glowing skin, and strong nails, many turn to beauty supplements for a...
0
2024-05-27T23:22:15
https://dev.to/faaiz_siddiqui_6d949d275c/quick-beauty-boost-biotin-results-in-one-week-31op
healthydebate, biotin, supplements, tablets
In the pursuit of radiant hair, glowing skin, and strong nails, many turn to beauty supplements for a quick fix. Among these, biotin, also known as Vitamin B7, has gained popularity for its promising beauty benefits. But can [biotin results after 1 week ](https://versusforher.com/products/super-biotin-supplement)truly deliver noticeable changes? Let’s explore whether biotin can live up to its reputation within such a short timeframe. What is Biotin? Biotin is a water-soluble vitamin that plays a crucial role in converting food into energy. It’s found naturally in foods like eggs, nuts, and certain vegetables. Biotin supplements come in various forms, including capsules, tablets, and gummies, with dosages ranging from a few micrograms to several thousand micrograms per day. The Beauty Claims Biotin supplements are marketed with several enticing promises: Enhanced Hair Growth and Health: Biotin is said to stimulate hair growth, improve hair texture, and strengthen strands. Stronger, Resilient Nails: Regular use of biotin can reduce nail brittleness and promote stronger, healthier nails. Improved Skin Texture and Hydration: Biotin may help maintain healthy skin by enhancing its hydration and appearance. These claims have fueled the popularity of biotin as a beauty supplement, with many hoping to achieve visible results quickly. The One-Week Experiment To put these claims to the test, I embarked on a one-week biotin trial. As a 25-year-old woman with a healthy lifestyle, I took a daily dose of 5000 mcg of biotin in the form of gummy supplements. I kept my diet and skincare routine consistent throughout the experiment to isolate the effects of biotin. Daily Observations Day 1: Baseline Assessment At the start of the experiment, my hair was lackluster, my nails were prone to breaking, and my skin was relatively clear but could use some hydration. I began taking the biotin gummies with anticipation, eager to see if any changes would occur. Day 2-3: Early Impressions By the second day, I noticed a subtle improvement in the texture of my hair. It felt slightly softer and smoother, though the change was minor. My nails seemed a bit stronger, with less peeling at the tips. As for my skin, there were no noticeable changes yet. Day 4-5: Notable Changes As the week progressed, the improvements became more apparent. My hair appeared shinier and more vibrant, with fewer flyaways and frizz. My nails showed signs of increased strength, with less bending and breakage. Additionally, my skin felt more hydrated and supple, especially in areas prone to dryness. Day 6-7: Final Reflections By the end of the week, I was pleasantly surprised by the results. My hair looked noticeably healthier, my nails were stronger and longer, and my skin had a subtle glow. While the changes were not dramatic, they were certainly enough to make a difference in my overall appearance. Scientific Insights Scientific research on biotin’s effectiveness for beauty benefits is mixed. While some studies support its role in promoting hair and nail health, others suggest that the evidence is inconclusive, particularly for individuals without a biotin deficiency. Experts often recommend longer-term use of biotin to see significant results, with improvements typically becoming noticeable after several weeks to months of consistent supplementation. Personal Experiences and Testimonials In addition to my own observations, testimonials from other biotin users echoed similar experiences. Many reported seeing improvements in hair, skin, and nails within a few weeks of starting biotin supplements. While individual results may vary, these testimonials suggest that biotin can indeed provide visible benefits over time. Conclusion: Quick Beauty Boost or Longer Commitment? The one-week biotin experiment yielded promising results, with noticeable improvements in hair, skin, and nails. While the changes were not drastic, they were certainly enough to provide a quick beauty boost. However, it’s essential to recognize that significant and lasting results may require longer-term use of biotin supplements. Tips for Maximizing Biotin Benefits For those considering biotin supplements, here are some tips to maximize their beauty benefits: Choose high-quality supplements from reputable brands. Be patient and consistent with daily supplementation. Pair biotin with a balanced diet [health](https://dev.to/xenoxdev/health-issues-you-face-being-a-developer-4785) and skincare routine for optimal results.
faaiz_siddiqui_6d949d275c
1,866,991
Understanding the JVM optimization (JIT)
Java is widely regarded as an interpreted language, primarily relying on the Java Virtual Machine...
0
2024-05-27T23:14:33
https://dev.to/david_f_santos/understanding-the-jvm-optimization-jit-2d2o
java, jvm, code, spring
![JVM scheme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bvc23oc15q9dx764g1qg.jpg)Java is widely regarded as an interpreted language, primarily relying on the Java Virtual Machine (JVM) to convert the code we write into machine code. This process allows Java to uphold its renowned principle of "write once, run anywhere," ensuring platform independence. However, the performance of interpreted languages can lag behind that of natively compiled machine code. To bridge this performance gap, the JVM employs sophisticated techniques to optimize code execution, making Java applications run faster. One of the key mechanisms it uses is Just-In-Time (JIT) compilation. During execution, the JVM identifies frequently executed parts of the code, compiles them into native machine code, and optimizes them for better performance. **JVM Compilers: C1 and C2** The JVM uses two main compilers, each designed to handle different levels of optimization: C1 and C2. **C1 Compiler**: The C1 compiler, also known as the client compiler, handles initial stages of optimization with two primary levels: **Level 1**: At this stage, the JVM simply interprets the bytecode. This is the least optimized level and is used for initial execution when the JVM doesn't yet have enough profiling information. **Level 2**: The code is compiled into machine code without any further optimization. This level is quicker than the more advanced levels but provides a foundation for performance improvements as the application continues to run. **C2 Compiler**: The C2 compiler, or server compiler, takes optimization to a more advanced level: **Level 3**: Here, the JVM compiles code into highly optimized native machine code. Although this process takes longer than Level 2, it significantly enhances execution speed. This level of optimization is typically applied to methods and loops that are executed very frequently, making it unlikely to be used in short-lived applications. The Role of Caching in JVM Optimization Once the code is compiled and optimized, it is stored in a cache to speed up future executions. This caching mechanism ensures that the JVM does not need to recompile code segments repeatedly. However, since the cache has limited capacity, it periodically needs to be cleared to accommodate new compilations. This process ensures efficient use of memory and maintains optimal performance. **Beyond Compilation: Next Steps** Understanding the JVM's compilation and optimization mechanisms provides a solid foundation for grasping Java's performance capabilities. In subsequent sections, we will delve into other crucial aspects of Java performance, such as the differences between the stack and heap memory, and the concept of passing values by reference versus passing by value. These topics are essential for mastering Java performance tuning and writing efficient Java code. Stay tuned as we explore these advanced topics and continue to demystify the inner workings of the JVM.
david_f_santos
1,866,989
Hello world!!!
This is classic word when start to writing some code. So, it's my first time on Dev.to community....
0
2024-05-27T23:03:48
https://dev.to/tsunin/hello-world-29i0
This is classic word when start to writing some code. So, it's my first time on Dev.to community. See ya.
tsunin
1,866,966
64-Bit Assembly Language Lab 3 part-3
Hiii!! Thank you for your patience, I truly appreciate it. If you have'nt already read my last blog...
0
2024-05-27T22:58:08
https://dev.to/yuktimulani/64-bit-assembly-language-lab-3-part-3-3ipi
assembly, loop
Hiii!! Thank you for your patience, I truly appreciate it. If you have'nt already read my [last blog](https://dev.to/yuktimulani/64-bit-assembly-language-lab-3-part-2-f9p) go read it now!! so you get some context. Lets get started before I get beaten up by my readers for keeping the walkthrough a suspense. ## Walk through for the loop program in aarch64 archietecture 1.Data Section (.data): ``` .data msg: .ascii "Loop: #\n" len= . - msg ``` - msg is a string "Loop: #\n", where # is a placeholder for the loop counter. - len is the length of the msg string, calculated as the difference between the current address and the address of msg. 2.Text Section (.text): ``` .text .globl _start min = 0 max = 30 _start: mov x19, min ``` - .globl _start: Declares _start as a global symbol (entry point). - min = 0 and max = 30: Constants for loop bounds. - _start:: Label marking the entry point of the program. - mov x19, min: Initializes x19 (loop index) to 0. 3.Loop and Message Preparation: ``` loop: add x15, x19, 0x30 adr x14, msg+6 mov x12, 10 udiv x13, x19, x12 add x16, x13, 0x30 cmp x16, 0x30 b.eq ones strb w16, [x14] ``` - add x15, x19, 0x30: Convert loop index (x19) to ASCII character. - adr x14, msg+6: Address of the placeholder # in the msg string. - mov x12, 10: Move 10 into x12 for division. - udiv x13, x19, x12: Divide x19 by 10, quotient in x13. - add x16, x13, 0x30: Convert quotient to ASCII. - cmp x16, 0x30: Compare if the quotient is 0. - b.eq ones: If the quotient is 0, branch to ones. - strb w16, [x14]: Store the quotient character. 4.Handling Ones Place: ``` ones: adr x14, msg+7 msub x13, x13, x12, x19 add x13, x13, 0x30 strb w13, [x14] ``` - adr x14, msg+7: Address of the next character after the placeholder #. - msub x13, x13, x12, x19: Compute the remainder. - add x13, x13, 0x30: Convert remainder to ASCII. - strb w13, [x14]: Store the remainder character. 5. Print the Message: ``` mov X0, 1 adr x1, msg mov x2, len mov x8, 64 svc 0 ``` - mov X0, 1: Set stdout file descriptor. - adr x1, msg: Address of the msg string. - mov x2, len: Length of the msg string. - mov x8, 64: Syscall number for write. - svc 0: Make the syscall. 6.Increment and Check Loop: ``` add x19, x19, 1 cmp x19, max b.ne loop mov x0, 0 mov x8, 93 svc 0 ``` - add x19, x19, 1: Increment loop index. - cmp x19, max: Compare loop index with max. - b.ne loop: If loop index is not equal to max, repeat loop. - mov x0, 0: Exit status code. - mov x8, 93: Syscall number for exit. - svc 0: Make the syscall to terminate the program. Overall this program iterates from min (0) to max (30), converting the loop index to a string and printing it using a syscall. The program handles converting numbers to their ASCII representation and uses system calls to print the message and eventually exit the program. Each iteration prints "Loop: #\n" where # is the current loop index. This could also be written in x86_64 archietecture. The code is as follows. ``` .text .globl _start min = 0 /* starting value for the loop index; **note that this is a symbol (constant)**, not a variable */ max = 33 _start: mov $min,%r15 /* loop index */ loop: mov $0,%rdx mov %r15,%rax mov $10,%r12 div %r12 mov %rax,%r14 add $'0',%r14 cmp $'1',%r14 je loopOnes mov %r14b,msg+6 loopOnes: mov %rdx,%r14 add $'0',%r14 mov %r14b,msg+7 movq $len,%rdx movq $msg,%rsi movq $1,%rdi movq $1,%rax syscall /* ... body of the loop ... do something useful here ... */ inc %r15 /* increment index */ cmp $max,%r15 /* see if we're done */ jne loop /* loop if we're not */ mov $0,%rdi /* exit status */ mov $60,%rax /* syscall sys_exit */ syscall .section .data msg: .ascii "Loop: #\n" len = . - msg ``` ## The Output [I almost forgot] The output for both the archietectures looks like this ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dw7ncsibbi9mg3c7ry3g.png) So here it is the third part of the blog, but I dont like the number three. So, I'm excited to add one more part to my blog, the cherry on top to complete the series! and also to include some more experiments on the assembler. Thank you for reading! Untill then Happy Coding!!👋
yuktimulani
1,866,988
Condos & Bungalows for sale in Oakville | Preserve Oakville
The Canadian Housing Market A Sea Change in 2 (Almost) 2024 The Canadian housing marketplace, as soon...
0
2024-05-27T22:54:03
https://dev.to/irfan_iqbal_71c4a0d34ff2f/condos-bungalows-for-sale-in-oakville-preserve-oakville-2jg3
**The Canadian Housing Market** A Sea Change in 2 (Almost) 2024 The Canadian housing marketplace, as soon as a runaway teach of rate increases, is beginning to resemble a sailboat navigating choppy waters. While fundamental cities still grapple with affordability demanding situations, recent shifts propose a length of capability correction. Understanding these dynamics is vital for every person thinking about buying, selling, or investing in Canadian real estate within the latter 1/2 of 2024. **A Moderating Market** The maximum widespread replace to the Canadian housing marketplace is the cooling of price boom. After years of double-digit will increase, national common domestic charges are showing signs and symptoms of stagnation or even slight decline (depending at the supply). The Canadian Real Estate Association (CREA) reported a 2.6% decrease in countrywide common domestic expenses in April 2024 in comparison to April 2023 [Source: CREA]. This fashion is mainly obtrusive in formerly purple-hot markets like Toronto and Vancouver, where charges have dipped via four.7% and eight.Three% respectively [Source: MLS Home Price Index]. **The Culprit? Rising Interest Rates** As expected, the Bank of Canada's aggressive hobby fee hikes have impacted the market. Higher borrowing charges have translated into decreased shopping for energy, making expensive houses much less available. This has softened demand, specifically for indifferent houses in essential city centres. **Regional Divergence** The cooling effect isn't uniform throughout Canada. While fundamental towns revel in a slowdown, smaller centres and low priced markets show endured boom. This is in part due to the spillover impact, in which customers priced out of larger cities discover alternative places. Additionally, the rise of far off work keeps to fuel demand in formerly left out regions with a decrease value of living. **Government Intervention and the Affordability Question** The Canadian authorities's efforts to address affordability concerns are ongoing. The strain check for mortgage qualification stays in place, making sure borrowers can climate capacity hobby fee increases. Additionally, some provinces like Ontario have implemented a non-resident speculation tax targeted at foreign consumers [Source: Government of Ontario]. Whether those measures are powerful in the long term remains an open query, but they signal a continued recognition on affordability. **Emerging Trends Beyond the Price Tag** The evolving market landscape is going past just costs. Here are some extra traits shaping Canadian real estate: Sustainability on the Rise: Environmental focus continues to influence client options. Homes with energy-efficient capabilities, inexperienced constructing practices, and proximity to inexperienced areas are in high demand. The Rise of Condominiums and Townhomes: As affordability turns into a larger issue, detached homes might grow to be less attainable for some customers. Condominiums and townhomes provide a greater low-cost entry factor into the ownership marketplace, particularly in city regions. The "Fixer-Upper" Appeal: Rising production charges make existing housing inventory more attractive. Homebuyers looking for fee would possibly don't forget purchasing homes requiring renovations to customise and potentially growth future cost. Navigating the Market: Tips for Buyers and Sellers in 2024 The present day market affords both possibilities and demanding situations. Here's a few guidance for the ones thinking about a actual property transaction: **Buyers**: Be affected person and do your research! Market conditions can exchange fast. Work with a realtor to recognize the nuances of specific areas and get pre-accepted for a loan before making offers. Consider a wider variety of assets sorts, including condos and townhomes, to extend your options. **Sellers**: Price your own [home](https://preserveoakville.ca/) realistically primarily based on modern market traits and latest income information in your neighbourhood. Staging and minor renovations can beautify your own home's attraction. Be prepared for negotiation and a doubtlessly longer promoting time-frame compared to the latest past. A Cautiously Optimistic Future: Opportunities for Stability While predicting the destiny is never foolproof, the cutting-edge marketplace shift signifies a ability duration of greater stability in Canadian real property. Buyers may additionally ultimately see some relief at the affordability front, whilst sellers would possibly want to adjust their expectancies in certain markets. The attention would possibly shift in the direction of sustainable housing answers that prioritize power efficiency and accountable improvement. Additionally, with faraway work turning into normalized, smaller towns with exact infrastructure and services ought to see persisted boom. **Final Words Knowledge is Power** The Canadian actual property market remains complex and dynamic. Staying knowledgeable about current tendencies, engaging in thorough research (such as local marketplace analysis), and searching for expert steering from qualified realtors may be vital for navigating this ever-changing panorama. By drawing close your real property dreams with a nicely-knowledgeable and lengthy-time period angle, you may maximize your probabilities of fulfillment within the (almost) 2024 Canadian housing marketplace.
irfan_iqbal_71c4a0d34ff2f
1,866,937
Showcase Your GitHub Profile: Contribute to the "Cool GitHub Profile README" Repository!
Hey Dev Community! 👋 I'm excited to share a project I've been working on: the Cool...
0
2024-05-27T22:50:32
https://dev.to/nikhilshukla/showcase-your-github-profile-contribute-to-the-cool-github-profile-readme-repository-4c1p
github, opensource, firstpost, firstyearincode
> ## Hey Dev Community! 👋 I'm excited to share a project I've been working on: [**the Cool GitHub Profile README repository**](https://github.com/nikhil-shuklaa/Cool-GitHub-Profile-README)! This repository is all about collecting and showcasing the coolest GitHub profile READMEs. Whether you’ve already crafted an amazing README or you’re just starting out, we’d love to see your contribution! ### Why Contribute? > 1. **Inspiration for Others**: Your profile README could inspire fellow developers. > 2. **Showcase Your Creativity**: Display your unique style and personality. > 3. **Learn Open Source Contribution**: If you haven't made any open source contributions yet, this is the perfect time to get started! ### How to Contribute to this repo Contributing is simple and it's a great way to get familiar with the open source workflow. Here’s a step-by-step guide: **1. Fork the Repository**: > - Go to the [Cool GitHub Profile README repo](https://github.com/nikhil-shuklaa/Cool-GitHub-Profile-README). ![Fork the repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h3xdmpqeqvgpvshc53ui.png) > - Click on the "**Fork**" button at the top right of the page and after that click on **Create Fork**. This creates a copy of the repository in your GitHub account. ![Forking Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bwqntr0g79rimm4md881.png) **2. Check out the Contribution Guidelines**: > - Review the [Contribution Guidelines](https://github.com/nikhil-shuklaa/Cool-GitHub-Profile-README/blob/master/contributing.md) to understand the contribution process and requirements. **3. Edit the README.md File**: > - Navigate to the `README.md` file in your forked repository. > - Click on the "Edit this file" pencil button on the right side of the opened tab. ![Edit Button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7376c02cm82dk4pgkp6c.png) **4. Add Your README.md to the Relevant Category**: > - Choose the compatible/relevant README category. For example, if your README is visually Minimalistic ✨, add it to the `Minimalistic ✨` category. ![readme category](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gz5qftnawk12ql9hs8zz.png) > - Add your profile by inserting the following code under the chosen category (replace <your-name> with your username): ``` ["Your Name"](https://github.com/<your-username>/<your-username>) ``` - Example: `[Nikhil Shukla](https://github.com/nikhil-shuklaa/nikhil-shuklaa)` **5. Commit Your Changes**: > - Click on "**Commit changes**" - Add a commit message like: ``` Added [Your Name] in [Category] - README.md ``` > - Click on the "**Commit changes**" Button. **6. Verify Your Changes**: > - Navigate back to the root of your forked repository. > - Verify that your name has been added to the list in your selected category. **7. Create a Pull Request**: > - In your forked repository, click on the "Contribute" button. > - Click on the "**Open pull request**" button below. > ![Contribute button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvn4g07y4kygbhf4ikn4.png) **8. Compare Changes and Create Pull Request**: > - The "Comparing changes" tab will open. > - Fill in all the necessary details. `Example` ![Create Pull Request](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8y8h0gtbx0ikkbvr32n.png) > - Click on "**Create pull request**" And that's it! You've made an open-source contribution! 🎉 ### Ready to Get Started? Head over to the [Cool GitHub Profile README](https://github.com/nikhil-shuklaa/Cool-GitHub-Profile-README) repo and start showcasing your awesome profiles. If you need some inspiration, feel free to check out my [GitHub profile README](https://github.com/nikhil-shuklaa/nikhil-shuklaa). Whether you’re an open-source newbie or a seasoned contributor, we can’t wait to see what you bring to the table! If you have any ideas or suggestions, please let me know. I’m always happy to discuss and contribute! Thank you so much for considering contributing. Let's make this a wonderful collection together! Happy Coding!
nikhilshukla
1,866,967
JavaScript's Gotchas, also known as "WTF JS"
1. Arrays and Equality [] == ![]; // -&gt; true // Explanation: Arrays are truthy, so...
0
2024-05-27T22:48:35
https://dev.to/falselight/javascripts-gotchas-also-known-as-wtf-js-obf
webdev, javascript, beginners, programming
### 1. Arrays and Equality ```javascript [] == ![]; // -> true // Explanation: Arrays are truthy, so ![] is false, which coerces to 0. [] coerces to 0, so 0 == 0 is true. true == []; // -> false true == ![]; // -> false // Explanation: true converts to 1 and [] converts to 0. 1 != 0. false == []; // -> true false == ![]; // -> true // Explanation: false and [] both convert to 0. 0 == 0. ``` ### 2. Type Coercion Oddities ```javascript !!"false" == !!"true"; // -> true // Explanation: Both strings are truthy, so !! converts them to true. "b" + "a" + +"a" + "a"; // -> 'baNaNa' // Explanation: +"a" converts 'a' to NaN, so it becomes "ba" + NaN + "a" which is 'baNaNa'. NaN === NaN; // -> false // Explanation: NaN is not equal to anything, including itself. ``` ### 3. Object Comparison ```javascript Object.is(NaN, NaN); // -> true NaN === NaN; // -> false // Explanation: Object.is and === have different behaviors for NaN. Object.is(-0, 0); // -> false -0 === 0; // -> true // Explanation: -0 and 0 are considered equal with === but not with Object.is. ``` ### 4. Fun with Syntax ```javascript [1, 2, 3] + [4, 5, 6]; // -> '1,2,34,5,6' // Explanation: Arrays are converted to strings and concatenated. let a = [, , ,]; a.length; // -> 3 // Explanation: Trailing commas create empty slots, affecting array length. ``` ### 5. Number Coercion and Parsing ```javascript parseInt(null, 24); // -> 23 // Explanation: null is converted to a string and then parsed according to the specified radix. 0.1 + 0.2; // -> 0.30000000000000004 // Explanation: Floating-point arithmetic can produce imprecise results. true + true; // -> 2 (true + true) * true - true; // -> 1 // Explanation: Booleans are coerced to numbers in arithmetic operations. Number(); // -> 0 Number(undefined); // -> NaN // Explanation: Number without arguments returns 0, with undefined returns NaN. ``` ### 6. Unexpected Typeof and Instanceof ```javascript typeof NaN; // -> 'number' // Explanation: Despite its name, NaN is of type 'number'. typeof null; // -> 'object' // Explanation: Null is considered an object in JavaScript, although it is a primitive value. ``` ### 7. Miscellaneous ```javascript {} + []; // -> 0 [] + {}; // -> '[object Object]' // Explanation: The order of operations and type coercion produce different results. [10, 1, 3].sort(); // -> [1, 10, 3] // Explanation: Default sorting converts elements to strings, sorting them lexicographically. let f = () => {}; f(); // -> undefined // Explanation: Arrow function with empty block returns undefined. let f = function() { return arguments; }; f("a"); // -> { '0': 'a' } // Explanation: Regular function captures arguments. let f = () => arguments; f("a"); // -> ReferenceError: arguments is not defined // Explanation: Arrow function does not capture arguments. (() => { try { return 2; } finally { return 3; } })(); // -> 3 // Explanation: finally block overrides the return statement. new class F extends (String, Array) {}(); // -> F [] // Explanation: Extends clause uses the last argument, so class extends Array. let x, { x: y = 1 } = { x }; y; // -> 1 // Explanation: Destructuring with default value when x is undefined. [...[..."..."]].length; // -> 3 // Explanation: Spreading a string spreads its characters into an array. foo: { console.log("first"); break foo; console.log("second"); } // Explanation: Labeled block with break statement. typeof new class { class() {} }(); // -> 'object' // Explanation: Keyword can be used as method name. ``` ### 📚 Other resources [qit.tools](https://qit.tools/developer/cheat-sheet/javascript/gotchas/) - JavaScript's Gotchas (WTF JS): Unexpected Behaviors
falselight
1,866,987
help with apps script
I am trying to learn java script for google apps script to have a spreadsheet I can use for theater...
0
2024-05-27T22:45:08
https://dev.to/emily_tischer_bf4f731fb26/help-with-apps-script-4180
beginners, javascript, googlecloud, explainlikeimfive
I am trying to learn java script for google apps script to have a spreadsheet I can use for theater costume plots. Basically, I want the spreadsheet to generate sheets for different sorts, but then keep them updated with edits to the parent. I have an on Edit script to make a new sheet when an actor's name is entered, but I can't get it to link to the new sheet. It also does not sync with changes.
emily_tischer_bf4f731fb26
1,866,985
Structural-Based Testing: A Simple Guide
When writing tests for your code, it's easy to miss some parts, which can lead to bugs. How can you...
0
2024-05-27T22:44:06
https://springmasteryhub.com/2024/05/27/structural-based-testing-filling-the-gaps-in-your-test-suite/
java, tutorial, programming, softwaredevelopment
When writing tests for your code, it's easy to miss some parts, which can lead to bugs. How can you ensure you've tested everything properly? Use structural-based testing! ## What is Structural-based testing? This technique is about considering your code when writing your tests. It's a complementary technique and should be used as a support of other testing techniques. The idea here is that you already have a test suite and you want to check if all branches and partitions of your code were already tested. This can be achieved by looking at the line coverage report. It will spot places that might be missing some test scenarios. But do not use this to write tests right away. Use it to understand what’s going on first. As I said it is a complementary technique that should be used to help you fill the gaps that your tests can be missing. Use as a part of the process. ## So what process is this? 1. [**Specification-based testing**:](https://dev.to/tiuwill/specification-based-testing-a-developers-secret-weapont-3c5p) this will help you to create scenarios that match the specification expectations. 2. [**Use coverage as a guide, not a goal**:](https://dev.to/tiuwill/use-coverage-as-a-guide-not-a-goal-4925) Run your coverage tool to see if some branches or partitions are missing. 3. **Understand the results**: question yourself to get clarification, this will be a filter to write the missing tests later. Example: - Why this part was not covered by the test suite? - How this partition can be exercised? - Could this be missing from the specification? - Or just was an update? - Did someone just forget to write a test considering this branch? - Is the developer checking something that does not make sense at this moment? 4. **Create test scenarios**: Write tests for what makes sense to fill the gaps of what went missing. For what it doesn't maybe you should refactor. ## Additional tips: [**Write meaningful assertions**](https://dev.to/tiuwill/how-to-write-meaningful-test-assertions-that-help-you-not-break-your-code-base-ohh): it’s tempting to write tests that just pass through the code without testing anything, this will help you avoid this mistake. Some tests can fool the coverage metric, so make sure that are testing something. [**Run mutation tests**:](https://dev.to/tiuwill/from-bugs-to-brilliance-enhancing-code-reliability-through-mutation-testing-15gc) by writing tests and looking at the code is easy to fool yourself and think that everything is ok because it’s covering all parts of your code. Mutation tests will put that into proof and help you to see what tests need some rework to improve their strength to catch bugs. So next time you are going to create tests by looking at your code, following this process, will help you a lot! For more tips, follow me on social media! [Willian Moya (@WillianFMoya) / X (twitter.com)](https://twitter.com/WillianFMoya) [Willian Ferreira Moya | LinkedIn](https://www.linkedin.com/in/willianmoya/) Also follow me here on dev.to!
tiuwill
1,866,894
Systemd
Systemd, Linux işletim sistemleri için bir başlatma sistemi ve hizmet yöneticisidir. Geleneksel...
0
2024-05-27T22:43:12
https://dev.to/teknikbilimler/systemd-ebc
Systemd, Linux işletim sistemleri için bir başlatma sistemi ve hizmet yöneticisidir. Geleneksel SysVinit sistemini değiştirmek üzere tasarlanmıştır ve paralel sistem hizmetlerinin başlatılması, gerektiğinde servislerin başlatılması ve bağımlılık tabanlı hizmet kontrolü gibi daha fazla özellik sunar. Systemd, sistem başlatma sürelerini iyileştirmeyi hedefler ve sistem süreçlerini ve hizmetlerini daha iyi yönetme imkanı sağlar. Systemd'in önemli özelliklerinden biri, hizmetler, soketler, aygıtlar, bağlantılar ve diğer sistem kaynaklarını tanımlamak için birim dosyalarını kullanmasıdır. Bu birim dosyaları basit bir deklaratif dilde yazılmıştır ve her bir birimin yapılandırmasını ve bağımlılıklarını belirtmek için kullanılır. Systemd ayrıca sistem hizmetlerini yönetmek için systemctl gibi yardımcı programlar içerir, servisleri kontrol etmek için journalctl gibi sistem günlüklerine erişmek için ve sistem başlatma sürelerini analiz etmek için systemd-analyze gibi yardımcı programlar bulunur. Genel olarak, systemd birçok Linux dağıtımında varsayılan başlatma sistemi haline gelmiştir, bunlar arasında Debian, Ubuntu, Fedora, CentOS ve diğerleri bulunmaktadır. Ancak, systemd'in algılanan karmaşıklığı ve geleneksel Unix prensiplerinden sapması nedeniyle Linux topluluğu içinde tartışmalı bir kabul görmüştür. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2170aumann6oi0prodcw.png) **Systemd'in Özellikleri:** - **Daha hızlı başlatma:** Systemd, paralel işleme ve soket ve D-Bus etkinleştirme gibi özellikler kullanarak işletim sisteminin daha hızlı başlatılmasını sağlar. - **Gelişmiş servis yönetimi:** Systemd, servislerin bağımlılıklarını ve başlatma sırasını yönetmek için daha karmaşık bir sistem kullanır. Bu, sistemin daha kararlı ve güvenilir çalışmasını sağlar.Gelişmiş servis yönetimi: Systemd, servislerin bağımlılıklarını ve başlatma sırasını yönetmek için daha karmaşık bir sistem kullanır. Bu, sistemin daha kararlı ve güvenilir çalışmasını sağlar. - **Daha iyi hata ayıklama:** Systemd, daha ayrıntılı hata ayıklama bilgileri sağlar. Bu, sorunları daha hızlı bulup çözmenizi kolaylaştırır. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8k45y7zj9z99227wqfm.jpg) **Systemd Örneği** Aşağıdaki örnek, systemd kullanarak bir servis nasıl başlatılır ve durdurulurunu gösterir: **_Servisi başlat_** sudo systemctl start my-service **_Servisi durdur_** sudo systemctl stop my-service **_Servisin durumunu kontrol et_** sudo systemctl status my-service ** SORULAR** _**1. Systemd dosyaları nelerdir?**_ _**2. Systemd komutları nelerdir?**_ _**3. Systemd, Linux işletim sistemlerinde kullanılan ____'dir.**_ **_4. Systemd servis birimler ____ .service dosyaları olarak oluşturulur._** **KAYNAKÇA** _https://chatgpt.com/?oai-dm=1_ _https://gemini.google.com/app/0abc9ab5ad85e18f_ _https://gemini.google.com/app/0abc9ab5ad85e18f_
eylemirat
1,866,877
How to use database triggers in Rails
Introduction In modern web development, efficiently managing data within a database is...
0
2024-05-27T22:33:32
https://dev.to/gavrilarails/how-to-use-database-triggers-in-rails-1a3l
rails, postgres, database, tutorial
### Introduction In modern web development, efficiently managing data within a database is crucial for ensuring optimal application performance and data integrity. Rails provides robust tools for interacting with databases. However, there are scenarios where leveraging the power of the database itself can yield significant benefits. This is where database triggers come into play. Database triggers are special procedures that are automatically executed in response to certain events on a particular table or view in a database. These events can include actions such as insertions, updates, or deletions. Triggers are powerful tools for enforcing rules, maintaining audit trails, and ensuring data consistency without the need for manual intervention. By encapsulating logic within the database, triggers can help offload processing from the application layer, reduce network overhead, and ensure that critical operations are performed reliably. ### When to Use Them While database triggers can be incredibly useful, their application should be carefully considered. Triggers can be highly effective for specific use cases such as data denormalization. Data denormalization involves storing redundant data to improve read performance. For example, in a denormalized database, you might maintain a summary table that aggregates data from multiple related tables. A common scenario is updating a `total sales` column in a `customers` table whenever a new order is inserted into the `orders` table. Instead of recalculating the total sales every time it is needed, a trigger can automatically update the total whenever an order is added, modified, or deleted, thereby reducing the complexity and number of queries required to fetch this data. This use of triggers helps maintain data integrity while significantly improving query performance. Another practical case for denormalisation using database triggers is to add a reference to another table during an insert operation to simplify queries. For instance, consider a scenario where you have a `companies` table, and each company has many `branches`, each `branch` has many `employees`, and each `employee` has many `sales`. If you frequently need to get aggregated sales by company, you may benefit from adding a `company_id` column to the `sales` table and populating it on insert. This simplifies your queries by allowing direct access to the company information without needing to join multiple tables. For example, instead of joining the `sales`, `employees`, `branches`, and `companies` tables to get the total sales for a company, you can directly query the `sales` table using the `company_id`. This not only makes your queries more straightforward but also improves performance by reducing the complexity and number of joins required. This approach ensures that your data remains consistent and that the `company_id` is always correctly populated, making your data aggregation tasks more efficient. ### When Not to Use Them While database triggers can offer significant advantages in certain scenarios, there are situations where their use can complicate the architecture and maintenance of an application. For example, consider a scenario where we decide to create a record in the `invoices` table every time a record is created in the `sales` table. Implementing this logic with a trigger would require embedding business rules directly within the database layer, which can violate the separation of concerns principle. By placing business logic in triggers, you risk making your application harder to maintain and understand. Business logic is typically best handled within the application code, where it is more visible, easier to test, and simpler to modify as requirements evolve. When business rules are hidden within database triggers, it becomes challenging for developers to trace the flow of data and understand the application's behavior, leading to potential bugs and increased maintenance overhead. Additionally, debugging issues that arise from triggers can be more complex, as the logic is executed automatically by the database in response to events, rather than being explicitly called within the application code. In this example, the preferred approach would be to handle the creation of invoice records within the application's service layer. This ensures that the business logic remains centralized, making the application more modular, maintainable, and easier to understand. By keeping business rules within the application code, developers can leverage standard development tools and practices, such as unit testing and version control, to ensure the integrity and reliability of the application. ### Let's Start Let's create an example trigger in the Rails environment. I suspect you have come to read this post expecting to see one. As an example, I've chosen to create a URL shortener that works the following way: For each long URL, we create a record in the database with the corresponding short alphanumeric code. For the short code, we will use the first 5 characters of the long URL's MD5 hash. If the short code is already taken by another URL, we will take the first 6 characters, and so on, until we find a free code or reach the limit of 32 characters, which is the length of an MD5 hash. By design, if the same URL is added again, it will generate the same short code, and instead of creating a new record, it will update the `updated_at` field of the existing record. This approach ensures that we avoid duplicate entries and maintain the uniqueness of short codes efficiently. Now, let's dive into the details of how to implement this in a Rails application with a database trigger. ```ruby class CreateUrls < ActiveRecord::Migration[7.1] def up create_table :urls do |t| t.string :long t.string :short t.timestamps end add_index :urls, :short, unique: true add_index :urls, :long, unique: true path = "#{Rails.root}/db/triggers/add_unique_short_to_urls_on_insert.sql" sql = File.read(path) ActiveRecord::Base.connection.execute sql end def down drop_table :urls ActiveRecord::Base.connection.execute 'DROP FUNCTION IF EXISTS add_unique_short' end end ``` Like any other database change, triggers are added to Rails using migrations. Here is the migration to create a table, add indices, and execute SQL code from the file we'll be storing in the `triggers` folder. It is important to add a `down` method to delete your trigger when you reverse the migration. I've also put the SQL code for the trigger into a separate folder. Not only does this allow us to use code highlighting and autocomplete provided by your IDE, but it also indicates to other developers (and your future self) that there are database triggers in the app, making it easy to get a full list of them. Giving them obvious names is also important to ensure clarity and ease of maintenance. I don't think it is superfluous to clarify to folks who might not be familiar with Rails how migrations work. In Rails, we create classes for migrations in the `db/migrate` folder that inherit from `ActiveRecord::Migration[:rails_version]`. This is a good example of metaprogramming in Ruby. Instead of directly inheriting from the `ActiveRecord::Migration` class, `ActiveRecord::Migration` has redefined the `[]` (square brackets) method to dynamically create a class with features available for the specified Rails version and return it, so we can inherit from it. This allows us to use migrations created in previous versions of Rails even after updating Rails. The newly created class typically has two methods, `up` and `down`, which apply and revert the changes to the database, respectively. Alternatively, it might have a single `change` method if the changes can be automatically reversed by Rails. The name of the file containing the class starts with a 14-digit timestamp, and Rails maintains a table with one column containing these timestamps for executed migrations. This ensures that migrations are run only once and in the order they were created when you type `rails db:migrate`. This system ensures smooth database schema changes and consistency across different environments. It's important to mention that the SQL code we will write in the next section will be compiled and executed by the database engine, so if we need to make changes, we need to revert the migration, change the code, and execute it again. You can read more about migrations here: [Rails Migrations Guide](https://github.com/rails/rails/blob/main/guides/source/active_record_migrations.md). ### SQL Code Now let's dive into the SQL code. Since I am using PostgreSQL, I will be writing code in PL/pgSQL. Here is the code: ```sql CREATE OR REPLACE FUNCTION add_unique_short() RETURNS TRIGGER AS $$ DECLARE l int := 5; hash varchar(32); found boolean; BEGIN hash := MD5(NEW.long); -- Generate the hash based on the 'long' URL -- Check for uniqueness of the short URL LOOP SELECT EXISTS(SELECT 1 FROM "urls" WHERE "urls"."short" = LEFT(hash, l)) INTO found; EXIT WHEN NOT found OR l >= 32; l := l + 1; END LOOP; -- Handle the case where a unique short hash is not found IF l >= 32 AND found THEN RAISE EXCEPTION 'Unable to generate a unique short URL'; END IF; -- Set the short URL NEW.short := LEFT(hash, l); RETURN NEW; END; $$ LANGUAGE plpgsql; DROP TRIGGER IF EXISTS add_unique_short_to_urls_on_insert ON urls; CREATE TRIGGER add_unique_short_to_urls_on_insert BEFORE INSERT OR UPDATE OF long ON urls FOR EACH ROW EXECUTE FUNCTION add_unique_short(); ``` The code is straightforward, but let's highlight a few details about how PL/pgSQL works. In PL/pgSQL, all variables must be declared in a specific section at the beginning of the function, and the language is strictly typed, requiring each variable to have a defined data type. Additionally, functions must be declared before they can be used in triggers, ensuring that the database recognizes the function and its capabilities when setting up the trigger. Since this logic operates at the data layer, making queries within the loop is not as expensive as it would be if performed from Rails. This is particularly efficient because we have an index for the short column. The database might not need to scan the entire table for the EXISTS query; it can simply check the index tree, which significantly reduces the overhead and improves performance. ### Alternatives and Debugging While PL/pgSQL is a powerful language for writing stored procedures and triggers in PostgreSQL, other database engines use different languages for similar tasks. For example, MySQL uses a language called SQL/PSM (Persistent Stored Modules), and Oracle uses PL/SQL (Procedural Language/SQL). Microsoft SQL Server employs Transact-SQL (T-SQL), which extends SQL with procedural programming capabilities. Each of these languages has its own syntax and features tailored to the specific database engine, allowing developers to write complex logic directly within the database. For debugging and testing SQL code, it's often more efficient to use a database management application like DBeaver. These tools provide a graphical interface where you can execute SQL code directly, inspect the results, and interact with your database more intuitively. This can be particularly useful when working with stored procedures and triggers, as you can immediately see the impact of your code and make adjustments as needed. ### Creating a URL in Rails Now let's try to create a URL. Assuming the `Url` model is already created, we expect that calling `Url.create(long: 'https://dev.to')` will return a `Url` object with both `long` and `short` attributes populated. However, by default, this won't happen because Rails expects that after a record is created, only the ID and timestamps can change, so it doesn't update other attributes. To make this work, I will redefine the `save` method to ensure it returns the `short` attribute as well. Additionally, we need to handle the case when the long URL already exists in the database. By creating a unique index in the migration, we have essentially created another trigger that stops the insert operation if the value is not unique. In Rails, I used the `upsert` method to handle this scenario and specified what to update if a duplicate is found. This ensures that if the long URL already exists, the `updated_at` timestamp is updated instead of creating a new record. ```ruby require 'uri' class Url < ApplicationRecord before_validation :set_timestamps validate :long_is_a_valid_url def save(*_args) return false unless valid? result = self.class.upsert(attributes.except(*%w[id short]), returning: %i[id short created_at updated_at], unique_by: :long, record_timestamps: false, update_only: [:updated_at]) update_attributes_from_upsert_result(result) rescue StandardError => e errors.add(:base, e.message) false end private def update_attributes_from_upsert_result(result) return false unless result&.first assign_attributes(result.first) true end def set_timestamps self.updated_at = Time.now self.created_at ||= Time.now end def long_is_a_valid_url uri = URI.parse(long) uri.is_a?(URI::HTTPS) && uri.host.present? || raise rescue StandardError errors.add(:long, 'Should be a valid and secure URL') end end ``` ### Conclusion Now, everything should be working smoothly. You can find a working example [here](https://gavrilchik.net/urls), and the source code is available in this [GitHub Repository](https://github.com/Gavrilajava/portfolio/tree/main). If you have any suggestions or feedback, please feel free to leave a comment.
gavrilarails
1,866,980
Next.js 14: Server Components and Client Components Explained
Hello everyone, السلام عليكم و رحمة الله و بركاته Next.js 14 continues the tradition of offering...
0
2024-05-27T22:27:37
https://dev.to/bilelsalemdev/nextjs-14-server-components-and-client-components-explained-1gp4
javascript, nextjs, webdev, frontend
Hello everyone, السلام عليكم و رحمة الله و بركاته Next.js 14 continues the tradition of offering server components and client components, allowing you to build performant and interactive web applications. Here's a detailed breakdown of these concepts: **Server Components** * **Execution:** Run exclusively on the server during the initial request. * **Rendering:** Server-side rendering (SSR) generates pre-rendered HTML sent to the browser. * **Benefits:** * **Faster Initial Load:** Improves perceived performance by delivering pre-built HTML, ideal for SEO. * **Data Fetching:** Can directly access server-side data sources for content generation. * **Reduced Bundle Size:** Code doesn't get shipped to the client, minimizing initial JavaScript download. * **Drawbacks:** * **Limited Interactivity:** Relies on subsequent requests for user interactions, potentially impacting responsiveness. **Client Components** * **Execution:** Run on the client-side (browser) using JavaScript. * **Rendering:** Handled by the browser after receiving JavaScript code from the server. * **Benefits:** * **Rich Interactivity:** Enables dynamic updates and user interactions within the browser. * **Offline Functionality:** Can potentially function with limited internet connectivity (depending on implementation). * **Smaller Server Load:** Reduces server workload by handling interactions on the client. * **Drawbacks:** * **Slower Initial Load:** The browser needs to download and parse JavaScript before rendering, potentially impacting initial render time. * **Limited Data Access:** Direct access to server-side data sources is restricted. **Choosing Between Server and Client Components** * **Default Behavior:** Next.js uses server components by default, offering a balance between performance and SEO benefits. * **Choosing Client Components:** Use the `use client` directive to opt-in to client components. This is ideal for highly interactive elements or those requiring access to browser APIs. **Next.js 14 Enhancements** While the core concepts remain the same, Next.js 14 introduces some exciting features that impact server and client components: * **Turbopack:** This optional development server significantly improves build performance, benefiting both server and client components by speeding up development iteration. * **Server Actions:** Now stable in Next.js 14, server actions provide a powerful way to fetch data and handle mutations on the server while offering progressive enhancement (initial static rendering followed by dynamic updates). This can be used with both server and client components for improved data handling. * **Partial Prerendering (Experimental):** This experimental feature allows for a mix of static site generation (SSG) and SSR. You can prerender the initial content of a page while keeping dynamic parts for server-side rendering. This can further optimize performance for specific scenarios involving server and client components. **Example: Blog with Server and Client Components** * **Posts List (Server Component):** A page displaying a list of blog posts can be a server component for fast initial load. It fetches data on the server and renders pre-built HTML. * **Like Button (Client Component):** A Like Button for each post would benefit from being a client component. Clicking the button triggers a client-side update (like state change) and potentially a server action to update the like count on the server. **In Summary** By understanding server and client components in Next.js 14, you can build performant and interactive web applications. Leverage Next.js 14's features like Turbopack and server actions to enhance development experience and data handling. Remember to consult the official Next.js documentation for the latest implementation details on features like partial prerendering.
bilelsalemdev
1,866,979
SYSTEMD
Systemd servislerini yönetmek için kullanılan dosyalardır. birim dosyalarında, bir hizmetin nasıl...
0
2024-05-27T22:22:58
https://dev.to/teknikbilimler/systemd-1kpm
Systemd servislerini yönetmek için kullanılan dosyalardır. birim dosyalarında, bir hizmetin nasıl başlatılacağı, durdurulacağı, hangi kullanıcı tarafından hangi ortam değişkenleriyle çalıştırılacağı gibi bilgiler bulunur. Linux dağıtımları systemd init sistemini benimsiyor. Bu yazılım paketi servislerden, sistem durumlarına kadar sunucunun bir yönünü yönetebiliyor. Systemd'de bir unit (birim),sistemin üzerinde nasıl çalışacağını ve yönetileceğini bildiği herhangi bir kaynağa denk gelir. Bu kaynaklar, unit dosyaları adı verilen yapılandırma dosyaları kullanılarak tanımlanır. (Unit) dosyalarının çoğunda bulunan ilk bölüm (Unit) bölümüdür. Bu genellikle Unit için tanımlayıcı verileri ve birimin diğer birimlerle ilişkisini yapılandırmak için kullanılır. Dosyanın okunması sırasında, bu bölüm Unit ile ilgili genel bir bakış sunduğu için genelde ilk sırada yer alır. Bu bölümde bulunan bazı önemli direktifler: - Description - Documentation - Requires - Wants - Before - After Benim için systemd ya da farklı bir init sistem fark etmez. Bunlardan herhangi kullanan bir dağıtımı rahatlıkla kullanabilirim. Ama systemd'nin bir çok avantajı olduğunu da ayrıca belirtmek lazım. Mesela systemd'nin zamanlayıcısı (timer) cron ile uğraşmaktan daha kolay geliyor bana. Ayrıca systemd ile günlükleri (log) çok daha iyi yönetiyorum ve daha anlaşılır sonuçlar sunuyor. systemd genelinde ya da kullanıcı bazlı değişiklikler yapabilirsiniz, mesela bir servisin sadece bir kullanıcı için farklı biçimde çalışmasını ya da sadece belirli bir kullanıcı için çalışacak bir servis ya da timer üretebilirsiniz. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bzq0ephxyxi9c0p3avvo.jpeg) Sözdizimi (syntax) olarakta systemd oldukça kolaydır. Bir dosyanın ikili ( binary) olarak çalışması ya da dosya biçiminde bir formatta çalışması açısından bize yansıyacak bir farkı yoktur. zaten sisteminizde bunu sorun etmeyeceğiniz kadar bir dolu ikili dosya mevcut, bunların arasında da daemon olarak çalışanlar dahi var. Kısaca systemd özgür bir yazılımdır, dileyen dilediği gibi kodlarını düzenleyip derler ve çalıştırır, özgür yazılım felsefesi açısından bir mahsuru yoktur. Diğer init sistemlerine yama ile yaptığınız değişiklikleri, systemd'nin modüler yapısında servisleri vb. düzenleyerek kolayca yapabilirsiniz. systemd kaynaklı bir performans sorunu yaşamanız çok olası değil. Netice olarak systemd'nin zararlı ya da şüpheli olabilecek bir hususu yoktur. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mfi8ftffzn1u261tz2f5.jpeg) **Systemd'in Özellikleri:** **Daha hızlı başlatma:** Systemd, paralel işleme ve soket ve D-Bus etkinleştirme gibi özellikler kullanarak işletim sisteminin daha hızlı başlatılmasını sağlar. **Gelişmiş servis yönetimi:** Systemd, servislerin bağımlılıklarını ve başlatma sırasını yönetmek için daha karmaşık bir sistem kullanır. Bu, sistemin daha kararlı ve güvenilir çalışmasını sağlar. **Gelişmiş servis yönetimi:** Systemd, servislerin bağımlılıklarını ve başlatma sırasını yönetmek için daha karmaşık bir sistem kullanır. Bu, sistemin daha kararlı ve güvenilir çalışmasını sağlar. **Daha iyi hata ayıklama:** Systemd, daha ayrıntılı hata ayıklama bilgileri sağlar. Bu, sorunları daha hızlı bulup çözmenizi kolaylaştırır. Image description ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qd6a3nzc9er6fa686muz.png) ### Avantajları 1. **Hızlı Başlatma**: Paralel başlatma ile hızlı sistem açılışı. 2. **Birleşik Yönetim**: Servisler, cihazlar ve mount noktaları için tek bir yönetim çerçevesi. 3. **Otomatik Yeniden Başlatma**: Çöken servisleri otomatik olarak yeniden başlatma. 4. **Kolay Konfigürasyon**: Okunabilir ve basit konfigürasyon dosyaları. 5. **Günlük Kaydı**: JournalD ile merkezi log yönetimi. 6. **Güçlü Araçlar**: Systemctl ve journalctl ile etkili yönetim ve izleme. **Dezavantajları** 1. **Karmaşıklık**: Öğrenme eğrisi yüksek olabilir. 2. **Unix Felsefesine Aykırılık**: Çok işlevli olması eleştirilir. 3. **Bağımlılıklar**: Diğer sistem bileşenlerine bağımlıdır. 4. **Değişim Zorluğu**: Geleneksel sistemlerden geçiş zor olabilir. 5. **Uyumsuzluk**: Eski init sistemlerine yönelik araçlarla uyumsuzluk. 6. **Kaynak Kullanımı**: Düşük kaynaklı sistemlerde ek yük getirebilir. ** SORULAR** **Systemd nedir?** Cevap: servislerini yönetmek için kullanılan dosyalardır. **Unitte bulunan direktifler nelerdir?** Cevap: After before wants documentation vb. **Dosyaların çoğunda bulunan ilk hangi bölümdür?** A)AFTER B)WANTS C)SYSTEMD D)UNİT Cevap D **Systemd zamanlayıcısı hangisidir?** A)CROM B)LOG C)DOCUMENTDATİON D)TİMER Cevap D **Systemd.............bir yazılımdır.** Cevap: özgür bir yazılımdır. **Linux dağıtımları................sistemlerini benimsiyor.** Cevap: systemd init. ** KAYNAKÇA** _https//donanımhaber.com_ _https//medium.com_ _https://gemini.google.com/app/0abc9ab5ad85e18f_
nazlisevim47
1,866,974
Setting up Fast API in IIS and run APIs in Python
Many clients I meet struggle to implement AI within their corporate infrastructure. They often become...
0
2024-05-27T22:16:26
https://jstoppa.com/posts/artificial-intelligence/fundamentals/setting-up-fast-api-in-iis-and-use--apis-written-in-python/post/
python, iis, fastapi, windows
Many clients I meet struggle to implement AI within their corporate infrastructure. They often become frustrated because their companies are mostly on-premises and use Windows, while the AI industry largely operates in the cloud. Although they can call APIs like ChatGPT and Azure OpenAI, they face problems when attempting to integrate more advanced AI features into solutions primarily written in Java and .NET. This is where I see Python playing a crucial role. The AI industry predominantly uses it to develop solutions, making it easier to get up to speed with any AI example. The real question is whether you can integrate Python into your existing tech stack if it's already based on Windows. This article will show you how to setup an API written in Python using an amazing framework called [FastAPI](https://fastapi.tiangolo.com/). This article is an introduction on how to use the framework, I blog later on more advanced use cases. ## Setting up the app example in IIS Follow the steps below to start with > NOTE: you'll need to have Python and PIP installed for this, follow [these steps](https://jstoppa.com/posts/getting_started_with_openai_in_python/post/#1-how-to-install-python-on-windows) if you haven't installed it already 1. Create the website in IIS as shown in the image, note I'm using the port 8080 ![Image example for GPT-Vision](https://jstoppa.com/posts/artificial-intelligence/fundamentals/setting-up-fast-api-in-iis-and-use--apis-written-in-python/fast-api-setting-up-webstie-in-iis.png) 2. Copy the code example below into a main.py code (the example was taken from the [Fast API website](https://fastapi.tiangolo.com/#example)) ```python from typing import Union from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` 3. Install Fast API using the pip command `pip install fastapi` ![Install FastAPI using PIP](https://jstoppa.com/posts/artificial-intelligence/fundamentals/setting-up-fast-api-in-iis-and-use--apis-written-in-python/install-fast-api-with-pip.gif) ## Configuring the HttpPlatformHandler The next step is to get the `HttpPlatformHandler` working in IIS, this is a handler that passes socket connections directly to the Python process (more info [here](https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2022#configure-the-httpplatformhandler)). 1. Create a `web.config` file inside the website folder with the following content, make sure you change the folder to point at the location where python is installed in your local machine ```xml <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers accessPolicy="Read, Execute, Script"> <add name="FastAPIHttpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> </handlers> <httpPlatform processPath="C:\Users\<username>\AppData\Local\Programs\Python\Python312\python.exe" arguments="-m uvicorn --port %HTTP_PLATFORM_PORT% main:app" stdoutLogEnabled="true" stdoutLogFile="C:\logs\python.log" startupTimeLimit="120" requestTimeout="00:05:00"> </httpPlatform> <httpErrors errorMode="Detailed" /> </system.webServer> </configuration> ``` 2. Navigate to the [http://localhost:8080/](http://localhost:8080/) which should load the API already ![Load Fast API locally](https://jstoppa.com/posts/artificial-intelligence/fundamentals/setting-up-fast-api-in-iis-and-use--apis-written-in-python/load-fast-api-locally.png) Fast API also comes with swagger already installed, you can simply navigate to [http://localhost:8080/docs](http://localhost:8080/docs) ![Load Fast API swagger](https://jstoppa.com/posts/artificial-intelligence/fundamentals/setting-up-fast-api-in-iis-and-use--apis-written-in-python/load-fast-api-swagger.png) ## Other considerations You might find some recommendations to use [hypercorn](https://pgjones.gitlab.io/hypercorn/) rather than [uvicorn](https://www.uvicorn.org/), I tried that initially but I couldn't resolve an issue with socket permission, I raised it as a bug in [their GitHub repo](https://github.com/pgjones/hypercorn/issues/231). You might also find issues where the API loads and hangs forever. In that case, you'll most likely need to grant `IIS_IUSRS` read access to the folder where the app and Python are located, as mentioned in [here](https://docs.lextudio.com/blog/running-flask-web-apps-on-iis-with-httpplatformhandler/#the-infinite-loading).
juanstoppa
1,866,975
The Best New AI Image Generator
I'm thrilled to share the AI Image Generator that we have been working hard on: Idyllic App! In a...
0
2024-05-27T22:14:51
https://dev.to/max_polaczuk/the-best-ai-image-generator-516n
ai, startup, product, ux
I'm thrilled to share the AI Image Generator that we have been working hard on: [Idyllic App](https://idyllic.app)! In a market that's becoming increasingly saturated with AI tools, Idyllic App stands out with its unique approach to user experience and product design. Our AI image generator is designed with two main goals in mind: making it incredibly user-friendly for non-tech users and creating a seamless environment for exploring the stunning content generated by our vibrant community. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/icvuxebuqk8facpqyw6s.png) ## Why Idyllic App is the Best AI Art Generator **Streamlined for Non-Tech Users:** One of the biggest challenges with many AI image generators is their complexity. At Idyllic App, we've invested significant effort into ensuring that even users with no technical background can easily create and explore AI art. The interface is intuitive, and the process is straightforward, making the world of AI-generated images accessible to everyone. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i98jbfvvwara36a0ngov.png) **Seamless Community Exploration:** Beyond just generating images, Idyllic App offers a unique experience where users can effortlessly explore the amazing AI art created by others. The app's recommendation system evolves in real-time, providing users with increasingly personalized content as they create and explore. This feature not only enhances user engagement but also rewards users with a richer experience simply by enjoying the app. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yzzkook0fse06z5ge9h3.png) In other words, Idyllic App is equal parts AI art generator and AI image exploration tool. We believe that achieving this balance makes our app the best AI art generator available. ## Create and Explore a Variety of AI Images Idyllic App empowers you to create a wide range of AI-generated images, from humorous memes to breathtaking masterpieces. Whether you're looking to generate something funny or create a work of art, Idyllic App has you covered. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8bkf4iq83213folw2fmo.png) ## No Registration Required to Explore One of the most user-friendly features of Idyllic App is that you don't need to register an account to search through and explore the stunning AI art generated by other users. This open access encourages more users to engage with the app and discover the possibilities of AI-generated art. ## Impressive Growth and User Engagement Since our launch **three months ago**, we've seen incredible growth and engagement: **40k Registered Accounts:** Our user base is rapidly expanding, completely organically, showing the appeal and usability of Idyllic App. **12k Searches a Day:** Users are actively exploring and engaging with the AI art on our platform daily. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/txmqfby9982pd3f2eiky.png) Idyllic App is not just an AI image generator; it's a thriving community of creators and explorers. Join us today and discover the future of AI-generated art. Visit [Idyllic App](https://idyllic.app) and start your journey into the world of AI art!
max_polaczuk
1,866,972
Empowering Humans Through Innovative Web Development
Who I am is why I'm doing this A google search for affordable jeans. Four hours later I'm staring at...
0
2024-05-27T22:04:19
https://dev.to/mhgarry/empowering-humans-through-innovative-web-development-mj6
learning, webdev, career
**Who I am is why I'm doing this** A google search for affordable jeans. Four hours later I'm staring at a wikipedia page about a subgenre of a subgenre of subgenre branching off of an already specific brand of hardcore punk called emotive hardcore (emo), on the fringe between screamo, post hardcore, and shoegaze that consists of about three bands from the early 1990s. A waste of time? Maybe. But I like to categorize and compare things. It helps me organize my thoughts and understand the world. It's the way I think. It's probably impossible to categorize myself as an outside observer would. But if I was to try I'd say I was a fiance, a guitarist, a caretaker and "Matt" to my fiance's daughter, and a web developer who struggles with both ADHD and Bipolar Disorder. In the past my description of myself would be a lot different. I would probably be quite a bit harsher and include words such as college dropout, lazy, failure and disappointment. In reality, none of the negative things I thought about myself ever defined me. It took me 31 years to realize that. That's how long it took me to find tangible success in the "adult" world. My 20s are a billboard of polaroid pictures of seemingly disparate realities. Some blurry, some overexposed, some crystal clear. I didn't finish college. I lost countless friends and acquaintances. I didn't know why everyone else was moving forward so easily while I was felt like a car attempting to back out of a driveway in six inches of snow. No matter how hard my engine was working and my wheels were turning I was stuck in place. The reality is I was fighting against a system not designed for my brain - it wasn't that I was failing; the system was failing me. I was working as a waiter and making a living. It wasn't for me and I was burnt out and jaded. Luckily my wonderful fiance realized that I was unhappy. She urged and encouraged me to pursue a coding bootcamp. I signed up already expecting to fail. Why would I expect anything different. Except I didn't. **Getting There** Three months, five days a week, eight hours a day of instruction, an assignment due every two days, three group projects that were essentially full fledged, full stack web apps. First HTML, then css, then vanilla browser JavaScript, then Jquery, then bootstrap and css frameworks, then nodejs, then mysql, then express, then rest APIs, then mongodb, then PWAs, then react, then graphql, and then redux. Coding at least sixteen hours a day. I showed up every day, turned in every assignment, and suddenly, it was over. I did it. In the process I fell in love with web development. The day I graduated coding full stack web development boot camp was the proudest day of my life. I couldn't have done it without my support system. I had a wonderful instructor and patient instructor, helpful TAs, supportive peers, and my wonderful fiance all in my corner. My instructor somehow fielded my endless stream of questions, that according to the curriculum, were "out of order" or irrelevant. He understood that they made sense to me. My TAs stayed after class to help me build apps, talk coding, and listened to my ideas and thoughts. I had three group projects with different groups of peers. I was a valued member of all three groups because of the way my brain worked not despite it. My fiance took on more responsibility than I would ever ask of anyone all while giving me nothing but positivity and encouragement. Without all the every single one of these people's patience, desire to understand me, belief in me, and support there's no doubt I would have failed. I got hired as a Wordpress developer by a boss of a small agency who also believed in me. I spent six months there. Wordpress development wasn't for me. I struggled with the workflow. It wasn't intuitive to me. I yearned for my code editor, npm, nodejs, tailwindcss, and react. After a couple weeks of "casually" bringing up React and nodejs to my boss I accepted that those weren't the tools my agency used. Those weren't the tools my agency was ever going to use. So I worked as hard as I could and learned everything I could every day about Wordpress and how to effectively build websites and apps in the environment I was in with the tools I was given. My boss and the other developer I worked with took the effort to learn the way I think. They both had a paradigm on web development that was foreign to me and my paradigm was foreign to them. Despite miscommunications due to a mutual lack of assumed knowledge from my boss and the other developer I worked with and I, they supported me and were patient with me. I was able to build three production sites with Wordpress, as well as multiple HTML emails, a frontend landing page using bootstrap, html, css, and javascript, and so much more. After six months we parted ways. I want to build full stack modern web applications and the agency I worked at mainly builds business to business sites with Wordpress. I parted ways with the agency with no ill will. On the contrary the developer I worked with told me how impressed he was with how quickly I learn and how I should go after a job working with React and Nodejs. He said he was going to miss working with me. My boss wished me luck and understood my thought process and vision even though it didn't align with his vision for his agency. Again I found myself succeeding and growing, this time with tools that weren't intuitive to me, and a workflow that wasn't aligned with my brain, because of the support system I had. **The Vision** I suddenly had time to build the apps I wanted to. To use the technologies I love and am comfortable with. I was ready to get started. I started building a video streaming app. But what if it had a real time chat feature? Real time chat apps are really cool. I should build one. But why not just make a whole social media app? I miss Myspace so why don't I do something about it? It should have an intuitive UI and user hub. The main reason I stop using an app is because I find it clunky or difficult to navigate. For whatever reason while all of these ideas were viable projects that I would enjoy making, they didn't quite feel right. And then it hit me. The seemingly disparate, disorganized, and "wrong" neurons started doing what they do. I needed to make sense of where I was and what I was going to do from here. So my brain made connections. I know I want to help people. People with neurodiverse brains. People with unaddressed needs. People who are out of the scope of assistance of their community. Of their nations, cities, peers, families, and friends. People who think they are deficient who aren't. People who are smart and capable but don't have the opportunities or support system to flourish. How can I help these people? I'm definitely not running for office and I'm not going to med school. What else can I do to help. I know how much a support system helped me succeed. I know I didn't have an adequate support system until recently. I know I can build web apps. I thought about the all of the apps I was building and contemplating building. I thought of the social media app I aspired to. I thought of Myspace and the Ultimate Guitar Forum's IRC chat that I used to frequent when I first discovered the internet. They shaped me into who I am now. They both gave me communities and support systems. As entertaining and digestible as short form social media is, it doesn't foster the same sense of personal connection that and community that I experienced when I first discovered the internet. I realized that even with that support system the tools, technologies, and workflow I cultivated for myself was a huge part of my ability to function. I thought about why I felt more capable and confident building web apps in React and Nodejs rather than Wordpress. I realized it was the workflow. When I'm building a modern web application I have almost everything I need in the command line, my code editor, and one browser window. I have a layout specifically set up for it. I don't have to switch contexts much. With Wordpress, at least the way my agency builds sites, it was all browser based. It was rapid and there was a lot of context switching. I realized how much harder my brain was working building Wordpress sites. My productivity and abilities to execute my work hinges greatly on my workflow. I thought about the video streaming app I was building. Most neurodivergent people I know have some kind of skill to showcase. I want them to have a safe and encouraging place to share it. I can make an app that hosts users created media. I'd love to give people a space to showcase their work and grow whether it be electronic music production, animation, film making, constructing charts based on data analysis, photography, writing poetry, writing documentation, recording impressions, and so on. I know what helps me. I know that my brain is considered neurodivergent and I know what environments, tools, and support I thrive in. I can build a comprehensive and accessible user hub with an intuitive UI and navigation. I can build an app that a user can navigate to any part of the app from any other part of the app to eliminate context switching and content overload. I can build an app with all of the features want to implement intuitively. Now I need to make people want to use it. I want to foster a real and authentic community with this app. I want to give people the tools they need to succeed. I want the app to be a genuinely rewarding experience to the neurodivergent brain. I want to give a platform to everybody who feels like they don't have one. Gradually, this rabbit hole my mind was exploring deeper into was uncovering **Pixel Path**. I know I need to make an app that is rewarding and intuitive. I realized the inherently rewarding principles and dopamine that make RPGs addictive. So I can implement an RPG like experience and level type system that's tangibly rewarding. I'm building this app to foster community and community input is essential to me. Whatever you're capable of I promise you there's a role for you in the creation of this community. I envision Pixel Path growing into a vibrant, supportive community where neurodiverse individuals can thrive and showcase their unique talents. Here's a brief overview of the features I plan to implement into **Pixel Path**. This isn't an essay exploring the impact of the commodification of the World Wide Web, so I won't go too in depth about it. In short, with this app I aim to solve the problems that the commodification, commercialization, and monetization of the web that have become omnipresent. I aim to create a space where the user's privacy is never compromised for any reason. It is essential that users feel safe and protected on **Pixel Path**. The practice of selling user data to data brokers is something I don't believe is right and I will never do. I aim to create a space with valuable content. I believe that algorithmic rewards for mass produced shallow content that's easy to monetize is severely degrading the quality of content on the web. The practice of rewarding low effort content farming for the sake of producing more content makes building an authentic community nearly impossible. **Pixel Path** will never incentivize this practice althorithmically or philosophically. I aim to create a space that is accessible with as few barriers of entry as possible. In order for **Pixel Path** to serve it's purpose it must be as accessible as possible. I promise that **Pixel Path** will never engage in any deceptive monetization tactics and will always be transparent and clear with any and all transactions, both monetary and informationally (no email subscription spam or required opt-ins). There will be no automatic charges and no credit card or payment information needed or asked for during registration or while using the app. I aim to keep this app as affordable as possible and I will never implement a paywall for core features and app functionality. Users will have the option to change the UI to dyslexic friendly fonts. I plan on implementing robust caching, optimization, and many other strategies to make sure **Pixel Path** will use as little data as possible and run on as many machines as possible. #### Features **Interactive Overworld Map** Navigate your tasks through an intuitive, pixel art overworld map. As you complete tasks, unlock new areas, revealing a path of progression that visually represents your achievements. **Pixel Art Avatars** Customize your personal avatar with vibrant pixel art. Your avatar grows and evolves as you conquer tasks, making productivity a personal and rewarding journey. **8-Bit Sound Design** Enjoy nostalgic 8-bit chimes and soundtracks that provide rewarding feedback for completing tasks and reaching milestones. Each sound is carefully chosen to enhance the experience without overwhelming the senses. **Task Management** Effortlessly create, categorize, and track tasks. Pixel Path supports various task types, including one-time actions, recurring responsibilities, and long-term goals. **Rewards and Achievements** Unlock achievements and collect items as you progress. These rewards are designed to provide extra motivation and a sense of accomplishment beyond the everyday. **Accessibility Features** Pixel Path is designed to be inclusive, with dyslexia-friendly fonts and color-blind modes, ensuring that everyone can navigate and enjoy the app without barriers. **Focus Zones** Use specialized zones on the map for deep focus, where you can set timers and work without distractions, enhancing productivity, especially for challenging tasks. **Community and Customization** Share your progress with friends or the community and see how others are navigating their paths. Customize the look and feel of your map and avatar to make your productivity journey uniquely yours. If you do want to help me develop the app check the tech stack I will be using for development is listed below: #### Tech Stack **Client**: React, Next.js 14 (jsx and app router), TailwindCSS, TailwindUI **Server**: Node.js, Express, MongoDB, Mongoose This tech stack is an initial development tech stack and it will be expanded upon. I'm open to any suggestions and input on the expansion and direction of the tech stack. I will do my best to accommodate all contributing developers skill sets and development environment preferences. I still have a lot to think about, plan, and develop. The github repo to **Pixel Path** is linked below. Please check it out. I welcome all feature requests, development help, and feedback in general. Stay tuned, this is a rabbit hole worth going down. I'd love for you to join me on my journey by * **Providing Feedback**: Share your thoughts on features and user experience. * **Contributing to Development**: [Check out the GitHub repo and contribute to the code.](https://github.com/mhgarry/PixelPath_Your-ADHD-Productivity-Adventure) * **Spreading the Word**: Help me build this community by sharing this blog and app with others who might benefit. ``
mhgarry
1,866,971
Two ways I discovered to pass dynamic parameters in (arrow and non-arrow) function.
In my attempt to understand how the clsx utility is written by looking at its source code, I found...
0
2024-05-27T22:04:10
https://dev.to/ramunarasinga/two-ways-i-discovered-to-pass-dynamic-parameters-in-arrow-and-non-arrow-function-4lg1
javascript, opensource, shadcn, clsx
In my attempt to understand how the [clsx](https://github.com/lukeed/clsx) utility is written by looking at its [source code](https://github.com/lukeed/clsx/blob/master/src/index.js#L31), I found that clsx does not have function parameters declared. ![](https://media.licdn.com/dms/image/D4E12AQGi6c9doQ0-tw/article-inline_image-shrink_1500_2232/0/1716816891950?e=1722470400&v=beta&t=UZumkYglgPNMzoIlmULswG9ZRyXpdJBktvV7oTlw2s8) How is it possible to access the parameters without declaring them? clsx expects dynamic parameters. Below is an usage example from the docs ![](https://media.licdn.com/dms/image/D4E12AQFiKdck1ZuLhQ/article-inline_image-shrink_1000_1488/0/1716816893341?e=1722470400&v=beta&t=dowfSLO0pbva33JFi2UyRXt5mr34Lx00bo-nYqj7-OI) Then, I looked at the function code and from the lines below, it was apparent that through arguments variable, it is possible to access the function parameters. ``` export function clsx() { var i=0, tmp, x, str='', len=arguments.length; ``` I searched on Google with this query “arguments without paramters in nodejs” and clicked on the first [Stackoverflow link](https://stackoverflow.com/questions/59315539/why-can-arguments-be-passed-to-a-function-that-has-no-parameter-in-javascript). [As per documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments): > arguments is an Array-like object accessible inside functions that contains the values of the arguments passed to that function. > The arguments object is a local variable available within all non-arrow functions. ### First way of accepting dynamic function parameters (non-arrow): > The arguments object is useful for functions called with more arguments than they are formally declared to accept. This technique is useful for functions that can be passed a variable number of arguments. Using arguments only works in non-arrow functions. ### Second way of accepting dynamic function parameters (arrow): I read in some open source code sometime ago (I think, it is nextjs source code), don’t exactly remember but, you could use spread operator to accept dynamic function parameters. I found this [stackoverflow question](https://stackoverflow.com/questions/45217420/in-node-js-how-do-i-dynamically-pass-function-arguments-to-a-child-function). ``` const childFunc = (str1, str2, str3) => \`${str1} ${str2} ${str3}\`; const parentFunc = (...args) => childFunc('foo', ...args); console.log(parentFunc('bar', 'fizz')); ``` Since arguments variable does not work in arrow functions, I would choose a spread operator like shown in the above code snippet. ### Conclusion: Use arguments in non-arrow functions and a single parameter with a spread operator in arrow functions to accept dynamic function parameters. ### About me: Website: https://ramunarasinga.com/ Linkedin: https://www.linkedin.com/in/ramu-narasinga-189361128/ Github: https://github.com/Ramu-Narasinga Email: ramu.narasinga@gmail.com ### References: 1. [https://github.com/lukeed/clsx/blob/master/src/index.js](https://github.com/lukeed/clsx/blob/master/src/index.js) 2. [https://github.com/lukeed/uvu/blob/master/docs/cli.md](https://github.com/lukeed/uvu/blob/master/docs/cli.md) 3. [https://stackoverflow.com/questions/59315539/why-can-arguments-be-passed-to-a-function-that-has-no-parameter-in-javascript](https://stackoverflow.com/questions/59315539/why-can-arguments-be-passed-to-a-function-that-has-no-parameter-in-javascript) 4. [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) 5. [https://stackoverflow.com/questions/45217420/in-node-js-how-do-i-dynamically-pass-function-arguments-to-a-child-function](https://stackoverflow.com/questions/45217420/in-node-js-how-do-i-dynamically-pass-function-arguments-to-a-child-function) 6. [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest\_parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters)
ramunarasinga
1,866,968
How to Fix Stuck Ready Event in Discord Embedded App SDK
If you've been following Discord's Building Your First Activity tutorial, you may have encountered an...
0
2024-05-27T22:00:00
https://blog.waveplay.com/how-to-fix-stuck-ready-event-in-discord-embedded-app-sdk/
javascript, programming, discord, node
If you've been following Discord's **[Building Your First Activity](https://discord.com/developers/docs/activities/building-an-activity)** tutorial, you may have encountered an issue where the **[Embedded App SDK](https://github.com/discord/embedded-app-sdk)** gets stuck on the `READY` event. This issue can be caused by a few different things, but the most common cause is **[Vite's](https://vitejs.dev/)** hot module reloading **[(HMR)](https://vitejs.dev/guide/api-hmr.html)** feature. We've seen **[this issue](https://github.com/discord/embedded-app-sdk/issues/41)** pop up in a **[few different places](https://discord.com/channels/613425648685547541/1219458343513358356)**, so we wanted to provide a quick guide on how to fix it. This post will explain it in more detail and suggest ways around it. ## TLDR; Quick Fix If you're in a hurry, the quickest way to fix this without disabling HMR is to make sure you're creating only one instance of the `DiscordSDK` close to the root of your app. Check out **[this template](https://github.com/Wave-Play/robo.js/tree/main/templates/starter-app-js-react)** to see how it's done. You can also create a new **Discord Activity** project with the fix already included by running this in your terminal: ```bash npx create-robo <projectName> -k activity ``` ## What's Happening? When you're developing a **Discord Activity** with **Vite**, the hot module reloading feature can cause the SDK to be re-created multiple times. This is because **Vite** reloads the module when you make changes, which can cause the `DiscordSDK` to be reinitialized. Unfortunately, `discordSdk.ready()` gets stuck on the `READY` event because **[Discord sends the payload once per instance](https://github.com/discord/embedded-app-sdk/issues/41#issuecomment-2062926815)**. That means your activity will be left waiting for the `READY` event to fire, but it never will until you restart it. ## Starting Fresh with a Fix To fix this issue, you need to ensure that you're only creating one instance of the `DiscordSDK` close to the root of your app. This way, the SDK won't be re-initialized every time you make changes, thus you won't need to `await discordSdk.ready()` more than once. The easiest and fastest way to prevent this is to make sure you start from a template that already has this fix in place. You can **[clone this template]()** or create a new project with the fix included by running: ```bash npx create-robo <projectName> -k activity ``` This will create a new **Discord Activity** project with the fix already in place, so you won't have to worry about this issue. Check out our guide for more info! ➞ [✨ **Guide:** Creating a Discord Activity in seconds with Robo.js](https://dev.to/waveplay/how-to-build-a-discord-activity-easily-with-robojs-5bng) ![Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dtw3dql9wofx0coon46.png) ## Fixing Your Existing Project If you're already working on a project and don't want to start over, you can fix this issue by ensuring that you're only creating one instance of the `DiscordSDK` close to the root of your app. For example, in a **[React](https://react.dev)** app, you can use a **[Context](https://react.dev/docs/context)** to manage the SDK instance. Here's a simplified example: ```jsx import { DiscordSDK, DiscordSDKMock } from '@discord/embedded-app-sdk' import { createContext, useContext } from 'react' export const discordSdk = new DiscordSDK(import.meta.env.VITE_DISCORD_CLIENT_ID) const DiscordContext = createContext({ discordSdk }) export function DiscordContextProvider(props) { const { children } = props const setupResult = useDiscordSdkSetup() return <DiscordContext.Provider value={setupResult}>{children}</DiscordContext.Provider> } export function useDiscordSdk() { return useContext(DiscordContext) } function useDiscordSdkSetup() { // Your setup logic here (e.g., discordSdk.ready() in a useEffect) return { discordSdk } } ``` Then apply the `DiscordContextProvider` at the root of your app: ```jsx import { DiscordContextProvider } from '../hooks/useDiscordSdk' import { Activity } from './Activity' import './App.css' export default function App() { return ( <DiscordContextProvider> <Activity /> </DiscordContextProvider> ) } ``` This way, **Vite** won't re-initialize the `DiscordSDK` every time you make changes, and you won't get stuck on the `READY` event. It works like so: 1. The `DiscordSDK` is created once and passed down through the context. 2. The SDK is initialized in the context provider. 3. Components can access the SDK through the custom `useDiscordSdk` hook. 4. The same SDK instance will be re-used, as long as you don't edit the `useDiscordSdk` file. ## Conclusion React's **[Context](https://react.dev/docs/context)** is a great way to manage global state in your app, and it's perfect for managing the `DiscordSDK` instance. By ensuring that you only create one instance of the SDK close to the root of your app, you can prevent the `READY` event from getting stuck and avoid the need to restart your activity every time you make changes. We highly recommend using `create-robo` to create a **Discord Activity** project. These templates are designed to help you get started quickly and avoid common issues like this one. What's more, they come with a lot of other features and tools to help you build your activity faster and more efficiently, such as **[Multiplayer Support](https://dev.to/waveplay/how-to-add-multiplayer-to-your-discord-activity-lo1)**, **[TypeScript](https://docs.roboplay.dev/robojs/typescript)**, **[Easy Hosting](https://docs.roboplay.dev/discord-activities/hosting)**, **[Streamlined Tunnels](https://docs.roboplay.dev/discord-activities/tunnels)**, **[Built-in Database](https://docs.roboplay.dev/robojs/flashcore)**, **[Plugin System](https://docs.roboplay.dev/plugins/overview)**, and so much more! Don't forget to **[join our Discord server](https://roboplay.dev/discord)** to chat with other developers, ask questions, and share your projects. We're here to help you build amazing apps with **Robo.js**! 🚀 ➞ [🚀 **Community:** Join our Discord Server](https://roboplay.dev/discord) Our very own Robo, **Sage**, is there to answer any questions about Robo.js, Discord.js, and more
waveplay-staff
1,866,969
JOTAI(GLOBAL STATE MANGEMENT)
Hey? REACT developers, are you tired of managing the global states on the client side and bored with...
0
2024-05-27T21:53:52
https://dev.to/hussain101/jotaiglobal-state-mangement-2aaa
webdev, javascript, react, zustandjotai
Hey? REACT developers, are you tired of managing the global states on the client side and bored with using the useContext hook to pass the state? Here is an optimal alternative of this to manage the global state on the client side. **Introduction:** Jotai takes an atomic approach to global React state management. Build state by combining atoms and renders are automatically optimized based on atom dependency. This solves the extra re-render issue of React context, eliminates the need for memoization, and provides a similar developer experience to signals while maintaining a declarative programming model. **Example** **First, create a primitive atom** An atom represents a piece of state. All you need is to specify an initial value, which can be primitive values like strings and numbers, objects, and arrays. You can create as many primitive atoms as you want. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sr6l0vr2vbs3q86egqwc.png) **Use the atom in your components** It can be used like React.useState: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rkfzo4f0hxvgo5mtc1yz.png) for more details: https://jotai.org/
hussain101
1,863,444
¿Qué esta pasando con Gemini AI de Google?
Desde diciembre de 2023, hemos visto el cambio de Bard a Gemini, la nueva generación de inteligencia...
0
2024-05-27T21:38:39
https://dev.to/marianocodes/que-esta-pasando-con-gemini-ai-de-google-h06
ai, gemini, machinelearning, google
Desde diciembre de 2023, hemos visto el cambio de Bard a Gemini, la nueva generación de inteligencia artificial de Google, ¡y ha sido un cambio para bien! En el reciente Google I/O nos sorprendieron con una cantidad generosa de actualizaciones. Les presento: **Gemini 1.5 Flash:** ¿Necesitas respuestas rápidas para tareas repetitivas? Este modelo optimiza el tiempo de procesamiento, además de ser más económico. No creas que por ser más rápido soporta menos tokens; tiene la increíble capacidad de manejar un contexto de ¡1 millón de tokens! **Gemini 1.5 Pro:** El jefe de las tareas complejas. Este modelo viene cargado de mejoras significativas en traducción, manejo de código y razonamiento. Su fuerte está en la capacidad de trabajar tareas más complejas. Su capacidad actual es de 1 millón de tokens, pero para Google eso no es suficiente: ahora podrá manejar ¡2 millones de tokens! Para que te hagas una idea de cuánto representa esto, se puede traducir a: - 2 horas de video - 22 horas de audio - +60 mil líneas de código - +1.4 millones de palabras ![Comparación de modelos y gemini con su procesamiento de 2 millones de tokens](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6jnrjia6mdvumv8q1fs.png) **¿Cómo saber cuál utilizar?** - Si necesitas procesar mucha información y respuestas más detalladas utiliza Gemini 1.5 Pro. - Si necesitas velocidad y respuestas más rápidas utiliza Gemini 1.5 Flash. **Google también anunció estas características:** - Multimodalidad: Gemini ahora puede procesar información de múltiples fuentes simultáneamente: texto, imágenes, audio y video. - Gemma se expande: ¡El nuevo modelo PaliGemma! Gemma es una lista de modelos open source de Google, y se une PaliGemma, que se especializa en la identificación, descripción visual y comprensión de imágenes. **¿Quieres probar Gemini?** [¡Es gratis!](https://ai.google.dev/pricing) Puedes intentarlo en Google AI Studio y experimentar con su API de Gemini de forma gratuita (sujeto a disponibilidad por región). Te aseguro que te impresionará la velocidad y capacidad de procesamiento de esta nueva generación de IA. Déjame en los comentarios qué piensas sobre estas actualizaciones.
marianocodes
1,866,964
Pro Edge Services and Training, Inc.
Pro Edge Services and Training, Inc. is your trusted local HVACR expert in Oakdale, CA, serving...
0
2024-05-27T21:33:56
https://dev.to/proedgeserv/pro-edge-services-and-training-inc-1b8b
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5x0otat38wfk1xz52h4l.png) Pro Edge Services and Training, Inc. is your trusted local HVACR expert in Oakdale, CA, serving Modesto and the surrounding areas. For over ten years, we've been committed to providing top-quality HVAC repair, maintenance, and installation services at fair and reasonable prices. Whether you need residential or commercial HVAC solutions, our experienced team is dedicated to ensuring optimal comfort and efficiency in your home or business. At Pro Edge Services and Training, Inc., we value long-lasting customer relationships and look forward to welcoming new clients. Contact us today to experience exceptional service tailored to your needs. Pro Edge Services and Training, Inc. Address: [657 Armstrong Way Office Suite D, Oakdale, CA 95361](https://www.google.com/maps?cid=9152766348593560696) Phone: 209-425-3880 Website: [https://www.proedge-services.com](https://www.proedge-services.com) Contact email: chuck@proedge-services.com Visit Us: [Pro Edge Services and Training, Inc. Facebook](https://www.facebook.com/ProEdgeServicesAndTraining/) `[Pro Edge Services and Training, Inc. Instagram](https://www.instagram.com/pro.edge.services_hvac/) [Pro Edge Services and Training, Inc. Yelp](https://www.yelp.com/biz/pro-edge-services-and-training-waterford) Our Services: Commercial / Industrial Refrigeration & HVAC Services Residential HVAC and Appliance Services Temp Alert Services
proedgeserv
1,866,963
ABOUT ME
I'm Subhasis Tripathy, a Pre Final Year Student of GIET University with 2 years of experience in...
0
2024-05-27T21:33:22
https://dev.to/subhasisd3v/about-me-1ld6
I'm Subhasis Tripathy, a Pre Final Year Student of GIET University with 2 years of experience in creating dynamic and user-friendly websites. My passion lies in expanding my knowledge in Python web development and cloud hosting. I'm dedicated to honing my expertise in the cloud field and exploring innovative solutions. I have been an active part of GDSC under the domain of CLoud as cloud’s Co-Lead. I have profound knowledge in the fields of Cloud Technology, IOT and Web development. I have essential skills in the programming Languages like C,Java,Python.I have other fundamental skills like communicational skills,Public speaking skills and Leadership qualities.I have an aim to Become a DevOps Engineer.
subhasisd3v
1,866,961
ariston viet nam
(Máy nước nóng Ariston là sản phẩm cao cấp chất lượng của thương hiệu Ariston được sản xuất từ Ý với...
0
2024-05-27T21:24:46
https://dev.to/aristonvietnam/ariston-viet-nam-312h
(Máy nước nóng Ariston là sản phẩm cao cấp chất lượng của thương hiệu Ariston được sản xuất từ Ý với hơn 30 năm có mặt trên thị trường Việt Nam nhận được rất nhiều sự ủng hộ và tin cậy tuyệt đối từ người tiêu dùng. Máy nước nóng Ariston là sản phẩm được sản xuất từ Ý với chất lượng vượt bậc nhất, là dòng sản phẩm thông minh với công nghệ đột phá, tạo tính thuận tiện và hiện đại nhất cho ngườ tiêu dùng, mang lại sự hài lòng tuyệt đối khi sử dụng. Đến với chi nhánh Bình Phước khách hàng sẽ được sở hữu ngay máy nước nóng Ariston cao cấp chính hãng mà giá ưu đãi bất ngờ, với đội ngũ nhân viên kĩ thuật chuyên nghiệp sẽ hỗ trợ và tư vấn miễn phí một cách tận tình nhất, hi vọng đến với chi nhánh máy nước nóng Ariston.quý khách sẽ thực sự cảm thấy thoải mái và tin tưởng khi chọn mua tại đây) Website: https://ariston.website Phone: 0822153220 Address: Ho Chi Minh https://topsitenet.com/profile/aristonvietnam/1195699/ https://www.creativelive.com/student/ariston-viet-nam?via=accounts-freeform_2 https://www.instapaper.com/p/aristonvietnam https://connect.garmin.com/modern/profile/eb22f95b-8171-4f6a-bcf7-2f43f1ecf9d6 https://answerpail.com/index.php/user/aristonvietnam https://timeswriter.com/members/aristonvietnam/ https://www.catchafire.org/profiles/2816961/ https://www.metooo.io/u/6654f0432dd71b1633fe6a83 https://www.patreon.com/aristonvietnam http://hawkee.com/profile/6960598/ https://www.proarti.fr/account/aristonvietnam https://guides.co/a/ariston-viet-nam https://www.fimfiction.net/user/746574/aristonvietnam https://vocal.media/authors/ariston-viet-nam https://club.doctissimo.fr/aristonvietnam/ https://potofu.me/aristonvietnam https://leetcode.com/u/aristonvietnam/ https://forum.dmec.vn/index.php?members/aristonvietnam.61012/ https://www.plurk.com/aristonvietnam/public www.artistecard.com/aristonvietnam#!/contact https://readthedocs.org/projects/httpsaristonwebsite/ https://www.cineplayers.com/aristonvietnam https://naijamp3s.com/index.php?a=profile&u=aristonvietnam https://hypothes.is/users/aristonvietnam https://rentry.co/e53y894p https://hub.docker.com/u/aristonvietnam https://www.pearltrees.com/aristonvietnam https://telegra.ph/aristonvietnam-05-27 https://www.ohay.tv/profile/aristonvietnam https://www.exchangle.com/aristonvietnam https://visual.ly/users/aristonviet https://dreevoo.com/profile.php?pid=642232 https://muckrack.com/ariston-viet-nam https://www.funddreamer.com/users/ariston-viet-nam https://qiita.com/aristonvietnam https://coolors.co/u/ariston_viet_nam https://gifyu.com/aristonvietnam https://crowdin.com/project/aristonvietnam https://www.credly.com/users/ariston-viet-nam/badges https://vnseosem.com/members/aristonvietnam.31072/#info http://idea.informer.com/users/aristonvietnam/?what=personal https://taplink.cc/aristonvietnam https://slides.com/aristonvietnam https://turkish.ava360.com/user/aristonvietnam/# https://wakelet.com/@aristonvietnam57484 https://my.desktopnexus.com/aristonvietnam/ https://www.diggerslist.com/aristonvietnam/about https://research.openhumans.org/member/aristonvietnam https://www.designspiration.com/aristonviet/ https://pastelink.net/1814b2yd https://active.popsugar.com/@aristonvietnam/profile https://app.talkshoe.com/user/aristonvietnam https://www.dnnsoftware.com/activity-feed/my-profile/userid/3198848 https://hackerone.com/aristonvietnam?type=user https://www.divephotoguide.com/user/aristonvietnam/ https://www.noteflight.com/profile/a1997eeb60807bc50ad989c87db7614e9f9ffa74 https://padlet.com/aristonviet https://www.webwiki.com/info/add-website.html https://www.copytechnet.com/member/355506-aristonvietnam/about https://www.babelcube.com/user/ariston-viet-nam https://camp-fire.jp/profile/aristonvietnam https://piczel.tv/watch/aristonvietnam https://glose.com/u/aristonvietnam https://lab.quickbox.io/csaristonvietnam https://huggingface.co/aristonvietnam https://www.fitday.com/fitness/forums/members/aristonvietnam.html https://sinhhocvietnam.com/forum/members/74546/#about http://forum.yealink.com/forum/member.php?action=profile&uid=342315 https://play.eslgaming.com/player/20130113/ https://www.ethiovisit.com/myplace/aristonvietnam http://gendou.com/user/aristonvietnam https://www.5giay.vn/members/aristonvietnam.101974401/#info https://doodleordie.com/profile/aristonvietnam https://www.pling.com/u/aristonvietnam/ https://www.beatstars.com/aristonviet/about https://www.cakeresume.com/me/aristonvietnam https://www.equinenow.com/farm/aristonvietnam.htm https://chodilinh.com/members/aristonvietnam.78885/#about https://linkmix.co/23443921 https://www.wpgmaps.com/forums/users/aristonvietnam/ https://www.reverbnation.com/aristonvietnam https://www.anobii.com/fr/01458bf7502208cabf/profile/activity https://www.dermandar.com/user/aristonvietnam/ https://www.codingame.com/profile/ac93e3f780b577bee4c18eeb531158400216906 https://files.fm/aristonvietnam/info https://www.trepup.com/@aristonvietnam http://buildolution.com/UserProfile/tabid/131/userId/405693/Default.aspx https://gettr.com/user/aristonvietnam https://wibki.com/aristonvietnam?tab=ariston%20viet%20nam https://zzb.bz/6aknc https://able2know.org/user/aristonvietnam/ https://pinshape.com/users/4442388-aristonvietnam#designs-tab-open https://myanimelist.net/profile/aristonvietnam https://www.gaiaonline.com/profiles/aristonvietnam/46697340/ https://www.speedrun.com/users/aristonvietnam https://chart-studio.plotly.com/~aristonvietnam https://data.world/aristonvietnam https://englishbaby.com/ https://bentleysystems.service-now.com/community?id=community_user_profile&user=f59fb8bb47920a14e3378d53636d43e7 https://participez.nouvelle-aquitaine.fr/profiles/aristonvietnam/activity?locale=en https://wperp.com/users/aristonvietnam/ https://notabug.org/aristonvietnam https://socialtrain.stage.lithium.com/t5/user/viewprofilepage/user-id/65175 https://git.industra.space/aristonvietnam https://nhattao.com/members/aristonvietnam.6534589/ https://www.quia.com/profiles/aristonv https://hashnode.com/@aristonvietnam https://edenprairie.bubblelife.com/users/aristonviet_w8a97831 https://expathealthseoul.com/profile/ariston-viet-nam/ https://profile.ameba.jp/ameba/aristonvietnam/ https://www.artscow.com/user/3196413 https://www.deviantart.com/aristonvietnam/about https://www.scoop.it/u/aristonviet-nam https://controlc.com/d3802e75 https://inkbunny.net/aristonvietnam https://www.kniterate.com/community/users/aristonvietnam/ https://stocktwits.com/aristonvietnam https://justpaste.it/u/aristonvietnam https://allods.my.games/forum/index.php?page=User&userID=149205 https://wmart.kz/forum/user/163326/ https://devpost.com/aristonviet https://www.guilded.gg/profile/dNo3njym https://jsfiddle.net/user/aristonvietnam/ https://app.roll20.net/users/13381776/ariston-v https://roomstyler.com/users/aristonvietnam https://rotorbuilds.com/profile/42368/ https://www.penname.me/@aristonvietnam https://diendannhansu.com/members/aristonvietnam.49798/#about https://myspace.com/aristonvietnam https://www.kickstarter.com/profile/aristonvietnam/about https://www.silverstripe.org/ForumMemberProfile/show/152514 https://www.robot-forum.com/user/160277-aristonvietnam/?editOnInit=1 https://filesharingtalk.com/members/596776-aristonvietnam?tab=aboutme#aboutme https://willysforsale.com/profile/aristonvietnam https://community.tableau.com/s/profile/0058b00000IZYX7 https://tupalo.com/en/users/6779862 https://os.mbed.com/users/aristonvietnam/ https://qooh.me/aristonvietna https://www.intensedebate.com/people/ilaristonvietn https://forum.codeigniter.com/member.php?action=profile&uid=108607 https://makersplace.com/aristonviet/about https://hackmd.io/@aristonvietnam https://www.hahalolo.com/@6654f72f05740e60d0946642
aristonvietnam
1,854,172
Setup Eslint + Prettier for code standardization in React
Introduction During the development process, it becomes important to define a project...
0
2024-05-27T21:18:14
https://dev.to/griseduardo/setup-eslint-prettier-for-code-standardization-in-react-112p
react, eslint, prettier, webdev
## Introduction During the development process, it becomes important to define a project standard aimed at readability, maintenance and code quality improvement. To this end, this article will introduce two libraries that, together, allow code verification to find/solve problems and its formatting according to the defined rules. ## Libs - prettier: it is the lib responsible for code formatting - eslint: it is the lib that will analyze the code with the aim of finding and solving problems ## Setup To add prettier: ``yarn add prettier --dev`` To add eslint: ``yarn add eslint@8.57.0 eslint-config-prettier --dev`` - `eslint@8.57.0`: it will add version 8.57.0 (the latest version below 9) due to some [issues](https://github.com/jsx-eslint/eslint-plugin-react/issues/3699) related to the React plugin from version 9 onwards, which are currently being analyzed - `eslint-config-prettier`: it will disable the eslint rules that conflict with prettier To add eslint plugins: ``yarn add eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks --dev`` - `eslint-plugin-prettier`: it will allow prettier to run with eslint - `eslint-plugin-react`: it will include linting rules specific to React applications - `eslint-plugin-react-hooks`: it will include linting rules for React hooks To allow eslint to run on a React application that uses Babel as its compiler: ``yarn add @babel/eslint-parser --dev`` After installing the libs, add the `.eslintrc.json` file at the root of the project to configure eslint execution. This file will be gradually updated as the configurations are explained: #### env It brings predefined global variables. - `"browser": true`: related to the browser - `"node": true`: related to the Node.js - `"jest": true`: related to the Jest ```js { "env": { "browser": true, "node": true, "jest": true }, } ``` For example, if I have an app that uses Jest for testing and I don't define the env `"jest": true`, when running eslint, it will raise errors like: `describe, it, expect are not defined`. When I set the env `"jest": true`, eslint will know that these are terms used in tests and won't raise errors because of them. #### extends It brings additional configurations for eslint. - `eslint:recommended`: it includes recommended rules from eslint - `plugin:react/recommended`: it includes recommended rules for React (this is possible due to the addition of the `eslint-plugin-react` plugin) - `plugin:react-hooks/recommended`: it includes recommended rules for React hooks (this is possible due to the addition of the `eslint-plugin-react-hooks` plugin) - `prettier`: it removes eslint rules that may conflict with prettier (this is possible due to the addition of the `eslint-config-prettier` lib) ```js { //... "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier" ], } ``` #### parser - `@babel/eslint-parser`: it allows running eslint for applications that use Babel as the compiler ```js { //... "parser": "@babel/eslint-parser", } ``` #### parserOptions - `ecmaVersion`: it specifies the ECMAScript syntax used (`latest` corresponds to the most recent supported version) - `sourceType`: it specifies if the application is using ESM: `module` or if it's using CommonJS: `script` - `ecmaFeatures` - `"jsx": true`: it specifies if include jsx syntax ```js { //... "parserOptions": { "ecmaVersion": "latest", "sourceType": "module", "ecmaFeatures": { "jsx": true } }, } ``` #### plugins It allows adding plugins to extend eslint, which can add validation rules, configurations, envs. - `prettier`: prettier plugin - `react`: React plugin - `react-hooks`: React hooks plugin ```js { //... "plugins": [ "prettier", "react", "react-hooks" ], } ``` #### settings - `react` - `"version": "detect"`: it automatically detects the version of React used in the application ```js { //... "settings": { "react": { "version": "detect" } }, } ``` #### ignorePatterns Files that will be ignored when running eslint. - `*.stories.tsx`: it was mentioned in the article just as an example. In this case, eslint would not check files ending with `.stories.tsx` ```js { //... "ignorePatterns": ["*.stories.tsx"], } ``` #### rules Allows adding prettier rules to be executed with eslint: ```js { //... "rules": { "prettier/prettier": ["error"] } } ``` - `prettier/prettier`: it adds prettier rules when eslint is executed - `error`: it defines that if any prettier rule is not satisfied, it should return an `error`. Besides `error`, it's possible to use `warn`, which would raise a `warning` if any rule is not satisfied. Or `off` to deactivate the rules It allows customizing eslint rules: ```js { //... "rules": { "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "prettier/prettier": ["error"] } } ``` `"react/jsx-uses-react": "off"` e `"react/react-in-jsx-scope": "off"`: disables the eslint rule that returns an error if `import React from 'react'` is not included in the files. Useful for React versions 17 onwards that don't require this It allows customizing prettier rules: ```js { //... "rules": { "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "prettier/prettier": [ "error", { "singleQuote": true } ] } } ``` `singleQuote`: it defines single quotes as the formatting rule for strings After finishing the configuration file setup, add the scripts in package.json: ```js "scripts": { //... "lint": "eslint .", "lint-files": "eslint", "lint-fix": "eslint . --fix", "lint-fix-files": "eslint --fix", }, ``` By default, following this configuration, eslint will check `.js` files. To check other types of files, add after eslint in the scripts above `--ext=js,{other_file_type}`. - `eslint .`: when running `yarn lint`, it will check all files if they comply with eslint and prettier rules - `eslint`: When running `yarn lint-files {file_name or folder_name}`, it will check the specified file or all files in the specified folder if they comply with eslint and prettier rules - `eslint . --fix`: when running `yarn lint-fix`, it will format and correct the code according to eslint and prettier rules - `eslint --fix`: when running `yarn lint-fix-files {file_name or folder_name}`, it will format and correct the code according to eslint and prettier rules for the specified file or all files in the specified folder Suggestion: if it's always executed for a specific folder (for example, `src`), it might be convenient to replace the `.` in the scripts with `src`. ## Example Let's start with the complete configuration file defined above: ```js { "env": { "browser": true, "node": true, "jest": true }, "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier" ], "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": "latest", "sourceType": "module", "ecmaFeatures": { "jsx": true } }, "plugins": [ "prettier", "react", "react-hooks" ], "settings": { "react": { "version": "detect" } }, "ignorePatterns": ["*.stories.tsx"], "rules": { "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "prettier/prettier": [ "error", { "singleQuote": true } ] } } ``` Example file: ```js import Component from "./Component"; const Example = () => <p>Eslint article</p>; export default Example; ``` When running `yarn lint-files` for this file: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdnalf5c5c8pzbjh9qsi.png) It returns 3 errors, 2 from prettier and 1 from eslint, indicating that two can be fixed by `--fix`: - First error: regarding the eslint rule that returns an error for declared but unused variable in the code - Second error: regarding the custom rule defined to use single quotes in prettier - Third error: regarding the prettier rule about spacing When running `yarn lint-fix-files` for this file: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t4o82hf2scu0k84v8wa.png) It fixes two of the errors that were raised and continues to report the one that was not automatically fixable. So, the file remains as follows: ```js import Component from './Component'; const Example = () => <p>Eslint article</p>; export default Example; ``` Removing the unused import will eliminate any further errors appearing in the eslint execution. ## Conclusion The idea was to bring the necessary libs for configuring eslint with prettier, focusing on how to run them together and showing where it's possible to customize the rules for both. I tried to provide a general overview of what the elements in the configuration file represent. Depending on the app, it may not be necessary to add all the elements shown above, or a small alteration may be needed in one of them. You can see the documentation [version 8.57.0](https://eslint.org/docs/v8.x/) of eslint for more details. In the next article, I'll focus on bringing rules that are interesting to customize for both prettier and eslint.
griseduardo
1,854,173
Setup Eslint + Prettier para padronização de código em React
Introdução Durante o processo de desenvolvimento, torna-se importante a definição de um...
0
2024-05-27T21:18:03
https://dev.to/griseduardo/setup-eslint-prettier-para-padronizacao-de-codigo-em-react-4029
react, eslint, prettier, webdev
## Introdução Durante o processo de desenvolvimento, torna-se importante a definição de um padrão de projeto visando legibilidade, manutenção e aumento da qualidade de código. Para isso, esse artigo vai trazer duas libs que em conjunto permitem verificar o código na busca/solução de problemas e a formatação dele, dada as regras definidas. ## Libs - prettier: é a lib responsável pela formatação de código - eslint: é a lib que vai analisar o código visando a busca e solução de problemas ## Setup Para adicionar o prettier: ``yarn add prettier --dev`` Para adicionar o eslint: ``yarn add eslint@8.57.0 eslint-config-prettier --dev`` - `eslint@8.57.0`: vai adicionar a versão 8.57.0 (a mais recente abaixo da 9), dado a alguns [problemas](https://github.com/jsx-eslint/eslint-plugin-react/issues/3699) relacionados com o plugin de react a partir da versão 9, que estão sendo analisados - `eslint-config-prettier`: vai desativar as regras do eslint que conflitam com o prettier Para adicionar os plugins do eslint: ``yarn add eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks --dev`` - `eslint-plugin-prettier`: vai permitir rodar o prettier em conjunto com o eslint - `eslint-plugin-react`: vai trazer as regras de linting específicas para aplicações React - `eslint-plugin-react-hooks`: vai trazer as regras de linting para hooks em React Para permitir executar o eslint para aplicação React que tem o Babel como compilador: ``yarn add @babel/eslint-parser --dev`` Após a instalação das libs, adicionar na raiz do projeto o arquivo `.eslintrc.json` para configurar a execução do eslint. Ele vai ser incrementado aos poucos a medida que vão sendo explicadas as configurações: #### env Traz variáveis globais predefinidas. - `"browser": true`: referentes ao browser - `"node": true`: referentes ao Node.js - `"jest": true`: referentes ao Jest ```js { "env": { "browser": true, "node": true, "jest": true }, } ``` Por exemplo, se tenho uma app que usa Jest para os testes e não defino a env `"jest": true`, ao executar o eslint vai ser levantados erros do tipo: `describe, it, expect não estão definidos`. Quando coloco a env `"jest": true`, ao executar o eslint ele já saberá que são termos usados nos testes e não vai levantar erros por causa deles. #### extends Traz configurações adicionais para o eslint. - `eslint:recommended`: traz regras recomendadas do eslint - `plugin:react/recommended`: traz regras recomendadas para react (é possível usar devido a adição do plugin `eslint-plugin-react`) - `plugin:react-hooks/recommended`: traz regras recomendadas para hooks em React (é possível usar devido a adição do plugin `eslint-plugin-react-hooks`) - `prettier`: remove as regras do eslint que podem conflitar com o prettier (é possível usar devido a adição da lib `eslint-config-prettier`) ```js { //... "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier" ], } ``` #### parser - `@babel/eslint-parser`: permite executar o eslint para aplicações que usam o babel como compilador ```js { //... "parser": "@babel/eslint-parser", } ``` #### parserOptions - `ecmaVersion`: especifica a ECMAScript syntax usada (`latest` corresponde a mais recente versão suportada) - `sourceType`: especifica se a aplicação está usando ESM: `module` ou se está usando CommonJS: `script` - `ecmaFeatures` - `"jsx": true`: especifica se inclui syntax jsx ```js { //... "parserOptions": { "ecmaVersion": "latest", "sourceType": "module", "ecmaFeatures": { "jsx": true } }, } ``` #### plugins Permite adicionar plugins para extender o eslint, que podem adicionar regras de validação, configurações, envs. - `prettier`: plugin do prettier - `react`: plugin do React - `react-hooks`: plugin de hooks em React ```js { //... "plugins": [ "prettier", "react", "react-hooks" ], } ``` #### settings - `react` - `"version": "detect"`: detecta automaticamente a versão do React da aplicação ```js { //... "settings": { "react": { "version": "detect" } }, } ``` #### ignorePatterns Arquivos que serão ignorados quando rodar o eslint. - `*.stories.tsx`: foi colocado no artigo somente como exemplo, nesse caso o eslint não iria olhar os arquivos que terminam com `.stories.tsx` ```js { //... "ignorePatterns": ["*.stories.tsx"], } ``` #### rules Permite adicionar as regras do prettier para serem executadas em conjunto com o eslint: ```js { //... "rules": { "prettier/prettier": ["error"] } } ``` - `prettier/prettier`: adiciona as regras do prettier quando for executado o eslint - `error`: define que caso alguma regra do prettier não seja satisfeita, retorne erro. Além de `error`, é possível passar `warn` que levantaria um `warning` se alguma regra não fosse satisfeita. Ou `off` para desativar as regras Permite customizar as regras do eslint: ```js { //... "rules": { "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "prettier/prettier": ["error"] } } ``` `"react/jsx-uses-react": "off"` e `"react/react-in-jsx-scope": "off"`: desativa no eslint a regra que retorna erro se não é colocado o `import React from 'react'` nos arquivos. Bom para versões de React 17 para frente que não tem essa necessidade Permite customizar as regras do prettier: ```js { //... "rules": { "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "prettier/prettier": [ "error", { "singleQuote": true } ] } } ``` `singleQuote`: define como regra de formatação as strings terem aspas simples Após finalizar a definição do arquivo de configuração, adicionar em package.json os scripts: ```js "scripts": { //... "lint": "eslint .", "lint-files": "eslint", "lint-fix": "eslint . --fix", "lint-fix-files": "eslint --fix", }, ``` Por default seguindo essa configuração, o eslint vai olhar os arquivos `.js`. Para verificar outros tipos de arquivos é nos scripts acima adicionar depois de eslint `--ext=js,{outro_tipo_de_arquivo}` - `eslint .`: ao rodar `yarn lint` vai verificar em todos os arquivos se estão de acordo com as regras do eslint e prettier - `eslint`: ao rodar `yarn lint-files {nome_do_arquivo ou nome_da_pasta}` vai verificar o arquivo passado ou todos os arquivos da pasta passada, se estão de acordo com as regras do eslint e prettier - `eslint . --fix`: ao rodar `yarn lint-fix` vai formatar e corrigir o código seguindo as regras do eslint e prettier - `eslint --fix`: ao rodar `yarn lint-fix-files {nome_do_arquivo ou nome_da_pasta}` vai formatar e corrigir o código seguindo as regras do eslint e prettier, para o arquivo ou todos os arquivos da pasta passada Sugestão: caso sempre é executado para uma pasta específica (por exemplo `src`), para facilitar pode trocar os `.` dos scripts para `src`. ## Exemplo Vamos partir do arquivo de configuração completo definido acima: ```js { "env": { "browser": true, "node": true, "jest": true }, "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier" ], "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": "latest", "sourceType": "module", "ecmaFeatures": { "jsx": true } }, "plugins": [ "prettier", "react", "react-hooks" ], "settings": { "react": { "version": "detect" } }, "ignorePatterns": ["*.stories.tsx"], "rules": { "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "prettier/prettier": [ "error", { "singleQuote": true } ] } } ``` Arquivo de exemplo: ```js import Component from "./Component"; const Example = () => <p>Eslint article</p>; export default Example; ``` Ao executar `yarn lint-files` para esse arquivo: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdnalf5c5c8pzbjh9qsi.png) Ele retorna 3 erros, 2 do prettier e 1 do eslint, informando que dois são corrigidos pelo `--fix`: - Primeiro erro: referente a regra do eslint que retorna erro para variável declarada mas não usada no código - Segundo erro: referente a regra customizada definida para usar aspas simples no prettier - Terceiro erro: referente a regra do prettier de espaçamento Ao executar `yarn lint-fix-files` para esse arquivo: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t4o82hf2scu0k84v8wa.png) Ele corrige dois dos erros que tinha levantado, e continua avisando do que não era auto corrigível. Ficando o arquivo dessa forma: ```js import Component from './Component'; const Example = () => <p>Eslint article</p>; export default Example; ``` Removendo o import que não é utilizado, não terá mais erros aparecendo na execução do eslint. ## Conclusão A ideia foi trazer as libs necessárias para configuração do eslint com o prettier, focando em como executar eles em conjunto e mostrar onde é possível customizar as regras referentes a ambos. Tentei trazer de forma geral o que representa os elementos do arquivo de config, dependendo da app pode ser que não seja necessário a adição de todos os elementos mostrados acima ou uma pequena alteração em um deles, segue a doc referente a [versão 8.57.0](https://eslint.org/docs/v8.x/) do eslint. No próximo artigo vou focar em trazer regras que são interessantes se customizar tanto para o prettier quanto ao eslint.
griseduardo
1,866,941
Condos for sale in Canada | Condo Point
The Journey: A Deep Dive into Canadian Real Estate The Canadian real estate market is a hot topic...
0
2024-05-27T21:13:50
https://dev.to/sara_vicky_loves_condos/condos-for-sale-in-canada-condo-point-45l3
**The Journey: A Deep Dive into Canadian Real Estate** The [Canadian real estate market](https://condopoint.ca/) is a hot topic both in Canada and around the world. The abundant variety of landscapes, urban and suburban growth, together with a solid economy make Canada an attractive option for investors as well as home ownership or renting. Yet, managing through a landscape like this requires finesse — with an understanding of the market trends and regulatory environment or acceptable socio-economic factors underneath. In this deep dive, we cover the most current updates and perspectives driving the Canadian real estate market. **Canadian Real Estate Market Overview** The Canadian Housing Market Has Regional VariancesAs with markets in general, the Canadian housing market has regional differences, with large cities like Toronto, Vancouver and Montreal playing significant roles. Low interest rates, population growth and demographic demand underpin rising prices in so may of our property markets. Affordability challenges, supply shortages and real estate market-cooling regulatory measures have also arisen as critical forces shaping supply-and-demand fundamentals **Tackling the Housing Affordability Problem** This means that affordability in some parts of Canada — like Vancouver and Toronto, where rising prices have outstripped income growth — is still a very real concern. To help control affordability and reduce overheating measures to cool the markets include foreign buyer taxes, speculation tax or mortgage stress test. But it has sparked debate about the measures' effectiveness, and fears of potential unintended consequences - including that fewer homes will be built or sub-let rents are rising. **Rental Market Dynamics** A combination of factors including supply constraints, demographic shift, and economic uncertainty have cumulatively impacted the Canadian rental market. Rising populations, especially in urban centres such as Toronto and Vancouver, have driven down rental vacancy rates and forced tenants to outbid one another by paying higher rents. That includes wooing developers back to within the confines of municipal control so both private and non-profit rental construction can gradually be nudged into existence… more sustainably than ever before. **Government Policies and Regulatory Measures** Government guidelines and regulatory measures play a important position in shaping the Canadian real estate market, from taxation and land use policies to loan lending rules and housing subsidies. Recent initiatives aimed at increasing housing deliver, promoting affordability, and addressing speculative hobby had been delivered at each the federal and provincial tiers. However, the effectiveness of these policies relies upon on their implementation, enforcement, and coordination throughout jurisdictions. **Outlook and Future Trends** Looking in advance, the Canadian real estate marketplace is expected to keep evolving in response to converting economic situations, demographic trends, and coverage trends. Factors including hobby rate movements, immigration degrees, and the tempo of monetary recovery will have an effect on marketplace interest and fee increase within the coming years. Sustainable development practices, modern housing answers, and inclusive urban planning will be critical in addressing the lengthy-term challenges facing the Canadian real estate marketplace. Conclusion: The Canadian actual property marketplace offers both possibilities and demanding situations for buyers, owners, and policymakers alike. Understanding the modern-day updates and traits shaping the market is critical for making informed selections and navigating this dynamic landscape effectively. By staying abreast of trends in housing affordability, condo marketplace dynamics, authorities regulations, and future trends, stakeholders can function themselves for achievement in Canada's ever-changing actual estate market.
sara_vicky_loves_condos
1,866,942
The fastest local database ever!!!!
verse.db isn't just a database, it's your universal data bridge. Designed for unmatched flexibility,...
27,720
2024-05-27T21:13:24
https://versedb.jedi-studio.com/blog#
database, javascript, typescript, npm
verse.db isn't just a database, it's your universal data bridge. Designed for unmatched flexibility, security, and performance, verse.db empowers you to manage your data with ease. ## Introduction to verse.db **Welcome to verse.db!** Allow us to introduce you to the universe of verse.db, a powerful database solution. Whether you're building applications, conducting research, or organizing information, verse.db offers a versatile set of tools to streamline your data-related tasks. Here are some key features of verse.db: ### Local and Online Database: - verse.db provides both local and online database options, allowing you to choose the setup that best suits your needs. - Use it as a local database for offline applications or connect to an online server for real-time data access. ### Adapter Flexibility: - We offer multiple adapters to cater to different use cases. - For example, you can use the JSON adapter to store data in JSON format or explore other adapters like YAML and SQL. ### Efficient Data Management: - verse.db optimizes data handling, ensuring efficient retrieval, storage, and manipulation. - Whether you're storing user profiles, game scores, or scientific data, verse.db has you covered. > Note*: the online is still under development {% embed https://versedb.jedi-studio.com %}
marco5dev
1,866,940
Web Sunucuları: İnternetin Temel Taşları
Web sunucuları, internetin temel ve en önemli yapı taşlarından biri olup, kullanıcının web...
0
2024-05-27T20:58:39
https://dev.to/teknikbilimler/web-sunuculari-internetin-temel-taslari-36k9
webdev, computerscience, internet, webserver
Web sunucuları, internetin temel ve en önemli yapı taşlarından biri olup, kullanıcının web sayfalarına erişimini sağlar. Web sunucuları, HTTP (HyperText Transfer Protocol) veya HTTPS (HTTP Secure) protokollerini kullanarak istemci yani client'in taleplerini işler ve web sayfalarını tarayıcıya iletir. Bu sunucular, hem dinamik hem de statik içerik sunabildiği için bu onların esnek ve çok yönlü olmasını sağlar. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwzsimrdtrx8fcg6yz8b.jpg) Web sunucularının en bilinen örnekleri arasında Apache HTTP Server, Nginx ve Microsoft'un Internet Information Services (ISS) vardır. Apache: Esnek ve genişletilebilir yapısıyla kullanıcılar genelinde en çok kullanılan Web sunucularından birisidir. Nginx: Yüksek performansı ve düşük kaynak kullanımı ile dikkat çeker ve özellikle yüksek trafiğe sahip web siteleri tarafından tercih edilir. ISS: Windows tabanlı sistemlerle uyumlu çalışması açısından ve kolayca yönetilebildiğiyle bilinir. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3p14xc8jgi3ocjzizhf.jpg) Web sunucularının temel işlevleri arasında, gelen HTTP isteklerini işlemek, ilgili dosyaları (HTML, CSS, JavaScript, resim dosyaları vb.) sunmak ve dinamik içerik oluşturmak yer alır. Dinamik içerik, sunucu tarafında çalışan uygulamalar (örneğin, PHP, Python, Ruby, ASP.NET) tarafından oluşturulur ve kullanıcının talebine göre şekillenir. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ddopsf6ihnguftkgrbwr.png) Güvenlik konusu, web sunucularının yönetimi kısmında çok kritik bir role sahiptir. Güvenlik açıkları, veri ihlalleri ve siber saldırılara neden olabildiği için, güvenlik yamalarının düzenli olarak uygulanması ve güçlü politikalarının benimsenmesi ve güvenlik duvarları gibi koruyucu adımların atılması gereklidir. HTTPS protokolünün kullanımı, veri iletiminde gizliliği ve bütünlüğü sağlar ve kullanıcıların güvenliğini arttırır. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fq9rjxjg2l2wg9htr673.jpg) Web sunucularının verimliliği önemli bir faktördür. Yük dengeleme (load balancing) ve önbellekleme (caching gibi teknikler, web sunucularının performans verimliliğini arttırır. Yük dengeleme, gelen istekleri birden fazla sunucu arasında dağıtarak, her bir sunucunun aşırı yüklenmesini önler. Önbellekleme ise sıkça erişilen verilerin daha hızlı sunulmasını sağladığı için sunucu yükünü azaltır ve yanıt sürelerini kısaltır. **Sonuç:** Web sunucuları internetin çalışmasını sağlayan kritik bileşenlerden biridir. Kullanıcıların deneyimini iyileştirmek için sürekli olarak güvenlik ve performans optimizasyonlarının geliştirilmesi ve yapılması gerekmektedir. Web sunucularının etkili yönetimi, internetin hızlı, güvenli ve sorunsuz bir şekilde işlemesini sağlıyor, Bu yüzden web sunucuları modern internet altyapısının vazgeçilmez unsurudur. 1)Web sunucularının temel işlevi nedir? A) İnternet bağlantısını sağlamak B) Kullanıcı taleplerini işleyerek web sayfalarını tarayıcılara iletmek C) E-posta gönderimini yönetmek D) Dosya depolamak Doğru cevap: B) Kullanıcı taleplerini işleyerek web sayfalarını tarayıcılara iletmek 2)Aşağıdakilerden hangisi bir web sunucusu örneğidir? A) MySQL B) Apache HTTP Server C) FTP Server D) SSH Server Doğru cevap: B) Apache HTTP Server 3)Web sunucularında dinamik içerik hangi yöntemle oluşturulur? A) Statik HTML dosyalarıyla B) Sunucu tarafında çalışan uygulamalarla (PHP, Python, Ruby, ASP.NET) C) DNS sorgularıyla D) FTP protokolüyle Doğru cevap: B) Sunucu tarafında çalışan uygulamalarla (PHP, Python, Ruby, ASP.NET) 4)Web sunucularının güvenliğini artırmak için aşağıdakilerden hangisi yapılmalıdır? A) Sadece HTTP protokolü kullanmak B) Güvenlik yamalarını düzenli olarak uygulamak C) Yük dengeleme tekniklerini kullanmamak D) Veri iletiminde şifreleme kullanmamak Doğru cevap: B) Güvenlik yamalarını düzenli olarak uygulamak 5)Yük dengeleme (load balancing) ve önbellekleme (caching) tekniklerinin amacı nedir? A) Web sunucularının maliyetini artırmak B) Web sunucularının performansını artırmak C) Web sunucularının güvenliğini azaltmak D) Web sunucularının veri kaybını önlemek Doğru cevap: B) Web sunucularının performansını artırmak
yyserhatyy
1,866,879
Explore the world with Google Maps APIs
TL;DR: The US Memorial Day holiday is traditionally a time when many travel to visit...
0
2024-05-27T20:54:08
https://dev.to/wescpy/explore-the-world-with-google-maps-apis-lhj
python, node, api, webdev
<!-- Explore the world with Google Maps APIs --> <!-- address geocoding, time zone identification, walking directions --> ## TL;DR: The US Memorial Day holiday is traditionally a time when many travel to visit friends or family for a long weekend in remembrance of military personnel who made the ultimate sacrifice while serving in the country's armed forces, and traveling makes me think of Google Maps and _its_ APIs. While there's a brief intro to one of the Maps APIs in a [post on API keys](https://dev.to/googleworkspace/getting-started-using-google-apis-api-keys-part-2-38i6), Maps needs its own treatment, so this is your _formal_ introduction to the [Maps Platform](https://mapsplatform.google.com). To avoid an overwhelming amount of content, we're exploring its _server-side_ APIs, those you'd access from a web app or mobile backend. <!--[OLD Google Maps Platform](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yl28ado3xzy4wtl9cucd.jpg)--> ![Google Maps Platform](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fpjk3h7d8ezeupyok0m2.jpg) ## Introduction Welcome to the blog focused on showing Python (and sometimes Node.js) developers how to use a variety of Google APIs. On this blog, you'll find content covering a broad variety of topics such as [serverless computing](https://dev.to/wescpy/a-broader-perspective-of-serverless-1md1), [generative AI with Gemini](https://dev.to/wescpy/series/27183), and Google credentials like [API keys](https://dev.to/wescpy/series/25404) and [OAuth client IDs](https://dev.to/wescpy/series/25403), the latter specifically for use with [Google Workspace (GWS) APIs](https://developers.google.com/gsuite). Other posts dive into a specific solution, such as _using_ one of those GWS APIs to [export Google Docs as PDF](https://dev.to/wescpy/export-google-docs-as-pdf-without-the-docs-api-9o4) files. This post exposes readers to several APIs from yet another product group, [Google Maps](https://developers.google.com/maps). The platform features many _different_ services, APIs, and SDKs (~20), and covering them all isn't really "digestible" in one go. Maps is also a _visual_ product, so many of its services are on the client-side as one would expect. If you're a developer reading a blog covering APIs and frequently _using_ APIs however, there's a good chance you work on server-side software, so covering the Maps APIs accessible from that perspective makes the most sense here. Maps services are [grouped into four distinct categories](https://mapsplatform.google.com/maps-products), each summarized below: | Category | Description | | --- | --- | | **Maps** (_M_) | Static & dynamic mapping, Street View imagery, elevation, aerial/geospatial imagery, map tiles | | **Routes** (_R_) | Location of roads; routing/directions for various transportation modes; traffic info, times & distances | | **Places** (_P_) | Place & location information: details, search, lat-long coordinates, addressing & geolocation, time zones | | **Environment** (_E_) | Solar energy potential, air quality indexes, location-based pollen/pollutant info & health recommendations | <figcaption>Google Maps Platform service categories</figcaption> &nbsp; The server-side APIs are known as the [Web Service APIs](https://developers.google.com/maps/apis-by-platform#web_service_apis). There are 15 of them at the time of this writing, and that's _still_ too much to cover in a single post. To further whittle down what to cover, we're going to focus on those that are supported by the [Maps client libraries](https://developers.google.com/maps/web-services/client-library). The others require you to use raw REST and HTTP, and hopefully the Maps team will soon support those with their client libraries. In the meantime, we can help you get started with supported APIs. Client libraries encapsulate much of the boilerplate and do a lot of the heavy lifting so developers can focus on using API features. At the time of this writing, they support the 7 APIs listed below and account for nearly a third of all Maps services about half of all Maps APIs: 1. **Directions API** (_R_) 1. Distance Matrix API (_R_) 1. Elevation API (_M_) 1. **Geocoding API** (_P_) 1. Roads API (_R_) 1. Places API (_P_) 1. **Time Zone API** (_P_) Of the APIs listed, I'll be demonstrating the **bolded** ones in this post. ## Prerequisites As with other Google APIs, there are several distinct steps that you must take before you can use them from your application: 1. **Get credentials** from DevConsole; Maps uses API keys 1. **Install client library** for your development language 1. **Enable desired API(s)** in developer's console ("DevConsole") These actions are unrelated to each other, meaning you can do them in any order. ### Get credentials (API key) The first task is to get an API key: 1. Go to the [DevConsole credentials page](https://console.cloud.google.com/apis/credentials) 1. Click **+ Create Credentials** at the top 1. Select **API key** and wait a few seconds for completion 1. Copy and save API key as a variable `API_KEY = '<YOUR-API-KEY>'` to `settings.py` for Python or `.env` for Node.js (may need to refresh credentials page and click **Show key** to see it) | :warning: WARNING: Keep API keys secure | |:---------------------------| | Storing API keys in files (or hard-coding them for use in actual code or even assigning to environment variables) is for prototyping and learning purposes only. When going to production, put them in environment variables or in a secrets manager. Files like `settings.py` or `.env` containing API keys are susceptible. ***Under no circumstances*** should you [upload files like those to any public or private repo](https://www.gitguardian.com/glossary/remediate-sensitive-data-leaks-api-keys-hardcoded-source-code), [have sensitive data like that in TerraForm config files](https://spacelift.io/blog/terraform-secrets), [add such files to Docker layers](https://www.darkreading.com/cloud-security/docker-leaks-api-secrets-private-keys-cybercriminals), etc., as once your API key leaks, everyone in the world can use it. | If you're new to Google developer tools, [_API keys_](https://dev.to/wescpy/series/25404) are one of the credentials types supported by Google APIs, and they're the _only_ type supported by Maps APIs. Other credentials types include [_OAuth client IDs_](https://dev.to/wescpy/series/25403), mostly used by GWS APIs, and _service accounts_, mostly used by Google Cloud (GCP) APIs. ### Install client library (Maps) The core Maps client libraries are available in four languages: 1. [Java](https://github.com/googlemaps/google-maps-services-java) 1. [Python](https://github.com/googlemaps/google-maps-services-python) 1. [Go](https://github.com/googlemaps/google-maps-services-go) 1. [Node.js](https://github.com/googlemaps/google-maps-services-js) | :memo: NOTE: Other client libraries | |:---------------------------| | In the documentation, you may find reference to additional client libraries, for example in C# and Objective-C. However, these are resources used to either access REST API interfaces directly or are custom-built for specific APIs like the [Address Validation API](https://developers.google.com/maps/documentation/address-validation/client_libraries), so they aren't part of the "core" Maps client libraries. | Install the one for your development language, and any others if you work with more than one. Here are the commands for Python (2 or 3) and Node.js: | Language | Command | | --- | --- | | **Python** | `pip install -U googlemaps html2text` # (or `pip3`) | | **Node.js** | `npm install core-js dotenv @googlemaps/google-maps-services-js` | <figcaption>Maps client library installation commands</figcaption> &nbsp; Confirm all required packages have been installed correctly with these validation commands: | Language | Command | | --- | --- | | **Python** | `python -c "import googlemaps, html2text"` # (or `python3`) | | **Node.js** | `node -e "require('@googlemaps/google-maps-services-js')"` | <figcaption>Maps client library validation commands</figcaption> &nbsp; If they complete without error, the installation(s) succeeded and they're ready for use. ### Enable APIs (Maps) Now it's time to enable the Maps APIs used in the samples. All Google APIs must be enabled before they can be used. While many Google APIs are free to use, Maps APIs are not. However, all users are granted a [free monthly "quota" of $200USD of usage](https://mapsplatform.google.com/pricing) before incurring billing. Review the [Maps Platform billing page](https://developers.google.com/maps/billing-and-pricing/billing) to understand all the terms and conditions, then create a billing account backed by some financial instrument like a credit card or trial credit as described on that billing page. Once you have a billing account, the next step is to [create a project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project) and assign that billing account to that project. You can also reuse an existing project if you have one. Now you can enable the Maps APIs. There are generally three different ways of enabling Google APIs. 1. **DevConsole manually** -- Enable one API at a time by following these steps: - Go to [DevConsole](http://console.developers.google.com) - Click on **Library** tab and search for "Maps" to see all the Maps APIs - Scroll down and look for **Geocoding API**, **Time Zone API**, and **Directions API** - Click **Enable API** button for each API 1. **DevConsole link** -- You may be new to Google APIs or don't have experience enabling APIs in the DevConsole. If this is you, the above steps can be simplified with a single [DevConsole link (and click) that enables all three APIs](http://console.developers.google.com/start/api?id=geocoding-backend.googleapis.com,timezone-backend.googleapis.com,directions-backend.googleapis.com). 1. **`gcloud`/command-line** -- For those who prefer working in a terminal, you can enable APIs with a single command in the [Cloud Shell](https://cloud.google.com/shell) or locally on your computer if you [installed the Cloud SDK](https://cloud.google.com/sdk/install) (which includes the `gcloud` command-line tool [CLI]) and initialized its use. If this is you, issue the following command to enable all three APIs: `gcloud services enable geocoding-backend.googleapis.com timezone-backend.googleapis.com directions-backend.googleapis.com`. Confirm which APIs you've enabled in-all with `gcloud services list`. Any which way you've enabled the APIs, it's time to look at code. ## Code samples This section covers use of the three Maps APIs enabled above, the Geocoding, Time Zone, and Directions APIs. Let's start with the Geocoding API since it was previously covered in an [earlier post on API keys](https://dev.to/googleworkspace/getting-started-using-google-apis-api-keys-part-2-38i6). ### Maps Geocoding API Available in the [repo](https://github.com/wescpy/google), the [`maps_geocode.py` script](https://github.com/wescpy/google/blob/main/maps/maps_geocode.py) is the same as from the other post on API keys: it takes an address and geocodes it to a latitude-longitude ("lat/long") pair or 2-tuple: ```python ''' maps_geocode.py -- geocode address in Google Maps ''' from __future__ import print_function import googlemaps from settings import API_KEY ADDRESS = '1600 Amphitheatre Pkwy 94043' GMAPS = googlemaps.Client(key=API_KEY) res = GMAPS.geocode(ADDRESS)[0] geo = res['geometry']['location'] print('** Geocode for %r: (%s, %s)' % (ADDRESS, geo['lat'], geo['lng'])) ``` The script creates an API client, passes in the API key for authorization, then calls the `geocode()` function with the target address. The lat/long is extracted from the payload and displayed with the origin address. All scripts in this post are Python 2/3-compatible, meaning this code can help those on 2.x finally migrate to 3.x. ``` $ python3 maps_geocode.py ** Geocode for '1600 Amphitheatre Pkwy 94043': (37.4226277, -122.0841644) ``` The input is an imperfect address for Google's headquarters, but Maps still has enough information to do its job and returns the lat/long as requested. I don't use it in the script above, but the API also returns a more "formal" `formatted_address` field that you can use if desired: ```python >>> res['formatted_address'] '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA' ``` As I'm also learning JavaScript, here's my attempt porting the script to Node.js: ```javascript /** * maps_geocode.js -- geocode address in Google Maps */ require('dotenv').config(); const { Client } = require("@googlemaps/google-maps-services-js"); const ADDRESS = '1600 Amphitheatre Pkwy 94043'; const GMAPS = new Client(); const args = { params: { key: process.env.API_KEY, address: ADDRESS, } }; async function main() { const rsp = await GMAPS.geocode(args); const res = rsp.data.results[0]; const geo = res.geometry.location; console.log(`** Geocode for "${ADDRESS}": (${geo.lat}, ${geo.lng})`); } main(); ``` You'll find [this new script in the repo](https://github.com/wescpy/google/blob/main/maps/maps_geocode.js), and running it results in nearly the same output as the Python version: ``` $ node maps_geocode.js ** Geocode for "1600 Amphitheatre Pkwy 94043": (37.4226277, -122.0841644) ``` For those who prefer a modern ECMAScript module, here's the equivalent `.mjs` file, which is [also in the repo](https://github.com/wescpy/google/blob/main/maps/maps_geocode.mjs): ```javascript /** * maps_geocode.mjs -- geocode address in Google Maps */ import dotenv from "dotenv"; import { Client } from "@googlemaps/google-maps-services-js"; dotenv.config(); const ADDRESS = '1600 Amphitheatre Pkwy 94043'; const GMAPS = new Client(); const args = { params: { key: process.env.API_KEY, address: ADDRESS, } }; async function main() { const rsp = await GMAPS.geocode(args); const res = rsp.data.results[0]; const geo = res.geometry.location; console.log(`** Geocode for "${ADDRESS}": (${geo.lat}, ${geo.lng})`); } main(); ``` Take my word for it that its output is identical to the CommonJS version. The remaining samples are only in Python, and you can use this example to extrapolate porting the others to Node.js. Next is the Time Zone API, which is a natural follow-up to the Geocoding API because it requires the lat/long coordinates of a location to determine its time zone. ### Maps Time Zone API The [`maps_tzone.py` script found in the repo](https://github.com/wescpy/google/blob/main/maps/maps_tzone.py) takes a geolocation and returns its time zone and offset from GMT/UTC: ```python ''' maps_tzone.py -- geocode address and get Google Maps time zone ''' from __future__ import print_function import googlemaps from settings import API_KEY ADDRESS = '1600 Amphitheatre Pkwy 94043' GMAPS = googlemaps.Client(key=API_KEY) rsp = GMAPS.geocode(ADDRESS)[0]['geometry']['location'] rsp = GMAPS.timezone((rsp['lat'], rsp['lng'])) offset = rsp['rawOffset'] + rsp['dstOffset'] sign = '-' if offset < 0 else '+' offset, frac = divmod(abs(offset), 3600) frac_str = str(round(frac/3600, 2))[1:] if frac else '' tz_abbr = ''.join(c[0] for c in rsp['timeZoneName'].split()) print('** Time zone for %r:' % ADDRESS, rsp['timeZoneId'], '(%s/GMT%s%s%s)' % (tz_abbr, sign, offset, frac_str)) ``` This script starts with a similar recipe to `maps_geocode.py`, and extends it after the geocoding takes place. An additional call to `timezone()` passing in the resulting geocode returns several key fields: | Field | Description | Example | | --- | --- | --- | | **`rawOffset`** | Number of seconds away from GMT/UTC; positive if ahead of UTC, negative if behind | `-28800` (for GMT-8) | | **`dstOffset`** | Daylight saving time adjustment (in seconds) from standard GMT offset | `3600` (for 1-hour DST offset) | | **`timeZoneId`** | [IANA time zone identifier](https://wikipedia.org/wiki/List_of_tz_database_time_zones) in "continent/locale" format | `America/Los_Angeles` (for PST/GMT-8 or PDT/GMT-7) | | **`timeZoneName`** | Localized descriptive time zone name | `Pacific Daylight Time` (for GMT-7) | <figcaption>Key fields returned by <code>geocode()</code> function</figcaption> &nbsp; Here's the output running this script: ``` $ python3 maps_tzone.py ** Time zone for '1600 Amphitheatre Pkwy 94043': America/Los_Angeles (PDT/GMT-7) ``` The `rawOffset` is combined with any possible DST adjustment (`dstOffset`) for the current time zone offset (in seconds) away from GMT. The `sign` variable tracks whether the time zone is ahead of GMT or behind. The overall offset is then split up into an hourly `offset` and a `frac`tional remainder, if any -- this applies to time zones that don't start a multiple of hours away from UTC. For example, replacing the Google headquarters address with that of its Bangalore office reveals that India Standard Time isn't on an hourly boundary away from GMT; it's further offset by a half-hour: ``` $ python3 maps_tzone-india.py ** Time zone for '3 Old Madras Rd, Bengaluru 560016 IN': Asia/Calcutta (IST/GMT+5.5) ``` For an _even more interesting_ time zone, change the address to that of the Pashupatinath Temple, a well-known Hindu temple in Kathmandu: ``` $ python3 maps_tzone-nepal.py ** Time zone for 'Pashupati Nath Road, Kathmandu 44600 NP': Asia/Katmandu (NT/GMT+5.75) ``` You're reading it correctly: Nepal Time is ahead of India Standard time by another 15 minutes, totaling 5.75 hours ahead of GMT, but this script (via `frac` & `frac_str`) can handle scenarios like these from south Asia. **NOTE:** There are no files in the repo named `maps_tzone-india.py` and `maps_tzone-nepal.py`... I merely copied `maps_tzone.py` to different files and changed the `ADDRESS` in each for illustrative purposes only. Create your own versions and try different addresses as you see fit. Now let's move on to the final sample using the Directions API. ### Maps Directions API The Directions API returns driving (default), walking, cycling, or public transit directions to get from point A to point B. The sample below, `maps_wlkdir.py`, also found [in the repo](https://github.com/wescpy/google/blob/main/maps/maps_wlkdir.py), calculates the walking directions, distance, and time to walk from one side of Google's main New York office building to the other side but from the outside rather than through the building itself: ```python ''' maps_wlkdir.py -- get Google Maps walking directions ''' from __future__ import print_function from datetime import datetime import googlemaps from html2text import html2text from settings import API_KEY ADDRESSES = ('111 8th Ave, New York', '76 9th Ave') GMAPS = googlemaps.Client(key=API_KEY) rsp = GMAPS.directions(*ADDRESSES, mode='walking', departure_time=datetime.now()) dirs = rsp[0]['legs'][0] print('** Walking directions...') print('STARTING from:', dirs['start_address']) print('CONCLUDING at:', dirs['end_address']) print('DISTANCE:', dirs['distance']['text']) print('DURATION:', dirs['duration']['text']) print('DIRECTIONS:') for i, step in enumerate(dirs['steps']): print('\t%d.' % (i+1), html2text( step['html_instructions']).strip().replace('\n\n', '\n\t')) ``` This script relies on a 3rd-party package, `html2text`, to convert the directions into plain text for our command-line script because they only come in HTML from the API. The `directions()` function is called with the origin and destination addresses, the desired transportation `mode`, and the `departure_time` used by the API to determine the duration based on any extra traffic that may be around on that day at that time. Running this script results in the following output: ``` $ python3 maps_wlkdir.py ** Walking directions... STARTING from: 111 8th Ave, New York, NY 10011, USA CONCLUDING at: 76 9th Ave, New York, NY 10011, USA DISTANCE: 0.2 mi DURATION: 4 mins DIRECTIONS: 1. Head **southwest** on **8th Ave** toward **W 15th St** 2. Turn **right** onto **W 15th St** 3. Turn **right** onto **9th Ave** Destination will be on the right ``` ## Summary Google provides a wide variety of developer tools and APIs for users to integrate their technologies programmatically. There is a definite bias towards GCP and GWS APIs on this blog because of my personal experience as a member of both of those teams during my time at Google, but Maps is another API family that deserves some attention too. This post provides a basic introduction to several of its server-side APIs to help you get your users where they need to go as well as get information about places found on Maps. If you find yourself needing to know how to use these APIs, I hope this post helps kick off your journey into the Maps family of APIs. If you find any errors or have suggestions on content you'd like to see in future posts, be sure to leave a comment below, and if your organization needs help integrating Google technologies via its APIs, reach out to me by submitting a request at <https://cyberwebconsulting.com>. Lastly, below are links relevant to the content in this post for further exploration. ## References This post covered quite a bit, so there is a good amount of documentation to link you to: ### Blog post code samples - [Maps APIs only](https://github.com/wescpy/google/maps) - [All featured APIs](https://github.com/wescpy/google) ### Google Maps Platform - [Platform home](https://mapsplatform.google.com) - [Platform pricing](https://mapsplatform.google.com/pricing) - [Detailed pricing](https://developers.google.com/maps/billing-and-pricing/pricing) - [Developers home](https://developers.google.com/maps) - [Developers docs](https://developers.google.com/maps/documentation) ### Google Maps APIs - [Maps Web Service APIs](https://developers.google.com/maps/apis-by-platform#web_service_apis) - [Choosing a Maps API](https://developers.google.com/maps/documentation/api-picker) - [Getting & using API keys](https://developers.google.com/maps/documentation/geocoding/get-api-key) - [API keys best practices](https://developers.google.com/maps/api-security-best-practices) - [API quotas & limits](https://developers.google.com/maps/faq#usage_apis) ### Maps APIs client libraries - [Client libraries & supported APIs](https://developers.google.com/maps/web-services/client-library) - [Python client library](https://github.com/googlemaps/google-maps-services-python) - [Node.js client library](https://github.com/googlemaps/google-maps-services-nodejs) ### Maps Geocoding API - [Geocoding API home](https://developers.google.com/maps/documentation/geocoding) - [Geocoding getting started](https://developers.google.com/maps/documentation/geocoding/start) ### Maps Time Zone API - [Time Zone API home](https://developers.google.com/maps/documentation/timezone) - [Time Zone getting started](https://developers.google.com/maps/documentation/timezone/start) ### Maps Directions API - [Directions API home](https://developers.google.com/maps/documentation/directions) - [Directions getting started](https://developers.google.com/maps/documentation/directions/start) ### Other Google Maps content by the author - [Getting started using Google APIs: API Keys (Part 2/2)](https://dev.to/googleworkspace/getting-started-using-google-apis-api-keys-part-2-38i6) post - [Accessing Google Maps from a spreadsheet?!?](http://goo.gl/oAzBN9) video --- <small> **WESLEY CHUN**, MSCS, is a [Google Developer Expert](https://developers.google.com/experts) (GDE) in Google Cloud (GCP) &amp; Google Workspace (GWS), author of Prentice Hall's bestselling ["Core Python"](https://corepython.com) series, co-author of ["Python Web Development with Django"](https://withdjango.com), and has written for Linux Journal & CNET. He runs [CyberWeb](https://cyberwebconsulting.com) specializing in GCP & GWS APIs and serverless platforms, [Python & App Engine migrations](https://appenginemigration.com), and Python training & engineering. Wesley was one of the original Yahoo!Mail engineers and spent 13+ years on various Google product teams, speaking on behalf of their APIs, producing sample apps, codelabs, and videos for [serverless migration](http://bit.ly/3xk2Swi) and [GWS developers](http://goo.gl/JpBQ40). He holds degrees in Computer Science, Mathematics, and Music from the University of California, is a Fellow of the Python Software Foundation, and loves to travel to meet developers worldwide at conferences, user group events, and universities. Follow he/him [@wescpy](https://twitter.com/wescpy) & his [technical blog](https://dev.to/wescpy). Find this content useful? [Contact CyberWeb](https://forms.gle/bQiDMiGyGrrwv5sy5) if you may need help or [buy him a coffee (or tea)](http://buymeacoffee.com/wescpy)! </small>
wescpy
1,866,939
My Movie Website
This app is about making movies, the reason why I made this app is because we all like movies, We all...
0
2024-05-27T20:53:07
https://dev.to/dirtypaki1/my-movie-website-3jgo
This app is about making movies, the reason why I made this app is because we all like movies, We all have a favorite movie. The way way this app works is that the you type in the movie you like, in the search bar after you have typed in the name of the movie.You click on the add movie and the movie is on the list. My Favorite Movie is 21 Jump Street, this movie is about two guys that are under cover cops, dress as teenagers and their job is to arrest kids that are selling this narcotic that is killing students. These two Cops were played by Jonah Hill and Channing Tatum. When these two were kids in high school Channing tatum was popular and Jonah Hill was not popular at all, So now that they are both adults they are going to be under cover cops, but now the roles were reversed Jonah was popular and Channing was not popular, they both saw each others perspective, however Jonah was having a really good time. As the movie was going on both of them were not finding any breaks in the case so their supervisor was telling them that if they don't close this case soon. They won't be able to be undercover cops anymore, so they both learned that one of the popular kids and one of the teachers were the one selling the drugs to the students. That they bought from a moter cycle gang, they had a shoot out with the gang and they apprehended the gang and the student and teacher. Because they were able to close this case.
dirtypaki1
1,866,938
64-Bit Assembly Language Lab 3 part-2
Welcome back everybody!! In the last post we saw some basic hello world programs in x86_64 and...
0
2024-05-27T20:52:45
https://dev.to/yuktimulani/64-bit-assembly-language-lab-3-part-2-f9p
assembly, helloworld, x86, aarch64
Welcome back everybody!! In the last post we saw some basic hello world programs in x86_64 and aarch64 archietectures, what is the difference between the 2 and how they work. The programs we analysed were written in c. But in todays post we are going to analyse them in assembly language in both the archietectures. And may be re-evaluate our descision of assembly being difficult and boring, may be ⚠️. So lets get started with the tasks. ## Step 3: Review, build, and run the x86_64 assembly language programs • Navigate to the spo600/examples/hello/assembler/x86_64 directory. • Use make to build the assembly language programs. • Use objdump -d on the generated object files to inspect the assembly code. • Compare the assembly code with the C source code and note the differences. So first we need to navigate to the address where all the programs are present we can do this with simple cd commad `cd spo600/examples/hello/assembler/x86_64` as we have already extracted the tar archieve using `tar xvf /public/spo600-assembler-lab-examples.tgz` If you do a `ls` you will see the follwoing files 1. hello-gas.s 2. hello-nasm.s 3. Makefile Now lets check the contents of our hello-gas.s file, which looks like this ![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttoqq9adfp4yr3fimltp.png) This program is written in the gnu assembler syntax so the name hello-gas Next is the hello-nasm.s ![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4vghlcyzmimk1o3vc64.png) You can see the difference in the syntax of the two files as this one uses the Netwide Assembler, which is a popular assembler for the x86 architecture. We will be working with hello-gas for today. So, lets compile it with the commad `make hello-gas`. ![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6ston8s9bs1o7h4biji.png) It won't compile in aarch64 archietecture because duh!! this for x86 only. This will generate a binary file called hello-gas and when we execute the binary with the commad `./hello-gas` we will see the following results. ![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp75749clvz1dqtbhecx.png) Now lets take a look at the object dump of this program. You can use te command `objdump -d hello-gas` which will look something like this. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkvqbq9c6dwaon6x1gfp.png) This displays the disassembly of the .text section. The .text section contains the actual executable instructions of the program. When the program is run, the CPU reads and executes the instructions from this section. ## Step 4: Build and run the aarch64 assembly language program • Navigate to the spo600/examples/hello/assembler/aarch64 directory. • Use make to build the assembly language program. • Use objdump -d on the generated object file to inspect the assembly code. • Compare the assembly code with the C source code and note the differences. Lets perfom the same actions for aarch64 program. When you do a `ls` after navigating to the directory address you will see the following files. 1. hello.s 2. Makefile Hello.s contains our program and Makefile is the file that compiles and builds our project as we discussed in my [last post](https://dev.to/yuktimulani/exploring-64-bit-asseembly-lanaguage-4fin) Lets see what is there in hello.s ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/608f28xrgqevzuniuesv.png) Notice the aarch64 program fails to compile in the x86 system. Quite colorful is aarch64 right! I like it. Now lets build it with `make hello` which gives us the following outcome. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/au4x31np78qxaav7bo3a.png) The object dump and execution looks something like this. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bvwu0mlh33snvjdybttk.png) Note that in both the systems apart from the binary file there is one more file being generated called hello.o in aarch64 and hello-gas.o in x86. What are these files now? Object files, commonly with the .o extension, are intermediate files produced by the assembler or compiler from source code. They contain machine code that is not yet linked into a complete executable program. The `.o` files represent the machine code translation of individual source files. They are not directly executable but contain the compiled code that will later be linked together to form an executable. Do not get angry when I tell you that these were just the basics for getting us familiar with running and compiling the programs. The real task is to write a program that prints the word "Loop" or any other word with the index count of the loop. The loop should run 30 times. Calm down and don't worry we have a hint!!😅 Here is a basic loop in AArch64 assembler - this loops from 0 to 9, using r19 as the index (loop control) counter: ``` .text .globl _start min = 0 /* starting value for the loop index; **note that this is a symbol (constant)**, not a variable */ max = 10 /* loop exits when the index hits this number (loop condition is i<max) */ _start: mov x19, min loop: /* ... body of the loop ... do something useful here ... */ add x19, x19, 1 cmp x19, max b.ne loop mov x0, 0 /* status -> 0 */ mov x8, 93 /* exit is syscall #93 */ svc 0 /* invoke syscall */ ``` This code doesn't actually do anything while looping, because the body of the loop is empty. But we can use this code and combine it the hello world program so that it prints a word each time it loops. I already did the hardwork for you and it did take sometime. ## Code Reveal 🤫 ``` .text .globl _start min = 0 /* starting value for the loop index; **note that this is a symbol (constant)**, not a variable */ max = 30 /* loop exits when the index hits this number (loop condition is i<max) */ _start: mov x19, min loop: add x15, x19, 0x30 adr x14, msg+6 mov x12, 10 udiv x13, x19, x12 add x16, x13, 0x30 cmp x16, 0x30 b.eq ones strb w16, [x14] ones: adr x14, msg+7 msub x13, x13, x12, x19 add x13, x13, 0x30 strb w13, [x14] mov X0, 1 adr x1, msg mov x2, len mov x8, 64 svc 0 add x19, x19, 1 cmp x19, max b.ne loop mov x0, 0 mov x8, 93 svc 0 .data msg: .ascii "Loop: #\n" len= . - msg ``` I know , I know that you guys need a walkthrough and I won't keep you guys waiting. So, see you guys in the next post. Untill then Happy Coding!!!!😉
yuktimulani
1,866,909
Buy Verified Paxful Account
https://dmhelpshop.com/product/buy-verified-paxful-account/ Buy Verified Paxful Account There are...
0
2024-05-27T19:34:45
https://dev.to/fosin60384/buy-verified-paxful-account-k2d
webdev, javascript, beginners, programming
ERROR: type should be string, got "https://dmhelpshop.com/product/buy-verified-paxful-account/\n\n\n![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/it4z8y29uoa51jo1ujku.png)Buy Verified Paxful Account\nThere are several compelling reasons to consider purchasing a verified Paxful account. Firstly, a verified account offers enhanced security, providing peace of mind to all users. Additionally, it opens up a wider range of trading opportunities, allowing individuals to partake in various transactions, ultimately expanding their financial horizons.\n\nMoreover, Buy verified Paxful account ensures faster and more streamlined transactions, minimizing any potential delays or inconveniences. Furthermore, by opting for a verified account, users gain access to a trusted and reputable platform, fostering a sense of reliability and confidence.\n\nLastly, Paxful’s verification process is thorough and meticulous, ensuring that only genuine individuals are granted verified status, thereby creating a safer trading environment for all users. Overall, the decision to Buy Verified Paxful account can greatly enhance one’s overall trading experience, offering increased security, access to more opportunities, and a reliable platform to engage with. Buy Verified Paxful Account.\n\nBuy US verified paxful account from the best place dmhelpshop\nWhy we declared this website as the best place to buy US verified paxful account? Because, our company is established for providing the all account services in the USA (our main target) and even in the whole world. With this in mind we create paxful account and customize our accounts as professional with the real documents. Buy Verified Paxful Account.\n\nIf you want to buy US verified paxful account you should have to contact fast with us. Because our accounts are-\n\nEmail verified\nPhone number verified\nSelfie and KYC verified\nSSN (social security no.) verified\nTax ID and passport verified\nSometimes driving license verified\nMasterCard attached and verified\nUsed only genuine and real documents\n100% access of the account\nAll documents provided for customer security\nWhat is Verified Paxful Account?\nIn today’s expanding landscape of online transactions, ensuring security and reliability has become paramount. Given this context, Paxful has quickly risen as a prominent peer-to-peer Bitcoin marketplace, catering to individuals and businesses seeking trusted platforms for cryptocurrency trading.\n\nIn light of the prevalent digital scams and frauds, it is only natural for people to exercise caution when partaking in online transactions. As a result, the concept of a verified account has gained immense significance, serving as a critical feature for numerous online platforms. Paxful recognizes this need and provides a safe haven for users, streamlining their cryptocurrency buying and selling experience.\n\nFor individuals and businesses alike, Buy verified Paxful account emerges as an appealing choice, offering a secure and reliable environment in the ever-expanding world of digital transactions. Buy Verified Paxful Account.\n\nVerified Paxful Accounts are essential for establishing credibility and trust among users who want to transact securely on the platform. They serve as evidence that a user is a reliable seller or buyer, verifying their legitimacy.\n\nBut what constitutes a verified account, and how can one obtain this status on Paxful? In this exploration of verified Paxful accounts, we will unravel the significance they hold, why they are crucial, and shed light on the process behind their activation, providing a comprehensive understanding of how they function. Buy verified Paxful account.\n\n \n\nWhy should to Buy Verified Paxful Account?\nThere are several compelling reasons to consider purchasing a verified Paxful account. Firstly, a verified account offers enhanced security, providing peace of mind to all users. Additionally, it opens up a wider range of trading opportunities, allowing individuals to partake in various transactions, ultimately expanding their financial horizons.\n\nMoreover, a verified Paxful account ensures faster and more streamlined transactions, minimizing any potential delays or inconveniences. Furthermore, by opting for a verified account, users gain access to a trusted and reputable platform, fostering a sense of reliability and confidence. Buy Verified Paxful Account.\n\nLastly, Paxful’s verification process is thorough and meticulous, ensuring that only genuine individuals are granted verified status, thereby creating a safer trading environment for all users. Overall, the decision to buy a verified Paxful account can greatly enhance one’s overall trading experience, offering increased security, access to more opportunities, and a reliable platform to engage with.\n\n \n\nWhat is a Paxful Account\nPaxful and various other platforms consistently release updates that not only address security vulnerabilities but also enhance usability by introducing new features. Buy Verified Paxful Account.\n\nIn line with this, our old accounts have recently undergone upgrades, ensuring that if you purchase an old buy Verified Paxful account from dmhelpshop.com, you will gain access to an account with an impressive history and advanced features. This ensures a seamless and enhanced experience for all users, making it a worthwhile option for everyone.\n\n \n\nIs it safe to buy Paxful Verified Accounts?\nBuying on Paxful is a secure choice for everyone. However, the level of trust amplifies when purchasing from Paxful verified accounts. These accounts belong to sellers who have undergone rigorous scrutiny by Paxful. Buy verified Paxful account, you are automatically designated as a verified account. Hence, purchasing from a Paxful verified account ensures a high level of credibility and utmost reliability. Buy Verified Paxful Account.\n\nPAXFUL, a widely known peer-to-peer cryptocurrency trading platform, has gained significant popularity as a go-to website for purchasing Bitcoin and other cryptocurrencies. It is important to note, however, that while Paxful may not be the most secure option available, its reputation is considerably less problematic compared to many other marketplaces. Buy Verified Paxful Account.\n\nThis brings us to the question: is it safe to purchase Paxful Verified Accounts? Top Paxful reviews offer mixed opinions, suggesting that caution should be exercised. Therefore, users are advised to conduct thorough research and consider all aspects before proceeding with any transactions on Paxful.\n\n \n\nHow Do I Get 100% Real Verified Paxful Accoun?\nPaxful, a renowned peer-to-peer cryptocurrency marketplace, offers users the opportunity to conveniently buy and sell a wide range of cryptocurrencies. Given its growing popularity, both individuals and businesses are seeking to establish verified accounts on this platform.\n\nHowever, the process of creating a verified Paxful account can be intimidating, particularly considering the escalating prevalence of online scams and fraudulent practices. This verification procedure necessitates users to furnish personal information and vital documents, posing potential risks if not conducted meticulously.\n\nIn this comprehensive guide, we will delve into the necessary steps to create a legitimate and verified Paxful account. Our discussion will revolve around the verification process and provide valuable tips to safely navigate through it.\n\nMoreover, we will emphasize the utmost importance of maintaining the security of personal information when creating a verified account. Furthermore, we will shed light on common pitfalls to steer clear of, such as using counterfeit documents or attempting to bypass the verification process.\n\nWhether you are new to Paxful or an experienced user, this engaging paragraph aims to equip everyone with the knowledge they need to establish a secure and authentic presence on the platform.\n\nBenefits Of Verified Paxful Accounts\nVerified Paxful accounts offer numerous advantages compared to regular Paxful accounts. One notable advantage is that verified accounts contribute to building trust within the community.\n\nVerification, although a rigorous process, is essential for peer-to-peer transactions. This is why all Paxful accounts undergo verification after registration. When customers within the community possess confidence and trust, they can conveniently and securely exchange cash for Bitcoin or Ethereum instantly. Buy Verified Paxful Account.\n\nPaxful accounts, trusted and verified by sellers globally, serve as a testament to their unwavering commitment towards their business or passion, ensuring exceptional customer service at all times. Headquartered in Africa, Paxful holds the distinction of being the world’s pioneering peer-to-peer bitcoin marketplace. Spearheaded by its founder, Ray Youssef, Paxful continues to lead the way in revolutionizing the digital exchange landscape.\n\nPaxful has emerged as a favored platform for digital currency trading, catering to a diverse audience. One of Paxful’s key features is its direct peer-to-peer trading system, eliminating the need for intermediaries or cryptocurrency exchanges. By leveraging Paxful’s escrow system, users can trade securely and confidently.\n\nWhat sets Paxful apart is its commitment to identity verification, ensuring a trustworthy environment for buyers and sellers alike. With these user-centric qualities, Paxful has successfully established itself as a leading platform for hassle-free digital currency transactions, appealing to a wide range of individuals seeking a reliable and convenient trading experience. Buy Verified Paxful Account.\n\n \n\nHow paxful ensure risk-free transaction and trading?\nEngage in safe online financial activities by prioritizing verified accounts to reduce the risk of fraud. Platforms like Paxfu implement stringent identity and address verification measures to protect users from scammers and ensure credibility.\n\nWith verified accounts, users can trade with confidence, knowing they are interacting with legitimate individuals or entities. By fostering trust through verified accounts, Paxful strengthens the integrity of its ecosystem, making it a secure space for financial transactions for all users. Buy Verified Paxful Account.\n\nExperience seamless transactions by obtaining a verified Paxful account. Verification signals a user’s dedication to the platform’s guidelines, leading to the prestigious badge of trust. This trust not only expedites trades but also reduces transaction scrutiny. Additionally, verified users unlock exclusive features enhancing efficiency on Paxful. Elevate your trading experience with Verified Paxful Accounts today.\n\nIn the ever-changing realm of online trading and transactions, selecting a platform with minimal fees is paramount for optimizing returns. This choice not only enhances your financial capabilities but also facilitates more frequent trading while safeguarding gains. Buy Verified Paxful Account.\n\nExamining the details of fee configurations reveals Paxful as a frontrunner in cost-effectiveness. Acquire a verified level-3 USA Paxful account from usasmmonline.com for a secure transaction experience. Invest in verified Paxful accounts to take advantage of a leading platform in the online trading landscape.\n\n \n\nHow Old Paxful ensures a lot of Advantages?\n\nExplore the boundless opportunities that Verified Paxful accounts present for businesses looking to venture into the digital currency realm, as companies globally witness heightened profits and expansion. These success stories underline the myriad advantages of Paxful’s user-friendly interface, minimal fees, and robust trading tools, demonstrating its relevance across various sectors.\n\nBusinesses benefit from efficient transaction processing and cost-effective solutions, making Paxful a significant player in facilitating financial operations. Acquire a USA Paxful account effortlessly at a competitive rate from usasmmonline.com and unlock access to a world of possibilities. Buy Verified Paxful Account.\n\nExperience elevated convenience and accessibility through Paxful, where stories of transformation abound. Whether you are an individual seeking seamless transactions or a business eager to tap into a global market, buying old Paxful accounts unveils opportunities for growth.\n\nPaxful’s verified accounts not only offer reliability within the trading community but also serve as a testament to the platform’s ability to empower economic activities worldwide. Join the journey towards expansive possibilities and enhanced financial empowerment with Paxful today. Buy Verified Paxful Account.\n\n \n\nWhy paxful keep the security measures at the top priority?\nIn today’s digital landscape, security stands as a paramount concern for all individuals engaging in online activities, particularly within marketplaces such as Paxful. It is essential for account holders to remain informed about the comprehensive security protocols that are in place to safeguard their information.\n\nSafeguarding your Paxful account is imperative to guaranteeing the safety and security of your transactions. Two essential security components, Two-Factor Authentication and Routine Security Audits, serve as the pillars fortifying this shield of protection, ensuring a secure and trustworthy user experience for all. Buy Verified Paxful Account.\n\nConclusion\nInvesting in Bitcoin offers various avenues, and among those, utilizing a Paxful account has emerged as a favored option. Paxful, an esteemed online marketplace, enables users to engage in buying and selling Bitcoin. Buy Verified Paxful Account.\n\nThe initial step involves creating an account on Paxful and completing the verification process to ensure identity authentication. Subsequently, users gain access to a diverse range of offers from fellow users on the platform. Once a suitable proposal captures your interest, you can proceed to initiate a trade with the respective user, opening the doors to a seamless Bitcoin investing experience.\n\nIn conclusion, when considering the option of purchasing verified Paxful accounts, exercising caution and conducting thorough due diligence is of utmost importance. It is highly recommended to seek reputable sources and diligently research the seller’s history and reviews before making any transactions.\n\nMoreover, it is crucial to familiarize oneself with the terms and conditions outlined by Paxful regarding account verification, bearing in mind the potential consequences of violating those terms. By adhering to these guidelines, individuals can ensure a secure and reliable experience when engaging in such transactions. Buy Verified Paxful Account.\n\nContact Us / 24 Hours Reply\nTelegram:dmhelpshop\nWhatsApp: +1 ‪(980) 277-2786\nSkype:dmhelpshop\nEmail:dmhelpshop@gmail.com\n\n \n\n"
fosin60384
1,866,935
Mastering Regex: From Beginner to Expert in Find and Replace
Welcome to the world of Regex! If you’ve ever found yourself frustrated with manually searching...
0
2024-05-27T20:42:25
https://dev.to/silverindigo/mastering-regex-from-beginner-to-expert-in-find-and-replace-4350
regex, pattern, search
Welcome to the world of Regex! If you’ve ever found yourself frustrated with manually searching through large blocks of text or painstakingly replacing similar patterns one by one, Regex is here to save the day. In this article, we’ll take you on a journey from the very basics of Regex to advanced techniques, empowering you to wield this powerful tool like a pro in your find and replace operations. Regex, short for Regular Expressions, is like a secret code language for finding and manipulating text patterns within strings of characters. At its core, Regex allows you to define a search pattern and then use that pattern to search, find, and replace text in a highly efficient and flexible manner. Let’s break down the basics of Regex: - **Definition:** Regex is a sequence of characters that define a search pattern. - **How It Works:** Regex engines scan through text looking for patterns that match the specified sequence of characters. - **Basic Syntax:** Regex patterns consist of ordinary characters (like letters and digits) and special characters (called metacharacters) that have special meanings. For example, the pattern \d{3}-\d{3}-\d{4} matches phone numbers in the format XXX-XXX-XXXX, where X represents a digit. Now that you understand the basics, let’s put Regex to work! Whether you’re using a text editor like Notepad++, Sublime Text, or even programming languages like Python or JavaScript, Regex can be integrated seamlessly into your workflow. Beginner-friendly tasks you can accomplish with Regex include searching, finding and replacing, and avoiding common mistakes. As you become more comfortable with Regex, it’s time to level up your skills! Dive deeper into the syntax and explore more complex patterns to tackle even trickier tasks. Some advanced concepts to explore include meta-characters and quantifiers, character classes and groups, and intermediate patterns. To truly master Regex, you’ll want to add some tricks to your toolbox. Here are a few tips to take your skills to the next level: - **Anchors for Precise Matches:** Use anchors like ^ and $ to ensure your pattern matches the beginning or end of a line. - **Lookaheads and Lookbehinds:** Employ these advanced techniques to make assertions about what comes before or after a match without including it in the result. - **Optimizing Performance:** Keep your Regex patterns efficient by avoiding unnecessary backtracking and using non-greedy quantifiers whenever possible. - **Resources for Further Learning:** Explore online tutorials, cheat sheets, and interactive Regex testers to deepen your understanding and expand your repertoire of patterns. Ready to take your Regex skills to the next level? Consider hiring a [Regex expert on Fiverr](https://www.fiverr.com/silverindigo/write-regular-expression-or-regex-pattern-in-any-language)! Whether you need personalized assistance with crafting complex patterns, troubleshooting tricky issues, or optimizing your Regex performance, there’s a freelancer ready to help you conquer any Regex challenge. Congratulations! You’ve unlocked the power of Regex and are now equipped to tackle any find and replace task with confidence. Remember, practice makes perfect, so don’t hesitate to experiment with different patterns and techniques to find what works best for you. And if you ever find yourself stuck or in need of guidance, the Regex community is always here to help. Happy Regex-ing!
silverindigo
1,866,934
Keml: Empowering UI Development, One Developer at a Time
Hey Fellow Developers, I'm thrilled to introduce you to Keml – a small yet mighty alternative to...
0
2024-05-27T20:41:31
https://dev.to/thealjey/keml-empowering-ui-development-one-developer-at-a-time-4e1n
Hey Fellow Developers, I'm thrilled to introduce you to Keml – a small yet mighty alternative to HTMX that's poised to change the game in UI development. And the best part? It's crafted and maintained by just one person (that's me!). Here's why Keml deserves a spot in your toolkit: ### 1. Versatile Integration, Zero Hassle 🛠️ With Keml, you're not tied down to a specific server-side stack. Whether you're rocking Node.js, PHP, Java, Python, or C#, Keml plays nice with them all. And guess what? Your server doesn't even need to know it's rendering Keml syntax – it's just standard HTML with a dash of extra custom attributes. Seamless integration, zero headaches. ### 2. Simplify UI Building with HTML-Extended Syntax 🏗️ Say goodbye to cumbersome JavaScript coding! Keml's magic lies in its extended HTML syntax, designed to make UI development a breeze. Build highly interactive user interfaces directly within your HTML markup, no complicated scripts required. ### 3. Performance, Flexibility, Simplicity – All in One 🚀 Keml isn't just about features; it's about delivering lightning-fast user experiences without the complexity. Think of it as your trusty sidekick, prioritizing performance, flexibility, and above all, simplicity. And since it's a one-person endeavor, your feedback and contributions carry extra weight in shaping Keml's future. ### 4. Early Stage Development, Honest Disclaimer 🚧 Let's keep it real – Keml is still in its early stages of development. Bugs might pop up here and there, but with your help, we'll squash them in no time. Your input matters more than ever as we refine Keml and pave the way for smoother UI development. ### 5. Dive into Keml Today 🎨 Ready to experience Keml firsthand? It's as easy as: ```html <!-- "install" the library --> <script src="https://unpkg.com/keml"></script> <!-- initiate an action --> <button on:click="updateCounter"> Click me! </button> <!-- send a post request on action --> <div on="updateCounter" post="/increment" result="counterValue" ></div> <!-- render responses --> <p> Here we have the value of counter: <span render="counterValue"></span>. And here it is again, but smaller: <small render="counterValue"></small> ;) </p> ``` Join me on this journey to simplify UI development, one line of code at a time. Have questions, feedback, or just want to say hi? Connect with me on GitHub. I'm all ears! Embrace simplicity with Keml – your partner in effortless UI magic! ✨ This article was written with the help of ChatGPT. But, after reading and re-reading it a few dozen times, I realize that it perfectly and concisely formulates my own thoughts better than I, probably, ever could by myself without a great number of revisions and tweaks. Cheers, https://github.com/thealjey/keml
thealjey
1,866,933
Avoiding the pitfalls of Architecture Astronautics
Exegi Monumentum I’ve crafted software more lasting than bronze, Loftier than pyramids,...
0
2024-05-27T20:38:38
https://swiderski.tech/2024-05-14-architecture-astronautics/
softwareengineering, overengineering, pragmatic, architecture
## Exegi Monumentum > I’ve crafted software more lasting than bronze, > Loftier than pyramids, resilient and strong, _Paraphrase of Horace's 'Exegi Monumentum' poem._ Have you ever felt that way about your code? You've just created a piece of engineering art, not just some working solution that meets the requirements. You didn't even look at the requirements, who needs them when you can focus on technology and architecture? Utilizing modern tech and approaches you've heard about at conferences and meetups. Following complex patterns and designs to handle the Facebook and Netflix scale of users and processes. Every concept is abstracted, so much, you don't even see the code anymore, just interfaces. Testable code, with injected dependencies, following DDD religiously. While it sounds nice, you may be an Architecture Astronaut, as [Joel Spolsky](https://www.joelonsoftware.com/2001/04/21/dont-let-architecture-astronauts-scare-you/) wrote in 2001. You went so far up with abstractions, generalizations, and new flashy tech, that there is no oxygen around you anymore. Yup, this is nothing new. We engineers have always been like this to some extent. > Software architecture is a set of decisions made for a particular product, shaping its form. Not just code organization, but the tools used, how they communicate, and where they exist. ### Visual aid In the '90s, Poland saw a wave of new building designs. The communism period has ended, and we were opened for new, western technologies, materials, designs, and money to build somewhat interesting structures. Like this monstrosity: ![Solpol building in Wrocław, Poland](https://swiderski.tech/assets/posts/solpol.jpg) _Solpol building in Wrocław, Poland_ Over-the-top form dominates the function. It was demolished in 2022. It looks like a toddler that just learned 3 basic shapes wanted to put all of them at the same time everywhere. Reminds me of hype-ego-cv-driven overengineered software design. On the other hand, we have: !["Okrąglak" building in Poznań, Poland](https://swiderski.tech/assets/posts/okraglak.jpg) _"Okrąglak" building in Poznań, Poland_ It was finished in 1954. Simple form, repeatable shapes. Elegant. Still serves people (in a different role than originally) and it is a city landmark. Just like simple, pragmatic architecture, that can serve its purpose for years, and is adaptable to needs. ## The pitfalls As Architecture Astronaut, you take deep pride in your work and try to deliver a great piece of software. No doubt here. But in the process, you may lose sight of what and why you are building. ### Tool hunger and overengineering You don't build software to use Kafka (put any other tool here), you use Kafka to provide better products. And you may not even need it in the first place. The same goes for every other tech, design pattern, and methodics. We often fall into bias, when we learn a new tool and now every place seems perfect to use it. The golden hammer, where everything is a nail. And while new tools often solve some problems, they come with a bundle of new ones you just haven't experienced yet. It's a hidden cost of using hyped technology. You know the term "cure worse than disease"? Greenfield projects are especially vulnerable. After working on legacy code, you might be eager to try new fancy stuff. Instead of the simple CRUD, you were asked for, you build a lofty bronze piece of art. Pet projects can help release your unused creativity, and test new tools outside of work projects. The sad truth about being a professional software engineer is that we rarely do interesting things. Or so it seems after some years of practice. Using too many similar tools in a single project is also problematic. Testing is a gray area. In Java/Kotlin it's not rare to see 3 mocking libraries in one project. Added because one could do something cool that others do weirdly. Or Cucumber for e2e tests, because non-programmers can then write those, but they never do. You end up with additional tools to learn and maintain instead of having pure code tests using the same language everywhere. Overcomplicating, overabstracting, and overengineering will make you an astronaut. Expecting unforeseen use cases for your code, making it as generic and reusable as possible. Or following "Clean Code" religiously can obfuscate readability. Using modern but unnecessary design patterns adds useless layers of abstraction. Having explicit boundaries between modules, and keeping dependencies between them straightforward is nice. But a simple app with 20+ Gradle modules, where half of them contain just 2 classes and an interface, is worth it. Especially when a simple change (like adding a field) is spreading across multiple modules each time. Try onboarding a junior dev or intern into such a project. > I've heard once about adding fake layers to the project, because after the initial solution was presented the client was under the impression that "this is too simple, it won't work in our complex situation". So the consultants designed a few pass-through layers so it looked more like the client would like :D can anyone confirm or deny this is happening? ### Big architecture upfront is a waste In CS class, we designed software using some UML tools that generated code. The professor believed this was the future. But 15 years later, I still write code, but I rarely see UML. Diagrams are useful for general concepts but not strict UML notation. Designing the whole system first and coding it later was the old mindset. It probably made more sense when you had to put your code on the perforated cards, which was an annoying and time-consuming process. But now? With automated tests, debuggers, and refactoring tools? There is a nice part of [The Primeagen interview with Uncle Bob](https://www.youtube.com/watch?v=UBXXw2JSloo), where they touch on this. Robert Martin would seem like old old-fashioned "design first" kind of guy, but actually, he is much more practical. He knows it doesn't work. What he does, is think about the problem to solve for a while and then start implementation. And often implementation ends up as something different from the initial idea. Big design upfront can't be right, because you don't know what you don't know. Gathering all intel is time-consuming, and keeping everything in the context when designing is impossible. Implementation will twist and bend the actual working solution into the frame of the initial design. Your time is a resource. Building unnecessarily complicated architecture wastes it. Sometimes, MVP won't meet market needs and will be scraped. [Minimum Viable Architecture](https://www.infoq.com/articles/minimum-viable-architecture/), answers: what is the minimum set of architecture decisions to make this MVP work now and scale later? If you don't know you will need to work on a huge scale, why waste efforts supporting it upfront? ### Perfectionism Combining all of the above and adding perfectionism you may never actually release a product. Constantly rewriting, redesigning, and reimplementing the ideal solution. Discovering new requirements breaks the design. You need to create a new, equally big upfront design. Or even worse, production doesn't perform as expected, and you start over. I was working as an Android developer, on the Backend For Frontend service, serving data from some ERP to the app. Glorified proxy as I called it :) Service was simple, it had 3 layers: HTTP Controller, Service, and External API Client. No DB, or any sort of persistence or cache (which was a mistake IMO). At some point, I started to hate that the Service layer was throwing HTTP exceptions, rather than domain-specific errors, that later the HTTP layer would translate to statuses and error messages. So I implemented a bunch of custom exceptions, handling them in ExceptionHandler (we used Spring), and I had to rewrite a few tests. Effect? Well, it worked the same. There was more code, but it was cleaner. The service layer became so independent that I could even move it to an Android or desktop app using UI and not HTTP responses. But from a time perspective, I think it was a waste of time, in a way. The project had a fixed scope and was almost done. The code was testable before and was tested. So I minimized the already small cognitive load while adding indirect mapping of exceptions to status codes... which may raise the cognitive load. I've created concrete boundaries between layers, so the code was more testable, while it was already testable. I enabled moving code to other services or apps, while it was never going to happen. My changes allowed faster and more secure growth of the service, while it was already feature-wise done. And if I were about to do it now, I think I still would, but using Kotlin `Result` instead of throwing exceptions. Guilty as charged. ## Creating practical architecture Well, every project needs some sort of architecture. Some decisions have to be made, some structure has to exist. Here are a few ways to approach it. ### Use familiar tools The best tool for the job is the one you know best. Remember that [some dude made a 3D rollercoaster in Excel](https://www.youtube.com/watch?v=5IOB2NKTOS0). It might not be the ultimate best tool, but it was the one he knew most. Pick whatever the team is comfortable with, not what is currently hyped. I've heard about MongoDB used as relational DB, because NoSQL is cool and seems to be a good fit, but the team was familiar only with SQL databases. If your team knows TypeScript well, maybe don't go with Scala or Lisp just because someone suggested it's great. ### Follow industry standards When solving common problems, use common solutions. Your problem is likely 95% the same as every other (CRUD, auth, logging, DBs, message queues). Use tools with good community support, most problems solved on StackOverflow, and decent tooling. Experimenting with new technologies is refreshing, but don't experiment on every part of your system. Even if the project is Proof of Concept, keep it focused. Each problem may have multiple common solutions, narrow it down with team capabilities and... ### Define Architectural Drivers Start from describing QARs, and finding the architectural drivers. Knowing what is important and what is not helps pick the right tools. Set requirements for security, performance, and reliability. There are some more ideas about architecture design pitfalls in [this post](https://www.infoq.com/articles/avoid-architecture-pitfalls/) I like to keep the design as minimal, obvious, simple, and flexible as possible. The more custom structures, naming conventions, and rules you put into your project, the more likely developers will diverge from the "ultimate" architecture design you've crafted. ## Conclusion Crafting software architecture is a balancing act between innovation and practicality. While it's tempting to dive into the latest tech and complex designs, staying grounded in the project's core goals is crucial. Overengineering, tool obsession, and perfectionism can derail even the best intentions. Instead, focus on simplicity, team capabilities, and actual user needs. Remember, the best architecture serves its purpose efficiently without unnecessary complexity. Stay pragmatic, use what works, and always keep the end-user in mind. This approach not only ensures functionality but also makes your code maintainable and adaptable for the future. --- What’s your biggest challenge in software architecture? Share your thoughts in the comments!
asvid
1,866,932
Unlocking the Power of YOLOv10: Step-by-Step Guide with Real-World Examples
Introduction In the rapidly evolving field of computer vision, YOLO (You Only Look Once)...
0
2024-05-27T20:38:08
https://dev.to/tarek_eissa/unlocking-the-power-of-yolov10-step-by-step-guide-with-real-world-examples-1lp7
webdev, deeplearning, datascience, beginners
## Introduction In the rapidly evolving field of computer vision, YOLO (You Only Look Once) models have consistently stood out for their remarkable balance between computational cost and detection performance. YOLOv10, the latest iteration, addresses key inefficiencies and introduces a slew of innovations, making it a game-changer for real-time object detection. This guide will walk you through the significant improvements in YOLOv10, provide a comparison with older YOLO versions and other models, and offer step-by-step instructions to implement object detection and region counting projects using YOLOv10. --- ## Table of Contents 1. [Comparing YOLOv10 to Previous Versions and Other Models](#comparing-yolov10-to-previous-versions-and-other-models) 2. [Setup](#setup) 3. Example 1: Object Detection with YOLOv10 ![alt] (https://miro.medium.com/v2/resize:fit:1000/format:webp/1*Bo6lga5VP5e4o_G6uJ-U-Q.gif) 4. Example 2: Region Counting Using YOLOv10 ![alt] (https://miro.medium.com/v2/resize:fit:1024/format:webp/1*SRaSQOtg-J8FU6EEq2YJYg.gif) --- ## Comparing YOLOv10 to Previous Versions and Other Models ### Academic Perspective YOLO models are popular in real-time object detection for their balance between computational cost and detection performance. Over the years, researchers have improved their designs, objectives, and data strategies, but reliance on non-maximum suppression increases latency and hinders end-to-end deployment. Various YOLO components have inefficiencies that limit their capability. #### YOLOv10 Improvements YOLOv10 addresses these issues with NMS-free training for lower latency and an efficiency-accuracy driven design strategy. The authors introduced consistent dual assignments for NMS-free training, which simultaneously achieves competitive performance and low inference latency. They also proposed a holistic efficiency-accuracy driven model design strategy, optimizing various YOLO components from both efficiency and accuracy perspectives. This reduces computational overhead and enhances performance. #### Performance Comparison Experiments show YOLOv10 achieves state-of-the-art performance and efficiency. For example, YOLOv10-S is 1.8 times faster than RT-DETR-R18 with similar accuracy and has fewer parameters and FLOPs. Compared to YOLOv9-C, YOLOv10-B has 46% less latency and 25% fewer parameters for the same performance. ### Visualization Here are visual comparisons of YOLOv10 with previous YOLO versions and other models in terms of latency and number of parameters: ![Figure 1: Comparisons with others in terms of latency-accuracy (left) and size-accuracy (right) trade-offs. We measure the end-to-end latency using the official pre-trained models. ](https://miro.medium.com/v2/resize:fit:1152/format:webp/1*BTzgE5EpUH4s9yIXyzvr_g.png) ![Figure 1: Comparisons with others in terms of number of parameters (left) and size-accuracy (right) trade-offs. We measure the end-to-end latency using the official pre-trained models. ](https://miro.medium.com/v2/resize:fit:1152/format:webp/1*p1mcgSG-ZjvZuTk87Hq2tA.png) --- ## Setup Before diving into the examples, let's ensure we have the necessary setup. We'll start by installing the required libraries. ### Step 1: Install the Required Libraries ```sh # Clone ultralytics repo git clone https://github.com/ultralytics/ultralytics # cd to local directory cd ultralytics # Install dependencies pip install -r requirements.txt ``` --- ## Example 1: Object Detection with YOLOv10 Object detection is a fundamental task in computer vision. YOLOv10 enhances this by eliminating the need for non-maximum suppression (NMS) during inference, leading to lower latency and improved performance. ### Step-by-Step Implementation 1. **Setup** ```python import cv2 import numpy as np from ultralytics import YOLO # Load YOLOv10 model model = YOLO('yolov10.pt') # Path to the video file video_path = 'path/to/your/video.mp4' cap = cv2.VideoCapture(video_path) ``` 2. **Process Video Frames** ```python while cap.isOpened(): ret, frame = cap.read() if not ret: break # Perform object detection results = model(frame) # Draw bounding boxes for result in results: boxes = result['boxes'] for box in boxes: x1, y1, x2, y2 = box['coords'] label = box['label'] confidence = box['confidence'] cv2.rectangle(frame, (x1, y1), (x2, y2), (0, 255, 0), 2) cv2.putText(frame, f'{label} {confidence:.2f}', (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2) # Display the frame cv2.imshow('YOLOv10 Object Detection', frame) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows() ``` --- ## Example 2: Region Counting Using YOLOv10 Region counting allows for tallying objects within specified areas, providing valuable insights in various applications such as surveillance and traffic monitoring. This example demonstrates how to count objects in defined regions using YOLOv10. ### Step-by-Step Implementation 1. **Define Regions and Setup Model** ```python from shapely.geometry import Polygon, Point # Define counting regions counting_regions = [ { "name": "Region 1", "polygon": Polygon([(50, 80), (250, 20), (450, 80), (400, 350), (100, 350)]), "counts": 0, "color": (255, 0, 0) }, { "name": "Region 2", "polygon": Polygon([(200, 250), (440, 250), (440, 550), (200, 550)]), "counts": 0, "color": (0, 255, 0) }, ] model = YOLO('yolov10.pt') ``` 2. **Process Video and Count Objects in Regions** ```python cap = cv2.VideoCapture('path/to/your/video.mp4') while cap.isOpened(): ret, frame = cap.read() if not ret: break # Perform object detection results = model(frame) # Draw regions for region in counting_regions: points = np.array(region["polygon"].exterior.coords, dtype=np.int32) cv2.polylines(frame, [points], isClosed=True, color=region["color"], thickness=2) region["counts"] = 0 # Reset counts for each frame # Count objects in regions for result in results: boxes = result['boxes'] for box in boxes: x1, y1, x2, y2 = box['coords'] center = Point((x1 + x2) / 2, (y1 + y2) / 2) for region in counting_regions: if region["polygon"].contains(center): region["counts"] += 1 # Display counts for region in counting_regions: text = f'{region["name"]}: {region["counts"]}' cv2.putText(frame, text, (int(region["polygon"].centroid.x), int(region["polygon"].centroid.y)), cv2.FONT_HERSHEY_SIMPLEX, 0.5, region["color"], 2) # Display the frame cv2.imshow('YOLOv10 Region Counting', frame) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows() ``` --- ## Community Support For more information, you can explore [Ultralytics YOLOv10 Docs](https://docs.ultralytics.com/). **Ultralytics Resources:** - [Discord Community](https://ultralytics.com/discord) **YOLOv10 Resources:** - [GitHub](https://github.com/ultralytics/ultralytics) - [Docs](https://docs.ultralytics.com/)
tarek_eissa
1,866,931
Recursos para Design com estilo "brasileiro" - de Cordel
Boa tarde, galera linda. No momento, estou trabalhando no site de um projeto artístico que segue as...
0
2024-05-27T20:34:50
https://dev.to/isa56/recursos-para-design-com-estilo-brasileiro-de-cordel-4ldg
braziliandevs, frontend, webdev, design
Boa tarde, galera linda. No momento, estou trabalhando no site de um projeto artístico que segue as gravuras de corde, então seria ótimo encontrar algo assim para usar no design do site (eu sou freelancer e solo). Vim perguntar se existe algum tipo de icon pack ou ilustrações pra uso em website no estilo de literatura de cordel ou gravura, ou mesmo que represente um pouquinho mais as culturas brasileiras do que um ícone corporativo genérico, ou se esse tipo de coisa teria que ser comissionado. Também, qualquer tipo de icon pack que vá pra um lado mais artístico que vocês recomendem. Obrigada!
isa56
1,866,930
DNS Sunucuları: İnternetin Gizli Kahramanları
[Domain Name System (DNS) sunucuları, internetin işleyişinde kritik bir rol oynayan altyapı...
0
2024-05-27T20:33:18
https://dev.to/teknikbilimler/dns-sunuculari-internetin-gizli-kahramanlari-ck9
dns, computerscience, internet, webdev
[[**Domain Name System (DNS) sunucuları,** internetin işleyişinde kritik bir rol oynayan altyapı bileşenleridir. Temel işlevleri, kullanıcıların adres çubuğu kısmına yazdıkları alan adlarını (örneğin, www.example.com) IP adreslerine (örneğin, 192.168.168.1) çevirmektir. Bu süreç, internet üzerinde ki cihazların birbirleriyle bağlanmasına ve böylelikle iletişim kurabilmelerini sağlar.](https://www.milleni.com.tr/blog/teknik/dns-nedir) [DNS sunucuları 4 ana türde sınıflandırılabilir: Kök DNS sunucuları, Üst Düzey Etki Alanı (TLD) sunucuları, Yetkili DNS sunucuları ve Özyinelemeli (recursive) DNS sunucuları. Kök DNS Sunucuları: Tüm DNS sorgularının başladığı yerdir ve Dünya çapında 13 kök sunucu bulunmaktadır. TLD Sunucuları: Bu sunucular, .com, .org gibi üst düzey etki alanlarının yönetiminden sorumludur. Yetkili DNS Sunucuları: Belirli bir alan adının IP adresi bilgilerini barındırıp tutar. Özyinelemeli DNS Sunucuları: Bu DNS sunucuları kullanıcı sorgularını alır, gerekli bilgiyi bulana kadar diğer DNS sunucularına başvurarak en sonunda kullanıcıya geri döner.](https://wisnet.com.tr/dns-sunuculari-turleri-ve-gorevleri/) DNS sunucularının güvenliği, internet güvenliği açısından büyük bir öneme sahip olup, korunması neredeyse zorunlu hale gelmiştir. DNS önbellek zehirlenmesi (cache poisoning) ve dağıtılmış hizmet reddi (DDoS) saldırıları gibi tehditler, DNS altyapısına zarar verebilir ve bu yüzden DNSSEC (DNS Security Extensions) gibi güvenlik protokolleri geliştirilerek korunması açısından önemli adımlar atılmıştır. DNSSEC, DNS yanıtlarının doğruluğunu ve bütünlüğünü doğrulamak için dijital imzalar kullanır. DNS sunucularının preformansı da kritik bir unsur olarak nitelendirilebilir. Yük dengeleme ve önbellekleme teknikleri, DNS sorgularının hızlı ve verimli bir şekilde yanıtlanmasını sağlar.Önbellekleme, sık kullanılan DNS sorgularının sonuçlarının belirli bir süre boyunca saklanmasıyla, aynı sorgunun tekrar yapılması durumunda daha hızlı yanıt alınmasını sağlar.Yük dengeleme ise, DNS sorgularının birden fazla sunucuya dağıtılarak, herhangi bir sunucunun aşırı yüklenmesini engeller. _**Sonuç:**_ [ DNS sunucuları internetin temel ve kritik yapı taşlarından biridir. Kullanıcıların sorunsuz ve hızlı bir kullanım yaşayabilmesi için bu sunucuların korunması ve performansı sürekli olarak dikkat edilmeli ve geliştirilmelidir.DNS, karmaşık yapısı ve kritik önemi ile internetin görünmez kahramanlarından birisidir. ](https://www.hosting.com.tr/blog/dns/) 1)DNS sunucularının temel işlevi nedir? A) Web sitelerinin hızını artırmak B) Kullanıcıların alan adlarını IP adreslerine çevirmek C) İnternet bağlantısını kesintisiz sağlamak D) E-postaların güvenliğini sağlamak 2)Aşağıdakilerden hangisi bir DNS sunucusu türü değildir? A) Kök DNS sunucuları B) TLD sunucuları C) Yetkili DNS sunucuları D) Önbellek sunucuları 3)DNSSEC'in temel amacı nedir? A) DNS sunucularının hızını artırmak B) DNS yanıtlarının doğruluğunu ve bütünlüğünü doğrulamak C) DNS sorgularını önbelleğe almak D) DNS sunucularını yük dengeleme ile optimize etmek 4)Yük dengeleme ve önbellekleme tekniklerinin DNS sunucuları açısından önemi nedir? A) İnternetin genel hızını artırmak B) DNS sorgularının hızlı ve verimli bir şekilde yanıtlanmasını sağlamak C) DNS sunucularının güvenliğini artırmak D) DNS sunucularının maliyetini düşürmek 5)DNS önbellek zehirlenmesi (cache poisoning) ve DDoS saldırıları hangi açıdan DNS sunucuları için tehdit oluşturur? A) DNS sunucularının performansını düşürür B) DNS sunucularının güvenliğini tehlikeye atar C) DNS sunucularının maliyetini artırır D) DNS sunucularının fiziksel zarar görmesine neden olur
bekirr_delikanl_7a2e83cd
1,866,929
Profylix
Hey everyone, I'm a 17-year-old developer and I've been working on something cool called Profylix....
0
2024-05-27T20:25:18
https://dev.to/xgaming300/profylix-p55
webdev, beginners, testing, demo
Hey everyone, I'm a 17-year-old developer and I've been working on something cool called Profylix. It's basically a platform where you can create your own awesome profiles to show off who you are, what you're into, and what you've achieved. Why Profylix? Customization: Make your profile totally you! Connection: Share it with others and make new connections. Visibility: Stand out from the crowd with a profile that's uniquely yours. I'd love to hear what you think! If you're interested, you can sign up for early access and share your thoughts here: https://shadowgames.ca/profylix Thanks a bunch for any support and feedback! 🙌
xgaming300
1,866,928
Validation With Yup!. Did You Know This Method ?
Hi Devs... Are you following the basic method to validate the forms in React JS. Did you know this...
0
2024-05-27T20:24:21
https://dev.to/sajithpj/validation-with-yup-did-you-know-this-method--5h8
javascript, learning, reactjsdevelopment, frontend
Hi Devs... Are you following the basic method to validate the forms in React JS. Did you know this method to validate the forms? **Let's Explore🙌** ## Before We Start Be ready with your React JS project with a form and install [Yup](https://www.npmjs.com/package/yup) to validate the form. Confused??, No worries. **Step 1: Installing React JS** I am going with vite to install the React JS. Simply run the following command to install React JS. ``` npm create vite@latest my-react-app --template react ``` *replace the my-react-app with your project name. change the directory to the project folder. ``` cd my-react-app ``` Install the required dependencies by running ``` npm install ``` **Step 2: Installing Yup** Yup is a JavaScript schema builder for value parsing and validation. It is often used to validate data structures such as objects and arrays, ensuring that they conform to specified formats and constraints. Yup is particularly popular in conjunction with form libraries like Formik for handling form validation in React applications. Install the Yup using the following command ``` npm install yup ``` As we are only learning the validation method here, I am not going for a detailed explanation of Yup. if you are new to the Yup, here is [docs for Yup](https://www.npmjs.com/package/yup). **Step 3: Set up a form** I am creating my form inside App.jsx and Here it is. ``` import { useState } from "react"; const App = () => { const [isPasswordHide, setIsPasswordHide] = useState(true); const [loginDetails, setLoginDetails] = useState({ email: "", password: "", }); const toggleType = () => setIsPasswordHide(!isPasswordHide); const handleChange = (event) => { setLoginDetails({ ...loginDetails, [event.target.name]: event.target.value, }); }; const handleLogin = (event) => { event.preventDefault() // Submit the form }; return ( <div className="w-full h-screen flex justify-center items-center "> <div className="w-[500px] h-[555px] px-[80px] py-[60px] rounded-[10px] border shadow-black/[12%] shadow-[1px_1px_5px_1px]"> <form onSubmit={handleLogin}> <div className=""> <h1 className="text-[40px] text-text-secondary font-semibold"> Login </h1> <p className=" text-text-secondary/70 tracking-[1.5px] font-medium"> Please Login to your account </p> </div> <div className="mt-[40px]"> <div className="input-container mb-4"> <label htmlFor="" className="label"> Email Address </label> <input type="text" className="input" placeholder="Enter your email" name="email" id="email" onChange={handleChange} value={loginDetails.email} /> </div> <div className="input-container"> <label htmlFor="" className="label"> Password </label> <div className="input " style={{ display: "flex", justifyContent: "space-between", alignItems: "center", }}> <input type={isPasswordHide ? "password" : "text"} placeholder="Enter password" className="outline-none" name="password" id="password" onChange={handleChange} value={loginDetails.password} /> <button type="button" onClick={toggleType}> {isPasswordHide ? "SHOW" : "HIDE"} </button> </div> </div> <button type="submit" className="w-full mt-[60px] py-[12px] px-[12px] bg-[#F76279] text-white rounded-[8px]"> Login </button> </div> </form> </div> </div> ); }; export default App; ``` Never mind the lengthyyy className, Using Tailwind CSS to style. Style your form, make it beautiful as per your creativity🌈. **Cool**😎, We are Good To Go!!!. ## **Validation Starts Here** I am going to create two reusable/common functions, one is for validating the form another is for resetting the errors. Create a folder called `utils` in the `src` directory and create a file `validator.js` inside the `utils`. So, the folder structure will be like this ``` my-react-app/ ├── node_modules/ ├── public/ │ └── index.html ├── src/ │ ├── utils/ │ │ └── validator.js │ ├── App.jsx │ ├── main.jsx │ └── index.css ├── .gitignore ├── index.html ├── package.json ├── vite.config.js └── README.md ``` The `validator.js` will have the following functions ``` const createError = (id, message) => { const errorElementExist = document.querySelector(`#${id}_error`); if (!errorElementExist) { const errorElement = document.createElement("span"); errorElement.id = `${id}_error`; errorElement.className = `error-msg`; errorElement.innerText = message; let inputElment = document.querySelector(`#${id}`); let inputParentElment = document.querySelector(`#${id}`).parentElement; if (!inputParentElment.getAttribute("data-input-parent")) { while ( !inputParentElment.getAttribute("data-input-parent") && inputParentElment !== null && inputParentElment.nodeType === 1 ) { inputParentElment = inputParentElment.parentNode; } } console.log(inputElment); if (inputElment.getAttribute("data-input") === false) { while ( inputElment.getAttribute("data-input") === false && inputElment !== null && inputElment.nodeType === 1 ) { inputElment = inputElment.parentNode; } } inputElment.style.border = "1px solid red" inputParentElment.appendChild(errorElement); } }; export const validate = async ({ validationSchema, value }) => { let errors = {}; try { const result = await validationSchema.validate(value, { abortEarly: false, }); } catch (error) { if (error.name === "ValidationError") { error.inner.forEach((err) => { errors[err.path] = err.message; createError(err.path, err.message); }); } } return { errors, isValid: Object.keys(errors).length === 0 }; }; export const removeError = (id) => { const errorElement = document.querySelector(`#${id}_error`); let inputElment = document.querySelector(`#${id}`); if (inputElment.getAttribute("data-input") === false) { while ( inputElment.getAttribute("data-input") === false && inputElment !== null && inputElment.nodeType === 1 ) { inputElment = inputElment.parentNode; } } // set the border according to your UI inputElment.style.border = "1px solid grey" // remove the span tag with error from the dom if (errorElement) errorElement.remove(); }; ``` ## **Explanation** 1. **validate**: This function will receive one object as parameters, which will have two keys, validationSchema, and value. This function validates the given values against a Yup validation schema and handles the display of error messages. - validationSchema: Yup validation schema object. - value: It is the value to be validated. - It initializes an empty errors object. - It tries to validate the provided values (value) against the validationSchema with abortEarly set to false, meaning it will validate all fields before stopping. - If validation errors occur, it catches the ValidationError and iterates over the errors. - For each error, it adds the error message to the errors object and calls createError to display the error message. - It returns an object containing the errors and a boolean isValid indicating if the validation passed without errors. 2. **createError**: This function displays an error message next to a form field when a validation error occurs. - It first checks if an error message element already exists for the given field ID. If it doesn't, it creates a new <span> element. - It sets the id and className of the new error element, and its inner text to the provided error message. - It then finds the input element and its parent element. If the parent element does not have the attribute data-input-parent, it traverses up the DOM tree until it finds an element with this attribute. - If the input element does not have the attribute data-input set to false, it also traverses up the DOM tree until it finds an appropriate element. - Finally, it appends the error message element to the parent element of the input field. 3.**removeError**: This function removes the error message associated with a specific form field. - It selects the error message element for the given field ID. - It finds the input element and traverses up the DOM tree if necessary to find an element with the class input. - It sets the data-invalid attribute of the input element to false, marking it as valid. - It removes the error message element if it exists. So, These three functions will help you to validate the values. Now, the question is... ## **How to use it with form** We need to import and call the valid validate method inside the onSubmit and call the removeError, inside the handleChange. And the component will look like this. ``` import { useState } from "react"; import { validate, removeError } from "./utils/validation"; import { object, string } from "yup"; const App = () => { const [isPasswordHide, setIsPasswordHide] = useState(true); const [loginDetails, setLoginDetails] = useState({ email: "", password: "", }); const toggleType = () => setIsPasswordHide(!isPasswordHide); const handleChange = (event) => { setLoginDetails({ ...loginDetails, [event.target.name]: event.target.value, }); removeError(event.target.id) }; let loginValidationSchema = object().shape({ email: string() .required("User ID is required") .email("Please enter a valid email address"), password: string().required("Required"), }); // onSudmit const handleLogin = async (event) => { event.preventDefault(); // Submit the form const { errors, isValid } = await validate({ validationSchema: loginValidationSchema, value: loginDetails, }); // errors, isValid can be used to control the submission of form console.log(errors); if(!isValid) return; // api call or any logic }; return ( <div className="w-full h-screen flex justify-center items-center "> <div className="w-[500px] h-[555px] px-[80px] py-[60px] rounded-[10px] border shadow-black/[12%] shadow-[1px_1px_5px_1px]"> <form onSubmit={handleLogin}> <div className=""> <h1 className="text-[40px] text-text-secondary font-semibold"> Login </h1> <p className=" text-text-secondary/70 tracking-[1.5px] font-medium"> Please Login to your account </p> </div> <div className="mt-[40px]"> <div className="input-container mb-4" data-input-parent="true"> <label htmlFor="" className="label"> Email Address </label> <input type="text" className="input" placeholder="Enter your email" name="email" id="email" onChange={handleChange} value={loginDetails.email} /> </div> <div className="input-container" data-input-parent="true"> <label htmlFor="" className="label"> Password </label> <div className="input " style={{ display: "flex", justifyContent: "space-between", alignItems: "center", }} data-input="true" > <input type={isPasswordHide ? "password" : "text"} placeholder="Enter password" className="outline-none" name="password" id="password" onChange={handleChange} value={loginDetails.password} /> <button type="button" onClick={toggleType}> {isPasswordHide ? "SHOW" : "HIDE"} </button> </div> </div> <button type="submit" className="w-full mt-[60px] py-[12px] px-[12px] bg-[#F76279] text-white rounded-[8px]" > Login </button> </div> </form> </div> </div> ); }; export default App; ``` ## **Conclusion** This will be one of the best methods, to handle the validations of the forms in React JS. You can avoid the copy-pasting & duplication of the code for validation and this method will allow you to reuse the code. And, That is how I used to validate the forms. What about you? ## **About Me** I am Sajith P J, Senior React JS Developer, A JavaScript developer with the entrepreneurial mindset. I combine my experience with the super powers of JavaScript to satisfy your requirements. ## **Reach Me Out ** - [LinkedIn](https://www.linkedin.com/in/sajith-p-j/) - [Instagram](https://www.instagram.com/dev_.sajith/) - [Website](https://sajith.in/) - [Email (sajithpjofficialme@gmail.com)](mailto:sajithpjofficialme@gmail.com) Thanks !!!🙌
sajithpj
1,866,927
Introduction to Dependency Inversion and Dependency Injection with NestJS
Hello everyone, السلام عليكم و رحمة الله و بركاته Today, I will delve into the concepts of...
0
2024-05-27T20:21:30
https://dev.to/bilelsalemdev/introduction-to-dependency-inversion-and-dependency-injection-with-nestjs-2036
nestjs, javascript, webdev, solidprinciples
Hello everyone, السلام عليكم و رحمة الله و بركاته Today, I will delve into the concepts of Dependency Inversion and Dependency Injection, using NestJS as the example framework. These principles are crucial for writing maintainable, testable, and scalable code in modern software development. Let's explore these concepts through an example implementation involving file storage strategies. ### Dependency Inversion Principle (DIP) The Dependency Inversion Principle (DIP) is one of the five SOLID principles of object-oriented design. It states that: 1. High-level modules should not depend on low-level modules. Both should depend on abstractions (e.g., interfaces). 2. Abstractions should not depend on details. Details should depend on abstractions. This principle helps in decoupling the software modules, making the system more modular and easier to maintain. ### Dependency Injection (DI) Dependency Injection is a design pattern that implements DIP. It allows a class to receive its dependencies from an external source rather than creating them itself. This can be done via constructor injection, method injection, or property injection. NestJS supports DI out-of-the-box using decorators. ### Implementing Dependency Injection in NestJS To illustrate these concepts, let's create a file storage system where we can switch between different storage strategies (e.g., Dropbox, Amazon S3) without changing the business logic. #### Step 1: Define an Interface for the Storage Strategy First, we define an interface `IStorageStrategy` that outlines the methods any storage strategy should implement: ```typescript export interface IStorageStrategy { uploadFile(file: Express.Multer.File, req?: Request): Promise<any>; _setAccessToken(): Promise<void>; download(file: string): Promise<Readable>; deleteFile(path: string): Promise<boolean>; getPresignedUrl(filepath: string): Promise<string>; } ``` #### Step 2: Implement the Storage Strategies Next, we implement the interface for different storage providers. Let's start with Dropbox: ```typescript import { Injectable } from '@nestjs/common'; @Injectable() export class DropboxStorageStrategy implements IStorageStrategy { async _setAccessToken(): Promise<void> { // Implement logic to set access token } async uploadFile(file: Express.Multer.File, req?: Request): Promise<any> { // Implement logic to upload file to Dropbox } async download(file: string): Promise<Readable> { // Implement logic to download file from Dropbox } async deleteFile(path: string): Promise<boolean> { // Implement logic to delete file from Dropbox } async getPresignedUrl(filepath: string): Promise<string> { // Implement logic to get presigned URL from Dropbox } } ``` Similarly, you would implement `S3StorageStrategy` for Amazon S3: ```typescript import { Injectable } from '@nestjs/common'; @Injectable() export class S3StorageStrategy implements IStorageStrategy { async _setAccessToken(): Promise<void> { // Implement logic to set access token } async uploadFile(file: Express.Multer.File, req?: Request): Promise<any> { // Implement logic to upload file to S3 } async download(file: string): Promise<Readable> { // Implement logic to download file from S3 } async deleteFile(path: string): Promise<boolean> { // Implement logic to delete file from S3 } async getPresignedUrl(filepath: string): Promise<string> { // Implement logic to get presigned URL from S3 } } ``` #### Step 3: Create a Service that Uses the Storage Strategy We create a service `MulterConfigService` that depends on `IStorageStrategy`. Using DI, we inject the appropriate strategy at runtime: ```typescript import { Injectable, Inject } from '@nestjs/common'; import { MulterModuleOptions } from '@nestjs/platform-express'; import { IStorageStrategy } from './interfaces/storage-strategy.interface'; @Injectable() export class MulterConfigService { constructor( @Inject('STORAGE_STRATEGY') private readonly storageStrategy: IStorageStrategy ) {} createMulterOptions(): MulterModuleOptions { return { storage: this.storageStrategy, // Adjust this line based on actual implementation }; } } ``` #### Step 4: Define Providers Next, we define the providers to inject the correct storage strategy. In this example, we'll use Dropbox by default: ```typescript export const StorageStrategyProvider = [ { provide: 'STORAGE_STRATEGY', useClass: DropboxStorageStrategy, // or S3StorageStrategy }, ]; ``` #### Step 5: Configure the Module Finally, we configure the `AppModule` to include our providers and service: ```typescript import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { MulterConfigService } from './multer-config.service'; import { StorageStrategyProvider } from './storage-strategy.provider'; import { DropboxStorageStrategy } from './strategies/dropbox-storage.strategy'; import { S3StorageStrategy } from './strategies/s3-storage.strategy'; @Module({ imports: [], controllers: [AppController], providers: [ ...StorageStrategyProvider, DropboxStorageStrategy, S3StorageStrategy, MulterConfigService, ], }) export class AppModule {} ``` ### Conclusion By adhering to the Dependency Inversion Principle and using Dependency Injection, we have created a flexible and maintainable system where the storage strategy can be easily swapped out without modifying the core business logic. This makes our application more modular and easier to extend in the future. By following these principles and patterns, you can build robust applications in NestJS that are well-architected and maintainable.
bilelsalemdev
1,866,924
Send Email in PHP Using PHPMailer | Gmail SMTP Phpmailer
In this post, you will learn to send Email in PHP Using PHPMailer | Gmail SMTP Phpmailer and how to...
0
2024-05-27T20:16:28
https://dev.to/hmawebdesign/how-to-receive-email-from-html-form-using-php-1g8n
programming, tutorial, php, email
In this post, you will learn to send Email in PHP Using PHPMailer | Gmail SMTP Phpmailer and how to Receive Emails from HTML forms using PHP. ## What is PHP Mailer? Before we dive into the details, let’s briefly introduce PHP Mailer. PHP Mailer is a robust PHP library that simplifies the process of sending emails through PHP scripts. It offers an intuitive and feature-rich interface for sending plain text and HTML emails, complete with attachments and more. ## Steps – Send HTML Form via PHP Mailer Let’s start with a detailed outline that will guide us to Send HTML Forms via PHP Mailer through this extensive guide. Here are the important steps to Send an HTML Form via PHP Mailer on HTML form submission: 1. Download and install PHP Mailer from GitHub 2. Setup your HTML Contact Form 3. Include PHP Mailer in your HTML code 4. Configure PHP Mailer 5. Process form data to send email 6. Compose the Email 7. Handle Success and Error messages 8. Send the Email 9. Video Tutorial – Send HTML Form via PHP Mailer 10. Now that we have our roadmap, let’s explore each section in detail to Send HTML Forms via PHP Mailer. ## Step-by-Step Video Tutorial: {% embed https://youtu.be/s5E0ekvEH18 %} ## How to Send HTML Form to Email Using PHP Mailer Sending HTML forms via email is a seamless process when you have PHP Mailer at your disposal. Here’s a step-by-step guide to achieving, how to send HTML form via PHP Mailer: ## Prerequisites Before diving into implementation, ensure that you have the following prerequisites in place: **A Web Server with PHP Support:** You’ll need a web server, such as Apache or Google, with PHP support to run your PHP Mailer script. Email Server Access: Ensure you have access to an email server or SMTP server to send emails, such as Gmail. Basic HTML and PHP Knowledge: Familiarize yourself with HTML to create the form and PHP to process it. ## Getting Started Let’s start by downloading PHP Mailer and setting up our HTML form to Send HTML Form via PHP Mailer: **1. Download and install PHP Mailer** Begin by downloading the PHP Mailer library. You can obtain it from the official GitHub repository or use Composer if you prefer package management. To Download the PHP Mailer manually from the GitHub library [Click Here](https://github.com/PHPMailer/PHPMailer)! If you want to install the PHPMailer using Composer. First of all, simply install the [Composer Setup](https://getcomposer.org/) on your computer and run the following command in your terminal: _<u>**composer require phpmailer/phpmailer**</u>_ Alternatively, if you’re not using Composer, you can [download PHPMailer](https://github.com/PHPMailer/PHPMailer/archive/master.zip) as a zip file, and then copy the contents of the PHPMailer folder into one of the include_path directories specified in your PHP configuration and load each class file manually: **2. Set Up Your HTML Form** Create an HTML form on your website where users can submit their information. Ensure that your form fields have appropriate name attributes. ## HTML Form Source Code I have created a simple HTML form to send web form data to email using PHPMailer. I will collect this form data from the user and send it to my email address using PHPMailer. ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact Form</title> <style> body{ background-color: aliceblue;} .contact { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: 1s; } .contact .input-box input, textarea { width: 100%; height: 35px; padding: 20px; letter-spacing: 1px; outline: none; border: 1px solid rgba(0, 0, 0, 0.61); /* border: 2px solid rgb(238, 224, 243); */ border-radius: 5px; margin: 0; margin-bottom: 10px; box-shadow: 0 1px rgba(0, 0, 0, 0.233); resize: none; box-sizing: border-box; } .contact .input-box input:focus { border: 1px solid rgb(0, 128, 255); } .contact .input-box textarea:focus { border: 1px solid dodgerblue; } .contact .input-box textarea { height: 100%; } ::placeholder { color: rgba(0, 0, 0, 0.521); letter-spacing: 0; font-size: 15px; } .contact .submit-btn input { width: 100%; height: 35px; border: none; /* background-color: rgba(17, 135, 253, 0.952); */ border: 1px solid rgb(0, 128, 255); ; background-color: transparent; border-radius: 3px; color: rgb(0, 128, 255); font-size: 20px; font-family: serif; padding: 0 8px; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.116); border-radius: 5px; outline: none; cursor: pointer; transition: 0.3s ease-in-out; } .contact .submit-btn input:hover { background-color: rgb(0, 128, 255); color: white; } h2 { color: rgb(0, 128, 255); text-align: center; font-size: 30px; } </style> </head> <body> <div class="contact"> <h2>Contact Now</h2> <form action="mail.php" method="post"> <div class="input-box"> <input type="text" name="name" placeholder="Your name"> </div> <div class="input-box"> <input type="email" name="email" placeholder="Email Address"> </div> <div class="input-box"> <textarea name="message" cols="25" rows="7" placeholder="Type your message"></textarea> </div> <div class="submit-btn"> <input type="submit" name="send" value="Send Message"> </div> </form> </div> </body> </html> ``` **3. Include PHP Mailer** In your PHP script, include the PHP Mailer library using require or require_once. as shown in the following script: **4. Configure PHP Mailer** Set up PHP Mailer with your email server details, including the SMTP host, username, password, and port. Make sure to use valid credentials and a secure connection. If you are using a Gmail SMTP server, first of all, login to your Gmail ID, turn on 2-step authentication and, generate an App Password. To generate an App Password in your Gmail account **[follow this link](https://myaccount.google.com/apppasswords)**. **5. Process Form Data** In your PHP script, retrieve the form data submitted by the user using $_POST or $_GET, depending on your form’s method attribute. In this tutorial, we have received the following form data from the user: **6. Compose the Email** Use PHP Mailer to compose your email. You can format it as plain text or HTML, depending on your preference. Here is the complete PHPMailer source code to send HTML form via PHP Mailer: ## PHPMailer Source Code Copy the below source code and change the data according to your preferences: ``` <?php //Import PHPMailer classes into the global namespace //These must be at the top of your script, not inside a function use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; //required files require 'phpmailer/src/Exception.php'; require 'phpmailer/src/PHPMailer.php'; require 'phpmailer/src/SMTP.php'; //Create an instance; passing `true` enables exceptions if (isset($_POST["send"])) { $mail = new PHPMailer(true); //Server settings $mail->isSMTP(); //Send using SMTP $mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'your email address'; //SMTP write your email $mail->Password = 'app password'; //SMTP password $mail->SMTPSecure = 'ssl'; //Enable implicit SSL encryption $mail->Port = 465; //Recipients $mail->setFrom( $_POST["email"], $_POST["name"]); // Sender Email and name $mail->addAddress('example@gmail.com'); //Add a recipient email $mail->addReplyTo($_POST["email"], $_POST["name"]); // reply to sender email //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = $_POST["subject"]; // email subject headings $mail->Body = $_POST["message"]; //email message // Success sent message alert $mail->send(); echo " <script> alert('Message was sent successfully!'); document.location.href = 'index.php'; </script> "; } ?> ``` **7. Handle Success and Error messages** Implement error handling to deal with scenarios where the email-sending process might fail. Display a success message to the user upon successful submission. **8. Send the Email** Use the send method to send the email. Ensure to implement error handling to deal with scenarios where the email-sending process might fail. **9. Testing Your Setup** After implementing the above steps, thoroughly test your setup. Submit test data through your HTML form to ensure that emails are being sent correctly to the specified email address. **Conclusion** In conclusion, PHP Mailer is a powerful tool that simplifies the process of sending HTML forms to email addresses. By following the steps outlined in this guide, you can enhance user interaction on your website and efficiently collect user information, feedback, and inquiries. Remember to handle errors gracefully and ensure the security of user data during transmission. Now, let’s address some frequently asked questions (FAQs) related to PHP Mailer and email functionality.
hmawebdesign
1,866,922
Short Overview: Micro-Frontends 🧩
When people talk about Micro-Frontends, the first thing that they would mention is their amazing...
0
2024-05-27T20:03:57
https://dev.to/buildwebcrumbs/short-overview-micro-frontends-2f5i
webdev, javascript, frontend, microservices
When people talk about **Micro-Frontends**, the first thing that they would mention is their amazing power to scale up. They achieve this by splitting services into smaller pieces which cooperate seamlessly. ## Advantages of Micro-Frontends 👍 - **Micro-Frontend** supports strands where teams can realize the subsequent frontend features distinctly making iteration faster. - **Horizontal scalability** in micro frontends aims to empower organizations to expand their frontend architectures by scaling out horizontally. 📈 ## Disvantages of Micro-Frontends 👎 - Micro-frontends can **complicate** the development, maintenance, and building of a website. However, these challenges can be mitigated by using smart designs, tools that aid in automatic deployment and testing, and ensuring clear communication between teams. 📉 - **Dependency management** could be a problem if the teams don't communicate each others. But it can be resolved by estabilishing clear communication channels between teams to discuss updates! 👌 Monolithic applications often encounter challenges with effective scaling. By decomposing the frontend into micro-frontends, advanced logic structures such as lazy loading and **service workers** can be implemented more efficiently. **JavaScript** flexibility allows teams to add a variety of frameworks and libraries, facilitating seamless integration and interoperability between microfrontends. The rich ecosystem of JavaScript tools provides developers with powerful resources to create dynamic and responsive user interfaces.❤️ - Inspired by the book: [**_Building Micro-Frontends Scaling Teams and Projects, Empowering Developers_**.](https://www.amazon.com/Building-Micro-Frontends-Projects-Empowering-Developers/dp/1492082996/ref=sr_1_2?crid=RCBAUE4OKJ0J&dib=eyJ2IjoiMSJ9.0ZJp2IXMP9BkahJYaiHl9ez2Wm6vlnMHRLwunki8JYstYZfM_ukCSBNN1JAldlIqkOUuSa70q6nEYv5Rle1a2vzND0PJ_BEBt_kCHgnNjO9tg-Kp9V1tGAtMW7QtLmY53ZAuOFX4lfXTM2DTu5KCUiwIHGHiERCZ9ehXTueraXmWd4AAl5aP6VkEgs56_BamuYAo7pHw1nb6ceTIouGXkdImZ4fB-y81_da06oyWRY8.601H27Rq2LULtNXKVir3Z3QOGJlbx6ovOrmk3Iny2Bg&dib_tag=se&keywords=micro+frontend&qid=1717013751&sprefix=microfronten,aps,223&sr=8-2) by: _Luca Mezzalira Foreword by Neal Ford_ ## Join Us! So... do you love Javascript and want to contribute to an open-source project? **What are you waiting for?**😁 Head over to [Webcrumbs](https://www.webcrumbs.org/ ) and join a community dedicated to the JavaScript ecosystem for open-source enthusiasts!
m4rcxs
1,866,948
Aprenda Programação De Graça Com 3 Sites Estadunidenses
O setor de programação continua a expandir-se, apresentando uma demanda constante por profissionais...
0
2024-06-23T13:52:09
https://guiadeti.com.br/aprenda-programacao-de-graca-3-sites/
cursogratuito, css, cursosgratuitos, html
--- title: Aprenda Programação De Graça Com 3 Sites Estadunidenses published: true date: 2024-05-27 19:58:56 UTC tags: CursoGratuito,css,cursosgratuitos,html canonical_url: https://guiadeti.com.br/aprenda-programacao-de-graca-3-sites/ --- O setor de programação continua a expandir-se, apresentando uma demanda constante por profissionais qualificados. Tendo o objetivo de apoiar aqueles que desejam ingressar ou avançar nessa área dinâmica, reunimos uma lista de três plataformas educacionais estadunidenses onde você pode aprender e praticar programação sem nenhum custo. Este guia inclui o The Odin Project, que oferece um currículo completo de desenvolvimento full stack suportado por uma comunidade de código aberto. Destacamos também a Codecademy, que disponibiliza uma variedade de cursos gratuitos abrangendo linguagens como JavaScript, Python, C#, e HTML. Por fim, a Sololearn oferta recursos para aprender Java, C++, CSS, entre outros. É uma excelente oportunidade para começar a sua jornada educacional em programação imediatamente! ## 3 Sites Estadunidenses Para Estudar Programação O mercado de programação está em constante expansão e busca incessantemente por profissionais altamente qualificados. Para auxiliar aqueles interessados em entrar ou progredir na área, compilamos uma seleção de três plataformas educacionais dos Estados Unidos que oferecem oportunidades de aprender e praticar programação gratuitamente. Neste guia, você encontrará recursos valiosos como o The Odin Project, a Codecademy e a Sololearn. ## The Odin Project ![](https://guiadeti.com.br/wp-content/uploads/2024/05/image-89.png) _Imagem da página The Odin Project_ The Odin Project é uma plataforma cujo conteúdo full stack é gratuito e suportado por uma comunidade de código aberto. A equipe por trás do projeto vasculhou a internet para selecionar apenas os melhores recursos, apresentando-os em uma sequência lógica que facilita o aprendizado. Os usuários podem aprender através de um currículo composto pelos melhores tutoriais, blogs e cursos online. É possível criar dezenas de projetos dignos de um portfólio, variando de scripts simples a programas completos e sites publicados. Durante o processo, os aprendizes também podem contar com o suporte de uma comunidade amigável de desenvolvedores, tanto novatos quanto experientes. Confira a ementa: - Intermediate HTML and CSS; - Advanced HTML and CSS; - Databases; - NodeJS; - JavaScript; - Getting Hired; - React; - Ruby on Rails; - Ruby. ## Codecademy ![](https://guiadeti.com.br/wp-content/uploads/2024/05/image-92.png) _Imagem da plataforma Codecademy_ Codecademy oferece uma variedade de cursos gratuitos e pagos que cobrem linguagens como JavaScript, Python, C#, e HTML. A plataforma tem como missão criar um mundo onde todos possam construir algo significativo com a tecnologia, fornecendo as ferramentas de aprendizagem, os recursos e as oportunidades necessárias para isso. Na Codecademy, há um compromisso firme de capacitar pessoas em todas as etapas de suas jornadas de codificação, permitindo que continuem aprendendo, crescendo e impactando o mundo ao seu redor. Confira um pouco da ementa de cursos gratuitos: - AngularJS 1.X - Build Connect Four Using Python - C# - C - C++ - Choosing a Career in Tech - Choosing a Programming Language - Code with Blockly - Computer Architecture: Assembly Language - CSS - Discrete Math - Fundamentals of Operating Systems - Game Development with Phaser.js - Getting Started with Python for Data Science - Git: Introduction - Golang - How to Code - How to Make a Website with NameCheap - HTML - Intro to AI Transformers - Intro to Data Visualization with Python - Intro to Generative AI - Intro to Java - Intro to Language Models in Python - Intro to PyTorch and Neural Networks - Intro to SQL - Intro to the Command Line - Introduction to Big Data with PySpark - Introduction to Cybersecurity - Introduction to DevOps - Introduction to Game Development - Introduction to IT - Introduction to Linux: Bash Scripting - Introduction to Personal Digital Security - Introduction to UI and UX Design - Java - JavaScript - Kotlin - Learn How to Use AI for Coding - Learn How to Use ChatGPT - Learn Intermediate Python: Object-Oriented Programming - Learn Redux - Lua - Machine Learning: Introduction with Regression - MongoDB - Node.js - PHP - PowerShell - Python - R - React - React Native - Ruby - SQL - Swift - TypeScript - E muito mais! ## Sololearn ![](https://guiadeti.com.br/wp-content/uploads/2024/05/image-93.png) _Imagem da plataforma Sololearn_ Sololearn oferece recursos educativos para aprender linguagens de programação como Java, C++, CSS, entre outras. Independentemente do nível de experiência do usuário, é possível começar a escrever código real e funcional poucos minutos após iniciar o primeiro curso. Os aprendizes podem progredir passo a passo através dos cursos únicos da plataforma, avaliando o aprendizado com quizzes durante as aulas e aprimorando gradualmente suas habilidades práticas. Ao concluir os cursos, os usuários recebem certificados que validam suas novas habilidades, os quais podem ser compartilhados nas redes sociais. Com Sololearn, é possível aprender em qualquer lugar e a qualquer hora, facilitando o acesso ao aprendizado contínuo. Confira a ementa: #### Introdutório - C; - C++; - C#; - CSS; - HTML; - Java; - JavaScript; - Python; - SQL. #### Intermediário - C; - C++; - C#; - Java; - JavaScript; - Python; - SQL. #### Desenvolvimento - Angular; - Codificação para dados; - Desenvolvedor Python; - Desenvolvimento Web; - Fundamentos da programação; - Front-end para iniciantes; - IA Generativa na prática. <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/Aprenda-Programacao-De-Graca-280x210.png" alt="Aprenda Programação De Graça" title="Aprenda Programação De Graça"></span> </div> <span>Aprenda Programação De Graça Com 3 Sites Estadunidenses</span> <a href="https://guiadeti.com.br/aprenda-programacao-de-graca-3-sites/" title="Aprenda Programação De Graça Com 3 Sites Estadunidenses"></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-Excel-Santander--280x210.png" alt="Curso De Excel Santander" title="Curso De Excel Santander"></span> </div> <span>Curso De Excel Gratuito Com Certificado Oferecido Pelo Santander</span> <a href="https://guiadeti.com.br/curso-excel-gratuito-certificado-santander/" title="Curso De Excel Gratuito Com Certificado Oferecido Pelo Santander"></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-Java-280x210.png" alt="Minicurso Java" title="Minicurso Java"></span> </div> <span>Curso De Java Gratuito Com Certificado Da Cubos Academy</span> <a href="https://guiadeti.com.br/curso-java-gratuito-certificado-cubos-academy/" title="Curso De Java Gratuito Com Certificado Da Cubos Academy"></a> </div> </div> <div> <div> <div> <span><img decoding="async" width="280" height="210" src="https://guiadeti.com.br/wp-content/uploads/2023/12/Santander-Curso-de-Ingles-1-280x210.png" alt="Santander Open Academy" title="Santander Open Academy"></span> </div> <span>Santander Oferece 8.000 Bolsas Para Ensino De Inglês</span> <a href="https://guiadeti.com.br/santander-bolsas-ingles/" title="Santander Oferece 8.000 Bolsas Para Ensino De Inglês"></a> </div> </div> </div> </aside> ## Programação A programação é o coração da tecnologia moderna, uma habilidade fundamental que permite a criação e manutenção de softwares, aplicativos e sistemas que formam a espinha dorsal do mundo digital. Conforme o avanço da internet, da computação móvel e do big data, a capacidade de escrever código tornou-se uma das habilidades mais valorizadas no mercado de trabalho. Programadores usam linguagens específicas para dar instruções aos computadores, criando soluções que podem variar desde simples páginas web até complexos sistemas de inteligência artificial. ### Ferramentas e Linguagens de Programação As ferramentas e linguagens de programação são numerosas e variadas, cada uma adequada para diferentes tipos de tarefas. Linguagens como Python são elogiadas por sua simplicidade e versatilidade, sendo usadas em web development, análise de dados, e aprendizado de máquina. JavaScript domina o desenvolvimento web, permitindo interações dinâmicas em páginas da internet. Java, por outro lado, é amplamente utilizado em aplicações empresariais e sistemas Android. Os programadores também dependem de ferramentas como frameworks e bibliotecas, que fornecem códigos pré-escritos e módulos para acelerar o desenvolvimento de software. ### Mercado de Trabalho O mercado de trabalho para programadores está em constante expansão e evolução. Com a digitalização de praticamente todas as indústrias, a demanda por desenvolvedores de software continua a crescer. As oportunidades variam de startups inovadoras a grandes corporações tecnológicas e setores tradicionais que estão passando por transformações digitais. A possibilidade do trabalho remoto e freelancing está cada vez mais presente, permitindo aos programadores trabalhar de qualquer parte do mundo. À medida que a tecnologia avança, surgem novas áreas como o desenvolvimento de aplicações para realidade aumentada e virtual, inteligência artificial e automação, que requerem habilidades de programação especializadas. ## Inicie sua jornada em programação hoje mesmo com cursos gratuitos! O [acesso da plataforma The Odin Project](https://www.theodinproject.com/) deve ser realizado pelo site da The Odin Project. O [acesso da plataforma Codecademy](https://www.codecademy.com/catalog) deve ser realizado pelo site da Codecademy. O [acesso da plataforma Sololearn](https://www.sololearn.com/pt/learn) deve ser realizado pelo site da Sololearn. ## Conhece alguém interessado em aprender programação? Compartilhe esses recursos incríveis! Gostou do conteúdo sobre as ferramentas de aprendizagem? Então compartilhe com a galera! O post [Aprenda Programação De Graça Com 3 Sites Estadunidenses](https://guiadeti.com.br/aprenda-programacao-de-graca-3-sites/) apareceu primeiro em [Guia de TI](https://guiadeti.com.br).
guiadeti
1,866,920
What is the git index?
🗃 💻 🌊 Ever so often, I like to "plunge" (more on that later..) into the depths of Git...
0
2024-05-27T19:57:30
https://dev.to/colin-williams-dev/what-is-the-git-index-2485
git, github, tutorial, programming
# 🗃 💻 🌊 _Ever so often, I like to "plunge" (more on that later..) into the depths of Git deeper to strengthen my understanding of this tool I leverage every single day._ Recently, I wanted to **untrack files that had previously been tracked and ultimately were pushed to my remote repository**. I added the directory for said files to my .gitignore and believed my next step would be to just delete them off the remote directly on GitHub... But, it occurred to me there were probably better ways to achieve this same outcome. ## (scroll down to the📌for tl;dr) --- My investigating lead me to a few places: ### 1. [Super-User Forum Comment on --cached](https://superuser.com/a/1442728) - Here is where I learned about `git rm --cached...`. - What `--cached` does is: > "Use this option to unstage and remove paths only from the INDEX. Working tree files, whether modified or not, will be left alone." [emphasis mine] [source below] ### 2. [Git Documentation on git rm](https://git-scm.com/docs/git-rm) - This lead me further into this "pipe" (more still to come...) with asking myself "what is the git index?" ### 3. [SO forum comment on the actual /.git/index](https://stackoverflow.com/a/3690796) - Where I learned that: > "The index is a single, large, binary file in <baseOfRepo>/.git/index, which lists all files in the current branch, their sha1 checksums, time stamps and the file name -- it is not another directory with a copy of files in it." Moreover, the git "index" is where your changes go when you run `git add ...` and directly into that above mentioned binary (`/.git/index`) which acts as your "staging area" in between your workspace (working directory) and your local repository (where your changes go to your current branch when you run `git commit ...`). # 📌 To summarize, when you run `git rm --cached folder/\*` git will delete the (history?) data represented by this directory in your /.git/index binary/staging area. Next, you push these changes to your remote to have them scrubbed out, LEAVING your directory locally. If this directory has been added to your .gitignore, it will no longer be tracked as well. # 🚽 🌊 🏄‍♂️ Now for the conceit that git uses regarding the words "plunge", "pipe" and these 🌊 emojis I've been cheekily trying to breadcrumb into this post... Through my investigation I learned of the "high level" and "low level" conceit that git adopts: "Porcelain" (high) and "Plumbing" (low). ### 4.a. [high_level_commands_porcelain](https://git-scm.com/docs/git#_high_level_commands_porcelain) ### 4.b. [low_level_commands_plumbing](https://git-scm.com/docs/git#_low_level_commands_plumbing) _Anyway, just thought that was funny. Git uses a toilet metaphor in their documentation_... 😋 ### Honorable mention: [Think like (a) Git: LSD & Chainsaws](https://think-like-a-git.net/sections/git-makes-more-sense-when-you-understand-x/example-4-lsd-and-chainsaws.html)
colin-williams-dev
1,866,919
Create easily a Python app with Streamlit
🇫🇷 version here. For some time now, I have been learning Vietnamese. To do this, like many people...
0
2024-05-27T19:54:29
https://dev.to/kevin75/create-a-python-app-easily-with-streamlit-38k3
python, streamlit, programming, beginners
:fr: version [here](https://dev.to/kevin75/streamlit-creer-des-apps-en-python-tres-simplement-c97). For some time now, I have been learning Vietnamese. To do this, like many people these days, I signed up for the Duolingo app. This app is really good; it makes learning quick and fun. But here’s the thing, like many apps these days, Duolingo offers a Freemium model, and its full potential is only unlocked with a subscription. One of the interesting features offered by the subscription is the ability to take a simple Vietnamese/English translation quiz with all the words learned since the beginning of the lessons. So I wondered, "How can I try to reproduce this exercise, which is quite simple, to practice without having to pay for a Duolingo subscription?" In this article, I will try to show you how to recreate this exercise with the Streamlit framework and a bit of code. ## First, the data First, I need a dataset to carry out this project. Fortunately, on its website, Duolingo lists all the words I've learned since the beginning of my lessons, along with their English translations (I can only learn Vietnamese from English in the app). ![A quick copy/paste](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x5gnnx586lvzlvtrcnw2.gif) A quick copy/paste of the word list into a text file (sorry Duolingo...), and here I am with a small dataset of 131 Vietnamese words with their corresponding English translations. All that's left is to reformat everything with a quick Python script, and I have a JSON file that contains the basic data for my future game. ```json { "translations": [ { "VN": "ga", "EN": "station, gas" }, { "VN": "trạm", "EN": "station, stations" }, { "VN": "đặt chỗ", "EN": "make a reservation, reservation" }, ... ``` ## Streamlit I had several options for creating my app. What I wanted was something relatively simple to implement, easily deployable so I could access it anywhere, and an opportunity to learn something while working on this project. So, what to do? Create a simple HTML/JS project, try to dive into a JS framework (React or Vue.js), or find another alternative? The HTML/JS project? Yes, why not, but I'm not sure I would learn anything interesting. Creating an app with a JS framework? Yes, that would be great, but I know these kinds of projects from having tried them several times before... They are great frameworks, but you still need to learn how to use them properly (I knew how to use React a few years ago, but it evolves so quickly that today I would have to start from scratch) to avoid doing things incorrectly, and you need to spend 2 weeks learning a framework to create an app with a few lines of code that takes 4 hours to implement. Moreover, I'm no longer comfortable with JS... So why not turn to something else? I'm a pythonista in my daily life, and I've heard about the Streamlit framework at work. It seems you can create cool apps with it. So, let's take a look :detective: ### Quick focus on the Framework Go to the [Streamlit](https://streamlit.io) website, and you'll see written in front of you: "A faster way to build and share data apps". That seems to be what we're looking for :smile:. A few minutes browsing the documentation confirms it. It's simple to install, use, and deploy, and it's all in Python. Let's see if it fits the bill! ### Installation Installing the framework is quite simple and can be done in a few lines: ```bash mkdir translation-exercise-app cd translation-exercise-app # make sure you have a version of python >= 3.8 python3 --version python3 -m venv .venv source .venv/bin/activate pip install streamlit ``` And that's it. Simple, right? For the rest of the article, the only Streamlit command we'll use is `streamlit run app.py`. ## Let's get started with the implementation With your favorite editor, open the `translation-exercise-app` folder. Your .venv folder should already be there. Add the JSON file containing the initially generated dataset, then create a file named `app.py`. ```python # app.py import streamlit as st st.text("Hello World!") ``` Now, use the command `streamlit run app.py`, and a page in your browser should open displaying "Hello World!". First easy victory :muscle: ! I won't explain each Streamlit component I'll use one by one. I prefer to provide you with links to the official documentation, which is much better than any explanations I could give. Instead, I'll show you how I use them to create my translation exercise app. ### Some design first What exactly do I want to do? I thought that, for now, I would create a very simple app. Its purpose will be to display a word in Vietnamese taken from the base dataset, along with 4 English translations, one corresponding to the exact translation of the chosen Vietnamese word, and the other 3 being just random English words from the rest of the dataset. The player will have to find the correct English translation among the 4 options. We will display a score on the screen which will count the number of consecutive correct answers from the player. This score will reset to 0 in case of a mistake. We will also display the best score obtained. ### Loading data into the app For the app to function, we need to make the dataset available to it. So here we go: ```python import json import streamlit as st # We create a function that will read and load the data into a Python dictionary def load_data() -> dict: data = {} with open("vn_en_words_translations.json") as fd: data = json.load(fd) return data # We check if the data is in the Streamlit "session_state" (or cache) # If it's not there, then we use the function to load the data if "words_dict" not in st.session_state: st.session_state["words_dict"] = load_data() ``` With this piece of code, I can load my data and store it in the Streamlit **session state** (I'll explain later what the session state is). It's quite simple and allows me to access my dataset throughout my file via `st.session_state["words_dict"]`, which is quite handy. ### Creating the Quiz Dataset We are tackling the most "difficult" part (in reality, it's very simple, don't panic) in terms of logic for our application. The idea here is to create a function that will randomly select a Vietnamese word and 4 English words, one of which will be the translation of our Vietnamese word. I decided to use a simple data structure for this: a dictionary with two keys. One of them is associated with a list that will contain the Vietnamese word (this list will always be of size 1). The other is associated with a list that will contain the 4 English translations, always placing the correct translation at the beginning of the list (index 0). ```python import random def select_quiz_words(words_dict: dict) -> dict: # Create the dictionary selected_words = { "VN": [], "EN": [] } # Randomly determine an index to use for selecting a Vietnamese word # and its English equivalent from our dataset to place at the start of the list. selected_word_index = random.randrange(0, len(words_dict["translations"])) selected_words["VN"].append(words_dict["translations"][selected_word_index]["VN"]) selected_words["EN"].append(words_dict["translations"][selected_word_index]["EN"]) # Thus, selected_words["EN"][0] will always be the correct translation of selected_words["VN"][0] ``` Next, we continue our function to randomly select the other three English words, ensuring these words meet the following two conditions: - They must not match `selected_words["EN"][0]`, otherwise the correct answer will appear twice among our 4 options. - There must be no duplicates among our 4 options. ```python import random def select_quiz_words(words_dict: dict) -> dict: selected_words = { "VN": [], "EN": [] } selected_word_index = random.randrange(0, len(words_dict["translations"])) selected_words["VN"].append(words_dict["translations"][selected_word_index]["VN"]) selected_words["EN"].append(words_dict["translations"][selected_word_index]["EN"]) find_other_words = True # Loop until 3 other words have been chosen while find_other_words: # Randomly determine an index to use for selecting an English word from our dataset selected_en_word_index = random.randrange(0, len(words_dict["translations"])) # Of course, this word must not be the one chosen above if selected_en_word_index != selected_word_index: # Nor should it already be in our list if words_dict["translations"][selected_en_word_index]["EN"] not in selected_words["EN"]: # If both conditions are met, then add it to our list selected_words["EN"].append(words_dict["translations"][selected_en_word_index]["EN"]) if len(selected_words["EN"]) == 4: find_other_words = False return selected_words ``` We now have the data for our quiz. ### The Content of the App Alright, all of this is nice, but at the moment, our app still looks like a blank page that says hello. It's time to add some content! Let's start by adding two or three sentences that will explain to the player what they are doing here. ```python selected_words_dict = select_quizz_words(words_dict=st.session_state["words_dict"]) st.title("Hello Learners :wave:!") st.subheader("Let's make a small game. I give you a Vietnamese word, and you try to give me the correct English translation. Let's go?") st.write(f"What is the English translation of the word **{selected_words_dict['VN'][0]}**?") ``` It's a start. First, we load our quiz data into a global variable called `selected_words_dict` using the function we wrote earlier. Then, we quickly explain the rules by displaying text very simply via `st.title()` and `st.subheader()`, and we present the Vietnamese word to be translated via `st.write()`. You can find all the details of the Streamlit functions that allow you to display text on the screen [here](https://docs.streamlit.io/develop/api-reference/text). Next, let's propose the 4 English translation options to the user. We need to find a way to allow the player to interact with our app by making a choice. I've decided to use the Streamlit component [`st.button()`](https://docs.streamlit.io/develop/api-reference/widgets/st.button). I will display 4 buttons side by side horizontally, each displaying one of the 4 possible answers. The user will then have the choice to click on one of them to select the correct translation. Here is the code to implement these buttons: ```python # We 'copy' our list of English options and then shuffle it like a good cocktail selected_en_words_dict_shuffled = selected_words_dict["EN"].copy() random.shuffle(selected_en_words_dict_shuffled) # We create a Streamlit layout composed of 4 columns. col1, col2, col3, col4 = st.columns(4) # And for each of them, we insert a clickable button containing the option with col1: word = selected_en_words_dict_shuffled[0] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) with col2: word = selected_en_words_dict_shuffled[1] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) with col3: word = selected_en_words_dict_shuffled[2] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) with col4: word = selected_en_words_dict_shuffled[3] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) ``` I decided to shuffle my array of answers because, remember, otherwise, we would end up with the correct answer always in the first position, which removes quite a bit of suspense from the exercise... Next, we use the [layout](https://docs.streamlit.io/develop/api-reference/layout) system of Streamlit to create 4 columns. For each of them, we add a clickable button representing one of the answers. Note that: - `label` is the text of the button. - `key` is a key used by Streamlit to have unique buttons. - `on_click` is a callback method that we will discuss shortly. - `args` is an array of parameters that will be given to the callback method. We pass the button's option to validate or not the click. - `use_container_width` is a simple boolean allowing the button to know that it can take the entire width of the container it is in, here the column (and I didn't need to spend 5 hours on CSS to achieve this, which is a miracle :pray:). This part of the code can probably be refactored, but I haven't found a correct way to do it yet. It might be the subject of a future article. ### Validate the result Our application is starting to have content. Now we need to validate the quiz result. As mentioned earlier, we will allow the player to see a score. We will also enable them to see their best score. So let's start by defining these two variables: ```python #... if "words_dict" not in st.session_state: st.session_state["words_dict"] = load_data() if "score" not in st.session_state: st.session_state["score"] = 0 if "best_score" not in st.session_state: st.session_state["best_score"] = 0 # ... ``` Next, let's focus on the check_result callback method that was passed to our buttons earlier: ```python def check_result(choice): if choice == selected_words_dict["EN"][0]: st.session_state["score"] += 1 else: if st.session_state["score"] > st.session_state["best_score"]: st.session_state["best_score"] = st.session_state["score"] st.session_state["score"] = 0 ``` This method is very simple. If the user's choice matches the first element of our list of English options, then it's a jackpot, and we increment their score. Otherwise, we update the best score if it is strictly less than the current score, and then we reset the current score to 0. We just need to display our scores: ```python st.subheader(body=f"Your current score is: {st.session_state['score']}") st.subheader(body=f"Your best score is: {st.session_state['best_score']}") ``` And there you have it! ## It's Time to Test By using `streamlit run app.py`, we can quickly launch and test our application. ![Quick test of our App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5orwbk9p1rckl6ae42g.gif) So yes, it's not very pretty, but it's still presentable, and that without a single line of CSS. We end up with a little game that allows us to practice our Vietnamese. The goal we set seems to be achieved! Yay :tada:! ## What's Happening Under the Hood? At this point, it's important to emphasize a mechanism of Streamlit that everyone needs to keep in mind if you want to use this framework. Streamlit reloads this little Python script that we just implemented at **EVERY** interaction we have with the app. In our case, this means that every time the user clicks a button, the entire script is rerun. This explains several things... It explains why some of my "variables," like the initial dataset, are loaded in this way: ```python if "words_dict" not in st.session_state: st.session_state["words_dict"] = load_data() ``` Here, I leverage Streamlit's ["cache"](https://docs.streamlit.io/get-started/fundamentals/advanced-concepts#caching) system to avoid having these data reloaded at every interaction. This is also what allows me to retain my score despite successive reloads. Indeed, at each rerun of the script, Streamlit checks if the `st.session_state` dictionary contains an element associated with `"words_dict"` (which it does) and therefore does not reload it. This also explains why most variables and Streamlit statements are executed at the global scope of the script. For example, the proposals used for each question are loaded in the global scope: ```python selected_words_dict = select_quizz_words(words_dict=st.session_state["words_dict"]) ``` I do it this way because I need this dictionary to be recreated each time to change the proposals and make the game, let's say... interesting! The buttons are thus also recreated each time with new values, which is our goal. ## In Conclusion Thanks to Streamlit, I managed to implement this little app in less than 100 lines of code and in just a few hours. So yes, I didn't start from scratch with Python, and the app is far from perfect, both technically and visually, but I'm quite happy with the result. I am very pleasantly surprised by the ease of use of the framework and the result. The fact that the script is fully reloaded each time makes me think that the framework must have limitations for more complex apps. Moreover, the available components, although numerous, do not cover all use cases of more sophisticated apps. But for small prototypes and simple apps like the one presented in this article, it works just fine. Regarding my app, I would like to make a few improvements in the future: - Add a green message in case of a correct answer or a red one in case of an error, explaining the correct answer. - Allow the user to choose the direction of the exercise: from Vietnamese to English or from English to Vietnamese. - Allow the user to choose between a word translation exercise or a sentence translation exercise. - Deploy my app online. - Refactor some of the code. - Add other features that I hope will come to mind later :thinking:. This will probably be the subject of future articles. That being said, I will continue to explore this framework that addresses one of my issues: being able to create simple apps in Python without having to spend several days learning to use a complex framework. See you soon for new adventures in the simple and efficient world of Streamlit. Feel free to check the Gitlab [repository](https://github.com/kevinl75/practice-vietnamese-app) to find the code for the article.
kevin75
1,851,951
My mistakes regarding the tech SEO optimization of my website
A few years ago, I migrated my website a couple of times, first from Wordpress to Frontity (A...
0
2024-05-27T03:52:21
https://coffeebytes.dev/en/my-mistakes-regarding-the-tech-seo-optimization-of-my-website/
opinion, seo, wordpress, hugo
--- title: My mistakes regarding the tech SEO optimization of my website published: true date: 2024-05-27 19:49:56 UTC tags: opinion,SEO,wordpress,hugo canonical_url: https://coffeebytes.dev/en/my-mistakes-regarding-the-tech-seo-optimization-of-my-website/ cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rlm6kgqhj2tc7a9tfsj7.jpg --- A few years ago, I migrated my website a couple of times, first from Wordpress to Frontity (A wordpress framework in React) and then from Frontity to a [Digital Ocean Hugo App](https://coffeebytes.dev/en/digital-ocean-analysis-and-my-experience-as-a-user/). I don’t regret my decision at all, but I made a few mistakes regarding SEO that you can probably avoid if you take into account what I’m about to tell you. ## Why should I care about SEO in web development? SEO is the factor that determines whether a website appears first in the search results of a search engine (almost always Google) or whether it is buried in the last positions, receiving little or no traffic and condemning the business it represents to bankruptcy, or if it is a personal project, to oblivion. And I’m not talking about subtle differences, I’m talking about abysmal differences. At the risk of sounding redundant, I will repeat it again: the traffic of a web site is much more important than the efficiency, the aspect or the language or framework with which it is made, yes, even if you write it in C++ or directly in assembler. ![Aves exoticas is a perfect example of a web site with good seo but awful UI](https://coffeebytes.dev/en/my-mistakes-regarding-the-tech-seo-optimization-of-my-website/images/aves-exoticas-org-bad-ui-good-seo.jpg) _Aves exoticas is the perfect example of a website visually not so attractive, but with an impeccable SEO that positions it in the first position on google for the keyword "aves exoticas"._ ### Web developers often ignore the potential of SEO. Most developers have an engineering background, where efficiency, best practices and the business aspect of a website are valued and overlooked. Hence, when a web developer launches their personal projects, they often completely ignore SEO and focus on [optimizing their website to the maximum](https://coffeebytes.dev/en/dont-obsess-about-your-web-application-performance/), usually resulting in an extremely fast, efficient, and even visually appealing website, but with no traffic. ![Web development in assembly meme](https://coffeebytes.dev/en/my-mistakes-regarding-the-tech-seo-optimization-of-my-website/images/web-development-assembly.webp) _It is said that only true programmers program in low-level languages._ ## My mistakes while migrating a website without considering Technical SEO When I migrated the blog the first thing I ignored were the multiple consequences of doing it abruptly. I made three main mistakes: - Ignoring the changes in the sitemap - Ignoring changes in URLs' structure - Ignoring schema ### The presence of a sitemap is crucial in Tech SEO A [sitemap is an xml file that functions as a map to navigate your site](https://coffeebytes.dev/en/dynamic-sitemap-with-django/), usually in XML format, that lists the pages of your website. The sitemap that my previous website had was located in a specific address changed its location when I migrated the website, so Google was unable to find the new sitemap, and then what happened? Well… Google indexed the pages as it could and wanted and, as you probably already know, I suffered the consequences. One night my cell phone vibrated to the rhythm of the cascade of warnings that Google Search Console was sending in the form of notifications from my cell phone. How could I have prevented it? By logging into Google search console and replacing the old sitemap address with the new one and asking google systems for a new reading. ### How I realized that URL structure is important in Tech SEO But that wasn’t all, after the migration from Wordpress to Hugo Google detected a lot of 404 errors when accessing the old URLs and, as a result of the consequent penalty, my traffic decreased by about 70%. Why did this happen? Imagine that search engines see your website with a URL structure like the following. ``` bash Website-->Year-->Month-->Day-->Entry; ``` And when you perform the migration, the structure changes; ``` bash Website-->Posts-->Entry; ``` The important thing to remember here is that search engines do not have a way to easily recognize that one entry is exactly the same as another if it has changed location, especially if this migration involves slight changes to the page. While it is true that Google can detect duplicate content and is able to render a web page, that doesn’t mean it “sees” the entries visually, as a human would, in its guts it is still receiving and parsing text in the form of HTML. How could I have prevented the traffic drop? By means of a redirect, in this case it was enough to tell Google that if it accessed _/202020/12/12/entry\_1_ it should redirect to _/posts/entry\_1_, and how? by returning an HTTP 302 or 308 response, Found or Permanent redirect, respectively. ### The absence of structured data or Schema markup When I used Wordpress the Yoast plugin took care of the structured data markup, but in Hugo this has to be done manually, so my website lasted a while without this structured data, the result? A penalty from google in the form of a decrease in impressions, and therefore traffic to my website. ![Screenshot of structured data markup on a web site](https://coffeebytes.dev/en/my-mistakes-regarding-the-tech-seo-optimization-of-my-website/images/schema-ld+json.png) _The structured data markup for a web site looks like this_ Structured data markup is usually in the form of an application/ld+json script on a website, it cannot be seen visually but it is read by search engines and helps them to understand the type and relationships that exist between each of the entities on your website. That was the tragic story of how I decreased my traffic being a layman in SEO. But after this incident there is a happy ending, because I started reading about it and I learned a lot of things that I put into practice, right now the website is not at the level it was before but it is heading that way and the best thing is that now I know what I’m doing. I had not given myself the opportunity to touch this topic in the blog, because semantically it is quite far from what most devs understand by web development, although it really is not. But I finally decided to write these mistakes in a post and if they can save you a couple of headaches, so much the better.
zeedu_dev
1,866,917
How to Use ADS1115 with the Raspberry Pi (Part 1)
Are you looking to expand the capabilities of your Raspberry Pi beyond simple digital tasks? One...
0
2024-05-27T19:49:15
https://dev.to/shilleh/how-to-use-ads1115-with-the-raspberry-pi-part-1-ij8
beginners, programming, raspberrypi, python
{% embed https://www.youtube.com/watch?v=fBUElwY3yrs %} Are you looking to expand the capabilities of your Raspberry Pi beyond simple digital tasks? One common limitation of the Raspberry Pi is its inability to directly read analog signals, which are crucial for a wide range of sensors, including environmental sensors like the MQ-135 gas sensor. Enter the ADS1115, a versatile and powerful analog-to-digital converter that unlocks the full potential of sensors with analog outputs. This guide will walk you through integrating the ADS1115 with your Raspberry Pi, using the MQ-135 gas sensor as a practical example to monitor air quality. The Raspberry Pi is a fantastic tool for digital computing tasks, but it lacks built-in support for analog inputs. This limitation can be a barrier when dealing with sensors that output analog signals, which are essential for capturing nuanced real-world data. The ADS1115 addresses this gap by providing precise 16-bit analog-to-digital conversion, allowing the Raspberry Pi to process detailed analog data from sensors like the MQ-135, which measures various gases in the air. Before reading the remainder, be sure to subscribe and support the channel if you have not! **Subscribe:** [Youtube](https://www.youtube.com/@mmshilleh) **Support:** [https://www.buymeacoffee.com/mmshilleh](https://www.buymeacoffee.com/mmshilleh) **Hire me at UpWork to build your IoT projects:** [https://www.upwork.com/freelancers/~017060e77e9d8a1157](https://www.upwork.com/freelancers/~017060e77e9d8a1157) ## Step 1-) Assemble the Components Gather all necessary components: - Raspberry Pi (any model with GPIO pins) - ShillehTek ADS1115 ADC module - MQ-135 gas sensor - Jumper wires - Breadboard (optional, but recommended for easier prototyping) **You can Purchase the ADS1115 Pre-Soldered at ShillehTek!** - Buy it on our Store: [Buy ADS1115 on ShillehTek](https://shillehtek.com/products/shillehtek-ads-1115-pre-soldered) - Or buy it on Amazon: [Buy ADS1115 on Amazon](https://www.amazon.com/SHILLEHTEK-Pre-Soldered-Converter-Programmable-Amplifier/dp/B0BXWJFCVJ/ref=pd_ci_mcx_mh_mcx_views_0?pd_rd_w=7Guvz&content-id=amzn1.sym.8b590b55-908d-4829-9f90-4c8752768e8b%3Aamzn1.symc.40e6a10e-cbc4-4fa5-81e3-4435ff64d03b&pf_rd_p=8b590b55-908d-4829-9f90-4c8752768e8b&pf_rd_r=NJ56555AM7K79XK9N9WM&pd_rd_wg=A2Cbt&pd_rd_r=7224bf11-585e-44f3-9390-8d20b2a53ef1&pd_rd_i=B0BXWJFCVJ) ## Step 2-) Set Up the Hardware See diagram for exact details. **Connect the ADS1115 to the Raspberry Pi:** - VDD to Pi 3.3V: Connect the VDD pin of the ADS1115 to one of the 3.3V pins on the Raspberry Pi. - GND to Pi GND: Connect the GND pin of the ADS1115 to one of the GND pins on the Raspberry Pi. - SCL to Pi SCL (GPIO 3): Connect the SCL pin of the ADS1115 to GPIO 3 (SCL) on the Raspberry Pi. - SDA to Pi SDA (GPIO 2): Connect the SDA pin of the ADS1115 to GPIO 2 (SDA) on the Raspberry Pi. **Connect the MQ-135 Sensor to the ADS1115:** - AOUT to ADS1115 A0: Connect the Analog Output (AOUT) pin of the MQ-135 to the A0 pin on the ADS1115. This allows the ADS1115 to read the analog output from the MQ-135 sensor. **Power the MQ-135 Sensor:** - VCC to Pi 5V: Connect the VCC pin of the MQ-135 to one of the 5V pins on the Raspberry Pi. This supplies the necessary power to the MQ-135 sensor. - GND to Pi GND (Additional): Connect another GND pin of the MQ-135 to a GND pin on the Raspberry Pi to ensure a common ground for all components. **Assembly Tips:** - Use a Breadboard: Utilize a breadboard and jumper wires for easier and safer connections. This setup allows for modifications without soldering and provides a clear visual of all connections. - Ensure Secure Connections: Check that all connections are secure to prevent loose connections that can lead to erratic readings or hardware damage. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2z56uxiugop704k0s9ew.png) ## Step 3-) Configure the Raspberry Pi for I2C Communication To communicate with the ADS1115, we need to use I2C communication which is characteristic for these applications. If this is your first time using sensors with the Raspberry Pi, chances are that you do not have I2C enabled on the device. You can read more about I2C here if you like. [What is I2C?](https://learn.sparkfun.com/tutorials/i2c/all) **Enable I2C on the Raspberry Pi:** - Open a terminal window on your Raspberry Pi. - Enter sudo raspi-config. - Navigate to Interfacing Options, select I2C, and enable it. - Exit the configuration tool and reboot the Raspberry Pi if prompted. **Verify that I2C devices are recognized:** - Run sudo i2cdetect -y 1 in the terminal. You should see the address of the ADS1115 listed (typically 0x48 unless the address pin is configured differently). ## Step 4-) Install Necessary Python Libraries To interface the ADS1115 ADC with our Raspberry Pi using Python, we need to install specific libraries that simplify the process of reading analog data. These libraries handle the complexities of digital-to-analog conversion and allow us to work with the data in a more straightforward, human-readable format. Install the Adafruit ADS1x15 library to interface with the ADS1115 ADC: - Open a terminal on your Raspberry Pi. - Update your package list: sudo apt-get update - Install pip if it is not already installed: sudo apt-get install python3-pip - Install the Adafruit library: sudo pip3 install adafruit-ads1x15 **Verify Installation:** Confirm that the library is installed correctly by importing it in a Python shell ## Step 5-) Write the Python Script to Read Sensor Data Create a new Python script using a text editor or the Python IDE on your Raspberry Pi: - Write a script to initialize the ADS1115 and continuously read the voltage from the MQ-135 sensor. - Use the provided sample code, adjusting parameters as necessary based on your specific setup. - Save the script and run it to start monitoring the air quality. FYI, you can use any analog output device you want, we are just using the MQ135 in our case because it is very common and easy to interpret. ``` import time import board import busio import adafruit_ads1x15.ads1115 as ADS from adafruit_ads1x15.analog_in import AnalogIn ``` ``` i2c = busio.I2C(board.SCL, board.SDA) # Create the ADS object and specify the gain ads = ADS.ADS1115(i2c) ads.gain = 1 chan = AnalogIn(ads, ADS.P0) # Continuously print the values while True: print(f"MQ-135 Voltage: {chan.voltage}V") time.sleep(1) ``` You can run this script in Python now, if you have everything setup properly you should begin to see values in the terminal window. To test the analog readings are making sense, you can place the MQ135 sensor above a bottle of alcohol to test that the sensor detects properly. If so, you should see an increase in the voltage values in the terminal which indicates the ADC is working properly as well. Voltage increases to above 1V after alcohol exposure! ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l38p3udqbgtjgrifbahi.png) ## Step 6-) Adjust Settings as Needed Proper calibration of the ADS1115's gain is crucial for optimizing the accuracy and reliability of your sensor readings. Gain adjustment helps tailor the ADC's input sensitivity to the output range of the MQ-135 sensor, thereby enhancing the precision of your data. **Understanding Gain Settings:** The gain setting on the ADS1115 defines the full-scale range of input voltages it can accurately read. The gain setting acts as a multiplier for the input signal, allowing the ADC to detect smaller changes in voltage at higher gain settings. Here's what happens with different gain settings: - Higher Gain (e.g., Gain = 4 for ±1.024V range): Increases the ADC's sensitivity to smaller voltage changes. Use this if the MQ-135 outputs low voltage levels, as it allows for finer resolution. However, be cautious, as setting the gain too high for the sensor's output voltage might cause the input signal to exceed the ADC's maximum range, leading to signal clipping. - Lower Gain (e.g., Gain = 1 for ±4.096V range): Decreases sensitivity but allows higher voltage inputs without saturation. This setting is suitable if the sensor outputs higher voltage levels, ensuring that the ADC does not clip the signal at its input. **How to Adjust Gain:** - Open your Python script where the ADS1115 is initialized. - Locate the line where the gain is set, typically ads.gain = 1. - Modify this line to adjust the gain to a level suitable for your sensor's output. For example, if you notice that the sensor's voltage rarely exceeds 1V and you want more precision, set ads.gain = 4. - Save the changes and rerun your script to observe the effects of the gain adjustment. **Monitor the Output:** After adjusting the gain, monitor the output closely. Look for these indicators: - Saturation: If all readings hit the same maximum or minimum value, the gain might be too high, causing the voltage to saturate. - Resolution: If the readings are more detailed and provide finer distinctions with smaller changes in detected gases, your gain setting is likely well-tuned. - Iterative Adjustments: Adjusting the gain may require several iterations to find the perfect balance. Experiment with different settings while monitoring the output to determine the best gain setting for your application. This step ensures that you are using the ADS1115 to its fullest potential, accurately capturing and analyzing the analog signals from the MQ-135 sensor. Adjusting the gain properly can significantly affect the quality of your data, making your air quality monitoring project more reliable and effective. ## Conclusion We've explored how to enhance your Raspberry Pi projects by integrating the ADS1115 ADC, using the MQ-135 gas sensor as a practical example for monitoring air quality. This setup not only broadens the capabilities of your Raspberry Pi by enabling it to read analog signals but also improves the precision and utility of your environmental monitoring projects. By carefully following the steps outlined, you've learned how to set up the hardware, install necessary software, and adjust settings to optimize the performance of your sensor system. Whether you're a hobbyist, a student, or a professional, the skills you've gained will serve as a solid foundation for more advanced projects involving a variety of sensors and data types. **Expand Your Knowledge and Skills:** If you enjoyed this tutorial and are eager to dive deeper into Raspberry Pi applications or want to explore other sensors and electronics projects, don't hesitate to subscribe. By subscribing, you'll get access to a wealth of resources, including: - Advanced Tutorials: Learn more complex setups and integrations. - Project Ideas: Get inspired with new project ideas that challenge your skills. - Community Insights: Join a community of like-minded enthusiasts sharing tips, tricks, and support. Stay Connected Subscribing will keep you updated on the latest posts, updates, and community projects. Your journey into electronics and environmental monitoring is just beginning, and there's so much more to discover. Subscribe today and transform your curiosity into expertise.
shilleh
1,866,916
Streamlit: Créer des apps en Python très simplement
Depuis quelques temps, je me suis mis à l'apprentissage du vietnamien. Pour cela, comme beaucoup de...
0
2024-05-27T19:48:27
https://dev.to/kevin75/streamlit-creer-des-apps-en-python-tres-simplement-c97
python, streamlit, french, programming
Depuis quelques temps, je me suis mis à l'apprentissage du vietnamien. Pour cela, comme beaucoup de monde en ce moment, je me suis inscrit sur l'application Duolingo. Cette application est vraiment pas mal, elle rend l'apprentissage rapide et ludique. Oui mais voilà, comme beaucoup d'applications de nos jours, Duolingo propose une offre Freemium, et son plein potentiel n'est libéré qu'avec un abonnement. Notamment, une des fonctionnalités intéressantes qu'offre l'abonnement, c'est la possibilité de faire un simple quiz de traduction vietnamien / anglais avec tous les mots appris depuis le début des leçons. Je me suis alors demandé "Comment essayer de reproduire cet exercice, finalement assez simple, pour pouvoir pratiquer sans avoir à payer un abonnement Duolingo ?" Dans cet article, je vais essayer de vous montrer comment recréer cet exercice avec le framework Streamlit et un peu de code. ## D'abord, les données Il me faut pour commencer un premier dataset pour réaliser ce projet. Ça tombe bien, sur son site internet, Duolingo me liste tous les mots que j'ai appris depuis le début de mes leçons, avec leurs traductions anglaises (je ne peux qu'apprendre le vietnamien à partir de l'anglais depuis l'application). ![Rapide copier/coller](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1w6jjaunh7jv2q96x3lm.gif) Un rapide copier/coller de la liste de mots dans un fichier texte (désolé Duolingo...), et me voilà avec un petit dataset de 131 mots vietnamiens avec la traduction anglaise correspondante. Reste encore à reformatter le tout avec un rapide script Python, et j'ai un JSON qui contient les données de base de mon futur jeu. ```json { "translations": [ { "VN": "ga", "EN": "station, gas" }, { "VN": "trạm", "EN": "station, stations" }, { "VN": "đặt chỗ", "EN": "make a reservation, reservation" }, ... ``` ## Streamlit Plusieurs choix s'offraient à moi pour créer mon application. Ce que je voulais, c'était avoir quelque chose de relativement simple à implémenter, pouvant être facilement déployé pour pouvoir y accéder partout, et apprendre quelque chose en travaillant sur ce projet. Du coup, quoi faire ? Faire un projet HTML/JS simple, essayer de me plonger dans un framework JS (React ou Vue.js), ou trouver une autre alternative ? Le projet HTML/JS ? Oui, pourquoi pas, mais pas sûr d'en apprendre quelque chose d'intéressant. Faire une application via un framework JS ? Oui, ça serait super, mais je connais ce genre de projet pour y avoir déjà goûté plusieurs fois... Ce sont de supers frameworks, mais il faut quand même apprendre à s'en servir (j'ai su faire du React il y a quelques années, mais ça évolue tellement vite qu'aujourd'hui je dois repartir de zéro) pour ne pas faire n'importe quoi, et il faut passer 2 semaines à apprendre un framework pour faire une application de quelques lignes qui prend 4 heures à implémenter. De plus, je ne suis plus super à l'aise avec JS... Alors pourquoi ne pas me tourner vers autre chose ? Je suis un pythonista dans mon quotidien, et j'ai entendu parler du framework Streamlit au travail. Il paraît que l'on peut faire des applications sympas avec. Alors, y jeter un coup d'œil :detective: ### Rapide focus sur le Framework Allez sur le site de [Streamlit](https://streamlit.io), et vous verrez s'afficher devant vous : "A faster way to build and share data apps". Ça semble être ce que l'on cherche :smile:. Quelques minutes à parcourir la documentation me le confirment. C'est simple à installer, à utiliser, à déployer, et c'est du full Python. Voyons si ça peut faire l'affaire ! ### L'installation L'installation du framework est assez simple et se réalise en quelques commandes : ```bash mkdir translation-exercice-app cd translation-exercice-app # assurez vous d'avoir une version de python >= 3.8 python3 --version python3 -m venv .venv source .venv/bin/activate pip install streamlit ``` Et c'est tout. Simple, non ? Pour la suite de l'article, la seule commande Streamlit que l'on utilisera sera `streamlit run app.py`. ## C'est parti pour l'implémentation Avec votre éditeur favori, ouvrez le dossier `translation-exercise-app`. Normalement, votre dossier .venv devrait déjà s'y trouver. Ajoutez le fichier JSON contenant le dataset initialement généré, puis créez un fichier `app.py`. ```python # app.py import streamlit as st st.text("Hello World!") ``` Maintenant, utilisez la commande `streamlit run app.py`, et une page de votre navigateur devrait s'ouvrir en affichant "Hello World!". Première victoire facile :muscle: ! Je ne vais pas vous expliquer un par un tous les composants Streamlit que je vais utiliser. Je préfère vous mettre les liens vers la documentation officielle, qui est bien meilleure que toutes mes explications pourront l'être. Je vais plutôt vous montrer comment je les utilise pour créer mon app d'exercice de traduction. ### Un peu de design d'abord Qu'est-ce que je veux faire exactement ? Je me suis dit que, pour le moment, j'allais faire une app très simple. Son but sera d'afficher un mot en vietnamien pris dans le dataset de base, ainsi que 4 traductions anglaises, une correspondant à l'exacte traduction du mot vietnamien choisie, les 3 autres étant juste des mots anglais pris au hasard dans le reste du dataset. Le joueur devra trouver la bonne traduction anglaise parmi les 4 proposées. On aura un score affiché à l'écran qui comptera le nombre de bonnes réponses d'affilée du joueur. Ce score retombera à 0 en cas d'erreur. On affichera également le meilleur score obtenu. ### Charger les données dans l'app Pour que l'app fonctionne, on doit lui mettre à disposition le dataset. Alors c'est parti: ```python import json import streamlit as s # On crée une fonction qui va lire et charger les données dans un dictionnaire Python def load_data() -> dict: data = {} with open("vn_en_words_translations.json") as fd: data = json.load(fd) return data # On vérifie si les données sont dans le "session_state" (ou cache) de Streamlit # Si ce n'est pas le cas, alors on utilise la fonction pour charger les données if "words_dict" not in st.session_state: st.session_state["words_dict"] = load_data() ``` Grâce à ce bout de code, je peux charger mes données et les stocker dans le **session state** de Streamlit (j'expliquerai plus tard ce qu'est le session state). C'est assez simple et ça me permet d'accéder à mon dataset partout dans mon fichier via `st.session_state["words_dict"]`, ce qui est assez pratique. ### Création du dataset de quiz Nous nous attaquons à la partie la plus "difficile" (en réalité, c'est très simple, ne paniquez pas) en termes de logique de notre application. L'idée ici est de créer une fonction qui va sélectionner au hasard un mot vietnamien et 4 mots anglais, dont un sera la traduction de notre mot vietnamien. Je décide pour cela d'utiliser une structure de données simple : un dictionnaire avec deux clés. L'une d'elles est associée à une liste qui contiendra le mot vietnamien (cette liste sera toujours de taille 1). L'autre est associée à une liste qui contiendra les 4 traductions anglaises, en prenant soin de toujours placer la bonne traduction au début de la liste (index 0). ```python import random def select_quizz_words(words_dict: dict) -> dict: # On créer le dictionnaire selected_words = { "VN": [], "EN": [] } # On détermine au hasard un index que l'on utilise pour prendre un mot vietnamien # et son équivalent anglais dans notre dataset que l'on place en début de liste. selected_word_index = random.randrange(0, len(words_dict["translations"])) selected_words["VN"].append(words_dict["translations"][selected_word_index]["VN"]) selected_words["EN"].append(words_dict["translations"][selected_word_index]["EN"]) # Ainsi, selected_words["EN"][0] sera toujours la bonne traduction de selected_words["VN"][0] ``` Nous continuons ensuite notre fonction pour choisir les trois autres mots anglais au hasard, en nous assurant que ces mots remplissent les deux conditions suivantes : - Ils ne doivent pas correspondre à `selected_words["EN"][0]`, sinon la bonne réponse apparaîtra en doublon dans nos 4 propositions. - Il ne doit pas y avoir de doublons dans nos 4 propositions. ```python import random def select_quizz_words(words_dict: dict) -> dict: selected_words = { "VN": [], "EN": [] } selected_word_index = random.randrange(0, len(words_dict["translations"])) selected_words["VN"].append(words_dict["translations"][selected_word_index]["VN"]) selected_words["EN"].append(words_dict["translations"][selected_word_index]["EN"]) find_other_words = True # On boucle tant que 3 autres mots n'ont pas été choisis while find_other_words: # On détermine au hasard un index que l'on utilise pour prendre mot anglais dans notre dataset selected_en_word_index = random.randrange(0, len(words_dict["translations"])) # Bien sûr, ce mot ne doit pas être celui choisi plus haut if selected_en_word_index != selected_word_index: # Ni déjà être dans notre liste if words_dict["translations"][selected_en_word_index]["EN"] not in selected_words["EN"]: # Si les deux conditions sont remplies, alors on l'ajoute à notre liste selected_words["EN"].append(words_dict["translations"][selected_en_word_index]["EN"]) if len(selected_words["EN"]) == 4: find_other_words = False return selected_words ``` Nous avons maintenant les données pour notre quiz. ### Le contenue de l'app Alors c'est bien joli tout ça, mais pour le moment notre application ressemble toujours à une page blanche qui dit bonjour. Il serait temps d'y mettre du contenu ! Commençons par y mettre deux ou trois phrases qui expliquent au joueur ce qu'il fait là. ```python selected_words_dict = select_quizz_words(words_dict=st.session_state["words_dict"]) st.title("Hello Learners :wave:!") st.subheader("Let's make a small game. I give you vietnamese word, and you try to give me the good english translation. Let's go?") st.write(f"What is the english translation of the word **{selected_words_dict['VN'][0]}**?") ``` C'est un début. D'abord, nous chargeons nos données de quiz dans une variable globale appelée `selected_words_dict` en utilisant la fonction écrite plus haut. Ensuite, nous expliquons rapidement les règles en affichant du texte très simplement via `st.title()` et `st.subheader()`, et nous proposons le mot vietnamien à traduire via `st.write()`. Vous pouvez trouver tous les détails des fonctions Streamlit qui permettent d'afficher du texte à l'écran [ici](https://docs.streamlit.io/develop/api-reference/text). Venons-en maintenant à proposer à l'utilisateur de l'application les 4 propositions de traduction en anglais. Il faut trouver un moyen de permettre au joueur d'interagir avec notre application en faisant un choix. J'ai décidé ici d'utiliser le composant Streamlit [`st.button()`](https://docs.streamlit.io/develop/api-reference/widgets/st.button). Je vais afficher 4 boutons côte à côte horizontalement, chacun affichant une des 4 réponses possibles. L'utilisateur pourra alors choisir en cliquant sur l'un d'entre eux. Voici le code pour implémenter ces boutons : ```python # On 'copie' notre liste de propositions en anglais puis on la mélange comme un bon cocktail selected_en_words_dict_shuffled = selected_words_dict["EN"].copy() random.shuffle(selected_en_words_dict_shuffled) # On crée un layout Streamlit composé de 4 colonnes. col1, col2, col3, col4 = st.columns(4) # Et pour chacun d'entre eux, on y insère un bouton cliquable contenant la proposition with col1: word = selected_en_words_dict_shuffled[0] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) with col2: word = selected_en_words_dict_shuffled[1] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) with col3: word = selected_en_words_dict_shuffled[2] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) with col4: word = selected_en_words_dict_shuffled[3] st.button(label=word, key=word, on_click=check_result, args=[word], use_container_width=True) ``` J'ai décidé de mélanger mon tableau de réponses, car sinon, rappelez-vous, nous nous retrouverions avec la bonne réponse toujours en première position, ce qui enlèverait pas mal de suspense à l'exercice... Ensuite, nous utilisons le système de [layout](https://docs.streamlit.io/develop/api-reference/layout) de Streamlit pour créer 4 colonnes. Pour chacune d'entre elles, nous ajoutons un bouton cliquable représentant une des réponses. À noter que : - `label` est le texte du bouton. - `key` est une clé utilisée par Streamlit pour avoir des boutons uniques. - `on_click` est une méthode de callback dont nous parlerons juste après. - `args` est un tableau de paramètres qui sera donné à la méthode de callback. Nous lui passons donc la proposition du bouton pour valider ou non le clic. - `use_container_width` est un simple booléen permettant au bouton de savoir qu'il peut prendre toute la largeur du conteneur dans lequel il est, ici la colonne (et je n'ai pas eu besoin de faire 5h de CSS pour réussir ça, ce qui est un miracle :pray:). Cette partie du code peut sûrement être factorisée, mais je n'ai pas trouvé de moyen correct de le faire pour le moment. Ce sera peut-être l'objet d'un futur article. ### Valider ou non le résultat Notre application commence à avoir du contenu. Reste maintenant à valider le résultat du quiz. Comme énoncé plus haut, on va permettre au joueur de voir un score. On va aussi lui permettre de voir son meilleur score. Alors commençons par définir ces deux variables : ```python #... if "words_dict" not in st.session_state: st.session_state["words_dict"] = load_data() if "score" not in st.session_state: st.session_state["score"] = 0 if "best_score" not in st.session_state: st.session_state["best_score"] = 0 # ... ``` Ensuite, attardons-nous sur la méthode de callback `check_result` passée plus haut à nos boutons : ```python def check_result(choice): if choice == selected_words_dict["EN"][0]: st.session_state["score"] += 1 else: if st.session_state["score"] > st.session_state["best_score"]: st.session_state["best_score"] = st.session_state["score"] st.session_state["score"] = 0 ``` Cette méthode est très simple. Si le choix de notre utilisateur correspond au premier élément de notre liste de propositions anglaises, alors c'est le jackpot, et on incrémente son score. Sinon, on met à jour le meilleur score si ce dernier est strictement inférieur au score actuel, puis on met ce dernier à 0. Il ne nous reste plus qu'à afficher nos scores : ```python st.subheader(body=f"Your current score is: {st.session_state['score']}") st.subheader(body=f"Your best score is: {st.session_state['best_score']}") ``` Et voila ! ### Il est temps de tester En utilisant `streamlit run app.py`, on peut rapidement lancer et tester notre application. ![Test de notre application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z8q5o9pppu8grzapkocc.gif) Alors oui, ce n'est pas très joli, mais c'est quand même présentable, et cela sans une seule ligne de CSS. On se retrouve avec un petit jeu qui nous permet de travailler un peu notre vietnamien. L'objectif que l'on s'était fixé semble atteint ! Youpi :tada:! ### Qu'est ce qu'il se passe sous le capeau ? Il me semble important à ce niveau d'insister sur un mécanisme de Streamlit qu'il faut que tout le monde garde à l'esprit si vous voulez utiliser ce framework. Streamlit recharge ce petit script Python que nous venons d'implémenter à **CHAQUE** interaction que nous avons avec l'application. Dans notre cas, cela veut dire qu'à chaque fois que l'utilisateur clique sur un bouton, c'est tout le script qui est relancé. Cela explique plusieurs choses... Cela explique pourquoi certaines de mes "variables", comme par exemple le dataset initial, sont chargées de cette manière : ```python if "words_dict" not in st.session_state: st.session_state["words_dict"] = load_data() ``` Ici, je joue avec le système de ["cache"](https://docs.streamlit.io/get-started/fundamentals/advanced-concepts#caching) de Streamlit pour éviter d'avoir ces données rechargées à chaque interaction. C'est aussi ce qui me permet de conserver mon score malgré les rechargements successifs. En effet, à chaque re-run du script, Streamlit teste si le dictionnaire `st.session_state` contient un élément associé à `"words_dict"` (ce qui est le cas) et donc ne le recharge pas. Cela explique enfin pourquoi la plupart des variables et instructions Streamlit sont réalisées au niveau du scope global du script. Par exemple, les propositions utilisées à chaque question sont chargées dans le scope global : ``` python selected_words_dict = select_quizz_words(words_dict=st.session_state["words_dict"]) ``` Je procède de cette manière car j'ai besoin que ce dictionnaire soit recréé à chaque fois, histoire de changer les propositions et de rendre le jeu, disons... intéressant ! Les boutons sont ainsi recréés aussi à chaque fois avec de nouvelles valeurs, ce qui est notre objectif. ## En conclusion Grâce à Streamlit, j'ai réussi à implémenter cette petite application en moins de 100 lignes de code et en une poignée d'heures. Alors certes, je ne pars pas de rien en Python, et l'application est loin d'être parfaite, tant sur le plan technique que visuel, mais je suis assez content du résultat. Je suis très agréablement surpris de la facilité d'utilisation du framework et du résultat. Le fait que le script soit entièrement rechargé à chaque fois me fait penser que le framework doit avoir des limitations pour des applications plus complexes. De plus, les composants disponibles, bien que nombreux, ne couvrent pas tous les cas d'utilisation d'applications plus sophistiquées. Mais pour des petits prototypes et des applications simples comme celle présentée dans cet article, ça fait largement l'affaire. Concernant mon application, j'aimerais apporter quelques améliorations dans le futur : - Ajouter un message vert en cas de bon résultat ou rouge en cas d'erreur, expliquant la bonne réponse. - Permettre à l'utilisateur de choisir le sens de l'exercice : du vietnamien à l'anglais ou de l'anglais au vietnamien. - Permettre à l'utilisateur de choisir entre un exercice de traduction de mots ou de phrases. - Déployer mon application en ligne. - Faire quelques factorisations du code. - Ajouter d'autres fonctionnalités qui me viendront en tête plus tard, je l'espère :thinking:. Cela fera sûrement l'objet de futurs articles. Ceci étant dit, je vais continuer à explorer ce framework qui répond à l'une de mes problématiques : réussir à créer des applications simples en Python sans avoir besoin de passer plusieurs jours à apprendre à utiliser un framework complexe. À bientôt pour de nouvelles aventures dans le monde simple et efficace de Streamlit. N'hésitez pas à consulter le [repo](https://github.com/kevinl75/practice-vietnamese-app) Gitlab pour retrouver le code de l'article. PS: Cet article a été corrigé grâce à L'IA.
kevin75
1,866,914
From scratch to my first job as a Java developer
Hello, how are you!! 👋 Starting my journey in the world of JAVA development. From Basic to...
0
2024-05-27T19:43:43
https://dev.to/diegojfsr/from-scratch-to-my-first-job-as-a-java-developer-3nge
java, backend, backenddevelopment, programming
Hello, how are you!! 👋 Starting my journey in the world of JAVA development. From Basic to Advanced, I want to go from Zero until I officially get my first job as a Java developer. #fromScratchToMyFirstJobAsJavaDeveloper 👉 While the Java vacancy is not enough, we will add more to the learning, with Santander2024 - Backend with Java. Bootcamp offered by DIO. 🚦 Check out the complete grid: ☑️ Principles of Collaborative Software Development. ☑️ Mastering the Java Programming Language. ☑️ Object Oriented Programming with Java. ☑️ Testing and Dependency Management in Java Projects. ☑️ SQL and NoSQL Database for Back-end Developers. ☑️ Gaining Productivity with Spring Framework and Java. ☑️ Soft Skills in the Agile Era: Connecting People and Opportunities. Check out all my step-by-step instructions, projects and codes developed during the training process.👀 🌐 https://github.com/Diegojfsr/Santander_Backend_Java_2024
diegojfsr
1,866,912
Buy Negative Google Reviews
https://dmhelpshop.com/product/buy-negative-google-reviews/ Buy Negative Google Reviews Negative...
0
2024-05-27T19:41:48
https://dev.to/fosin60384/buy-negative-google-reviews-2cfb
webdev, javascript, beginners, programming
ERROR: type should be string, got "https://dmhelpshop.com/product/buy-negative-google-reviews/\n![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odcvzb65cxr8i0vdiroq.png)\nBuy Negative Google Reviews\nNegative reviews on Google are detrimental critiques that expose customers’ unfavorable experiences with a business. These reviews can significantly damage a company’s reputation, presenting challenges in both attracting new customers and retaining current ones. If you are considering purchasing negative Google reviews from dmhelpshop.com, we encourage you to reconsider and instead focus on providing exceptional products and services to ensure positive feedback and sustainable success.\n\nWhy Buy Negative Google Reviews from dmhelpshop\nWe take pride in our fully qualified, hardworking, and experienced team, who are committed to providing quality and safe services that meet all your needs. Our professional team ensures that you can trust us completely, knowing that your satisfaction is our top priority. With us, you can rest assured that you’re in good hands.\n\nIs Buy Negative Google Reviews safe?\nAt dmhelpshop, we understand the concern many business persons have about the safety of purchasing Buy negative Google reviews. We are here to guide you through a process that sheds light on the importance of these reviews and how we ensure they appear realistic and safe for your business. Our team of qualified and experienced computer experts has successfully handled similar cases before, and we are committed to providing a solution tailored to your specific needs. Contact us today to learn more about how we can help your business thrive.\n\nBuy Google 5 Star Reviews\nReviews represent the opinions of experienced customers who have utilized services or purchased products from various online or offline markets. These reviews convey customer demands and opinions, and ratings are assigned based on the quality of the products or services and the overall user experience. Google serves as an excellent platform for customers to leave reviews since the majority of users engage with it organically. When you purchase Buy Google 5 Star Reviews, you have the potential to influence a large number of people either positively or negatively. Positive reviews can attract customers to purchase your products, while negative reviews can deter potential customers.\n\nIf you choose to Buy Google 5 Star Reviews, people will be more inclined to consider your products. However, it is important to recognize that reviews can have both positive and negative impacts on your business. Therefore, take the time to determine which type of reviews you wish to acquire. Our experience indicates that purchasing Buy Google 5 Star Reviews can engage and connect you with a wide audience. By purchasing positive reviews, you can enhance your business profile and attract online traffic. Additionally, it is advisable to seek reviews from reputable platforms, including social media, to maintain a positive flow. We are an experienced and reliable service provider, highly knowledgeable about the impacts of reviews. Hence, we recommend purchasing verified Google reviews and ensuring their stability and non-gropability.\n\nLet us now briefly examine the direct and indirect benefits of reviews:\nReviews have the power to enhance your business profile, influencing users at an affordable cost.\nTo attract customers, consider purchasing only positive reviews, while negative reviews can be acquired to undermine your competitors. Collect negative reports on your opponents and present them as evidence.\nIf you receive negative reviews, view them as an opportunity to understand user reactions, make improvements to your products and services, and keep up with current trends.\nBy earning the trust and loyalty of customers, you can control the market value of your products. Therefore, it is essential to buy online reviews, including Buy Google 5 Star Reviews.\nReviews serve as the captivating fragrance that entices previous customers to return repeatedly.\nPositive customer opinions expressed through reviews can help you expand your business globally and achieve profitability and credibility.\nWhen you purchase positive Buy Google 5 Star Reviews, they effectively communicate the history of your company or the quality of your individual products.\nReviews act as a collective voice representing potential customers, boosting your business to amazing heights.\nNow, let’s delve into a comprehensive understanding of reviews and how they function:\nGoogle, with its significant organic user base, stands out as the premier platform for customers to leave reviews. When you purchase Buy Google 5 Star Reviews , you have the power to positively influence a vast number of individuals. Reviews are essentially written submissions by users that provide detailed insights into a company, its products, services, and other relevant aspects based on their personal experiences. In today’s business landscape, it is crucial for every business owner to consider buying verified Buy Google 5 Star Reviews, both positive and negative, in order to reap various benefits.\n\nWhy are Google reviews considered the best tool to attract customers?\nGoogle, being the leading search engine and the largest source of potential and organic customers, is highly valued by business owners. Many business owners choose to purchase Google reviews to enhance their business profiles and also sell them to third parties. Without reviews, it is challenging to reach a large customer base globally or locally. Therefore, it is crucial to consider buying positive Buy Google 5 Star Reviews from reliable sources. When you invest in Buy Google 5 Star Reviews for your business, you can expect a significant influx of potential customers, as these reviews act as a pheromone, attracting audiences towards your products and services. Every business owner aims to maximize sales and attract a substantial customer base, and purchasing Buy Google 5 Star Reviews is a strategic move.\n\nAccording to online business analysts and economists, trust and affection are the essential factors that determine whether people will work with you or do business with you. However, there are additional crucial factors to consider, such as establishing effective communication systems, providing 24/7 customer support, and maintaining product quality to engage online audiences. If any of these rules are broken, it can lead to a negative impact on your business. Therefore, obtaining positive reviews is vital for the success of an online business\n\nWhat are the benefits of purchasing reviews online?\nIn today’s fast-paced world, the impact of new technologies and IT sectors is remarkable. Compared to the past, conducting business has become significantly easier, but it is also highly competitive. To reach a global customer base, businesses must increase their presence on social media platforms as they provide the easiest way to generate organic traffic. Numerous surveys have shown that the majority of online buyers carefully read customer opinions and reviews before making purchase decisions. In fact, the percentage of customers who rely on these reviews is close to 97%. Considering these statistics, it becomes evident why we recommend buying reviews online. In an increasingly rule-based world, it is essential to take effective steps to ensure a smooth online business journey.\n\nBuy Google 5 Star Reviews\nMany people purchase reviews online from various sources and witness unique progress. Reviews serve as powerful tools to instill customer trust, influence their decision-making, and bring positive vibes to your business. Making a single mistake in this regard can lead to a significant collapse of your business. Therefore, it is crucial to focus on improving product quality, quantity, communication networks, facilities, and providing the utmost support to your customers.\n\nReviews reflect customer demands, opinions, and ratings based on their experiences with your products or services. If you purchase Buy Google 5-star reviews, it will undoubtedly attract more people to consider your offerings. Google is the ideal platform for customers to leave reviews due to its extensive organic user involvement. Therefore, investing in Buy Google 5 Star Reviews can significantly influence a large number of people in a positive way.\n\nHow to generate google reviews on my business profile?\nFocus on delivering high-quality customer service in every interaction with your customers. By creating positive experiences for them, you increase the likelihood of receiving reviews. These reviews will not only help to build loyalty among your customers but also encourage them to spread the word about your exceptional service. It is crucial to strive to meet customer needs and exceed their expectations in order to elicit positive feedback. If you are interested in purchasing affordable Google reviews, we offer that service.\n\n\n\n\n\nContact Us / 24 Hours Reply\nTelegram:dmhelpshop\nWhatsApp: +1 (980) 277-2786\nSkype:dmhelpshop\nEmail:dmhelpshop@gmail.com"
fosin60384
1,866,911
How to install Aseprite on Windows 11 (2024 - Guide)
This guide is intended for users of Windows 11/10 and assumes prior experience with the terminal and...
0
2024-05-27T19:38:38
https://dev.to/eray_chumak/how-to-install-aseprite-on-windows-11-2024-guide-4ea
This guide is intended for users of Windows 11/10 and assumes prior experience with the terminal and Git. --- ## Motivation I had a rocky experience following the `INSTALL.md` guide to install Aseprite on Windows. At the time of writing, it was updated 8 months ago. I tried contributing an update to help organise it with tables and dropdowns but it was rejected for valid reasons _([see original PR](https://github.com/aseprite/aseprite/pull/4463))_. Not wanting to go through the long process of starting an issue and discussion on their repo, I thought it best to simplify even more and just publish a brief article guide on how to install Aseprite on Windows 11 in 2024 from my own experience. Hopefully, you find this useful 😁 --- ## 1. Get the source code Clone the repository and all its submodules using the following command: ```shell git clone --recursive https://github.com/aseprite/aseprite.git ``` To update an existing clone: ```shell git pull git submodule update --init --recursive ``` --- ## 2. Dependencies To compile Aseprite you will need: | Dependency | Version | Note | | - | - | - | | [CMake](https://cmake.org) | Latest *(minimum v3.16)* | Make available in PATH | | [Ninja](https://ninja-build.org) | Latest | Make available in PATH | | [aseprite/Skia](https://github.com/aseprite/skia/releases) | Skia-m102 | Follow their release notes | > Visit the links for more information on how to download pre-built packages or compile them yourself. **You will also need:** - [Visual Studio Community 2022](https://visualstudio.microsoft.com/downloads/) - Using `Visual Studio Installer`, install the `Desktop development with C++` item with: - Windows 10 SDK (10.0.18362.0) - MSVC v143 - VS 2022 C++ x64/x86 build tools *(or later version)* --- ## 3. Compiling For some of the commands below, make sure they point to the correct paths as they can be different on your system. **3.1 Create a build folder inside `./aseprite`** ```shell cd ./aseprite mkdir build ``` > Remove `build` folder and start again if you want fresh copy of Aseprite. **3.2 Enter the VS 2022 Dev CMD Env.** ```shell call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -arch=x64 ``` **3.3 Run cmake inside `./aseprite/build`:** ```shell cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLAF_BACKEND=skia -DSKIA_DIR=C:\deps\skia -DSKIA_LIBRARY_DIR=C:\deps\skia\out\Release-x64 -DSKIA_LIBRARY=C:\deps\skia\out\Release-x64\skia.lib -G Ninja .. ``` > No MinGW support. See info within [Issue #2449](https://github.com/aseprite/aseprite/issues/2449). **3.4 Run ninja in `aseprite/build` folder** ```shell ninja aseprite ``` You can find the executable inside `./aseprite/build/bin/aseprite.exe`. --- ## Attributions - The official `INSTALL.md` guide can be found on their [official repository](https://github.com/aseprite/aseprite/blob/main/INSTALL.md). - The cover image is a screenshot from their [official website](https://www.aseprite.org/). --- Hopefully, this guide helps you install Aseprite locally on your machine.
eray_chumak
1,866,900
One month after leaving the internet and leaving everyone believing I'm still active.
It's been...a month since I left social media. I said in my previous post that I would delete my...
0
2024-05-27T19:31:15
https://yuricunha.com/blog/one-month-after-leaving-the-internet-and-leaving-everyone-believing-im-still-active/
It's been...a month since I left social media. I said in my previous post that I would delete my social media accounts, but then I did something better: I activated my AIs, my bots, and automated my posts. So, sometimes I post something through my private bot on Telegram. It formats and adds things using Tailwind patterns. My bot sees some posts, likes others, and does what I used to do but have no desire to do anymore: look at what other people are doing. How do I feel off social media? Well, I feel great. I thought I would go through a social media detox, but it seems that it wasn't even necessary. I don't open Instagram, Twitter, or Snapchat to see if anyone sent me something, much less do I check from time to time if someone posted something new, whether it's someone I'm following or someone I like to see (like Yetz). Personally, I'm much better than I was before. My solitude and mindfulness practices have improved significantly. My phone usage has decreased from 1.5 to 2 hours to just 25 to 30 minutes. This has been incredibly beneficial. Currently, my daily activities consist of listening to music on my headphones, responding to messages from my few friends, and occasionally checking Tinder to see what's up. The only exception to my phone usage meter is my Kindle. I don't see the need to own a separate Kindle e-book reader. When I'm out and about, if I'm not reading a physical book or an e-book on my phone, I'm playing games on my PSP (PlayStation Portable), especially on long trips or when I'm not in the mood to read. Shifting gears slightly, but staying on the topic, I'm much happier and more at peace with myself. My friends used to call me a "weird nerd," not in a derogatory sense, but because I have a resting "bad boy" face and always seem angry or like I don't want to talk to anyone. In reality, I'm just a nerdy guy who loves manga, books, anime, and technology. To top it off, I'm low-key and rarely post anything on the internet (my bot does it for me). I only view things I'm tagged or mentioned in, which is quite often. I've always been a fan of my solitude. I only post things that have already happened in my life, so many of my posts are recycled. My AI-powered bot learned this and now replicates it, which makes some people think I'm out having fun with friends when I'm actually just reading a book, chatting with friends on Discord, or playing games on my computer, PlayStation, or PSP. Every day, I go for a morning walk or run, complete my work tasks, and read something. I'm currently reading "The Hedge Knight" by George R.R. Martin, which is set in the same world as "A Song of Ice and Fire" (the Game of Thrones series), but the story takes place before that time period. When I'm not reading, I enjoy taking leisurely walks or runs of 10-15 kilometers around my city. On one of my random walks around, I found one or two people who were sad and I made them smile, but the point is, I usually make people think a lot about life. Just this week, I met a girl walking, and I was walking in the same direction, but I was walking fast, so I was faster than her. When I stopped at the crosswalk, I noticed with my peripheral vision that she was looking at me, so I looked at her, smiled, and she smiled back. I took out my headphones and said, "Every day I like to make someone smile, after all, a day without smiles is a day wasted." She laughed and said that day was not a wasted day. I laughed lovingly at that phrase and told her to take care, put my headphones back on and started walking again. On the way I found a St. Bernard dog (the same name as my city) and I always thought this breed was wonderful, so I had to stop to pet the dog. I thanked the owner for letting me pet the dog and continued on my way. After that I arrived at the Green Area square (the people in my city gave this nickname to the square, but it has another name). I bought an acai, sat on an isolated wooden bench, and listened to some Post Malone songs, while watching people walking, running or exercising, and said to myself "if I was wasting my time on social networks, I wouldn't be able to have smiled as much as I smiled today." Ah, each day has been wonderful and unique, even if I do repetitive things, these things end up becoming unique because of something that happens while I'm doing that task. I believe the craziest part of this is that I am doing many things without losing my solitude. I never looked for validation on social media, just as I never cared if people stopped talking to me. Seriously, I'm the kind of guy that most girls would be angry with, because if I send you a message and you ignore me on purpose, I don't care. If I send you a message and you don't answer me for days, I won't send another message asking for attention, time or an answer. I always answer whenever I pick up my cell phone, so if you take a minute or ten days to answer me, when I pick up my cell phone or open Telegram or WhatsApp on my computer, I will answer you. Many people think that my way of being is because I don't care, and that's not quite right. Although I love my solitude, if I have a relationship with you, whether friendly or romantic, and you take a long time to show up, I will call to see if you are okay. If you don't answer, I will send you a text message or a message through an app. The problem is that it takes time for you to become my friend, but when that happens, you become part of my lived routine. There is a big difference between when you are just a person who talks to me and when you become at least a person with a relationship that I consider a friendship. And probably the biggest difference is that I will show and talk much more than if you weren't. Now, speaking of this blog, it is my day-to-day or what I like to call my "time-to-time", because I post here when I believe there will be a post, and it is not linear, quite the contrary. Well, today I will end this post here. Always remember that you can send me an email or call me on Telegram. Take care.
isyuricunha
1,866,899
My last goodbye
In the midst of this era defined by relentless connectivity, I stand at the crossroads of an...
0
2024-05-27T19:30:03
https://yuricunha.com/blog/my-last-goodbye/
In the midst of this era defined by relentless connectivity, I stand at the crossroads of an extraordinary digital transformation, contemplating a pivotal decision that will redefine my relationship with the virtual realm. Today signifies the commencement of a profound chapter—the deliberate erasure of my social media footprint. Instagram, Facebook, Twitter, Snapchat, and various other platforms that once dictated my online existence are now on the brink of extinction in my digital universe. In this odyssey, I'm not merely bidding farewell to virtual connections; I'm dismantling the intricate web of automation that once orchestrated my online narrative. Imagine this: my Instagram, once a meticulously curated gallery of automated reposts imitating the influencer Yetz, is now dissipating into the vast digital abyss. The seamless replication of Yetz's Instagram stories, orchestrated by bots and AI, is gracefully coming to a halt. This departure signifies more than just a retreat from artificial glamour; it marks a profound shift from the borrowed shine of someone else's life. My inner circle, ever adaptive, has already transitioned to alternative communication platforms such as Signal, Session, or Telegram to stay connected. Nevertheless, the impending solitude prompts a self-imposed digital retreat. My phone, now permanently set in 'Do Not Disturb' mode and cloaked in grayscale, imposes strict limits on the time allocated to each application—a mere 25 minutes per day. Farewell, Facebook, Instagram, and Snapchat; a new chapter begins. The decision to sever ties with social media is deeply rooted in a profound realization: the reasons to disconnect far outweigh those compelling me to stay linked. The tipping point was a seemingly idyllic Instagram post showcasing a picturesque sunset, concealing the underlying truth of that moment—I was battling subtle depression, hungry and cold. Why did I feel the need to showcase a facade of perfection when authenticity was my true essence? To aid in this transformative endeavor, I've armed myself with an arsenal of tools and strategies: ### On my computer: - News Feed Eradicator - Distraction-free YouTube extension ### On my iPhone: - Grayscale display - Airplane mode - Focus modes, particularly 'Do Not Disturb' - App-specific time limits ### In cultivating healthy habits: - Meditation heightens self-awareness, curbing impulsive behaviors. - Reading replaces mindless scrolling, enhancing attention span. - Musical instruments and sports fill the void with gratifying activities. ### Various lifestyle changes: - A physical alarm clock keeps my phone in a separate room, deterring late-night or early-morning digital temptations. - A 'dumb' watch replaces my Fitbit, reducing dependency on constant notifications. - A notebook and pen capture fleeting thoughts, replacing digital clutter. - Kindle or physical books offer an escape from the digital world. - Letter writing with envelopes and stamps resurrects the charm of traditional correspondence. - Venturing outside, I intentionally leave my phone behind or stow it away in a bag. The more I distance myself, the more I realize how little I truly need it. In the pursuit of disconnection, I find solace in silence—a sanctuary away from the curated noise of social media. This intentional withdrawal is a quest to rediscover authenticity, rebuild meaningful connections, and savor the beauty of life without the digital filter. As the days unfold in my journey of digital emancipation, the void left by the absence of constant notifications and virtual validations begins to fill with a profound sense of clarity. The quiet moments, once drowned out by the incessant buzz of likes and comments, now echo with the subtle melody of my own thoughts. The deliberate steps I've taken to minimize my digital presence are slowly transforming into a dance of liberation, a choreography of rediscovery. With each passing sunrise, I witness the world with unfiltered eyes, unencumbered by the virtual lens that once colored my perceptions. The hues of the sky, the rustle of leaves, and the laughter of strangers in a coffee shop all become more vibrant, more authentic, as if the world has shed its pixelated veil. This newfound clarity extends beyond the physical realm, penetrating the depths of my relationships. I begin to appreciate the genuine conversations that flourish without the constant interruption of notification pings. The richness of a shared moment, unmarred by the compulsion to document it for online consumption, adds a layer of authenticity to my interactions. As I delve into the art of letter writing, the tactile pleasure of putting pen to paper becomes a sensory experience, replacing the sterile tap of a keyboard. The digital detox seeps into my professional life, too, as I reevaluate the meaning of productivity in a world perpetually connected. The once incessant urge to check emails and respond to Slack messages is replaced by a deliberate focus on deep work. My creative pursuits, once overshadowed by the instant gratification of social media engagement, now unfold in the quiet sanctuary of concentration. Yet, the process of disconnecting is not without its challenges. The reflex to reach for my phone in idle moments, seeking the instant distraction of a digital scroll, remains a persistent echo of my former self. However, armed with resilience, I redirect that impulse towards more mindful activities – a few pages of a captivating novel, a stroll in the park, or a moment of quiet reflection. The absence of curated perfection in my virtual life accentuates the beauty of imperfection in the real world. I embrace the candid snapshots of life, acknowledging the rawness of emotions and the unpredictability of experiences. The flaws and vulnerabilities once concealed behind filters now stand proudly, adding depth to the tapestry of my existence. As I navigate this uncharted territory, I find myself becoming an unintentional advocate for a life less digitally adorned. Friends and acquaintances, initially perplexed by my decision, begin to witness the transformative effects. Some join me in the pursuit of mindful disconnection, while others observe from a distance, curious about the path less traveled. In the quietude of this digital detox, I forge a deeper connection with myself. The introspective moments that were once fleeting now become a constant companion. In the absence of external validations, I discover an internal compass guiding me towards authenticity and self-discovery. With each passing chapter of this narrative, the decision to sever ties with the digital mirage emerges as a pivotal turning point. The canvas of my life, once crowded with pixelated imitations, now awaits the strokes of genuine experiences and unfiltered emotions. The odyssey continues, and as I navigate the uncharted waters of a life less connected, I realize that in disconnecting from the virtual noise, I'm uncovering the symphony of my true self.
isyuricunha
1,866,908
Buy verified cash app account
https://dmhelpshop.com/product/buy-verified-cash-app-account/ Buy verified cash app account Cash app...
0
2024-05-27T19:29:09
https://dev.to/fosin60384/buy-verified-cash-app-account-2h2o
webdev, javascript, beginners, programming
ERROR: type should be string, got "\nhttps://dmhelpshop.com/product/buy-verified-cash-app-account/\n![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6he700wmaimg827tlfiw.png)\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"
fosin60384
1,866,898
Exploring the Fascinating Field of Botany
Botany, the scientific study of plants, is a diverse and dynamic field that plays a crucial role in...
0
2024-05-27T19:25:19
https://dev.to/edward_jack_f0739d3d50885/exploring-the-fascinating-field-of-botany-1093
webdev, devops, discuss, news
Botany, the [scientific study of plants](https://botanylive.com/), is a diverse and dynamic field that plays a crucial role in our understanding of the natural world. From the tiniest algae to the largest trees, botany encompasses the study of all plant life, providing insights into their structure, growth, reproduction, metabolism, development, diseases, and evolutionary relationships. Here’s an overview of what makes botany such a vital and captivating discipline. Importance of Botany 1. Biodiversity and Conservation Botanists work to identify, classify, and study plant species, contributing to our knowledge of biodiversity. This is essential for conservation efforts, as understanding plant diversity helps in protecting endangered species and preserving ecosystems. 2. Agriculture and Food Security Botany is fundamental to agriculture, as it involves the study of crops and their growth conditions. Advances in plant science lead to improved crop yields, pest resistance, and sustainable farming practices, all of which are critical for food security. 3. Medicinal Plants Many plants have medicinal properties and are used in traditional and modern medicine. Botanists study these plants to discover new drugs and understand how they can be used to treat various health conditions. 4. Environmental Impact and Climate Change Plants play a key role in the Earth’s carbon cycle and are integral to combating climate change. Botanists study plant responses to environmental changes, helping to predict and mitigate the effects of climate change. Key Areas of Study in Botany 1. Plant Physiology This area focuses on understanding how plants function, including processes such as photosynthesis, nutrient uptake, and water transport. Knowledge of plant physiology is crucial for improving crop efficiency and addressing issues related to plant health. 2. Plant Taxonomy Plant taxonomy involves the classification and naming of plants. This systematic approach helps scientists communicate about plant species and understand their evolutionary relationships. 3. Plant Ecology Plant ecologists study the interactions between plants and their environments, including relationships with other organisms. This field is essential for ecosystem management and conservation efforts. 4. Plant Genetics Plant genetics explores the genetic makeup of plants and how traits are inherited. This knowledge is applied in plant breeding to develop new varieties with desirable characteristics, such as disease resistance and increased productivity.
edward_jack_f0739d3d50885
1,866,897
Buy verified cash app account
Buy verified cash app account Cash app has emerged as a dominant force in the realm of mobile banking...
0
2024-05-27T19:22:23
https://dev.to/robert_miller_3916c1653f0/buy-verified-cash-app-account-3i3p
Buy verified cash app account Cash 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. https://dmhelpshop.com/product/buy-verified-cash-app-account/ Our 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. Why dmhelpshop is the best place to buy USA cash app accounts? It’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. Clearly 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. Our account verification process includes the submission of the following documents: [List of specific documents required for verification]. https://dmhelpshop.com/product/buy-verified-cash-app-account/ Genuine and activated email verified Registered phone number (USA) Selfie verified SSN (social security number) verified Driving license BTC enable or not enable (BTC enable best) 100% replacement guaranteed 100% customer satisfaction When 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. Clearly 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. Additionally, 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. How to use the Cash Card to make purchases? To 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. https://dmhelpshop.com/product/buy-verified-cash-app-account/ 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 buy verified Cash App account for seamless transactions, especially for business purposes. Buy verified cash app account. Why we suggest to unchanged the Cash App account username? To 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. 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. https://dmhelpshop.com/product/buy-verified-cash-app-account/ Selecting 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.   Buy verified cash app accounts quickly and easily for all your financial needs. As 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. For 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. https://dmhelpshop.com/product/buy-verified-cash-app-account/ When 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. This 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.  https://dmhelpshop.com/product/buy-verified-cash-app-account/ Is it safe to buy Cash App Verified Accounts? Cash 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. Unfortunately, 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. Cash 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. https://dmhelpshop.com/product/buy-verified-cash-app-account/ Leveraging 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.  https://dmhelpshop.com/product/buy-verified-cash-app-account/ Why you need to buy verified Cash App accounts personal or business? The 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. To 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. If 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. Improper 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. A 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. This 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.  https://dmhelpshop.com/product/buy-verified-cash-app-account/ How to verify Cash App accounts To 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. As 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.   How cash used for international transaction? Experience 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. No 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. Understanding 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. As 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. Offers and advantage to buy cash app accounts cheap? With 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. We 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. Enhance 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. Trustbizs.com stands by the Cash App’s superiority and recommends acquiring your Cash App accounts from this trusted source to optimize your business potential. How Customizable are the Payment Options on Cash App for Businesses? Discover 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. Explore 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. Discover 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. Where To Buy Verified Cash App Accounts When 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. Equally 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. The Importance Of Verified Cash App Accounts In 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. By 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. When 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. Equally 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. Conclusion Enhance 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. Choose 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. Contact Us / 24 Hours Reply Telegram:dmhelpshop WhatsApp: +1 ‪(980) 277-2786 Skype:dmhelpshop Email:dmhelpshop@gmail.com
robert_miller_3916c1653f0
1,866,896
reflections of a conflicted impostor
Ah... how difficult it is to admit this, but I failed. Actually, I don't know if it's difficult, if...
0
2024-05-27T19:20:27
https://dev.to/isyuricunha/reflections-of-a-conflicted-impostor-1o7l
Ah... how difficult it is to admit this, but I failed. Actually, I don't know if it's difficult, if I'm afraid, or if I just lack courage, despite many people saying that fear is the absence of courage, so this might be redundant. I always thought I was a very intelligent guy and ahead of my time, especially when I was around 18 years old or younger. I remember people always saying that I was very mature for my age, because I had values that were already lost, and even my culture was from generations much earlier than mine. When technology was still a novelty, and servers were something only large or well-structured companies had, I was basically a master, and I was still a minor... I remember setting up LANs for acquaintances or friends to play games, and even setting up a server (more like hosting in this case) at home, so people could create their own game servers, websites, emails, and various programs... I did so many things that were, well, let's say "ahead of my time." Talking like this, I even seem old, but I'm still not over 25. The issue, in itself, is that I miserably failed to become someone better or maybe even to be someone. I don't know exactly how I failed, much less where I failed professionally, because, seriously, I have two degrees, over 90 courses (which I paid for), including at Harvard, Cisco, and even Microsoft certifications, but still, professionally, I feel that I failed and continue to fail, even going through trial and error. And when it comes to being a person, on a personal level, I also failed, I don't know how and I don't know where, but I miserably failed. I lost one of my three friends, I currently check my phone about 3-4 times a day, and totaling that time, I don't exceed about one to two hours a day on my phone (excluding when I'm out or traveling, in which case screen time usually exceeds eight hours since I watch anime). And I can't feel good about myself today, I can't have a romantic relationship with any girl, not because I'm not attracted to any, but because I simply don't have the desire to talk to someone in that sense. I can't simply like most of my family, mainly due to their attitudes, which I don't agree with. Besides, I consider family to be people who are with me, who share moments with me, or who simply create bonds, not people who share part of my DNA. Maybe my solitude and loneliness have brought me this feeling? I doubt it. My solitude and loneliness are things I chose and am happy with in most cases, and my indifference to things that don't affect me is also something I feel good about. Actually, these or this is the only point where I feel good and accomplished. Honestly, this seems like an endless confusion. A crazy paradigm or paradox. My professional failure, in which I dedicate and have dedicated a lot, building a name in the technology field, participating in various open and even some closed projects. Building a GitHub portfolio that has surpassed six thousand followers. My personal failure, even though I've understood that I enjoy my solitude, loneliness, and indifference to most problems. However... where are these failures? Where exactly did I go wrong? Where can't I recognize the error, or why do I believe there is a failure? What kind of mental confusion is this? Ah, my psychologist said that I suffer from impostor syndrome: I think I'm bad at everything, that I don't do anything well or good, and that I failed miserably at everything, but actually, I'm fine and doing well, but I deceive and lie to myself saying the opposite. But honestly? I don't know, I can't see or understand that. Maybe my chronic depression is causing this? Even if it's somewhat stable? Or is it because I grew up hearing from my biological parents that I was a shame and should have died? Even hearing from my adoptive parents that I was a pride and the best they could have? Changing the subject a bit but still within it, sometimes I cry at night and don't even seem like the same person during the day or in front of others. When I'm out with my headphones on, listening to a song I really like, I dance alone and even sway if I don't dance. I smile when I see something I find cool or a person who has an enjoyable conversation, and look, even people who don't agree with me but know how to have a debate make me smile because we are human beings with different cultures, ideas, or views, but who can still have a conversation with debate without attacking the other. I also laugh, even chuckle, when I see something funny. And all this on the street, but most of the time, my mind is thinking about how I managed to fail in every aspect of my life and how I'm a despicable person, while at the same time thinking I'm an awesome guy, and hearing from others how intelligent I am. In the end, am I a flawed, confused, silly, good, intelligent guy, or a bit of everything? Honestly, I don't know.
isyuricunha
1,866,889
Train Release: Uma abordagem para entrega de apps mobile
No contexto de enviar versões de app mobile para loja, um Release Train assume um papel crucial na...
0
2024-05-27T19:16:14
https://dev.to/yagoliveira92/train-release-uma-abordagem-para-entrega-de-apps-mobile-j26
mobile, android, ios, cicd
No contexto de enviar versões de app mobile para loja, um Release Train assume um papel crucial na agilização, padronização e otimização do processo de lançamento. Funciona como um trem em movimento constante, transportando incrementos de valor para os usuários de forma regular e eficiente. <p align="center"> <img src="https://miro.medium.com/v2/resize:fit:800/0*lr82C1yiwA5rIAAy" /> </p> <p style="text-align: center;">Exemplo de Fluxo de um Train Release de um app mobile</p> ##O que é um Train Release Como o próprio nome sugere, um "Trem de Lançamento" é um fluxo de trabalho que ocorre periodicamente. A analogia com um trem se refere à ideia de que, assim como os trens param em estações para pegar passageiros, os lançamentos periódicos carregam mudanças e correções de software, levando-as até o destino final: o dispositivo do usuário. Para implementar um Train Release de forma eficaz, primeiro defina os intervalos de tempo para cada estágio de desenvolvimento e determine quanto tempo será dedicado aos testes de integração, testes beta e aos estágios de lançamento. Durante a fase de desenvolvimento, as equipes têm tempo para revisar, testar e mesclar os recursos no branch principal que será incluído no trem. Quando o conteúdo de um lançamento é definido e está pronto, ocorre uma fase final de testes de integração. Nesta fase, os membros da equipe devem verificar se os novos recursos e correções funcionam conforme esperado. Bugs serão corrigidos e mesclados novamente, se necessário. Um congelamento de código pode marcar o fim de um ciclo de desenvolvimento e o início de outro. As equipes de desenvolvimento podem então iniciar um novo sprint para continuar o processo até o próximo lançamento. ##Exemplo de Train Release Uma empresa está lançando um novo app mobile para iOS e Android. O app oferece funcionalidades para gerenciar tarefas, notas e calendário. A equipe de desenvolvimento utiliza o framework Scrum para gerenciar o projeto e deseja implementar o Release Train para otimizar o processo de lançamento. 1. **Defina o intervalo de tempo:** No caso da empresa, por ser uma equipe pequena, ficou definido uma janela de desenvolvimento de quinze dias (duas semanas). 1. **Congelamento do código**: Passado o período de desenvolvimento, é criado uma branch do código base naquela data. Até este momento, todos devem ter incluído suas funcionalidades e correções. Não é permitida a adição de novo código na branch de congelada, a não ser que seja para corrigir algo como veremos a seguir. 1. **Entrega para equipe de testes**: Um build do app é entregue para a equipe de qualidade da empresa. Eles devem ter os casos de uso definidos e todo o roteiro das funcionalidades novas e antigas, garantindo que tudo esteja funcionando. 1. **Correções**: Como a vida não é um morango, a equipe de qualidade pode encontrar problemas e inconsistências. Aqui criamos correções que vão para apenas a branch de congelamento e refazemos os testes. 1. **Disponibilização nas lojas**: Após os testes e tudo aprovado, a nova versão é enviada para lojas. 1. **Monitoramento**: É muito importante que o app seja monitorado para que possíveis problemas sejam corrigidos o mais rápido possível ou suspender a publicação daquela versão. ##Como o Release Train se aplica ao lançamento de apps mobile: **Planejamento em ciclos:** O Release Train define ciclos de planejamento regulares com duração fixa, onde cada empresa ou produto escolhem o melhor intervalo. Nesses ciclos, as equipes definem metas, priorizam tarefas e traçam o roteiro para o próximo lançamento. **Sincronização e ritmo constante:** Diferente de lançamentos pontuais e desorganizados, o Release Train sincroniza o trabalho de todas as equipes envolvidas, garantindo um ritmo constante de entregas. Isso significa que os incrementos de valor, seja uma nova funcionalidade ou correção de bug, chegam aos usuários com frequência previsível. **Visibilidade e colaboração:** O Release Train utiliza ferramentas e práticas para tornar o progresso do trabalho transparente para todos. Isso facilita a identificação e resolução de problemas de forma proativa, além de promover a colaboração e o engajamento entre as equipes. **Foco em entregas frequentes:** O objetivo principal do Release Train é a entrega frequente de valor aos usuários. Isso significa que, em vez de esperar por um lançamento grandioso com todas as funcionalidades prontas, o app é lançado com incrementos que oferecem benefícios tangíveis aos usuários a cada ciclo. **Adaptabilidade e feedback:** O Release Train é um processo adaptável que se ajusta às necessidades do projeto e do mercado. O feedback dos usuários é coletado e utilizado para aprimorar o app e direcionar o desenvolvimento em iterações futuras. ##Benefícios do Release Train para lançamento de apps mobile: - Maior velocidade de lançamento: Com lançamentos frequentes e previsíveis, o Release Train reduz drasticamente o tempo necessário para levar novos recursos e correções aos usuários. - Maior qualidade do app: A entrega frequente de valor permite que os bugs sejam identificados e corrigidos rapidamente, resultando em um app mais estável e confiável. - Maior satisfação do cliente: Ao receber novas funcionalidades e melhorias com frequência, os usuários se sentem mais engajados e satisfeitos com o app. - Maior agilidade e adaptabilidade: O Release Train permite que a equipe responda rapidamente às mudanças nas necessidades do mercado e dos usuários, ajustando o roteiro e priorizando as funcionalidades de acordo com o feedback. Em resumo, o Release Train é uma ferramenta poderosa para otimizar o lançamento de apps mobile, proporcionando maior velocidade, qualidade, satisfação do cliente e agilidade. Se você busca um processo mais eficiente e eficaz para levar seu app aos usuários, o Release Train pode ser a solução ideal. Foto de <a href="https://unsplash.com/pt-br/@jk?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">JK</a> na <a href="https://unsplash.com/pt-br/fotografias/trem-em-movimento-perto-de-arvores-gJhev0YgUcE?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>
yagoliveira92
1,866,895
GradeCalc: Your Ultimate Tool for Calculating Grades
Keeping track of grades and understanding your academic performance can be challenging. Whether...
0
2024-05-27T19:16:09
https://dev.to/edward_jack_f0739d3d50885/gradecalc-your-ultimate-tool-for-calculating-grades-19il
webdev, beginners, discuss, news
Keeping track of grades and understanding your academic performance can be challenging. Whether you’re a student aiming for high marks, a teacher managing class scores, or a parent monitoring your child’s progress, having an efficient tool to calculate grades is essential. GradeCalc is a versatile and user-friendly solution designed to make grade calculation easy, accurate, and accessible for everyone involved in education. **[What is GradeCalc](https://gradescalc.com/)?** GradeCalc is an online grade calculator that helps users compute their grades quickly and accurately. It supports various grading systems and can handle different types of assessments such as quizzes, assignments, exams, and participation scores. By inputting your scores and the corresponding weights of each component, GradeCalc provides an instant overview of your academic performance. ** Key Features of GradeCalc** 1. Multiple Grading Systems GradeCalc supports a variety of grading systems, including letter grades, percentages, and GPA scales. This flexibility makes it suitable for different educational institutions and grading policies. Whether you’re in high school, college, or university, GradeCalc can adapt to your specific grading criteria. 2. Weighted Grade Calculation Different assessments often have different weights that contribute to the final grade. GradeCalc allows you to input the weight of each assessment, ensuring an accurate calculation of your overall grade. This feature is particularly useful for courses with multiple components, such as labs, projects, and exams, each contributing differently to the final grade. 3. What-If Scenarios One of the standout features of GradeCalc is its ability to simulate what-if scenarios. Students can input hypothetical scores for upcoming assessments to see how they would impact their final grade. This tool is invaluable for setting goals and understanding what is needed to achieve a desired grade. 4. Easy-to-Use Interface GradeCalc boasts a simple and intuitive interface that makes it easy for users of all ages to navigate. The straightforward design ensures that you can quickly input your data and get results without any hassle. The clear and concise layout helps users focus on what matters most: their grades. 5. Mobile Compatibility Understanding the need for accessibility, GradeCalc is fully compatible with mobile devices. You can calculate your grades on-the-go using your smartphone or tablet, making it convenient to check your academic progress anytime, anywhere. 6. Data Privacy and Security GradeCalc prioritizes the privacy and security of your data. The platform ensures that all information entered is kept confidential and is not shared with third parties. This commitment to data security gives users peace of mind when using the tool.
edward_jack_f0739d3d50885
1,866,892
Communication Among Services in Microservices Architecture? Let's Clear it Out!
When services communicate with each other in a microservices architecture, there are two common...
0
2024-05-27T19:10:37
https://dev.to/hzahar/communication-among-services-in-microservices-architecture-lets-clear-it-out-14h6
microservices, architecture, softwareengineering, software
When services communicate with each other in a microservices architecture, there are two common patterns: Sync and Async. In Sync architecture, services call each other typically via direct API calls or other request/response methods. This means that if a service is down, all other dependent services are also down. But this pattern can simplify handling data consistency and reduce data duplication as each service can fetch data when needed. In Async architecture, services send messages to each other via messaging systems like message queues or event streams where messages are sent without requiring an immediate response. Services are relatively independent and don’t need to wait for each other to respond. If one service fails, other services continue functioning without caring much and will process messages as they become available once the failed service is restored. But this approach usually requires data duplication and extra consistency handling mechanisms, since each service most likely needs to have its own data copy to serve independently. It might seem like the async approach is the best choice for unicorn projects, but this isn't always the case. Whether to use Sync or Async pattern depends on various factors such as the requirements of the software, budget, market demand, etc. It's important to note that gaining one advantage usually means sacrificing another. Most large-scale software is built on a hybrid pattern to maximize optimization. I'm building a simple application using microservices architecture in my free time for fun. Shoot any questions you have. Stay tuned to get updates <3
hzahar
1,866,891
Transforming Spaces: The Artistry of Upholstery Shops
In the realm of interior design, upholstery plays a pivotal role in breathing life into furniture and...
0
2024-05-27T19:08:48
https://dev.to/upholsteryshop/transforming-spaces-the-artistry-of-upholstery-shops-o39
In the realm of interior design, upholstery plays a pivotal role in breathing life into furniture and spaces. Upholstery shops serve as sanctuaries for both artisans and clients, where creativity intertwines with functionality. From vintage armchairs to contemporary sofas, these establishments are hubs of craftsmanship and innovation. ## The Heritage of Upholstery: A Historical Perspective Upholstery traces its roots back to ancient civilizations, where textiles were used to adorn furniture for both comfort and aesthetics. Over time, this craft evolved, with techniques refined and styles diversified across cultures. From the opulent tapestries of the Renaissance to the minimalist designs of the modern era, upholstery reflects the zeitgeist of its time. ### *Revival in Contemporary Design* In recent years, there has been a resurgence of interest in upholstery, driven by a desire for personalized and sustainable decor. [Upholstery shops](https://upholsteryshop.ae/) have adapted to this trend by offering bespoke services that cater to individual tastes and preferences. This revival has also sparked innovation in materials and techniques, pushing the boundaries of traditional upholstery. ### **The Anatomy of an Upholstery Shop: Crafting Spaces, Crafting Stories** At the heart of every upholstery shop lies the workshop, where skilled artisans bring furniture back to life. Here, old becomes new as fabrics are carefully chosen, and frames are meticulously restored. From hand-stitching intricate patterns to applying the final touches, every step in the process is a testament to the artisan's dedication and expertise. ### *Showroom: Inspiring Imagination* The showroom serves as a showcase of possibilities, where clients can explore an array of fabrics, colors, and designs. It's a space where dreams take shape, and ideas come to fruition. Upholstery shops curate their collections with care, offering everything from classic prints to avant-garde textures, ensuring that there's something for every taste and style. ### *Consultation Area: Bridging Vision and Reality* The consultation area is where the magic begins, where clients collaborate with designers to bring their vision to life. Here, concepts are discussed, and plans are laid out, ensuring that every project is tailored to meet the client's needs. Whether it's a simple reupholstery or a complete custom design, this is where ideas take flight. ### **The Artisan's Touch: Celebrating Craftsmanship** At the heart of every upholstery shop are the master upholsterers, whose skills have been honed over years of dedication and practice. These artisans are custodians of tradition, preserving age-old techniques while embracing innovation. Their craftsmanship is imbued with a sense of pride and passion, evident in every stitch and seam. ### *Attention to Detail: Beauty in the Details* It's often said that the devil is in the details, and nowhere is this more evident than in upholstery. From perfectly aligned patterns to precisely tailored seams, attention to detail is paramount. It's these subtle touches that elevate a piece from ordinary to extraordinary, transforming it into a work of art. ### *Quality Craftsmanship: A Testament to Excellence* In a world of mass production, quality craftsmanship stands out as a beacon of excellence. Upholstery shops take pride in the quality of their work, using only the finest materials and techniques. Each piece is crafted with care and precision, ensuring not only beauty but also longevity. It's this commitment to quality that sets upholstery shops apart, earning them the trust and loyalty of their clients. ### **The Intersection of Art and Functionality: Upholstery in Modern Design** In modern design, upholstery serves as a bridge between form and functionality. It's no longer enough for furniture to be aesthetically pleasing; it must also be comfortable and practical. Upholstery shops excel in striking this delicate balance, creating pieces that are as beautiful as they are functional. ### *Sustainability: Upholding Values* As awareness of environmental issues grows, so too does the demand for sustainable design solutions. Upholstery shops are at the forefront of this movement, embracing eco-friendly materials and practices. From organic fabrics to upcycled frames, they are finding innovative ways to reduce their carbon footprint while still delivering exceptional quality. ### *Personalization: Making It Your Own* In a world of mass-produced furniture, personalization has become a luxury. Upholstery shops offer a welcome alternative, where every piece can be tailored to suit the client's unique style and preferences. Whether it's a bold color choice or a custom embroidery design, the possibilities are endless, allowing clients to truly make their mark on their space. ## **Conclusion: Upholding Tradition, Embracing Innovation** Upholstery shops are more than just places of business; they are guardians of tradition and bastions of creativity. In a world where disposable culture reigns supreme, they stand as a testament to the enduring value of craftsmanship and quality. As we look to the future, one thing is clear: the artistry of upholstery shops will continue to shape the spaces we inhabit, transforming houses into homes and furniture into works of art.
upholsteryshop
1,866,890
Monkey Patching in JavaScript
What is Monkey Patching 🐵 The term “monkey patching” is borrowed from the world of...
0
2024-05-27T19:08:46
https://dev.to/mrhimanshusahni/monkey-patching-in-javascript-19c8
javascript, webdev, learning, programming
## **What is Monkey Patching 🐵** The term “**monkey patching**” is borrowed from the world of software development, where it refers to the practice of modifying or extending code at runtime. In JavaScript, it allows developers to alter or extend the behavior of existing objects or classes without directly modifying their source code. In simple term's it is : <u>_**Monkey patching**_ is a technique to add, modify, or suppress the default behavior of a piece of code at runtime without changing its original source code.</u> Monkey patching involves making changes to existing code, typically by adding new methods or properties to objects or classes, or by modifying existing ones. This can be done at runtime, allowing developers to augment functionality without altering the original code base. Monkey patching is often used to fix bugs, add missing features, or adapt third-party libraries to better suit specific requirements. **_Let's see a basic example to understand this concept_** ![basic-code-example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4yexva04c1jposq7xea.png) <u>**Pros of Monkey Patching**</u> 1. Monkey patching allows developers to extend or modify existing code without directly altering its source, providing flexibility in adapting libraries or frameworks to specific requirements. 2. Developers can experiment with new features or enhancements without committing to permanent changes in the code base. 3. It enables quick fixes to issues or bugs in third-party code without waiting for official updates or patches. <u>**Cons of Monkey Patching**</u> 1. Overuse of monkey patching can lead to code base complexity and reduced readability, making it harder to understand and maintain. 2. Modifying existing code at runtime can introduce unintended side effects or conflicts, especially in large or collaborative projects. 3. **Global Scope Pollution**: Global scope pollution refers to a situation where too many variables, functions, or objects are introduced into the global scope. This makes it cluttered and can potentially lead to unintended behaviors. Monkey patching can introduce global scope pollution by adding or modifying properties and methods on built-in prototypes or objects. This can lead to naming conflicts and bugs, especially when using multiple libraries or codebases. **Traditional Monkey Patching and Why It Is it is Dangerous** ![traditional-monkey-patching](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1zoy7ll6h30zjemtfwx.png) - The author of `Array` could add a different implementation of `logAllMembers`, which could break your code which relies on your implementation. - Elsewhere in your codebase, someone could add a different implementation of `logAllMembers`, leading to fragile code. - Elsewhere in your codebase, it will be hard to tell whether `Array` has been patched or not, so other programmers (or you) could accidentally depend on `Array` being patched or not-patched. ## **Conclusion** **Monkey patching** is a powerful technique for extending or modifying existing code dynamically. However, it comes with considerations like understanding the prototype chain, avoiding global scope pollution. While implementing monkey patching, you must exercise caution, document changes, and thoroughly test patches to mitigate compatibility issues and security risks.
mrhimanshusahni
1,866,888
Javascript Equality Check
In javascript equality sign= is used for assigning variables so we use something different to check...
0
2024-05-27T18:58:19
https://dev.to/ikbalarslan/javascript-equality-check-37m6
In javascript equality sign`=` is used for assigning variables so we use something different to check equality. In javascript, we have three ways to check equality: - double equals `==` - triple equals `===` - `Object.is()` ### == (double equals) Double equals will allow coercion this is the algorithm for double equals: 1 - if types are the same do the rest of the calculations with triple equals 2 - null and undefined are equal to each other. 3 - if any side is reference type call ToPrimitive() 4 - if we have two different primitive types convert both of them to numbers then do the equality check. Since double equals allow coercion it allows some corner cases as well for example ``` [] == ![] // true ``` For not dealing with corner cases we shouldn't use these with double equals: - don't use 0,"", " " - don't use reference types - don't compare with a boolean > If the types are equal it will send it to triple equals anyway ### === (triple equals) It doesn't allow coercion. first, it checks the types if the types are equal it will check values then it will check equality. ``` 1 === "1" //Since the types are not equal its false ``` ### Object.is() It behaves the same as the triple-equals operator except `NaN` and `+0` and `-0`. ``` 1 === 1; // true Object.is(1, 1); // true +0 === -0; // true Object.is(+0, -0); // false NaN === NaN; // false Object.is(NaN, NaN); // true
ikbalarslan
1,866,887
Gia Han
Xin chào mọi người, mình là Gia Hân! Sức khỏe là niềm đam mê lớn nhất của mình, và mình luôn mong...
0
2024-05-27T18:54:48
https://dev.to/giahansongkhoe/gia-han-416i
Xin chào mọi người, mình là Gia Hân! Sức khỏe là niềm đam mê lớn nhất của mình, và mình luôn mong muốn được chia sẻ những kiến thức bổ ích về bệnh học cũng như các bí quyết chăm sóc sức khỏe toàn diện đến với mọi người. Hãy cùng mình khám phá hành trình sống khỏe, sống vui và tràn đầy năng lượng mỗi ngày nhé! Website: https://www.facebook.com/profile.php?id=61560278573274 Phone: 0984827621 Address: 235 Dang Thuy Tram, Phuong 13, quan Binh Thanh, TP.HCM https://chart-studio.plotly.com/~giahansongkhoe http://gendou.com/user/giahansongkhoe https://inkbunny.net/giahansongkhoe https://timeswriter.com/members/giahansongkhoe/ https://guides.co/a/gia-han-681604 https://www.diggerslist.com/giahansongkhoe/about https://linkmix.co/23442795 https://www.penname.me/@giahansongkhoe https://www.anibookmark.com/user/giahansongkhoe.html https://www.gaiaonline.com/profiles/giahansongkhoe/46697262/ https://community.tableau.com/s/profile/0058b00000IZYVB https://us.enrollbusiness.com/BusinessProfile/6698662/giahansongkhoe https://portfolium.com/giahansongkhoe https://link.space/@giahansongkhoe https://penzu.com/p/0681d314efec44a6 http://buildolution.com/UserProfile/tabid/131/userId/405688/Default.aspx https://hackerone.com/giahansongkhoe?type=user https://www.silverstripe.org/ForumMemberProfile/show/152503 https://gettr.com/user/giahansongkhoe https://allods.my.games/forum/index.php?page=User&userID=149197 https://huggingface.co/giahansongkhoe https://readthedocs.org/projects/httpswwwfacebookcomprofilephpid61560278573274/ https://community.fyers.in/member/cbTrEHTmLa https://www.reverbnation.com/giahansongkhoe https://www.instapaper.com/p/giahansongkhoe https://roomstyler.com/users/giahansongkhoe https://www.metooo.io/u/6654cdfc583ad610d5ab02e7 https://answerpail.com/index.php/user/giahansongkhoe https://www.plurk.com/giahansongkhoe/public https://justpaste.it/u/giahansongkhoe https://www.cineplayers.com/giahansongkhoe https://linktr.ee/giahansongkhoe https://peatix.com/user/22394206/view https://able2know.org/user/giahansongkhoe/ https://wakelet.com/@GiaHan65884 https://git.industra.space/giahansongkhoe https://my.desktopnexus.com/giahansongkhoe/ https://www.artscow.com/user/3196405 https://www.divephotoguide.com/user/giahansongkhoe/ https://www.deviantart.com/giahansongkhoe/about https://www.babelcube.com/user/gia-han-1 https://allmylinks.com/giahansongkhoe https://telegra.ph/giahansongkhoe-05-27 https://rotorbuilds.com/profile/42360/ https://myanimelist.net/profile/giahansongkhoe https://vnxf.vn/members/giahansongkhoe.81374/#about https://lab.quickbox.io/aigiahansongkhoe https://turkish.ava360.com/user/giahansongkhoe/# http://hawkee.com/profile/6959759/ https://naijamp3s.com/index.php?a=profile&u=giahansongkhoe https://jsfiddle.net/user/giahansongkhoe/ https://socialtrain.stage.lithium.com/t5/user/viewprofilepage/user-id/65167 https://www.codingame.com/profile/c18c2ee9d942b737ab0c6827172058598006906 https://edenprairie.bubblelife.com/users/giahansongkhoe https://hypothes.is/users/giahansongkhoe https://www.scoop.it/u/giahan https://hub.docker.com/u/giahansongkhoe https://doodleordie.com/profile/giahansongkhoe https://taplink.cc/giahansongkhoe https://camp-fire.jp/profile/giahansongkhoe https://www.designspiration.com/giahan121994/ https://research.openhumans.org/member/giahansongkhoe https://teletype.in/@giahansongkhoe https://active.popsugar.com/@giahansongkhoe/profile https://hashnode.com/@giahansongkhoe https://hackmd.io/@giahansongkhoe https://gifyu.com/giahansongkhoe https://www.quia.com/profiles/giahan https://www.credly.com/users/gia-han.aaff481c/badges https://muckrack.com/gia-han-3 https://www.hahalolo.com/@6654d0700694371ea491824e https://www.funddreamer.com/users/gia-han https://expathealthseoul.com/profile/gia-han/ https://vimeo.com/user220273374 www.artistecard.com/giahansongkhoe#!/contact https://wperp.com/users/giahansongkhoe/ https://www.kickstarter.com/profile/giahansongkhoe/about https://participez.nouvelle-aquitaine.fr/profiles/giahansongkhoe/activity?locale=en https://files.fm/giahansongkhoe/info https://topsitenet.com/profile/tggiahansongkhoe/1195654/ https://www.copytechnet.com/member/355500-giahansongkhoe/about https://ficwad.com/a/giahansongkhoe https://leetcode.com/u/giahansongkhoe/ https://www.dnnsoftware.com/activity-feed/my-profile/userid/3198835 https://motion-gallery.net/users/608637 https://collegeprojectboard.com/author/giahansongkhoe/ https://chodilinh.com/members/giahansongkhoe.78874/#about https://www.pearltrees.com/giahansongkhoe https://devpost.com/giahan121994 https://piczel.tv/watch/giahansongkhoe https://www.mixcloud.com/giahansongkhoe/ https://hubpages.com/@giahansongkhoe#about https://wibki.com/giahansongkhoe?tab=Gia%20Han https://www.equinenow.com/farm/giahansongkhoe.htm https://www.kniterate.com/community/users/giahansongkhoe/ https://www.cakeresume.com/me/giahansongkhoe https://wmart.kz/forum/user/163322/ https://makersplace.com/giahan121994/about https://visual.ly/users/giahan121994 https://www.trepup.com/@giahan https://www.intensedebate.com/people/giahansongkhoe https://pastelink.net/8xuvaewj https://play.eslgaming.com/player/20129941/ https://nhattao.com/members/giahansongkhoe.6534547/ https://disqus.com/by/giahansongkhoe/about/ https://www.exchangle.com/giahansongkhoe https://zzb.bz/2nhf7 https://slides.com/giahansongkhoe https://www.chordie.com/forum/profile.php?id=1964329 https://www.creativelive.com/student/gia-han-49?via=accounts-freeform_2 https://www.anobii.com/fr/01eb372a54a01c69ca/profile/activity https://myspace.com/signin# https://englishbaby.com/findfriends/gallery/detail/2505180 https://rentry.co/etq8oovt https://stocktwits.com/giahansongkhoe https://os.mbed.com/users/giahansongkhoe/ https://sinhhocvietnam.com/forum/members/74543/#about https://qooh.me/giahansongkho https://fileforum.com/profile/giahansongkhoe https://www.proarti.fr/account/giahansongkhoe https://www.noteflight.com/profile/81e284c3725e6aab9e3d6f9753efd469d08f4c89 https://tupalo.com/en/users/6779365 https://dreevoo.com/profile.php?pid=642221 https://willysforsale.com/profile/giahansongkhoe https://padlet.com/giahan121994 https://app.talkshoe.com/user/giahansongkhoe https://club.doctissimo.fr/giahansongkhoe/ http://forum.yealink.com/forum/member.php?action=profile&uid=342306 https://diendannhansu.com/members/giahansongkhoe.49788/#about https://www.are.na/gia-han-pepudy1b7mc/channels https://qiita.com/giahansongkhoe https://data.world/giahansongkhoe https://www.ohay.tv/profile/giahansongkhoe https://glose.com/u/giahansongkhoe https://potofu.me/giahansongkhoe http://idea.informer.com/users/giahansongkhoe/?what=personal https://www.fitday.com/fitness/forums/members/giahansongkhoe.html https://www.dermandar.com/user/giahansongkhoe/ https://vocal.media/authors/gia-han-42u50abn https://www.ethiovisit.com/myplace/giahansongkhoe
giahansongkhoe
1,866,886
The only tutorial to learn Javascript Callbacks
When I worked as a Full-Stack developer, creating new modules using native Javascript (hereafter JS),...
0
2024-05-27T18:54:40
https://dev.to/turalsuleymani/the-only-tutorial-to-learn-javascript-callbacks-hml
javascript, tutorial, callback, webdev
When I worked as a Full-Stack developer, creating new modules using native Javascript (hereafter JS), and dealing with issues such as supporting the existing system gave me invaluable knowledge in practice. This has greatly helped me to understand what many of the Javascript constructs do in practice. From this article, we will share with you many of our experiences not only on the .NET platform but also on Javascript. These articles will give you a better understanding of the internal structure of JS. ``` function add(a, b) { return a + b; } ``` This JS article will be about callbacks, which many people struggle with. Callbacks are used a lot in practice. Even if you use a JS library, one of the most common JS topics you will use will be callbacks. **It all starts with functions….** The theme of functions in programming languages allows us to create reusable blocks of code. When using functions, you can ensure that a block of code is reused by passing parameters to them. Here, if you give any value instead of arguments a and b, the program performs the correct calculation. With this approach, a kind of formula concept in mathematics is formed, and we get rid of repeatedly writing operations from the same classification. However, there are forms of functions to which it is not enough to simply pass a variable parameter. Sometimes it is necessary to pass blocks of code into smaller chunks to enable reuse and to handle this dynamically by passing one function as an argument to another function. **But what are the callbacks?** The callback is the process of passing another function as an argument to a function. Why would a function need to pass another function, or what does a callback do? To answer this question, let’s look at the simplest array search algorithm. Let’s take a step-by-step look at how to perform an array search without resorting to JS’s default search function. Task: Given an array of numbers 45,56,103,91,405, 324. We need to find numbers greater than 50 in this array. ``` let array = [45, 56, 103, 91, 405, 324]; function findInArray(arr) { let result = []; for (let f of arr) { if (f > 50) { result.push(f); } } return result; } ``` After a while, it is necessary to search for elements in another part of the program on the same array (or it can be another array) with another condition (for example, finding numbers greater than 100 and less than 200). According to what we learned about this in algorithms, the code we write must respect the massiveness property of the algorithm. The convergence property states that an algorithm must be correct for solving all problems from the same group of problems (same classification). This means that if you are searching for an array under a certain condition, you should not write an algorithm from scratch when searching under another condition! The previous algorithm you wrote should already satisfy all the search conditions. But the above search function does not meet our requirements. Cause: The code being written is not extensible. Now let’s ensure that this algorithm meets all search conditions. **First attempt** ``` let array = [45, 56, 103, 91, 405, 324]; function findInArray(arr) { let result = []; for (let f of arr) { if (f > 50) { result.push(f); } } return result; } ``` Probability of code reuse: 0–10% In our first attempt, we’ll look at passing the number we’re looking for as an argument to the function. Although it is easy to change the number, it is not possible to change the condition. Since we can change the number, let’s take the percentage of code reuse as 0–10%. **Second attempt.. removing the argument of the conditional operator** ``` let array = [45, 56, 103, 91, 405, 324]; function findInArray(arr, findNum, op) { let result = []; for (let f of arr) { switch (op) { case '>': { if (f > findNum) { result.push(f); } } break; case '<': { if (f < findNum) { result.push(f); } } break; case '>=': { if (f >= findNum) { result.push(f); } } break; } } return result; } ``` We can achieve approximately 30–35% reuse of the code by removing the conditional operator as an argument, but this code is also very weak in terms of extensibility, “unreleasable” code. The reason is that if there are binary conditions (for example, finding numbers greater than 100 but less than 300), the function does not meet our requirements. Also, depending on the requirement, we will need to add new conditions. But how do we make sure that the written function can satisfy all the search demands? **It is time for callbacks or “Show me how you do!”** To be able to perform the problem by the mass property, it is necessary to remove the conditional block from the function and write it in the argument. But in the programming language, the if block cannot be passed directly to the function as an argument. To overcome this, it is necessary to extract the if block into a separate function and pass that function as an argument to the main function. ``` let array = [45, 56, 103, 91, 405, 324]; function findInArray(arr, callback) { let result = []; for (let f of arr) { if (callback(f)) { result.push(f); } } return result; } //create separate function for every behaviour function ifLessFrom50(num) { return num < 50; } //create separate function for every behaviour function ifGreaterThan50(num) { return num > 50; } //send the function "ifLessFrom50" to findInArray as an argument let ls = findInArray(array, ifLessFrom50); console.log(ls); //send anonymous function as an argument let nextResult = findInArray(array, function(x) { return x > 50 && x < 200; }); console.log(nextResult); //send lambda expression as an argument //lambda expression is narrow function here. let result = findInArray(array, x => x > 50 && x < 300); console.log(result); ``` Thus, the function receives a callback as an argument, and we can pass any function as an argument to this function. If we are going to use the conditional code block we are going to write in more than one place, then it is appropriate to separate those blocks into separate functions. ``` //every function as an argument function ifLessFrom50(num) { return num < 50; } //every function as an argument function ifGreaterThan50(num) { return num > 50; } ``` If the given function is only needed within this context, then we can use it in anonymous functions or lambda expressions. ``` //function accepts anonymous function as an argument let nextResult = findInArray(array, function(x) { return x > 50 && x < 200; }); console.log(nextResult); // function accepts lambda expression as an argument let result = findInArray(array, x => x > 50 && x < 300); console.log(result); ``` ## How do they use callbacks in practice? Of course, we can’t review all practical use cases, but based on our practice, we will try to share with you the cases in which we need callbacks and the implementation options. Callbacks, as we say, are the process of passing one function as an argument to another function. In many cases, code repetition manifests itself not only as a primitive constant but also as a block of code. To isolate that block of code from its context and respond to the change, it is necessary to pass the block of code to another function in the form of a function. **Case 1** The DOM model works with event-based development. ![dom model callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jn4vx6qx13e7dshgp5t9.png) -The place of the DOM model in JS is irreplaceable, and in almost every step you will encounter callbacks in the DOM model. Example: There is a button on the page, and when it is clicked, we want to execute some block of code. **Case 2** When creating dynamic page components in JS. When programming the payment terminals, we created all the buttons on the page dynamically so that we didn’t have to go in and change the HTML file every time a new provider was added. Again, we use callbacks when any event occurs on dynamic elements. ![js callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e5l4cd5wiyah7db2pm9g.png) Which page to open when you click any button in the terminal is read from the configuration and bound to the component as a dynamic event. **Case 3** AJAX requests work based on callbacks. ![ajax callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pdw8os5ff825wzxlonqd.png) **Case 4** Jquery uses callbacks throughout. Most jQuery functions accept callbacks. ![jquery callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emyjxrga8ijhl9h9rqmg.png) **Case 5** When we developed a framework in Javascript, the most common feature we encountered in the project was callbacks. ![custom callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3sovi8vl938kttjgkwc5.png) **Case 6** Almost every API in Node.js uses callbacks. ![nodejs callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1uuww8i2tpife3yci1ax.png) **Case 7** Angular.js supports the end-to-end callback concept and is widely used in practice ![angular callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kq0ee0p2801p6pdp62r6.png) **Case 8** A large part of the basic processes in SignalR used for real-time communication are regulated by callbacks. ![signalr callbacks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8581blr6ixdq1dv24h86.png) **Case 9** HTML5 APIs like WebSocket, Server Send Events, etc. use callbacks in their core and configuration. ``` function WebSocketTest() { if ("WebSocket" in window) { alert("WebSocket is supported by your Browser!"); // Let us open a web socket var ws = new WebSocket("ws://localhost:9998/echo"); ws.onopen = function() { // Web Socket is connected, send data using send() ws.send("Message to send"); alert("Message is sent..."); }; ws.onmessage = function(evt) { var received_msg = evt.data; alert("Message is received..."); }; ws.onclose = function() { // websocket is closed. alert("Connection is closed..."); }; } else { // The browser doesn't support WebSocket alert("WebSocket NOT supported by your Browser!"); } } ``` Want to dive deeper? Regularly, I share my senior-level expertise on my **TuralSuleymaniTech** YouTube channel, breaking down complex topics like .NET, Microservices, Apache Kafka, Javascript, Software Design, Node.js, and more into easy-to-understand explanations. Join us and level up your skills!
turalsuleymani
1,866,885
AI Chrome Extension - Web Summarizer & Translator - Your Essential Tool for Learning English
Introduction In the era of technology 4.0, learning English and accessing global...
0
2024-05-27T18:53:17
https://dev.to/minhhungit/chrome-extension-web-summarizer-translator-your-essential-tool-for-learning-english-59dd
## Introduction In the era of technology 4.0, learning English and accessing global information has become easier than ever thanks to the assistance of artificial intelligence (AI). One of the useful tools is the Chrome extension "Web Summarizer & Translator". This extension offers powerful features such as text summarization, translation, grammar correction, and pronunciation, helping users improve their English skills quickly and efficiently. [Link to GitHub repository](https://github.com/minhhungit/webSummarizerTranslatorChromeExtension/) ![AI Web Summarizer & Translator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsqefsx9xmnzgheygygu.png) ## AI Assistance in Learning English ![AI Web Summarizer & Translator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9y492qwhc2wsbdbi1za0.png) ### Accurate and Smooth Translation Translating from English to other languages and vice versa often encounters many difficulties, especially with specialized terms or complex contexts. AI, with its natural language processing capabilities, has made translation more accurate and smoother. ### Efficient Text Summarization When accessing a large amount of information online, quickly summarizing the main content is essential. The summarization feature of this extension helps users grasp the core information without reading the entire text. ### Automatic Grammar Correction Writing with correct grammar is an important factor in English communication. AI helps users identify and correct grammatical errors automatically, thereby improving their writing skills. ### Text-to-Speech Besides understanding and writing, correct pronunciation is also an important skill. The text-to-speech feature helps users listen and learn the correct pronunciation of words and sentences in English. ## Installation and Usage Guide ### Installing the Extension 1. **Download the extension**: Download the .zip file from the Release of the GitHub repository, or you can zip the entire repository. 2. **Open Chrome extensions**: Open Chrome and type `chrome://extensions/` in the address bar. 3. **Enable Developer mode**: Turn on the "Developer mode" toggle. 4. **Load unpacked**: Click "Load unpacked" and select the folder where you extracted the .zip file. ### Using the Extension 1. **Select text**: Highlight the text you want to summarize, translate, correct, or pronounce. 2. **Right-click**: Right-click on the selected text and choose the desired action from the context menu. ### Customizing Settings This Chrome extension uses AI API to respond, so you need to configure some settings to use it. 1. **Open Chrome extensions**: Go to `chrome://extensions/`. 2. **Click on the extension icon**: Find the extension icon and click on it. 3. **Select "Options"**: Click on the "Options" link in the extension dialog. 4. On the Options page, you can configure the following parameters: #### Note Groq offers a free, fast API using the LLAMA 3 70B model, which is a great choice for those who want to experience AI features without any cost. Although Groq has some limitations in forcing the model to return in Vietnamese, its fast response speed and free service are significant advantages. - **API URL**: Endpoint for the selected AI service. - OpenAI: `https://api.openai.com/v1/chat/completions` - Groq: `https://api.groq.com/openai/v1/chat/completions` - **API KEY**: Your API key for the AI service. - [Get your API key from OpenAI](link) - [Get your API key from Groq](link) - **Model Name**: The specific AI model you want to use. It is recommended to use `llama3-70b-8192` on Groq because it responds quickly, although its Vietnamese might be lacking. - **Temperature**: Adjust the creativity and randomness of the AI's output. - **Max Token**: Limit the length of the AI's response. For LLAMA3-70B, it is 8192, for GPT-35-Turbo, it is 4096. This is the configuration I am using on my machine: ![AI Web Summarizer & Translator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6jatqua0enfv85xgpbj.png) ### Setup for TTS For the text-to-speech feature, this setup is optional. If left blank, the extension will use the system's default TTS. - **OpenAI Whisper API Key**: Your API key for OpenAI's text-to-speech service. - [Get your OpenAI Whisper API key](link) - **Open AI Whisper Model Name**: The specific Whisper model for text-to-speech. - **Voice Name**: The voice you want to use for pronunciation (e.g., echo, alloy). ## Contribution [Link to the repository](https://github.com/minhhungit/webSummarizerTranslatorChromeExtension/) The application is still under development, and any contributions to improve the extension are welcome and can be submitted through the project's GitHub page.
minhhungit
1,866,884
Adding dd() in Wordpress development
Hey folks! Hope you are all doing well. Today I just want to share a common topic, which is related...
0
2024-05-27T18:52:07
https://dev.to/rabibsust/adding-dd-in-wordpress-development-124h
webdev, laravel, wordpress, debug
Hey folks! Hope you are all doing well. Today I just want to share a common topic, which is related to debugging in Wordpress. I do like default Wordpress debugging. It's just fine. But you know what I like most is the Laravel's `dd()` function. :heart_eyes: So let's just check where and how the functions works. ``` if (!function_exists('dd')) { /** * @return never */ function dd(...$vars) { if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } foreach ($vars as $v) { VarDumper::dump($v); } exit(1); } } ``` We found the `dd()` function inside the Symfony component var-dumper. Oh! I love Symfony. :heart_eyes: So let's check the function now. - [\PHP_SAPI](https://www.php.net/manual/en/reserved.constants.php#constant.php-sapi) is a predefined constant in PHP. It tells us how the PHP script is being executed. So in the condition we found that `!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)` let's breakdown this: - `\PHP_SAPI` is being checked against an array containing 'cli' and 'phpdbg'. Here 'cli' indicates that the script is being run from the command line interface and 'phpdbg' indicates that the script is being run using PHP's interactive debugger. So this condition will be true if the script is not running in CLI or PHP Debugger mode. - [headers_sent](https://www.php.net/manual/en/function.headers-sent.php) is a function that checks if HTTP headers have already been sent to the client. So if the header is also not sent then the condition will be true. - If both conditions are true then the server will send a 500 Internal Server Error response - In the next we found this foreach function which is the main part of our dd function. ``` foreach ($vars as $v) { VarDumper::dump($v); } ``` So here `$vars` are actually items of collection. Then inside the foreach it calls the static `dump()` method inside the `[VarDumper](https://github.com/symfony/var-dumper/blob/7.0/VarDumper.php)` class. After this `foreach` block there is a `exit()` function call to exit the operation. Pretty straight forward right! ## Installation To use this function in my Wordpress plugin I needed to install this component. From my plugin directory I ran this command: `composer require --dev symfony/var-dumper`. It was installed. But to use this in my plugin I had to add `autoload` inside the `init` action hook. ``` add_action('init', function () { try { if (file_exists(__DIR__ . '/vendor/autoload.php')) { require_once __DIR__ . '/vendor/autoload.php'; } } catch (Exception $e) { logCatchException($e); } }, 10, 0); ``` So now I can call the `dd()` or `dump()` method inside any places from my plugin. And it perfectly shows the collection or array data. ``` public function schedule($postId, $timestamp, $opts) { $timestamp = $this->convertLocalTimeToUtc($timestamp); dd($opts); } ``` Here is the data: ``` array:4 [▼ "expireType" => "change-status" "newStatus" => "draft" "category" => "0" "categoryTaxonomy" => "category" ] ``` That's all for today. Thank you all for reading it.
rabibsust
1,854,007
EX280 Exam Dumps
Understand the Exam Blueprint: Familiarize yourself with the EX280 exam blueprint provided by Red...
0
2024-05-15T12:59:57
https://dev.to/sagint_6f7b943b848ba5325b/ex280-exam-dumps-4h0l
1. Understand the Exam Blueprint: Familiarize yourself with the EX280 exam blueprint provided by Red Hat. This document outlines the topics and objectives that will be tested in the exam, allowing you to focus your study efforts effectively. 2. Select High-Quality Exam Dumps: Choose exam dumps from reputable sources known for their accuracy and reliability. Look for dumps EX280 Exam Dumps that closely align with the exam blueprint and provide comprehensive coverage of all exam topics. 3. Develop a Comprehensive Study Plan: Create a structured study plan that incorporates the use of exam dumps. Allocate specific time slots for studying with the dumps and ensure consistency in your study routine. Break down the exam topics into manageable sections to cover each one thoroughly. 4. Actively Engage with the Material: Instead of passively reading through exam dumps, actively engage with the content by answering practice questions, solving problems, and explaining concepts in your own words. This active engagement will deepen your understanding of the material. CLICK HERE FOR MORE INFO>>>>>>>>>>>>>>> https://dumpsarena.com/redhat-dumps/ex280/
sagint_6f7b943b848ba5325b
1,866,883
kepa
Use the + icon on the left or hit the / (forward slash) key to insert a new block. Mailbob supports...
0
2024-05-27T18:47:30
https://dev.to/yara_moros_7685bbcc8574b3/kepa-5gn0
webdev
[Use the](http://chiangmaicaronline.com) + icon on the left or hit the / (forward slash) key to insert a new block. Mailbob supports various blocks, including paragraphs, images, lists, separators and more. Use the block options button on the left to configure blocks and move them around. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ff6fwiuoxws558cedcdj.png)
yara_moros_7685bbcc8574b3
1,866,882
Turbocharge Your Web: Mastering Performance JavaScript.🚀🚀🚀
1. Performance Basics Real vs. Perceived Performance Real Performance: Actual...
0
2024-05-27T18:45:22
https://dev.to/dharamgfx/turbocharge-your-web-mastering-performance-javascript-b77
javascript, webdev, programming, beginners
## 1. Performance Basics ### Real vs. Perceived Performance - **Real Performance**: Actual speed improvements such as smaller file sizes and quicker load times. - **Perceived Performance**: Enhancements that make the website feel faster to the user, like progress indicators and immediate content display. #### Example Show a loading spinner while fetching data to make the user feel like something is happening immediately. ```html <div id="spinner">Loading...</div> <div id="content" style="display: none;"> <!-- Dynamic content goes here --> </div> <script> setTimeout(() => { document.getElementById('spinner').style.display = 'none'; document.getElementById('content').style.display = 'block'; }, 2000); // Simulates a 2-second data fetch </script> ``` ### Key Performance Concepts - **Source Order**: Arrange HTML source to prioritize critical content. - **Critical Path**: Minimize resources loaded initially to render the most important parts of the page quickly. - **Latency**: Reduce delays in data transfer to improve loading times. - **Rendering**: Understand how the browser processes and displays content. #### Example: Critical Path Optimization ```html <link rel="stylesheet" href="critical.css"> <script src="critical.js" defer></script> ``` ### Sustainability and Performance - **Energy Efficiency**: Optimized code reduces CPU usage and power consumption. - **Demand Efficiency**: Perform computations only when and where necessary. ## 2. Improving Page Rendering ### Reducing Page Loading Times - **Optimal Media Formats and Compression**: Use WebP for images and compressed audio/video formats. - **Remove Unnecessary Audio**: Muted videos should not load audio tracks. - **Preload Video**: Use the `preload` attribute to manage video loading behavior. - **Adaptive Streaming**: Deliver video in chunks to optimize bandwidth. - **Specify Dimensions**: Prevent layout shifts by defining image and video dimensions. - **Font Choices**: Use smaller font files by including only necessary glyphs. #### Example: Lazy Loading Images ```html <img src="placeholder.jpg" data-src="image.jpg" alt="Lazy Loaded Image" loading="lazy"> <script> document.addEventListener('DOMContentLoaded', () => { const img = document.querySelector('img[data-src]'); img.src = img.dataset.src; }); </script> ``` ### Improving "Time to Usable" - **Minimal Initial Load**: Display essential content first. - **Background Data Loading**: Load additional resources as needed. - **Lazy Loading**: Defer loading of non-critical resources. #### Example: Initial Load Optimization ```html <div id="main-content"> <!-- Essential content --> </div> <div id="additional-content" style="display: none;"> <!-- Additional content --> </div> <script> window.addEventListener('load', () => { document.getElementById('additional-content').style.display = 'block'; }); </script> ``` ### Enhancing Perceived Performance - **Smooth Transitions**: Use animations to transition between states. - **Progress Indicators**: Show spinners or progress bars. - **Efficient Event Handling**: Use keydown events for quicker response. #### Example: Progress Bar ```html <div id="progress-bar" style="width: 0; height: 4px; background: green;"></div> <script> function updateProgressBar() { const progressBar = document.getElementById('progress-bar'); let width = 0; const interval = setInterval(() => { width += 10; progressBar.style.width = width + '%'; if (width >= 100) clearInterval(interval); }, 100); } updateProgressBar(); </script> ``` ## 3. Measuring Performance ### Key Metrics - **First Contentful Paint (FCP)**: Time to render the first bit of content. - **Speed Index**: Average time for content to become visible. - **Total Blocking Time (TBT)**: Time spent blocked by scripts. - **Bounce Rate**: Percentage of visitors who leave after viewing one page. - **Unique Users/Page Views**: Metrics from analytics tools. ### Performance Measurement Tools - **Google Lighthouse**: Audits web pages for performance. - **Pagespeed Insights**: Provides performance scores and suggestions. - **WebPageTest**: Detailed performance analysis. - **Browser DevTools**: Built-in tools for network and performance monitoring. #### Example: Using Google Lighthouse 1. Open Chrome DevTools. 2. Navigate to the "Lighthouse" tab. 3. Click "Generate report" to analyze the current page. ### Performance Web APIs - **Performance Timeline API**: Analyze various performance metrics. - **Navigation Timing API**: Measure load times. - **User Timing API**: Custom performance marks and measures. - **Resource Timing API**: Detailed timing data for resource requests. ## 4. CSS and Performance ### Techniques for Improving CSS Performance - **Conditional Loading**: Use media queries to load CSS only when needed. - **GPU Animations**: Use properties like `transform` and `opacity` for smoother animations. - **Minimize Repaints**: Optimize CSS to reduce layout shifts. - **Use `will-change` and `contain`**: Indicate elements likely to change to the browser for optimization. #### Example: GPU Animation ```html <style> .box { transition: transform 0.5s; } .box:hover { transform: translateX(100px); } </style> <div class="box">Hover over me!</div> ``` ## 5. JavaScript and Performance ### Techniques for Improving JavaScript Performance - **Reduce JavaScript Usage**: Limit the amount of JavaScript on your pages. - **Conditional Loading**: Load scripts only when needed using `async` and `defer`. - **Remove Unused Code**: Eliminate dead code. - **Code Splitting**: Break down scripts into smaller parts for better loading. #### Example: Deferred JavaScript ```html <script src="script.js" defer></script> ``` ### JavaScript Optimization - **Compression**: Minify and compress JavaScript files. - **Efficient Algorithms**: Use optimized algorithms for data processing. - **Event Delegation**: Handle events efficiently to minimize performance impact. #### Example: Event Delegation ```html <ul id="list"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <script> document.getElementById('list').addEventListener('click', (event) => { if (event.target.tagName === 'LI') { alert('Item clicked: ' + event.target.textContent); } }); </script> ``` ### Conclusion Improving JavaScript performance is crucial for creating fast, efficient, and user-friendly web applications. By understanding and implementing these techniques, you can ensure your websites load quickly and provide a smooth user experience.
dharamgfx
1,866,881
Unveiling the Magic of Web APIs: An In-Depth Guide🚀
1. Client-Side Web APIs Web APIs are the backbone of modern web development, enabling...
0
2024-05-27T18:37:11
https://dev.to/dharamgfx/unveiling-the-magic-of-web-apis-an-in-depth-guide-4lme
webdev, javascript, beginners, programming
## 1. Client-Side Web APIs Web APIs are the backbone of modern web development, enabling seamless interaction between web applications and various browser features. Here, we explore the general concepts and specific classes of Web APIs to empower you with the knowledge to dive deeper into browser API usage. ### Video and Audio APIs Video and audio APIs are essential for integrating media content into web applications, providing functionality to control playback, capture media, and handle various formats and codecs. #### Key Concepts - **Formats and Codecs**: Understand the different types of video (e.g., MP4, WebM) and audio (e.g., MP3, AAC) formats, and the role of codecs in compressing and decompressing media files. - **Basic Controls**: Learn to manipulate media playback using basic functions like play, pause, stop, seek, and track the media's duration and current time. #### Practical Example: Custom Media Player Using the HTMLMediaElement API, you can create a custom media player that caters to specific needs such as accessibility or consistent UI design across browsers. ```html <video id="myVideo" controls> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video> <script> const video = document.getElementById('myVideo'); video.play(); video.pause(); video.currentTime = 30; // Seek to 30 seconds </script> ``` #### Advanced APIs - **Media Streams (getUserMedia)**: Capture video and audio from local devices. - **Web Audio API**: Complex audio processing and synthesis. - **Media Stream Recording API**: Record audio and video streams. - **Media Source Extensions API**: Stream media for adaptive bitrate streaming. ### Handling Media Errors Ensure robust media delivery by handling common errors: - **<source> Elements**: Provide multiple formats for compatibility. - **MIME Types**: Use correct MIME types for media files. - **Fallback Content**: Display alternative content if media is unsupported. ## 2. Graphics and Animation APIs Graphics and animation APIs are powerful tools for creating dynamic and interactive web experiences, from simple animations to complex games. ### Timers and requestAnimationFrame() - **Timers**: Basic syntax and usage for creating timed animations using `setTimeout` and `setInterval`. - **requestAnimationFrame()**: Efficient animation loops that optimize performance compared to traditional timers. ```javascript function animate() { // Animation code requestAnimationFrame(animate); } requestAnimationFrame(animate); ``` ### Web Animations API - **Basic Syntax**: Define animations directly in JavaScript. - **Relation to CSS**: Understand when to use Web Animations API versus CSS animations. ```javascript element.animate([ { transform: 'translateY(0px)' }, { transform: 'translateY(100px)' } ], { duration: 1000, iterations: Infinity }); ``` ### Canvas - **Concept**: The `<canvas>` element and its associated APIs enable drawing and manipulation of graphics. - **2D Canvas API**: Basic syntax for drawing shapes, text, and images. - **Animation**: Looping canvas updates for creating animations or games. ```html <canvas id="myCanvas" width="200" height="200"></canvas> <script> const canvas = document.getElementById('myCanvas'); const ctx = canvas.getContext('2d'); ctx.fillStyle = 'green'; ctx.fillRect(10, 10, 100, 100); </script> ``` ## 3. Client-Side Storage Client-side storage APIs allow web applications to store data locally, enabling offline functionality and user personalization. ### Common Storage Mechanisms - **Web Storage API**: Simple key-value storage using `localStorage` and `sessionStorage`. - **Cookies**: Storing data in small text files, controlled by HTTP headers. - **Cache API and Service Workers**: Storing assets for offline access and improving performance. - **IndexedDB**: A complex transactional database system for more sophisticated data storage needs. #### Web Storage Example ```javascript localStorage.setItem('username', 'JohnDoe'); const username = localStorage.getItem('username'); console.log(username); // Outputs: JohnDoe ``` ### Handling Client-Side Storage - **Use Cases**: Maintain state across reloads, persist login and personalization data, enable offline functionality. - **Negative Patterns**: Avoid using cookies for tracking and fingerprinting. #### IndexedDB Example ```javascript const request = indexedDB.open('myDatabase', 1); request.onsuccess = function(event) { const db = event.target.result; // Perform database operations }; ``` ### Progressive Web Apps (PWAs) - **Service Workers**: Background scripts that enable offline functionality and caching of resources. - **Cache API**: Store and retrieve network requests and responses for offline access. ```javascript self.addEventListener('install', function(event) { event.waitUntil( caches.open('my-cache').then(function(cache) { return cache.addAll(['/index.html', '/styles.css']); }) ); }); ``` ## Conclusion Understanding Web APIs is crucial for modern web development, offering tools to create rich media experiences, dynamic graphics, and efficient client-side storage solutions. This guide provides a foundational overview, enabling you to explore and implement these powerful APIs in your projects.
dharamgfx
1,866,408
How I Resolved Prisma Issues and Fixed Vercel 500 INTERNAL_SERVER_ERROR 🚀
Yesterday, I moved an old application from my own hosting to Vercel. Although I anticipated some...
0
2024-05-27T18:29:52
https://dev.to/whoisarjen/how-i-resolved-prisma-issues-and-fixed-vercel-500-internalservererror-401j
prisma, vercel, devops, webdev
Yesterday, I moved an old application from my own hosting to Vercel. Although I anticipated some challenges, I encountered an issue that took longer to resolve than expected. Here’s how I navigated the problem and found a solution, so you can save time if you face the same problem! 😊 ### Step 1: Update Prisma and @prisma/client First, make sure you are using the latest versions of Prisma and `@prisma/client`. For my project, the latest version at the time was 5.14.0. Run the following command to update them: ```bash npm install prisma@5.14.0 @prisma/client@5.14.0 --save-dev ``` ### Step 2: Initial Setup After deploying to Vercel, I noticed the following error in Vercel's logs: ``` Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process. Learn how: https://pris.ly/d/vercel-build ``` ### Step 3: Following the Instructions The error message was clear. To fix it, I needed to add the following to my `package.json`: ```json "postinstall": "prisma generate" ``` ### Step 4: Adding a Build Command However, this didn't completely resolve the issue. So, I updated Vercel's build command to ensure Prisma generates the client before building the application: ```json "build": "npx prisma generate && next build" ``` ### Step 5: Encountering a New Issue After this change, my application built successfully, but all API calls returned a `Vercel 500: INTERNAL_SERVER_ERROR`. This was frustrating, and there wasn’t much information available on how to fix it. 😤 ### Step 6: Debugging the Problem After a few hours of trial and error, I found the problem in my `schema.prisma` file. Here’s what my initial setup looked like: ```prisma generator client { provider = "prisma-client-js" binaryTargets = ["native", "linux-musl"] // <- Required on Ubuntu } datasource db { provider = "postgresql" url = env("DATABASE_URL") relationMode = "prisma" } ``` This setup worked fine on my server but caused issues on Vercel as I forgot it was customed specificlly for Ubuntu. ### Step 7: Correcting the Schema Here are the correct settings: ```prisma generator client { provider = "prisma-client-js" previewFeatures = ["driverAdapters"] // <- neon.tech } datasource db { provider = "postgresql" url = env("DATABASE_URL") } ``` ### Step 8: Sleep With these adjustments, my application ran smoothly on Vercel. Finally, I could get some well-deserved rest! 🎉 I hope this will save someone time! ⏳ [Source](https://whoisarjen.com/blog/how-i-resolved-prisma-issues-and-fixed-vercel-500-internal-server-error)
whoisarjen
1,866,878
Buy Verified Payoneer Account
Buy Verified Payoneer Account Our Payoneer Account Features- Driving license Verified (full...
0
2024-05-27T18:28:52
https://dev.to/hmnb_ezck_1539e8e66952053/buy-verified-payoneer-account-4kkh
beginners, javascript, webdev, python
Buy Verified Payoneer Account Our Payoneer Account Features- Driving license Verified (full authorized) SSN, ID card Verified Bank documents verified 100% satisfaction guaranteed Avatar verified If You Need More Information Please Contact Us 24/7 Customer Support/ Contact Skype : Best5stareviews live:.cid.1dbfb5499a7b86c3 Telegram: @Best5stareviews Email: best5stareviews@gmail.com Buy verified Payoneer Account Payoneer is one of the most popular financial services company that helps people with online money transfer and digital payment services all over the world. This company was established in 2005 its purpose is to facilitate cross-border transactions for business and personal. Now, Payoneer support multiple currencies which is the main purpose to get more popular. Sometimes, Payoneer banned many persons for violating terms & conditions. Those people face problems with transactions all over the world. In this situation, We give a solution by clicking a few times. You can**[ buy verified Payoneer account from us.](https://best5stareviews.com/product/buy-verified-payoneer-account/)** How to Know Verified Payoneer Account? A verified Payoneer account is an account that is passed verification from the Payoneer verification team. A user completing this process by Govt. issue an ID card such as a Passport or Govt. National ID card. After completing the verification, it’s ready to use. The verified Payoneer account is stronger than the normal one. Why Need to Verify Payoneer Account? There are lots of causes to verify the Payoneer account but security, compliance, and access to the full range of services are the most common purposes. After completing the verification process, it increases the ability to trust the partner. If your account get any problem like someone’s use, unauthorized transaction, or claims ownership then it will help to identify the real owner. The Payoneer support agent asks many questions and gives access to the real owner. Buy Verified Payoneer Account Best Features of a Payoneer Account A **[Payoneer account offers](https://best5stareviews.com/product/buy-verified-payoneer-account/)** a lot of features across international business such as transactions, managing finance efficiently, flexible payment solutions, etc. As an international company, online seller, or a good freelancer you have to use these features according to your needs. Here we discuss a few things ⦁ Multi-currency: Payoneer can receive multiple currencies like USD, EUR, GBP, JPY, CAD, AUD, etc. You can transfer your money to your local bank easily. Again you can convert any currency to your local currency as you want. ⦁ Payment Receive: Most of the major marketplaces support Payoneer for receiving money such as Amazon, eBay, Upwork, Fiverr, etc. A user can also take payment directly from clients or companies via bank transfer, credit card, or eCheck. ⦁ Flexible Withdrawal Option: Payoneer users can withdraw funds by local bank, ATM or any global transfer. Payoneer also allows the user to send money to non-payoneer bank accounts. ⦁ Billing & Invoicing: Payoneer users can create and send invoices directly to clients Payoneer or set a reminder to ensure the payment. ⦁ User-Friendly interface: A user can manage an account using an app or web. Payoneer undated transactions and activity in real-time. Buy Aged Payoneer Accounts Generally, Aged accounts are trusted and more efficient than new accounts. You can transfer unlimited money from the old Payoneer account within a second. We have provided these services for 5 years. We always give high-quality and verified old accounts so that clients get more satisfaction. Payoneer account For sale Selling Payoneer accounts is like that to transfer ownership from one person to another. This occurs for various reasons like a business being sold, a freelancer changing career paths, etc. Sometimes, people want to hide their identity to buy or make payments. But They don’t want to open the Payoneer by their own identity. For this reason, Many people buy verified Payoneer accounts to get these advantages. Buy Payoneer Accounts Cheap Our teams always try to give the best service to our customers. We give more priority to our customers and will take any step which is more benefit both of us. We also generate custom orders for our client’s requirements. How to buy verified Payoneer Accounts? If you want to**[ buy verified Payoneer accounts](https://best5stareviews.com/product/buy-verified-payoneer-account/)** then you come to the right place. You will get your target accounts from us. Just click on the add to cart button and then process your order by completing the successful payment. What is the Exact Cost of Buying a Payoneer Account? The cost of buying verified Payoneer accounts depends on your requirements. After hearing your requirements we will talk to our team and also try to give the best price as per our relationship. We always recommend buying from a trusted seller before buying anything. The process of verification of Payoneer Accounts The verification process is to ensure security for regulatory requirements and provide full access to the Payoneer account features. The verification process follows a few steps- Sign Up: At the beginning, you have to create your Payoneer account by giving your own basic information like as your name, email, and password. After that, they also ask the more information such as an address, contact number, and date of birth including the National Identity Card number or SSN. Identity Verification: The Payoneer team asks the new users to upload any government-issued ID such as a passport, driver’s license, or national ID. To verify the process they also need a selfie or photo of the owner which must be a clear face. Address Verification : Address verification means verifying your residential address. The address verification acceptable documents like utility bills, bank statements, or any Govt. issued letters that clear display about your address and name. Verification Review: Payoneer verification team will review your submitted documents. This process will take few working days. After completing the process you will enjoy full features of payoneer. You will get the approval notification after completing the verification. The Payment Process except Verified Payoneer Accounts Payoneer is a popular payment gateway but new user who have no account and want to buy a Payoneer account then will face problems in making payments. But we accept any kind of payment through crypto, wise, skrill or stripe. After making the payment, you will get your verified Payoneer account and you can make payment by using that Payoneer. How stable is the Payoneer Account Security? Payoneer always improves security to give the best experience to their users. For this reason, they update the privacy policy, fraud detection, and prevention policy, etc. They also monitor the system and detect unusual account activities and transactions that might indicate fraudulent behavior. Sometimes, Payoneer gives notifications and alert about the transaction for quick respond for getting better result about any illegal activities.The company maintains transparency for better security practices and compliance status. Again, you can also give the Payoneer access if you are running a business for getting better experience. Buy Verified Payoneer Account Frequently Asked Questions Q. How can I get Verified Payoneer accounts? A. If you want to create your own account then follow our verification method otherwise you will get the verified account within a few clicks from our website. We sell business and personal accounts. Q. Can I use Payoneer Without Verification? A. No, Payoneer always takes verification when you will create the account. The verification process is mandatory for every user. Q. How to get Payoneer Approval? A. The payoneer verification team always checks documents and give approval. But if they think something wrong then they will ask for more documents and try to clear everything. After that they don’t clear the doubt then they suspend the payoneer accounts. Q. Can I create a Personal or Business Payoneer account ? A. The answer is Yes. If you have strong evidence of document of your business then you can create but if you think that it’s hard for you then please contact with us. We will give the business a Payoneer account at cheap prices. Q. Can I have Multiple Types of accounts with Payoneer? A. No, Payoneer only give access only one account for your personal use purposes. But if you want to create another account then you have to create a company and give strong evidence that help to create another business Payoneer account. Q. What types of accounts does Payoneer Offer? A. Payoneer only provides two types of accounts such as personal and business Payoneer accounts. Generally, freelancer uses their personal Payoneer account to withdraw money. Again, many small business who transfer money 3K+ dollar every month they create the business payoneer for getting better experience. Q. What are the differences between personal and business Payoneer accounts? A. The main difference between the two Payoneers is purpose. Payoneer companies give difference features for use such as verification process, control, security, fees, support, etc. Q. How long does it take to get an account verified ? A. This verification process may differ depending on several factors. But generally, it will not take 5-7 working days if you provide strong evidence. If you don’t know everything, you can buy a verified Payoneer account from us by clicking on our website. Q. What are the invoicing capabilities of Payoneer? A. Payoneer provides a muti-currency invoicing system that enables users to get more satisfaction. You can add everything on a pdf file such as project description, prices, your name, client name, terms and conditions, etc. Conclusion At the end, we can tell that it’s very hard to create a verified payoneer account but our expert team always waiting for your response to give you a verified payoneer account at a cheap price. After **[purchasing the verified Payoneer account](https://best5stareviews.com/product/buy-verified-payoneer-account/)**, you will use it very easily and seamlessly.
hmnb_ezck_1539e8e66952053
1,866,876
SamGIS - Alcuni appunti su Segment Anything
SamGIS - Alcuni appunti su Segment Anything Rimando alle mie note in inglese su Segment...
27,489
2024-05-27T18:27:17
https://trinca.tornidor.com/it/projects/notes-about-segment-anything
python, computervision, machinelearning, maps
# SamGIS - Alcuni appunti su Segment Anything Rimando alle mie note in inglese su [Segment Anything](/projects/notes-about-segment-anything). ## A proposito del riutilizzo degli embedding delle immagini e SamGIS Dopo aver riletto questo paper ho capito che avrei potuto migliorare l'efficienza di SamGIS conservando e riutilizzando gli embedding delle immagini. Ho implementato questa modifica in [SamGIS versione 1.3.0](https://docs.ml-trinca.tornidor.com/#version-1-3-0). Alcuni dati di test dalla [demo SamGIS](https://huggingface.co/spaces/aletrn/samgis) che ho utilizzato: - prima chiamata: 5.42s - modello [fastsam](https://github.com/CASIA-IVA-Lab/FastSAM) istanziato - immagine creata dalla mappa web (uso OpenStreetMap come tile provider e Mapnik come layer della webmap) - creato il embedding dell'immagine - seconda chiamata: 0,41 s - dalla terza alla settima chiamata: ~0,34s Si tenga presente che effettuando una chiamata immediatamente dopo l'altra la durata rimane bassa, probabilmente a causa dell'utilizzo della cache durante il download delle tile nel back-end. Aspettando più di 10 minuti sembra invalidare la cache, quindi [contextily](https://github.com/geopandas/contextily) (la libreria di GeoPanda che utilizzo come client di Tiles) ha impiegato da 0.5s a 1.5s di tempo, durante le mie prove, per il download delle tile. <details> <summary><i>Espandere qui per il dettaglio del payload delle chiamate di test.</i></summary> ```json { "bbox": { "ne": { "lat": 46.236615111857255, "lng": 9.519996643066408 }, "sw": { "lat": 46.13405108959001, "lng": 9.29821014404297 } }, "prompt": [ { "id": 146, "type": "point", "data": { "lat": 46.18483299780137, "lng": 9.418864745562386 }, "label": 1 } ], "zoom": 13, "source_type": "OpenStreetMap" } ``` </details> ## A proposito della conversione "dal testo alla maschera" "zero shot": LISA e SamGIS La versione originale di SAM può utilizzare anche semplici prompt testuali in linguaggio naturale. Per un uso pratico di questa funzionalità, si veda: - [Grounded-SAM](https://github.com/IDEA-Research/Grounded-Segment-Anything) - [LISA](https://github.com/dvlab-research/LISA) Naturalmente potrebbe interessare anche il mio [lavoro di integrazione di LISA con SamGIS](https://trinca.tornidor.com/projects/lisa-adapted-for-samgis) e la corrispondente [demo](https://huggingface. co/spaces/aletrn/samgis-lisa-on-cuda). Devo tenerlo in pausa a causa dei costi, ma sto richiedendo l'uso di una GPU gratuita da HuggingFace. Nel caso il mio [progetto](https://huggingface.co/spaces/aletrn/samgis-lisa-on-cuda) fosse interessante, metti "mi piace" o commenta il [thread di richiesta di risorse GPU di HuggingFace](https://huggingface.co /spaces/aletrn/samgis-lisa-on-cuda/discussions/1).
trincadev
1,866,875
SamGIS - Some notes about Segment Anything
SamGIS - Some notes about Segment Anything From the Segment Anything...
27,489
2024-05-27T18:27:09
https://trinca.tornidor.com/projects/notes-about-segment-anything
python, computervision, machinelearning, maps
# SamGIS - Some notes about Segment Anything ## From the [Segment Anything paper](https://arxiv.org/abs/2304.02643) "[SAM](https://github.com/facebookresearch/segment-anything)" is a [foundation model](https://aws.amazon.com/what-is/foundation-models/) aiming for performing "zero-shot" image segmentation: - it's build and trained with a large image dataset with a massive amount of segmentation masks - the SAM team propose the "promptable" segmentation task, where the goal is to return a valid segmentation mask given any segmentation prompt. Since this model should perform "zero-shot" segmentation the model must support flexible prompts, needs to compute masks in amortized real-time to allow interactive use and must be ambiguity-aware. That's the model architecture: 1. source 1: an image encoder computes an image embedding 2. source 2: a fast prompt encoder embeds prompts 3. output: a fast mask decoder combines these two sources to predict segmentation masks Because annotation masks are not abundant online, especially of high quality, the SAM developers opted for developing a "data engine", developing both the model and the dataset annotations (from manual stage to semi-automated to fully automated). Images in SA-1B span a geographically and economically diverse set of countries and we found that SAM performs similarly across different groups of people. ### Segment Anything Tasks #### Task Here SAM team translate prompts from NLP to segmentation (selecting/de-selecting points, box, mask, free-form text). Like a language model should output a coherent response to an ambiguous prompt, the promptable segmentation task should return a valid segmentation mask given any prompt. #### Pre-Training The promptable segmentation task suggests a natural pre-training algorithm that simulates a sequence of prompts (e.g., points, boxes, masks) for each training sample and compares the model’s mask predictions against the ground truth. ### Segment Anything Model #### Image encoder The algorithm use a MAE (["Masked Autoencoders Are Scalable Vision Learners"](https://arxiv.org/abs/2111.06377)) pre-trained Vision Transformer ([ViT](https://arxiv.org/abs/2010.11929)) minimally adapted to process [high resolution inputs](https://arxiv.org/abs/2203.16527). #### Prompt encoder SAM supports two sets of prompts: - sparse (points, boxes, text) - dense (masks) SAM prompts [handle points and boxes by positional encodings](https://arxiv.org/abs/2006.10739) summed with [learned embeddings for each prompt type](https://arxiv.org/abs/2103.00020). Dense prompts (i.e., masks) are embedded using convolutions and summed element-wise with the image embedding. #### Mask decoder The mask decoder efficiently maps the image embedding, prompt embeddings, and an output token to a mask. This design employs a modification of a [Transformer decoder block](https://arxiv.org/abs/1706.03762) followed by a dynamic mask prediction head. The decoder block uses prompt self-attention and cross-attention in two directions (prompt-to-image embedding and vice-versa) to update all embeddings. After running two blocks, the procedure upsample the image embedding and an MLP maps the output token to a dynamic linear classifier, which then computes the mask foreground probability at each image location. #### Resolving ambiguity With one output, to avoid masks merging in case of an ambiguous prompt the model can predict more than one output mask for a single prompt. 3 masks should address most common cases (nested masks are often at most three deep: whole, part, and subpart). During training, the procedure backprops only the minimum loss over masks. To rank masks, the model predicts a confidence score (i.e., estimated IoU) for each mask. ## About image embedding re-use and SamGIS After reading this paper I understood that I could improve SamGIS software design storing and re-using the image embeddings. I implemented this change in [SamGIS version 1.3.0](https://docs.ml-trinca.tornidor.com/#version-1-3-0). Some test data from the [SamGIS demo](https://huggingface.co/spaces/aletrn/samgis) I used: - first request: 5.42s - instantiated [fastsam](https://github.com/CASIA-IVA-Lab/FastSAM) model - created image from webmap (I'm using [OpenStreetMap](https://www.openstreetmap.org/) as tiles provider and Mapnik as map layer) - created image embedding - second request: 0.41s - from third to seventh request: ~0.34s Note that making one request immediately after another keep requests duration low probably because of cache during tiles download on backend side. Instead waiting more than 10 minutes it seems invalidate the cache, then [contextily](https://github.com/geopandas/contextily) (the GeoPandas' library that I use as a tiles client) added from 0.5s to 1.5s of time, during my tests, to download the tiles. <details> <summary><i>Click here to show my test request payload</i></summary> ```json { "bbox": { "ne": { "lat": 46.236615111857255, "lng": 9.519996643066408 }, "sw": { "lat": 46.13405108959001, "lng": 9.29821014404297 } }, "prompt": [ { "id": 146, "type": "point", "data": { "lat": 46.18483299780137, "lng": 9.418864745562386 }, "label": 1 } ], "zoom": 13, "source_type": "OpenStreetMap" } ``` </details> ## About Zero-Shot Text-to-Mask: LISA and SamGIS SAM can use also simple free-form text prompts. For a practical use of this feature, see: - [Grounded-SAM](https://github.com/IDEA-Research/Grounded-Segment-Anything) - [LISA](https://github.com/dvlab-research/LISA) Of course could be of your interest also my [integration work of LISA with SamGIS](https://trinca.tornidor.com/projects/lisa-adapted-for-samgis) and its [demo](https://huggingface.co/spaces/aletrn/samgis-lisa-on-cuda). I need to keep it paused because of cost, but I am requesting the use of a free GPU from HuggingFace. If you like my [project](https://huggingface.co/spaces/aletrn/samgis-lisa-on-cuda), please like or comment on the [HuggingFace GPU resource request thread](https://huggingface.co/spaces/aletrn/samgis-lisa-on-cuda/discussions/1).
trincadev
1,866,873
Javascript Coercion Corner Cases
Like any other language, JavaScript also has some corner cases, so it is a good idea to learn them....
0
2024-05-27T18:22:39
https://dev.to/ikbalarslan/javascript-coercion-corner-cases-4i68
webdev, javascript, programming
Like any other language, JavaScript also has some corner cases, so it is a good idea to learn them. today I want to show you a corner case about auto coercion. ``` 1 < 2 < 3 // true ``` In this code the answer is true. but how let's check it step by step. ``` step 1 -> (1 < 2) < 3 step 2 -> (true) < 3 step 3 -> 1 < 3 // true ``` In this case, the answer becomes true by chance. let's check another one ``` 3 > 2 > 1; // false ``` Mathematically this should be true but the execution says it is false lets check the code step by step ``` step 1 -> (3 > 2) > 1 step 2 -> (true) > 1 step 3 -> 1 > 1 // one is not bigger than one so should be false ``` Whenever you do any calculation please keep in mind the auto coercion. because math and code do not always say the same thing
ikbalarslan
1,866,874
How to connect to a Postgres database using URI in a Node JS app?
You establish the connection to a Postgres database using its URI by writing the following piece of...
0
2024-05-27T18:22:01
https://dev.to/mbshehzad/how-to-connect-to-a-postgres-database-using-uri-in-a-node-js-app-28ej
You establish the connection to a Postgres database using its URI by writing the following piece of code:- const connectionString = 'postgresql://dbuser:secretpassword@database.server.com:3211/mydb' const pool = new Pool({ connectionString, })
mbshehzad
1,866,818
VanillaJS Lazy Load images/video/embed/youtube
DEMO - https://codepen.io/ktr92/pen/qBGqRgZ html example &lt;img...
0
2024-05-27T18:18:59
https://dev.to/ktrblog/vanillajs-lazy-load-imagesvideoembedyoutube-3583
DEMO - https://codepen.io/ktr92/pen/qBGqRgZ html example ``` <img data-src='https://placehold.co/600x400'> <iframe width="560" height="315" data-src="https://www.youtube.com/embed/NpEaa2P7qZI?si=4Rq1E37zRobyhGRI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> ``` JS ``` function lazyLoadSrc(selector) { const callback = (entries, observer) => { entries.forEach(entry => { const source = entry.target if (entry.intersectionRatio > 0) { if (!source.getAttribute('src')) { source.setAttribute('src', source.dataset.src) observer.unobserve(source) } } }) } const target = document.querySelectorAll(selector) const options = { threshold: 0.4 } let obs = new IntersectionObserver(callback, options) target.forEach(item => { obs.observe(item) }) } ``` ``` // usage document.addEventListener('DOMContentLoaded', function() { lazyLoadSrc('img'); lazyLoadSrc('iframe'); }) ```
ktrblog
1,866,817
Choosing the Best Messaging System: Practical Guide
When it comes to communication between microservices, choosing the right messaging system is crucial....
0
2024-05-27T18:16:34
https://dev.to/patrick0806/choosing-the-best-messaging-system-practical-guide-286m
webdev, messaging, microservices, beginners
When it comes to communication between microservices, choosing the right messaging system is crucial. These systems guarantee the independence of services by storing events in a broker to be consumed when the services are available. However, with a variety of options on the market, such as Kafka, RabbitMQ and SQS, how do you decide which one to use? In this article, we'll explore the basics of queuing and the key differences between some of the major players. ## **Message Ordering** It is important to understand how messages are ordered in queuing systems. The most common methods are FIFO (First In, First Out) and LIFO (Last In, First Out). Additionally, some brokers offer priority queues, allowing important messages to be consumed first, regardless of the default order. ## **Types of Queues: Pull vs. Push** Another crucial aspect is the type of queue: Pull or Push. In a push queue, messages are automatically sent to consumers regardless of their status. This can lead to problems if consumers cannot process the volume of incoming messages. On the other hand, in a pull queue, consumers request new messages from the broker, ensuring that they can process them correctly, although this may be slower. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqeyjnt4reszbcvqqct3.png) ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ew5x9esqjl291v4v8ny1.png) ## **Difference between Messaging and Stream** Messaging enables asynchronous and reliable communication between systems, useful when message order is not critical and data does not need to be delivered in real time. On the other hand, streaming services deal with continuous streams of data in real time, maintaining the order of records. This is ideal for processing large volumes of data in real time where order is crucial. ### **Amazon SNS (simple notification service)** **Advantages:** Self-managed service that supports sending messages to multiple destinations, integrated with AWS services, facilitating the construction of cloud-based applications. **Disadvantages:** May be more expensive for applications with high message load and may not offer granular control over message consistency. ### **Amazon SQS (simple queue service)** **Advantages:** Managed and fault-tolerant queuing service, with automatic replication of messages between clusters. **Disadvantages:** Message size limit and possibility of receiving duplicate messages due to replication. ### **Redis** **Advantages:** Simple configuration and quick access to data due to its memory storage. **Disadvantages:** Lack of guarantees on message delivery order and latency for larger messages. ### **RabbitMQ** **Advantages:** Granular control over message consistency, support for multiple protocols and messaging models such as pub/sub and FIFO ordering. **Disadvantages:** Complex configuration for scalability beyond a high rate of requests per second. ### **Apache Kafka** **Advantages:** Highly scalable, fault tolerant and suitable for handling large volumes of data in real time. **Disadvantages:** Complexity in configuration and lack of integrated tools for management and monitoring. ## **Conclusion** Choosing the right messaging system depends on the specific needs of your project. Consider factors such as scalability, consistency, cost, and configuration complexity when making your decision. Carefully evaluate each option and choose the one that best meets your system requirements.
patrick0806
1,866,807
Understanding the Differences Between Google Agents and Google Chatbots
Key differences between Google Agents and Google Chatbots Businesses and users are...
0
2024-05-27T18:10:11
https://dev.to/aixart/understanding-the-differences-between-google-agents-and-google-chatbots-18b
google, gemini, agents, ai
###Key differences between Google Agents and Google Chatbots Businesses and users are increasingly adopting conversational AI solutions to interact with their users and perform routine tasks. When it comes to conversational AI, two technologies stand out: Google Agents and Google Chatbots. Both are designed to establish communication between users and systems, yet they are very different in their application and possibilities. In this blog, we cover those differences to help you decide which product to use. ###Chatbots: Informational transactional output Ref Link : [[Get started with ](https://www.youtube.com/watch?v=0k-wQj6Ttmo)] - Rule-based output: A Google Chatbot can perform pre-defined specific tasks. They function using rules and are best suited for simple FAQs and information access. For instance, your chatbot may respond to user queries like store opening/closing times, product information, simple technical support instructions etc. - Live Interactions: Most Chatbots offer live interactions to users. This means that the user poses a question and the bot replies immediately. Though this is synchronous in nature, such conversations are usually restricted to a single response and not suited for complex or extended discussions. - Limited automation: Chatbots can be used to automate simple, routine tasks but the possibilities remain limited to basic use cases. They are good at providing fast, transactional data but not so much at interpreting more complex user intent. ### Agents: Goal oriented task performers Ref Link : [[Get started with ](https://www.youtube.com/watch?v=H6nUoszwcrM)] - User Intent: Google Agents are advanced, goal oriented technology. They are focused on interpreting user intent which in turn helps them manage complex conversations. Agents are programmed to understand conversations in context and perform relevant actions that achieve user objectives. - Non Live Interactions: Agents unlike chatbots can participate in non live or asynchronous conversations. They have the ability to get started, engage in conversation over time, interact with other agents and systems and perform actions consistently to achieve a desired outcome. - Connectivity to APIs: Connectivity to APIs is perhaps the biggest differentiator for agents. They can be integrated to any API and perform relevant actions on behalf of the user. This means agents have the potential to book appointments, process purchases or even authenticate and authorize user logins. - Flexibility: Agents by design are flexible and perform a diverse range of tasks with optimum efficiency. They can handle complex workflows, assess user inputs and respond with relevant personalized information that meets user objectives. ###Agent Builder platform for easy agent creation Google has made available Agent Builder platforms to ease the creation and deployment of conversational agents. Particularly, Vertex AI's Agent Builder (previously Dialogflow CX) offers a highly scalable cloud-based conversational AI development platform using generative playbooks and the react pattern. Together these help developers create powerful agents capable of handling complex conversations and driving related business workflows. ###Conclusion: Choosing the Right Technology When deciding between Google Chatbots and Google Agents, consider the nature of the tasks you need to automate. If your requirements are limited to basic information retrieval and simple, rule-based interactions, a chatbot might be sufficient. However, if you need a more sophisticated solution capable of understanding user intent, performing actions, and handling complex tasks, an agent is the way to go. By leveraging the appropriate technology, you can enhance user interactions, improve operational efficiency, and deliver a more engaging and productive experience for your customers.
aixart
1,866,815
Buy verified cash app account
https://dmhelpshop.com/product/buy-verified-cash-app-account/ Buy verified cash app account Cash...
0
2024-05-27T18:09:19
https://dev.to/ditifej959/buy-verified-cash-app-account-17n0
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/geb014g2xqmqo2jubq1a.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"
ditifej959
1,866,814
Episode 24/21: Angular 18
Angular 18 is out. For the first time, the main feature is an experimental one: the zoneless...
0
2024-05-27T18:07:56
https://dev.to/this-is-angular/episode-2421-angular-18-21od
webdev, javascript, programming, angular
Angular 18 is out. For the first time, the main feature is an experimental one: the zoneless mode. {% embed https://youtu.be/gpaNrUmxpOw %} Until Angular 17, zone.js triggered Change Detection, which updates the DOM. Starting from Angular 18, we have a second trigger: the function `markForCheck()`, which runs automatically within the `async` pipe or when a Signal's value changes. That Signal must be used inside a template. There are also other occurrences for `markForCheck()` like immutable property binding or handled DOM events. `markForCheck()` triggering the Change Detection is not experimental but stable. It is a breaking change because the Change Detection might now also be triggered outside of zone.js. Although that is a rare use case, we can also re-introduce the behavior as before via `provideZoneChangeDetection({ignoreChangesOutsideZone: true})`. What is experimental, though, is that you can disable zone.js at all and only rely on `markForCheck()`. That is done via `provideExperimentalZonelessChangeDetection()`. --- Other features include the "Event Replay", which is important for server-side rendering. When the application hasn't hydrated, i.e. Angular hasn't been loaded yet, and users start clicking around, those events will be replayed after hydration. `provideClientHydration(withEventReplay())` --- The `redirectTo` property in the Router configuration accepts, next to the existing string, now also a function. That means, when logic is required for the redirection, one doesn't have to fallback to router guards. ```typescript export const routes: Routes = [ {path: '', component: HomeComponent}, { path: '**', redirectTo: () => isNight() ? '/404-night' : '404-day' } ]; ``` --- `<ng-content>` accepts a default value. It is actually very straightforward 😄: ```html <ng-content>Nothing to see here :) </ng-content>` ``` --- `FormGroup`, `FormArray`, and `FormControl` expose an `events` property, which provides all important events as an `Observable`: ```typescript export class AppComponent { name = new FormControl("", {validators: [Validators.required]}) constructor() { this.name.events.subscribe((event: ControlEvent) => { if (event instanceof StatusChangeEvent) { console.log('status changed'); } else if (event instanceof ValueChangeEvent) { console.log('value changed'); } // ... }) } } ``` --- A lot of features, like `@defer`, `@if`, `@for` are now stable (`effect()` is still in developer preview). According to Alex Rickabaugh, tech lead of the framework, we can expect new features in the next versions as well. For more information, check out the various videos, blog posts from the community, and the official channels. **Angular 18 Release - Developer Event** {% embed https://youtu.be/DK8M-ZFjaMw?si=svpiO2oh3Z10iIVq %} **Official Blog Post** {% embed https://blog.angular.dev/angular-v18-is-now-available-e79d5ac0affe %}
ng_news
1,866,813
Nueva herramienta SocialPhy.com
Social Phy es una plataforma completamente gratuita que ofrece una vasta gama de actividades...
0
2024-05-27T18:07:17
https://dev.to/socialphy/nueva-herramienta-socialphycom-lfj
socialmedia, javascript, beginners, programming
[Social Phy](https//socialphy.com) es una plataforma completamente gratuita que ofrece una vasta gama de actividades diseñadas para fomentar el crecimiento personal y profesional de sus usuarios. Combinando elementos de red social con herramientas educativas y cursos, SocialPhy crea un entorno único donde los usuarios pueden conectarse, aprender y desarrollarse de manera integral. Nuestro compromiso es revolucionar la educación en línea integrando actividades lúdicas que fortalecen el aprendizaje y mejoran las habilidades cognitivas. Desde juegos de memoria hasta complejos rompecabezas matemáticos, ofrecemos una variedad de actividades educativas que son tanto entretenidas como educativas. Entre las actividades destacadas en SocialPhy se encuentran: Juegos de Memoria y [Crucigramas](https://www.socialphy.com/crucigramas/): Pon a prueba y agudiza tu memoria con desafiantes juegos diseñados para estimular tu cerebro. Sopas de Letras, Adivinanzas y Acertijos: Mejora tu vocabulario y tus habilidades de resolución de problemas mientras te diviertes con juegos interactivos. Tareas Matemáticas y Rompecabezas: Desarrolla tu creatividad y habilidades numéricas a través de desafíos matemáticos y rompecabezas complejos. Test, Tests de Personalidad e IQ: Descubre más sobre ti mismo con tests que evalúan diversas características personales y cognitivas. Aprender Idiomas: Mejora tus habilidades lingüísticas con actividades interactivas diseñadas para ayudarte a hablar un nuevo idioma con confianza. Quizzes y Encuestas: Pon a prueba tus conocimientos en una variedad de temas y participa en encuestas para comparar tus opiniones con las de otros usuarios. Además de estas actividades, SocialPhy también ofrece una serie de herramientas y recursos adicionales para enriquecer tu experiencia de aprendizaje y promover tu desarrollo profesional. Estas incluyen: [Master Marketing Digital Gratis](https://www.socialphy.com/curso/master-marketing-digital/): Accede a cursos avanzados de marketing digital para impulsar tu carrera profesional. Herramienta [SEO](https://seo.socialphy.com/) Gratuita: Optimiza tu presencia en línea con nuestra herramienta SEO para mejorar tu visibilidad en los motores de búsqueda. [Video-Downloader Gratis](https://www.socialphy.com/video-downloader/): Descarga vídeos de diversas plataformas de forma sencilla y gratuita. Herramienta de [AI](https://ai.socialphy.com/) + Chat GPT 4 Gratuita: Experimenta con la inteligencia artificial y el procesamiento de lenguaje natural con nuestra herramienta gratuita. Acortar [URL](https://socialphy.com/url/) y Ganar Dinero: Obtén ingresos extra acortando enlaces y compartiéndolos en tus redes sociales. Article: Escribe y Gana: Participa en nuestra plataforma de redacción y gana dinero por tus artículos de calidad. Red Social Epic: Conecta con una comunidad global de aprendices y profesionales de diversos campos. Educación y Entretenimiento Interactivo: Sumérgete en un mundo de conocimiento y diversión con nuestras actividades educativas y recursos interactivos. En resumen, SocialPhy ofrece una experiencia única donde puedes expandir tu conocimiento, fortalecer tus habilidades y conectar con una comunidad diversa de aprendices. ¡Únete a nosotros hoy y comienza tu viaje de aprendizaje y crecimiento con SocialPhy!
socialphy
1,866,812
Buy verified cash app account
https://dmhelpshop.com/product/buy-verified-cash-app-account/ Buy verified cash app account Cash app...
0
2024-05-27T18:05:33
https://dev.to/olivapittere359/buy-verified-cash-app-account-3hhn
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/0lcfz55muslx4ux62mbp.jpg)\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"
olivapittere359
1,866,806
Javascript Boxing and Unboxing
Boxing Javascript primitive data types are not an object so it shouldn't have methods and...
0
2024-05-27T18:03:59
https://dev.to/ikbalarslan/javascript-boxing-and-unboxing-4o9g
javascript, webdev, programming
## Boxing Javascript primitive data types are not an object so it shouldn't have methods and properties right? Did you know that number and string primitive values can act like reference types so we can use methods and properties with them? By default when we run the javascript objects inside of the `__proto__` and we can use them in our code. some of the objects inside are `String` and `Number` Whenever we want to use methods or properties on primitive types: - if the type is a string it will wrap it with the String object from proto - if the type is a number it will wrap it with the Number object from the proto This is called auto-boxing, think of the objects as a big box and we put primitive types as small boxes inside of the objects so we can use all the methods and properties. For some reason, we can use methods and properties with primitive types. The reason is called boxing and it is automatically applied to primitive types. ``` var car = "ford"; console.log(car); car.length // 4 ``` ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/870ngfxwea8019d42ivw.png) In this case, the type of the car is a string which is a primitive type in the console.log(car) everything will be normal. but in the next line we are using a method that only reference types have so behind the scenes javascript will put this variable inside of the String object from proto so we can access to the methods. --- ## UnBoxing ``` {a : 4} > {a : 5} ``` In this case, when we want to compare two objects we can't do that. we can only compare primitive types. To do this calculation we need to convert them to the primitive types. for this, we have a method which is ToPrimitive(). it will call this method default to convert them to primitive types. So behind the scenes, the calculation will be like this ``` ToPrimitive({a:4}) > ToPrimitive({a:5}) //false ``` Since we are converting reference types to primitive types that called un-boxing.
ikbalarslan
1,866,811
Parayla Diploma
Para ile Alınan Diplomaların İlerleyen Zamanlarda Yol Açabileceği Sorunlar Giriş Eğitim, bireylerin...
0
2024-05-27T17:59:51
https://dev.to/parayladiploma/parayla-diploma-oj0
diploma, parayla, sahte
**Para ile Alınan Diplomaların İlerleyen Zamanlarda Yol Açabileceği Sorunlar** **Giriş** Eğitim, bireylerin hem kişisel gelişimlerini hem de mesleki kariyerlerini şekillendiren temel bir süreçtir. Ancak, son yıllarda "para ile alınan diploma" gibi etik dışı uygulamalar yaygınlaşmıştır. Bu tür diplomalar, kısa vadede bazı bireylere avantaj sağlıyor gibi görünse de, uzun vadede ciddi sorunlara yol açar. Bu makalede, para ile alınan diplomaların ilerleyen zamanlarda yaratabileceği sorunları detaylı bir şekilde ele alacağız. **Akademik ve Mesleki Güvenilirlik** Akademik Bütünlük Para ile alınan diplomalar, akademik bütünlüğü ciddi şekilde zedeler. Eğitim kurumlarının temel amacı, öğrencilere bilgi ve beceri kazandırmaktır. Para karşılığında diploma almak, bu amaca tamamen aykırıdır ve eğitim kalitesini düşürür. Uzun vadede, bu durum eğitim kurumlarının itibarını zedeler ve gerçek öğrencilere verilen diplomaların değerini düşürür. **İş Dünyasında Güvensizlik** Para ile alınan diplomalar, iş dünyasında büyük güvensizliklere yol açar. İşverenler, çalışanlarının belirli bir bilgi ve yetkinliğe sahip olduğunu varsayar. Ancak, para ile alınan diplomalara sahip bireyler, gerekli bilgi ve becerilere sahip olmadıkları için iş yerlerinde verimlilik düşebilir ve güven ortamı zedelenir. Bu durum, işverenlerin işe alım süreçlerinde daha fazla önlem almasına ve güvenilirlik kontrollerini artırmasına neden olur. **Hukuki ve Etik Sorunlar** Hukuki Yaptırımlar Birçok ülkede, sahte diplomalarla iş başvurusu yapmak veya akademik pozisyonlara başvurmak yasalarla düzenlenmiştir ve ciddi cezai yaptırımlara tabidir. Para ile alınan diplomalarla iş bulmak veya akademik kariyer yapmak, hukuki sorunlarla karşılaşmanıza neden olabilir. Bu tür eylemler, hapis cezası ve ağır para cezaları ile sonuçlanabilir. **Etik Sorunlar** Para ile diploma almak, ciddi etik sorunlar doğurur. Eğitim, dürüstlük ve adalet ilkelerine dayanmalıdır. Para karşılığında diploma almak, bu ilkeleri ihlal eder ve toplumda haksız rekabete yol açar. Bu durum, gerçek anlamda eğitim alarak diploma kazanan bireylerin emeklerine saygısızlık olarak değerlendirilir. **Mesleki ve Kişisel İtibar** Mesleki İtibar Para ile alınan diplomalar, mesleki itibarınızı ciddi şekilde zedeler. Sahte diplomalarla iş bulduğunuz ortaya çıkarsa, işverenler ve meslektaşlarınız tarafından güvenilmez olarak görülürsünüz. Bu durum, mesleki kariyerinizde ilerlemenizi engeller ve iş bulma şansınızı azaltır. **Kişisel İtibar** Sahte diplomalar, kişisel itibarınızı da olumsuz etkiler. Aile, arkadaşlar ve toplum nezdinde güvenilirliğiniz sorgulanır. Bu tür bir itibar kaybı, sosyal ilişkilerinizi olumsuz etkileyebilir ve kişisel yaşamınızda büyük sorunlara yol açabilir. **Uzun Vadeli Kariyer Planları** Sürdürülebilir Kariyer Gerçek bir eğitim, bireylerin uzun vadeli kariyer planlamasında önemli bir rol oynar. Para ile alınan diplomalar, kısa vadede bir çözüm gibi görünse de, uzun vadede sürdürülebilir bir kariyer için yeterli değildir. Gerçek bilgi ve becerilere sahip olmadan, iş yerinde başarılı olmak ve kariyer basamaklarını tırmanmak neredeyse imkansızdır. **Profesyonel Gelişim** Eğitim süreci, bireylerin profesyonel gelişimlerini destekler ve onları gelecekteki kariyerlerine hazırlar. Para ile alınan diplomalar, bu tür bir gelişimi sağlamaz ve bireylerin mesleki yetkinliklerini artırmaz. Uzun vadede, bu durum profesyonel hayatta başarısızlık ve memnuniyetsizlikle sonuçlanır. **Toplumsal Etkiler** Sosyal Adalet Eğitim, sosyal adaletin sağlanmasında kritik bir rol oynar. Para ile diploma, gelir düzeyi yüksek olanların avantaj sağladığı bir ortam yaratır ve eğitimde fırsat eşitliğini bozar. Bu durum, toplumda sınıf farklılıklarını artırır ve sosyal adaletsizliğe yol açar. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tjepjrhk174rjw418rf8.png) **Ekonomik Kalkınma** Toplumların uzun vadeli ekonomik kalkınması, eğitimli ve yetkin bireylere bağlıdır. Para ile diploma yaygınlaştıkça, toplumun genel bilgi seviyesi ve beceri düzeyi düşer, bu da ekonomik kalkınmayı olumsuz etkiler. Eğitimli bireylerin azaldığı bir toplumda, yenilikçilik ve rekabet gücü zayıflar. **Sonuç** Para ile alınan diplomalar, bireyler ve toplum için ciddi olumsuz sonuçlar doğurur. Akademik bütünlüğü zedeler, iş dünyasında güvensizlik yaratır, hukuki ve etik sorunlara yol açar, mesleki ve kişisel itibarı zedeler ve uzun vadeli kariyer planlamasını olumsuz etkiler. Ayrıca, sosyal adaleti bozar ve ekonomik kalkınmayı engeller. Bu nedenle, gerçek bir eğitim alarak diploma kazanmak, hem bireysel başarılar hem de toplumsal kalkınma için esastır. Eğitimde dürüstlük ve adaletin sağlanması, herkes için daha iyi bir geleceğin anahtarıdır. Bu sebeple bu tür sitelerden hizmet almayın [diplomasec.com](diplomasec.com)
parayladiploma
1,866,810
Explore National Highways & Motorway Police Jobs 2024
dvantages of a Career with NHMP Stability and Benefits: A career with the National Highways &amp;...
0
2024-05-27T17:58:13
https://dev.to/jobs2i/explore-national-highways-motorway-police-jobs-2024-2bgp
dvantages of a Career with NHMP Stability and Benefits: A career with the National Highways & Motorway Police (NHMP) offers unparalleled **[job](https://jobs2i.com/explore-national-highways-motorway-police-jobs-2024/)** security, a hallmark of government employment. Employees enjoy a range of benefits including pensions, healthcare, and housing allowances, ensuring a stable and secure future. Career Growth: The NHMP is committed to the professional growth of its employees. With clear paths for promotion and advancement, individuals have the opportunity to rise through the ranks and achieve their career goals. Professional Training: NHMP provides comprehensive training programs designed to enhance the skills and knowledge of its personnel. This continuous learning environment fosters expertise in various aspects of law enforcement and traffic management. Service to the Nation: Perhaps the most rewarding aspect of working with the NHMP is the chance to serve the community. Employees take pride in their contribution to public safety, making a tangible difference in the lives of citizens every day. Job Openings In 2024 The National Highways & Motorway Police (NHMP) has released a comprehensive list of job openings that reflect the diverse roles within the organization. These positions range from administrative support to active field duties, each contributing uniquely to the operations of the NHMP. The significance of these listings lies in their potential to attract a wide array of talents, essential for the multifaceted responsibilities of highway and motorway management. Patrol Officer Patrol Officers are the dynamic force of the NHMP, ensuring compliance with traffic laws and safety on the highways. They serve as first responders to incidents, providing aid and managing emergencies. Their role demands physical fitness, keen observation, and a commitment to public service. Requirement Description Education Intermediate, FA/FSc, Valid Driving License Salary 40,000 – 75,000 Age Limit Specified as per job criteria Location Various regions across Pakistan Last Date to Apply May 31, 2024
jobs2i
1,866,803
Terraform pipeline (IaC for AWS)
Automating Infrastructure Deployment for Static Websites with Terraform in AWS We'll...
0
2024-05-27T17:42:57
https://dev.to/monica_escobar/terraform-pipeline-iac-for-aws-438e
aws, devops, automation, iac
## Automating Infrastructure Deployment for Static Websites with Terraform in AWS **We'll leverage Terraform, an infrastructure as code (IaC) tool, to orchestrate the process. Here's a breakdown of the key steps involved:** **1. Terraform Setup:** Ensure Terraform is installed and configured locally. **2. Configuring the AWS Provider:** Terraform requires an AWS provider configuration file specifying the region and credentials for provisioning resources. We will create a **provider.tf** file for this. **3. Defining the VPC Network:** We'll define the Virtual Private Cloud (VPC)in the **vpc.tf** file where the server on the EC2 instance will reside. This includes creating a public subnet for internet access. Creating Internet Connectivity and Security: An internet gateway is established (in **network.tf**) to enable internet access for the VPC. We'll also define a custom route table and associate it with the public subnet for proper routing. Finally, a security group is created to control inbound and outbound traffic for the Jenkins EC2 instance. **4. Building the Terraform Configuration:** The core Terraform configuration file (**main.tf**) defines the provisioning of our EC2 instance with through a user data script. Additionally, it creates an S3 bucket for hosting the static website and configures it for website hosting. **5. Terraform Workflow:** Once the configuration is complete, we'll use Terraform commands to initialize, plan, and apply the changes. This will provision the resources in our AWS environment. `terraform init terraform plan terraform apply ` ![terraform init](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7t3xe647pl3s42ly8oeh.png) ![terraform plan](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9m3848o6b0ovjgekoygx.png) ![terraform apply](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xyka30u61tcxtdm82s0g.png) ![terraform destroy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ut4hmzv7c8xlvufjg1mh.png) **6. Validating Resources (Optional):** You can now validate the created AWS resources like the EC2 instance, security group, VPC, and S3 bucket to ensure everything is set up correctly.
monica_escobar
1,839,660
Learn SwiftUI (Day 8/100)
Swift functions with throw Exceptions import Cocoa enum PasswordError: Error,...
0
2024-05-01T14:32:59
https://dev.to/bitecode/learn-swiftui-day-8100-2587
swift
## Swift * functions with throw Exceptions ```swift import Cocoa enum PasswordError: Error, LocalizedError { case TooShort case Obvious var errorDescription: String? { switch self { case .TooShort: return NSLocalizedString("Password is too short", comment: "Too short") case .Obvious: return NSLocalizedString("Password is too obvious", comment: "Obvious") } } } // although defined with `throws`, // this function doesn't have to throw an exception func checkPassword(_ pwd: String) throws -> Bool { if pwd.count < 6 { throw PasswordError.TooShort } if pwd == "123456" { throw PasswordError.Obvious } return true } do { let ok = try checkPassword("hello") print(ok) } catch { print("Error happened: \(error.localizedDescription)") } // ## Checkpoints /* write a function that accepts an integer from 1 through 10,000, and returns the integer square root of that number. That sounds easy, but there are some catches: You can’t use Swift’s built-in sqrt() function or similar – you need to find the square root yourself. If the number is less than 1 or greater than 10,000 you should throw an “out of bounds” error. You should only consider integer square roots – don’t worry about the square root of 3 being 1.732, for example. If you can’t find the square root, throw a “no root” error. */ enum RootError: Error, LocalizedError { case outOfBounds case noRoot var errorDescription: String? { switch self { case .outOfBounds: return NSLocalizedString("Out of Bounds", comment: "OOB") case .noRoot: return NSLocalizedString("No root", comment: "NR") } } } func sqroot(_ num: Int) throws -> Int { if num < 1 || num > 10_000 { throw RootError.outOfBounds } for i in 1...100 { if i * i == num { return i } } throw RootError.noRoot } do { print(try sqroot(9)) print(try sqroot(25)) print(try sqroot(37)) } catch { print("error happened: \(error.localizedDescription)") } ```
bitecode