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,869,450 | Let’s highlight | Our team has been diligently adding screenshots to highlight the UI improvements made by PRs. While... | 0 | 2024-06-02T09:08:29 | https://dev.to/rationalkunal/lets-highlight-5lc | ios, swift, opensource | Our team has been diligently adding screenshots to highlight the UI improvements made by PRs. While this approach has been beneficial in pinpointing changes, it has become a cumbersome task when multiple UI elements are updated. The need to adhere to this guideline often results in the addition of numerous screenshots, which is a time-consuming process.
That's when I had a breakthrough: What if we could draw a border directly in the app to highlight changes? This would eliminate the bottleneck of manually adding borders by quick edit.
And here we are.
The plan is to create border drawing functionality:
- A simple keypress should trigger it.
- It should be separate from the app, i.e., the drawing should not affect it.
- We should be able to draw rectangles by just swiping.
## Trigger drawing functionality by keyboard keypress
I had already seen similar functionality in the FLEX tool, so that was my starting point. Interestingly, an app on a simulator captures keyboard events with `UIPhysicalKeyboardEvent` and exposes `_modifiedInput`, `_isKeyDown`, etc. As these are internal classes and Swift is a type-safe language, we need to use key-value pairs to access those. To intercept all events to the application, swizzled `UIApplication.sendEvent(_:)`.
```swift
// Hack: To look into keyboard events
extension UIEvent {
var modifiedInput: String? { self.value(forKey: "_modifiedInput") as? String }
var isKeyDown: Bool? { self.value(forKey: "_isKeyDown") as? Bool }
}
class ShortcutManager {
var actionsForKeyInputs: [String: () -> Void] = [:]
// Registers a action to be performed when "key" is presseed by user
// Note: This will override existing action for the "key"
func registerShortcut(withKey key: String, action: @escaping () -> Void) {
actionsForKeyInputs[key] = action
}
func handleKeyboardEvent(pressedKey: String) {
if let action = actionsForKeyInputs[pressedKey] {
action()
}
}
func interceptedSendEvent(_ event: UIEvent) {
guard event.isKeyDown ?? false else { return }
if let input = event.modifiedInput {
handleKeyboardEvent(pressedKey: input)
}
}
}
// Handle siwizzling: Just call `performSwizzling()`
// Expect call to `ShortcutManager.interceptedSendEvent(_: UIEvent)` when any event is performed on `UIApplication`.
extension ShortcutManager {
static func _swizzle() {
let originalSelector = #selector(UIApplication.sendEvent(_:))
let swizzledSelector = #selector(UIApplication.swizzled_sendEvent(_:))
guard let originalMethod = class_getInstanceMethod(UIApplication.self, originalSelector),
let swizzledMethod = class_getInstanceMethod(UIApplication.self, swizzledSelector) else {
return
}
let didAddMethod = class_addMethod(UIApplication.self, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))
if didAddMethod {
class_replaceMethod(UIApplication.self, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod))
} else {
method_exchangeImplementations(originalMethod, swizzledMethod)
}
}
}
extension UIApplication {
@objc func swizzled_sendEvent(_ event: UIEvent) {
ShortcutManager.sharedInstance.interceptedSendEvent(event)
// Call original
swizzled_sendEvent(event)
}
}
```
_<sup>Check out the complete code and a few improvements at [github/rational-kunal/Picaso/ShortcutManager.swift](https://github.com/rational-kunal/Picaso/blob/main/Sources/Draw/ShortcutManager.swift)</sup>_
## Launch drawing functionality separate from the app
We can create a separate `UIWindow` and show it on top of the current window to keep our drawing functionality separate from the app's views.
I created a `CanvasManager` that will toggle our toggle functionality on the `x` key press.
```swift
class CanvasManager {
var isCanvasActive: Bool { self.canvasWindow.windowScene != nil }
/// Default initialization
/// - Shortcut "x" to toggle canvas
static func defaultInitialization() {
ShortcutManager.sharedInstance.registerShortcut(withKey: "x",
action: {
CanvasManager.sharedInstance.toggleCanvas()
})
}
public func toggleCanvas() {
isCanvasActive ? hideCanvas() : showCanvas()
}
public func showCanvas() {
guard let windowScene = UIApplication.shared.activeWindowScene else { return }
canvasWindow.rootViewController = makeRootViewController()
canvasWindow.windowScene = windowScene
canvasWindow.isHidden = false
}
public func hideCanvas() {
canvasWindow.rootViewController = nil
canvasWindow.windowScene = nil
canvasWindow.isHidden = true
}
}
```
_<sup>Check out the full code at [github/rational-kunal/Picaso/CanvasManager.swift](https://github.com/rational-kunal/Picaso/blob/main/Sources/Draw/CanvasManager.swift)</sup>_
## Draw!
To draw a border, I created a subclass of `UIView` and maintained `startPoint` and `endPoint`. We will update those in `touchesBegan()` and `touchesMoved()`. Finally, draw the rectangle from `startPoint` and `endPoint` in `draw()`.
```swift
class CanvasView: UIView {
private var startPoint: CGPoint = .zero
private var endPoint: CGPoint = .zero
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let touch = touches.first else { return }
startPoint = touch.location(in: self)
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let touch = touches.first else { return }
endPoint = touch.location(in: self)
}
override func draw(_ rect: CGRect) {
let rectangle = CGRect(x: min(startPoint.x, endPoint.x), y: min(startPoint.y, endPoint.y),
width: abs(startPoint.x - endPoint.x), height: abs(startPoint.y - endPoint.y))
let roundedRectangle = UIBezierPath(roundedRect: rectangle, cornerRadius: 3.5)
roundedRectangle.lineWidth = 2.5
UIColor.clear.setFill()
UIColor.red.setStroke()
roundedRectangle.stroke()
}
}
```
_<sup>Check out the complete code for this at [github/rational-kunal/Picaso/CanvasView.swift](https://github.com/rational-kunal/Picaso/blob/main/Sources/Draw/CanvasManager.swift)</sup>_
With this, we have the following output
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nzcl571jbttv8issrmmy.gif" />
## Lets over-engineer
As further improvements, I implemented a way to resize the rectangle by dragging corners. To achieve this, we need to manage each corner and the selection state of the rectangle. I finally packaged this in a swift package for anyone who wants to check out the functionality with a quick setup.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7odqigxkas4reo34bggb.gif" />
Final comparison of before and after workflow of taking screenshots
| Before | After |
|------------|----------|-----------|
| |  |
With this, 1) improved productivity by removing the need to edit screenshots and 2) Learn a few new things like `UIPhysicalKeyboardEvent.` Please check out the complete plugin at [github/rational-kunal/Draw](https://github.com/rational-kunal/Draw), and leave a star if you liked it.
Thank you for reading. | rationalkunal |
1,873,583 | My GitHub Profile | Hello, I'm Sudhanshu Ambastha 👋 I'm a dedicated developer who enjoys tackling coding... | 0 | 2024-06-02T09:07:32 | https://dev.to/sudhanshuambastha/my-github-profile-47bc | markdown, profilereadme, commits | ## Hello, I'm Sudhanshu Ambastha 👋
I'm a dedicated developer who enjoys tackling coding challenges and finding elegant solutions. In my free time, I explore new technologies and contribute to open-source projects. If you're interested in collaborating on exciting projects or discussing tech-related topics, feel free to reach out to me!
**Gratitude**
I recently came across a **_[post](https://dev.to/syeo66/how-i-got-to-2000-followers-on-devto-118e)_** discussing how some followers on this platforms might be bots or spammers. This made me reflect on my own follower count as currently it is **_3536_**, especially considering the significant increase in followers I experienced in a single day. While it's possible that some followers might not be genuine, I am grateful for a total of **_1K views_** on all my posts combined from those who are genuinely engaging with my content. Thank you to everyone who supports me with likes and authentic engagement. Your support motivates me to continue creating valuable content. I will do my best to keep providing the quality content you enjoy.
**GitHub Profile Stats**
_Stars: 3
Clones: 16
Views: 64
Followers: 44_
I truly value the support from individuals like those **44 GitHub followers**. While many have cloned my projects, only a few have shown interest by granting them a star. **_Plagiarism is bad_**, and even if you are copying it, just consider giving it a star. If you're new and want to check traffic or how many people have cloned your project, simply visit your _desired repo > Insights > Traffic_.
I understand that not everyone may choose to star the project, but I kindly ask that if you find it useful, please consider giving it a star. It's a small gesture that means a lot to me and motivates me to generate more innovative ideas.
**Connect with Me**
You can connect with me on **_[GitHub](https://github.com/Sudhanshu-Ambastha)_**, _**[LinkedIn](https://www.linkedin.com/in/sudhanshu-ambastha-8a0b332a4/)**_ and support my work there, just as you do on **dev.to** and on **_[X](https://x.com/Sudhanshu79093)_**. Your continued support is crucial, and together we can achieve even greater milestones.
Thank you once again, and let's keep pushing the boundaries of what's possible in tech! | sudhanshuambastha |
1,839,271 | Django and PostgreSQL | Install Django on Mac: python3 -m pip install Django Enter fullscreen mode ... | 0 | 2024-06-02T09:06:36 | https://dev.to/ajeetraina/django-and-postgresql-4bfi | ## Install Django on Mac:
```
python3 -m pip install Django
```
## Installing Django Project:
```
django-admin startproject mysite
```
## View the project
```
tree mysite
mysite
├── manage.py
└── mysite
├── __init__.py
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py
2 directories, 6 files
```
These files are:
- The outer mysite/ root directory is a container for your project. Its name doesn’t matter to Django; you can rename it to anything you like.
- manage.py: A command-line utility that lets you interact with this Django project in various ways. You can read all the details about manage.py in django-admin and manage.py.
- The inner mysite/ directory is the actual Python package for your project. Its name is the Python package name you’ll need to use to import anything inside it (e.g. mysite.urls).
m- ysite/__init__.py: An empty file that tells Python that this directory should be considered a Python package. If you’re a Python beginner, read more about packages in the official Python docs.
- mysite/settings.py: Settings/configuration for this Django project. Django settings will tell you all about how settings work.
- mysite/urls.py: The URL declarations for this Django project; a “table of contents” of your Django-powered site.
You can read more about URLs in URL dispatcher.
- mysite/asgi.py: An entry-point for ASGI-compatible web servers to serve your project. See How to deploy with ASGI for more details.
- mysite/wsgi.py: An entry-point for WSGI-compatible web servers to serve your project. See How to deploy with WSGI for more details.
```
cd mysite
python3 manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
May 01, 2024 - 05:29:06
Django version 5.0.4, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[01/May/2024 05:29:21] "GET / HTTP/1.1" 200 10629
Not Found: /favicon.ico
[01/May/2024 05:29:22] "GET /favicon.ico HTTP/1.1" 404 2110
```

You’ve started the Django development server, a lightweight web server written purely in Python. We’ve included this with Django so you can develop things rapidly, without having to deal with configuring a production server – such as Apache – until you’re ready for production.
| ajeetraina | |
1,873,582 | FastAPI Microservices Deployment Using Kubernetes | In this article we are going to create 2 microservices in FastAPI and deploy them using kubernetes on... | 0 | 2024-06-02T09:05:14 | https://dev.to/sumangaire52/fastapi-microservices-deployment-using-kubernetes-4n4j | fastapi, docker, kubernetes, minikube | In this article we are going to create 2 microservices in FastAPI and deploy them using kubernetes on minkube. We are going to use kubernetes ingress to route requests to respective microservices.
Fist let’s go through kubernetes features we are going to use in this article.
Kubernetes Deployment: A Kubernetes Deployment automates the management of application updates and scaling. It defines the desired state for an application, such as the number of replicas, the container image to use, and update strategies. The Deployment controller ensures that the actual state of the application matches the desired state by creating and updating pods as needed. Deployments support rolling updates, rollback capabilities, and self-healing, making it easier to maintain application availability and reliability during changes. This abstraction simplifies deploying, scaling, and managing stateless applications in a Kubernetes cluster. [https://kubernetes.io/docs/concepts/workloads/controllers/deployment/](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)
Kuberenetes Service: A Kubernetes Service is an abstraction that defines a logical set of pods and a policy for accessing them, usually via a stable IP address and DNS name. Services enable communication between different parts of an application without needing to know the pod’s IP addresses, which can change.
[https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/](https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/)
Kubernetes Ingress: Kubernetes Ingress manages external access to services within a Kubernetes cluster. In our application we are going to use it to route the traffics to respective services (i.e microservice 1 or microservice 2). It defines rules to route traffic based on hostnames and paths to specific services. An Ingress controller, such as NGINX or Traefik, implements these rules, providing centralized management, load balancing, SSL termination, and path-based routing. Deploying an Ingress controller is required to use Ingress resources effectively.
[https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress)
**Microservice 1**:
Microservice 1 is going to be pretty straightforward. It is going to have only one endpoint which is going to return “You requested microservice 1”.
- Create a folder named microservice_1 and add a file named main.py.
```
# main.py (microservice 1)
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "You requested microservice 1"}
```
- Add requirements.txt file
`fastapi==0.111.0`
- Create Dockerfile
```
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
```
- Build the docker image and push it to dockerhub.
Make sure to tag the image in format username/image_name:version format. Otherwise kubernetes won’t be able to recognize the image. Run this command from the directory where Dockerfile for microservice 1 is located.
```
$ docker build . -t sumangaire96/microservice1:v1
$ docker push sumangaire96/microservice1:v1
```
**Microservice 2**:
Microservice 2 is also going to have only one endpoint which is going to return “You requested microservice 2”.
- Create a folder named microservice_1 and add a file named main.py.
```
`# main.py (microservice 2)
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "You requested microservice 2"}`
```
- Add requirements.txt
`fastapi==0.111.0`
- Add Dockerfile
```
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
```
- Build the docker image and push it to dockerhub.
`$ docker build . -t sumangaire96/microservice2:v1
$ docker push sumangaire96/microservice2:v1`
**Minikube**:
Make sure you have minikube installed. If it is not installed follow this link https://minikube.sigs.k8s.io/docs/start/. Make sure to have kubectl installed to interact with minikube cluster from the terminal. If it is not installed follow this link [https://kubernetes.io/docs/tasks/tools/](https://kubernetes.io/docs/tasks/tools/).
- Create a kubernetes cluster.
`$ minikube start`
- Enable ingress in minikube.
`$ minikube addons enable ingress`
- Create kubernetes manifest file for microservice 1.
```
# kubernetes/microservice_1.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: microservice1-deployment
spec:
replicas: 2
selector:
matchLabels:
app: microservice1
template:
metadata:
labels:
app: microservice1
spec:
containers:
- name: microservice1
image: sumangaire96/microservice1:v1
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: microservice1-service
spec:
selector:
app: microservice1
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
```
- Create kubernetes manifest file for microservice 2.
```
# kubernetes/microservice_2.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: microservice2-deployment
spec:
replicas: 2
selector:
matchLabels:
app: microservice2
template:
metadata:
labels:
app: microservice2
spec:
containers:
- name: microservice2
image: sumangaire96/microservice2:v1
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: microservice2-service
spec:
selector:
app: microservice2
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
```
- Create kubernetes ingress manifest file.
```
# kubernetes/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: microservice1.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: microservice1-service
port:
number: 80
- host: microservice2.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: microservice2-service
port:
number: 80
```
- Apply manifests
`$ kubectl apply -f microservice_1.yaml`
`$ kubectl apply -f microservice_2.yaml`
`$ kubectl apply -f ingress.yaml`
- Update hosts file to map the hostnames to the Minikube IP.
`$ echo "$(minikube ip) microservice1.local" | sudo tee -a /etc/hosts`
`$ echo "$(minikube ip) microservice2.local" | sudo tee -a /etc/hosts`
- Now go to url microservice1.local and microservice2.local. You should see output like this:


Congratulations! We have created 2 microservices in FastAPI and successfully deployed them using kubernetes. Make sure to follow me for upcoming articles. | sumangaire52 |
1,831,723 | What is Docker Debug and what problem does it solve? | The docker debug is a new command introduced in Docker Desktop 4.27.0. It allows you to open a... | 0 | 2024-06-02T09:05:08 | https://dev.to/ajeetraina/what-is-docker-debug-and-what-problem-does-it-solve-3f7g |

The `docker debug` is a new command introduced in Docker Desktop 4.27.0. It allows you to open a debug shell into any container or image. It's currently in beta and available to Pro subscribers. The command aims to provide a more comprehensive ecosystem of debugging tools and is seen as a crucial part of the Docker experience, not just a single CLI command
Docker Debug is a new tool to speed up the debugging process. Docker Debug is a tool designed to improve the troubleshooting process in Docker.
## What problem does it solve?
One of the main problems it tackles is the difficulty in debugging running and stopping containers. Docker Debug allows developers to join the execution context of a target container or create a temporary execution context for stopped containers, enabling them to investigate the containers.
Docker Debug also improves the shell environment for users, making it user-friendly and efficient. It includes features such as a descriptive prompt, auto-detection of the shell the user is using, persistent history across sessions, and a Nix-based package manager for adding tools as needed.
Additionally, Docker Debug helps with the issue of containers exiting unexpectedly, which previously made debugging impossible at that point.
By addressing these issues, Docker Debug enhances the usability of Docker and makes it easier for users to troubleshoot their applications.
It addresses several key issues:
1. The inability to effectively debug running and stopped containers. Docker Debug allows users to join the execution context of a target container or create a temporary execution context for stopped containers, enabling them to investigate the containers.
2. Difficulties in using docker exec command, which only works for containers that ship with a shell and doesn't work for stopped containers.
3. The need for a user-friendly and efficient shell environment, which Docker Debug aims to provide. This includes features such as a descriptive prompt, auto-detection of the shell the user is using, persistent history across sessions, and a nix-based package manager for adding tools as needed.
4. The problem of containers exiting unexpectedly, which makes debugging impossible at that point.
By addressing these issues, Docker Debug enhances the usability of Docker and makes it easier for users to troubleshoot their applications.
## Whos’ this for?
Docker Debug is primarily targeted at software developers and IT professionals who work with containerized applications, especially those using Docker for development and deployment. Here's a breakdown of who would benefit most:
### Developers:
- Building and deploying containerized applications
- Debugging issues within running or stopped containers
- Investigating runtime behavior and troubleshooting problems
- Simplifying the debugging workflow and streamlining development cycles
### IT professionals:
- Maintaining and managing containerized environments
- Diagnosing and fixing problems in production deployments
- Analyzing container performance and resource utilization
- Understanding the internals of containerized applications
While Docker Debug is currently in beta and limited to Pro subscribers, its potential benefits extend beyond these primary groups. Anyone who interacts with containerized applications, including system administrators and DevOps engineers, can benefit from its enhanced debugging capabilities and efficient shell environment.
## Getting Started
1. Ensure that you have Docker Desktop 4.27.0+ installed on your computer.
2. Verifying if the `docker debug` command is working correctly
```
docker debug --help
Usage: docker debug [OPTIONS] {CONTAINER|IMAGE}
Get an enhanced shell with additional tools into any container or image
Options:
-c, --command string Evaluate the specified commands instead, passing additional positional arguments through
$argv.
--host string Daemon docker socket to connect to. E.g.: 'ssh://root@example.org',
'unix:///some/path/docker.sock'
--shell shell Select a shell. Supported: "bash", "fish", "zsh", "auto". (default auto)
--version Display version of the docker-debug plugin
```
3. Running Docker Debug for Docker Images
The `docker debug` command requires container or image name as command-line argument. If you don’t have any container up and running or even if you don’t have any shell available in the running container, Docker Debug helps you to get access to the container shell.
I assume you just installed Docker Desktop 4.27.0 and right now you don’t have any image or container running on your system. Let’s jump into the Nginx image directly.
```
docker debug nginx
Pulling image, this might take a moment...
0.0.22: Pulling from docker/desktop-docker-debug-service
10c7e62bcff5: Pull complete
Digest: sha256:60b0227c4304f2d703255448aba2863c9a97e21ad0233514de3c7f200904869f
Status: Downloaded newer image for docker/desktop-docker-debug-service:0.0.22
latest: Pulling from library/nginx
a5573528b1f0: Pull complete
8897d65c8417: Pull complete
fbc138d1d206: Pull complete
06f386eb9182: Pull complete
aeb2f3db77c3: Pull complete
64fb762834ec: Pull complete
e5a7e61f6ff4: Pull complete
Digest: sha256:4c0fdaa8b6341bfdeca5f18f7837462c80cff90527ee35ef185571e1c327beac
Status: Downloaded newer image for nginx:latest
▄
▄ ▄ ▄ ▀▄▀
▄ ▄ ▄ ▄ ▄▇▀ █▀▄ █▀█ █▀▀ █▄▀ █▀▀ █▀█
▀████████▀ █▄▀ █▄█ █▄▄ █ █ ██▄ █▀▄
▀█████▀ DEBUG
Builtin commands:
- install [tool1] [tool2] ... Add Nix packages from: https://search.nixos.org/packages
- uninstall [tool1] [tool2] ... Uninstall NixOS package(s).
- entrypoint Print/lint/run the entrypoint.
- builtins Show builtin commands.
Checks:
✓ distro: Debian GNU/Linux 12 (bookworm)
✓ entrypoint linter: no errors (run 'entrypoint' for details)
Note: This is a sandbox shell. All changes will not affect the actual image.
Version: 0.0.22 (BETA)
root@6c7be49d2a11 / [nginx:latest]
docker >
```
## Inspect the entrypoint
```
docker > entrypoint
Understand how ENTRYPOINT/CMD work and if they are set correctly.
From CMD in Dockerfile:
['nginx', '-g', 'daemon off;']
From ENTRYPOINT in Dockerfile:
['/docker-entrypoint.sh']
```
By default, any container from this image will be started with following command:
```
/docker-entrypoint.sh nginx -g daemon off;
path: /docker-entrypoint.sh
args: nginx -g daemon off;
cwd:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Lint results:
PASS: '/docker-entrypoint.sh' found
PASS: no mixing of shell and exec form
PASS: no double use of shell form
Docs:
- https://docs.docker.com/engine/reference/builder/#cmd
- https://docs.docker.com/engine/reference/builder/#entrypoint
- https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact
root@6c7be49d2a11 / [nginx:latest]
```
## Viewing all builtin commands
```
builtins
A docker debugging toolbox. 0.0.22
Builtin commands:
- install [tool1] [tool2] ... Add Nix packages from: https://search.nixos.org/packages
- uninstall [tool1] [tool2] ... Uninstall NixOS package(s).
- entrypoint Print/lint/run the entrypoint.
- builtins Show builtin commands.
Note: This is a sandbox shell. All changes will not affect the actual image.
Version: 0.0.22 (BETA)
root@6c7be49d2a11 / [nginx:latest]
```
## Installing NIXOS Packages
```
install crossplane
Tip: You can install any package available at: https://search.nixos.org/packages.
[2024-01-22T07:13:47.863328585Z][W] tcp keep alive: request failed (Not Found): 404
[2024-01-22T07:13:52.866284045Z][W] tcp keep alive: request failed (Not Found): 404
installing 'crossplane-0.5.8'
these 2 paths will be fetched (0.07 MiB download, 0.26 MiB unpacked):
/nix/store/dnyyy0nbr9ybyh6b49b450arp3d4zgnq-python3.10-crossplane-0.5.8
/nix/store/ah81s4zhrdiz24avnfj92jw440kxy7f0-python3.10-crossplane-0.5.8-dist
copying path '/nix/store/dnyyy0nbr9ybyh6b49b450arp3d4zgnq-python3.10-crossplane-0.5.8' from 'https://cache.nixos.org'...
copying path '/nix/store/ah81s4zhrdiz24avnfj92jw440kxy7f0-python3.10-crossplane-0.5.8-dist' from 'https://cache.nixos.org'...
building '/nix/store/ryyfmaqkmy80333cprzipb8v82ghl5nf-user-environment.drv'...
root@6c7be49d2a11 / [nginx:latest]
```
## Displaying the content of a file inside Nginx
```
docker > bash -c "cat /usr/share/nginx/html/index.html"
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
root@6c7be49d2a11 / [nginx:latest]
docker >
```
## Tools available in Docker Debug
There are a number of tools that are made available. They don’t modify your container but just shipped with the CLI.
## 1. The vim tool
```
docker > vim
root@6c7be49d2a11 / [nginx:latest]
docker > vi hello
root@6c7be49d2a11 / [nginx:latest]
docker > ls
bin dev docker-entrypoint.sh hello lib mnt opt root sbin sys usr
boot docker-entrypoint.d etc home media nix proc run srv tmp var
root@6c7be49d2a11 / [nginx:latest]
docker >
```
## 2. The Htop Tool

## 2. Which tool
```
which vim
/nix/var/nix/profiles/default/bin/vim
root@6c7be49d2a11 / [nginx:latest]
```
## 4. Forwarding the port temporarily
```
root@6c7be49d2a11 / [nginx:latest]
docker > forward --port 81:80 nginx
2024/01/22 09:54:02 [notice] 59#59: using the "epoll" event method
2024/01/22 09:54:02 [notice] 59#59: nginx/1.25.3
2024/01/22 09:54:02 [notice] 59#59: built by gcc 12.2.0 (Debian 12.2.0-14)
2024/01/22 09:54:02 [notice] 59#59: OS: Linux 6.6.12-linuxkit
2024/01/22 09:54:02 [notice] 59#59: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/01/22 09:54:02 [notice] 64#64: start worker processes
2024/01/22 09:54:02 [notice] 64#64: start worker process 65
2024/01/22 09:54:02 [notice] 64#64: start worker process 66
2024/01/22 09:54:02 [notice] 64#64: start worker process 67
2024/01/22 09:54:02 [notice] 64#64: start worker process 68
2024/01/22 09:54:02 [notice] 64#64: start worker process 69
2024/01/22 09:54:02 [notice] 64#64: start worker process 70
2024/01/22 09:54:02 [notice] 64#64: start worker process 71
2024/01/22 09:54:02 [notice] 64#64: start worker process 72
```
## 5. Running Docker Debug for the running containers
```
docker run -d -p 6379:6379 redis
```
```
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a1ce95fc8430 redis "docker-entrypoint.s…" 26 seconds ago Up 26 seconds 0.0.0.0:6379->6379/tcp eloquent_hamilton
```
```
docker debug eloquent_hamilton
▄
▄ ▄ ▄ ▀▄▀
▄ ▄ ▄ ▄ ▄▇▀ █▀▄ █▀█ █▀▀ █▄▀ █▀▀ █▀█
▀████████▀ █▄▀ █▄█ █▄▄ █ █ ██▄ █▀▄
▀█████▀ DEBUG
Builtin commands:
- install [tool1] [tool2] ... Add Nix packages from: https://search.nixos.org/packages
- uninstall [tool1] [tool2] ... Uninstall NixOS package(s).
- entrypoint Print/lint/run the entrypoint.
- builtins Show builtin commands.
Checks:
✓ distro: Debian GNU/Linux 12 (bookworm)
✓ entrypoint linter: no errors (run 'entrypoint' for details)
This is an attach shell, i.e.:
- Any changes to the container filesystem are visible to the container directly.
- The /nix directory is invisible to the actual container.
Version: 0.0.22 (BETA)
redis@a1ce95fc8430 /data [eloquent_hamilton]
docker > ps -aef
UID PID PPID C STIME TTY TIME CMD
redis 1 0 0 10:08 ? 00:00:04 redis-server *:6379
root 47 0 0 10:24 pts/0 00:00:00 /bin/sh
root 54 47 0 10:24 pts/0 00:00:00 bash
redis 57 0 0 10:29 pts/0 00:00:00 /nix/var/nix/profiles/default/bin/zsh -i
redis 69 57 0 10:29 pts/0 00:00:00 ps -aef
redis@a1ce95fc8430 /data [eloquent_hamilton]
docker >
```
## 5. Installing nmap packages
```
docker > install nmap
Tip: You can install any package available at: https://search.nixos.org/packages.
[2024-01-22T10:36:46.561468511Z][W] tcp keep alive: request failed (Not Found): 404
[2024-01-22T10:36:51.567299097Z][W] tcp keep alive: request failed (Not Found): 404
replacing old 'nmap-7.93'
installing 'nmap-7.93'
redis@a1ce95fc8430 /data [eloquent_hamilton]
```
To check what ports are opened for scanme.nmap.org, run the following command
```
docker > nmap -v -A scanme.nmap.org
Starting Nmap 7.93 ( https://nmap.org ) at 2024-01-22 10:38 UTC
NSE: Loaded 155 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 10:38
Completed NSE at 10:38, 0.00s elapsed
Initiating NSE at 10:38
Completed NSE at 10:38, 0.00s elapsed
Initiating NSE at 10:38
Completed NSE at 10:38, 0.00s elapsed
Initiating Ping Scan at 10:38
Scanning scanme.nmap.org (45.33.32.156) [2 ports]
Completed Ping Scan at 10:38, 0.22s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 10:38
Completed Parallel DNS resolution of 1 host. at 10:38, 0.84s elapsed
Initiating Connect Scan at 10:38
Scanning scanme.nmap.org (45.33.32.156) [1000 ports]
Discovered open port 80/tcp on 45.33.32.156
Discovered open port 22/tcp on 45.33.32.156
```
| ajeetraina | |
1,843,082 | Getting Started with Nodejs | Node.js, built on Chrome's V8 JavaScript Engine, is a powerful JavaScript runtime that extends its... | 0 | 2024-06-02T09:04:28 | https://dev.to/ajeetraina/getting-started-with-nodejs-54pe | Node.js, built on Chrome's V8 JavaScript Engine, is a powerful JavaScript runtime that extends its capabilities to the server-side. Its asynchronous, event-driven nature, coupled with a non-blocking IO model, makes it exceptionally fast and efficient.
## Understanding Node.js
Node.js operates on an event-driven architecture, initializing all variables and functions and waiting for events to occur. Its asynchronous nature ensures that it doesn't block itself for one request but moves swiftly to the next, enhancing performance.
## Getting Started
Let's walk through creating a simple Node.js application step by step. We'll create a basic web server using Express.js and render a dynamic webpage using Handlebars as the templating engine.
## Step 1: Set Up Your Project
Create a new directory for your project and navigate into it:
```
mkdir my-node-app
cd my-node-app
```
## Initialize a new Node.js project:
```
npm init -y
```
This will create a package.json file with default settings.
## Step 2: Install Dependencies
Install Express.js and Handlebars as dependencies:
```
npm install express hbs
```
## Step 3: Create Your Server
Create a file named `app.js` in your project directory and open it in your code editor.
```
// Import required modules
const express = require('express');
const hbs = require('hbs');
const path = require('path');
// Create an Express app
const app = express();
// Set the view engine to Handlebars
app.set('view engine', 'hbs');
// Set the path for views and partials
app.set('views', path.join(__dirname, 'views'));
hbs.registerPartials(path.join(__dirname, 'views', 'partials'));
// Define routes
app.get('/', (req, res) => {
// Render the index page with dynamic data
res.render('index', {
title: 'Home',
author: 'Your Name'
});
});
// Start the server
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
```
## Step 4: Create Your Views
Create a directory named views in your project directory. Inside this directory, create two files: index.hbs and partials/header.hbs.
File: `index.hbs`
```
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
</head>
<body>
{{>partials/header}}
<h1>Welcome to {{ title }}</h1>
<p>Written by {{ author }}</p>
</body>
</html>
partials/header.hbs:
```
File: `partials/header.hbs`:
```
<header>
<h1>My Node.js App</h1>
<nav>
<ul>
<li><a href="/">Home</a></li>
</ul>
</nav>
</header>
```
## Step 5: Run Your Application
Navigate to your project directory in the terminal and run your Node.js application:
```
node app.js
```
Visit [http://localhost:3000](http://localhost:3000) in your web browser to see your Node.js application in action.
That's it! You've created a simple Node.js application with Express.js and Handlebars. Feel free to expand upon this example by adding more routes, views, or functionality as needed. | ajeetraina | |
1,843,302 | Integrating Backstage with Kubernetes | Kubernetes is an undeniable powerhouse in container orchestration, but its complexity can leave... | 0 | 2024-06-02T09:04:16 | https://dev.to/ajeetraina/integrating-backstage-with-kubernetes-2i1g | Kubernetes is an undeniable powerhouse in container orchestration, but its complexity can leave developers feeling lost at sea. This blog post explores how Backstage can act as a lighthouse, guiding developers through the murky waters of Kubernetes.
## The Kubernetes Challenge
There's no denying that Kubernetes packs a punch. However, its intricate nature can create a significant learning curve for developers. As a platform engineer, the goal is to provide tools that make Kubernetes more user-friendly and reduce this barrier to entry.
## Backstage: A Developer Portal Platform
Enter Backstage: a platform specifically designed for building developer portals. These portals function as a central hub for various development activities, including:
- Continuous Integration (CI) pipeline information
- Access to documentation
- Monitoring of Kubernetes deployments
- The Software Catalog: A Centralized Source
One of Backstage's core strengths is the software catalog. This catalog acts as a single source of truth for service information, including:
- Ownership details
- Git repository location
- Relationships between different services
The beauty of the software catalog lies in its adaptability and expandability. Developers can create custom plugins or leverage existing open-source options to tailor the catalog to their specific organizational needs.
## Backstage in Action: Everyday Kubernetes Tasks
The blog post dives into two practical use cases for the Backstage Kubernetes plugin. The first one addresses common developer questions, like "on which cluster is a particular service running?". Backstage eliminates the need to navigate to the Kubernetes dashboard for these basic inquiries.
The second use case tackles troubleshooting errors. Backstage aggregates crash logs from all the pods within a service and offers a convenient link to a log aggregation platform for further analysis.
## Boosting Developer Productivity
In essence, Backstage empowers developers by providing a centralized platform for viewing and managing their Kubernetes services. This streamlined approach can significantly enhance developer productivity.
Backstage comes to the rescue as a platform specifically designed for building developer portals. These portals act as a central hub, consolidating information about various development activities, including:
- Continuous Integration/Continuous Delivery (CI/CD) Pipelines: Monitor and track your CI/CD pipelines for efficient deployments.
- Documentation: Keep your team on the same page with readily accessible documentation.
- Monitoring Kubernetes Deployments: Gain insights into the health and performance of your Kubernetes deployments directly through Backstage.
## The Power of the Software Catalog
One of Backstage's core strengths is the software catalog. This catalog serves as a central repository for service information, including:
- Ownership: Clearly identify who owns and maintains each service.
- Git Repository Location: Simplify access to the codebase for each service.
- Relationships Between Services: Understand how different services interact and depend on each other.
The beauty of the software catalog lies in its adaptability. You can leverage open-source plugins or create custom plugins to tailor the catalog to your specific needs.
## Backstage in Action:
To begin with, let's set up a namespace in Kubernetes to segregate services in a multi-tenant environment. We can either use the kubectl create namespace command directly or create a Namespace definition file and apply it using kubectl apply.
```
apiVersion: v1
kind: Namespace
metadata:
name: backstage
```
This YAML file defines a namespace named "backstage".
Once the namespace is set up, we can move on to configuring PostgreSQL for our Backstage application. Firstly, we'll create a Kubernetes Secret to store the PostgreSQL username and password. This is done to ensure security and is used by both the PostgreSQL database and Backstage deployments.
```
apiVersion: v1
kind: Secret
metadata:
name: postgres-secrets
namespace: backstage
type: Opaque
data:
POSTGRES_USER: YmFja3N0YWdl
POSTGRES_PASSWORD: aHVudGVyMg==
```
These values are base64-encoded to maintain secrecy. After creating the Secret, we apply it to the Kubernetes cluster.
Next, PostgreSQL requires a persistent volume to store data. We define a PersistentVolume along with a PersistentVolumeClaim to ensure data persistence.
```
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-storage
namespace: backstage
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 2G
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: '/mnt/data'
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-storage-claim
namespace: backstage
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2G
```
This creates a local volume with a capacity of 2 gigabytes. After defining the storage, we apply it to the Kubernetes cluster.
Now, we move on to deploying PostgreSQL itself. We define a Deployment descriptor for PostgreSQL, specifying its image, environment variables, and volume mounts.
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: backstage
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:13.2-alpine
imagePullPolicy: 'IfNotPresent'
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: postgres-secrets
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgresdb
subPath: data
volumes:
- name: postgresdb
persistentVolumeClaim:
claimName: postgres-storage-claim
```
This Deployment ensures that PostgreSQL is up and running. We apply it to the Kubernetes cluster, and once deployed, we can verify its status.
After setting up PostgreSQL, we proceed to create a Kubernetes Service for it. This Service allows other pods to connect to the PostgreSQL database.
```
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: backstage
spec:
selector:
app: postgres
ports:
- port: 5432
```
We apply this Service to the Kubernetes cluster, and now PostgreSQL is ready to handle connections from other pods.
With PostgreSQL set up, we can now proceed to deploy the Backstage instance. This involves creating secrets, a deployment, and a service for Backstage similar to what we did for PostgreSQL.
Similar to PostgreSQL, we first create a Kubernetes Secret to store any configuration secrets needed for Backstage, such as authorization tokens.
```
apiVersion: v1
kind: Secret
metadata:
name: backstage-secrets
namespace: backstage
type: Opaque
data:
GITHUB_TOKEN: VG9rZW5Ub2tlblRva2VuVG9rZW5NYWxrb3ZpY2hUb2tlbg==
```
After creating the secret, we apply it to the Kubernetes cluster.
Now, we define a Deployment descriptor for Backstage, specifying its image, environment variables, and ports.
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: backstage
namespace: backstage
spec:
replicas: 1
selector:
matchLabels:
app: backstage
template:
metadata:
labels:
app: backstage
spec:
containers:
- name: backstage
image: backstage:1.0.0
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 7007
envFrom:
- secretRef:
name: postgres-secrets
- secretRef:
name: backstage-secrets
```
This Deployment ensures that the Backstage instance is up and running. We apply it to the Kubernetes cluster, and once deployed, we can verify its status.
After deploying Backstage, we create a Kubernetes Service to handle connecting requests to the correct pods.
```
apiVersion: v1
kind: Service
metadata:
name: backstage
namespace: backstage
spec:
selector:
app: backstage
ports:
- name: http
port: 80
targetPort: http
```
This Service ensures that other pods can connect to the Backstage instance. We apply it to the Kubernetes cluster.
Now, our Backstage deployment is fully operational! We can forward a local port to the service to access it locally.
```
$ sudo kubectl port-forward --namespace=backstage svc/backstage 80:80
```
With this setup, we can access our Backstage instance in a browser at localhost.
Let's delve into the additional steps and considerations for a production deployment of Backstage on Kubernetes.
- Set up a more reliable volume: The PersistentVolume configured earlier uses local Kubernetes node storage, which may not be suitable for production environments. It's recommended to replace this with a more reliable storage solution such as a cloud volume or network-attached storage.
- Expose the Backstage service: The Kubernetes Service created for Backstage is not exposed for external connections from outside the cluster. To enable external access, you can use - Kubernetes ingress or an external load balancer.
- Update the Deployment image: To update the Kubernetes deployment with a newly published version of your Backstage Docker image, you need to update the image tag reference in the deployment YAML file and then apply the changes using `kubectl apply -f`.
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: backstage
namespace: backstage
spec:
replicas: 1
selector:
matchLabels:
app: backstage
template:
metadata:
labels:
app: backstage
spec:
containers:
- name: backstage
image: your-updated-image:tag
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 7007
envFrom:
- secretRef:
name: postgres-secrets
- secretRef:
name: backstage-secrets
```
Configure app and backend URLs: Ensure that the URLs configured in your app-config.yaml file match the URLs you're forwarding locally for testing or the URLs you've set up for production environments.
```
app:
baseUrl: http://localhost
backend:
baseUrl: http://localhost
```
Update these URLs according to your deployment environment.
Authentication provider configuration: If you're using an authentication provider, ensure that its address is correctly configured for the authentication pop-up to work properly. Update the relevant configurations in your Backstage application.
By addressing these additional steps and considerations, you can have a robust and production-ready deployment of Backstage on Kubernetes.
## Conclusion
By integrating Backstage with Kubernetes, you can empower your developers with a centralized platform for viewing and managing their deployments. Backstage simplifies access to crucial information and streamlines workflows, ultimately boosting developer productivity and reducing friction in your Kubernetes environment.
| ajeetraina | |
1,847,055 | Running Ollama with Docker Compose and GPUs | Large Language Models (LLMs) are revolutionizing various fields, pushing the boundaries of what... | 0 | 2024-06-02T09:04:04 | https://dev.to/ajeetraina/running-ollama-with-docker-compose-and-gpus-lkn | Large Language Models (LLMs) are revolutionizing various fields, pushing the boundaries of what machines can achieve. However, their complexity demands ever-increasing processing power. This is where accelerators like Nvidia GPUs come into play, offering a significant boost for training and inference tasks.
In this blog post, we'll guide you through running Ollama, a popular self-hosted LLM server, with Docker Compose and leverage the raw power of your Nvidia GPU. We'll delve into the configuration details, ensuring you get the most out of your LLM experience.
## Prerequisites:
- Docker and Docker Compose: Ensure you have Docker and Docker Compose installed and running on your system. You can find installation instructions on the official Docker website: https://docs.docker.com/engine/install/
- Nvidia GPU: Your system must have an Nvidia GPU installed and configured. Verify this by running nvidia-smi in your terminal. If the command doesn't work or returns an error, refer to Nvidia's documentation for configuration guidance: https://docs.nvidia.com/
Understanding the Configuration:
Now, let's explore the key components of the docker-compose.yml file that facilitates running Ollama with GPU acceleration:
## Docker Compose Version:
The version property specifies the Docker Compose version being used. While some might mention 3.9, it's recommended to stick with the officially documented version, currently 3.8. This ensures compatibility and stability.
## Ollama Service Definition:
The services section defines the ollama service, which encapsulates the Ollama container. Here's a breakdown of its important properties:
- **image:** This specifies the Docker image for Ollama. The default is ollama/ollama, but you can use a specific version if needed (refer to Ollama's documentation for available versions).
- **deploy:** This section configures resource reservations for the Ollama container. This is where the magic happens for harnessing the GPU power.
resources: Defines the resource requirements for the container.
- **reservations:** This nested property allows you to reserve specific devices for the container.
devices: Defines a device reservation. Within this nested configuration, we specify:
- **driver:** Sets the device driver to nvidia to indicate we're requesting an Nvidia GPU.
capabilities: Lists the capabilities requested by Ollama. In this case, we specify "gpu" to signify our desire to leverage the GPU for processing.
- **count:** This value determines how many Nvidia GPUs you want to reserve for Ollama. Use all to utilize all available GPUs or specify a specific number if you have multiple GPUs and want to dedicate a subset for Ollama.
## Persistent Volume Definition:
The volumes section defines a persistent volume named ollama. This volume ensures that any data generated by Ollama, such as trained models or configurations, persists even after container restarts. It's mounted at the /root/.ollama directory within the Ollama container.
## Putting it All Together
Here's the complete docker-compose.yml configuration for running Ollama with Nvidia GPU acceleration using Docker Compose:
```
services:
ollama:
container_name: ollama
image: ollama/ollama # Replace with specific Ollama version if needed
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: ["gpu"]
count: all # Adjust count for the number of GPUs you want to use
volumes:
- ollama:/root/.ollama
restart: always
volumes:
ollama:
```
## Running Ollama with GPU Acceleration:
With the configuration file ready, save it as docker-compose.yml in your desired directory. Now, you can run the following command to start Ollama with GPU support:
```
docker-compose up -d
```
The `-d` flag ensures the container runs in the background.
## Verification:
After running the command, you can check Ollama's logs to see if the Nvidia GPU is being utilized. Look for messages indicating "Nvidia GPU detected via cudart" or similar wording within the logs. This confirmation signifies successful GPU integration with Ollama.
## Additional Considerations:
- Refer to Ollama's official documentation for any additional configuration or resource requirements based on your specific use case.
- Adjust the count value in the devices section to match the number of Nvidia GPUs you want to dedicate to Ollama.
- This example uses Nvidia and wouldn't work for ROCm directly. It's meant to illustrate the concept of resource reservations within a Compose file (which currently doesn't support ROCm).
| ajeetraina | |
1,850,183 | What's New in Docker Desktop 4.30.0? | Docker Desktop 4.30.0 is now available to download and install on your laptop. It brings a variety... | 0 | 2024-06-02T09:03:47 | https://dev.to/ajeetraina/whats-new-in-docker-desktop-4300-52o1 |

[Docker Desktop 4.30.0](https://docs.docker.com/desktop/release-notes/#4300) is now available to download and install on your laptop. It brings a variety of improvements and bug fixes for developers building and deploying containerized applications. This update focuses on three key areas:
- Enhanced security,
- Streamlined workflows, and
- Platform-specific fixes.
- Docker Compose v2.27.0
- Docker Engine v26.1.1
- Wasm runtimes:
- Updated runwasi shims to v0.4.0
- Updated deislabs shims to v0.11.1
- Updated spin shim to v0.13.1
- Docker Scout CLI v1.8.0
- Docker Debug v0.0.29
- Linux kernel v6.6.26
- Go 1.22.2
## Improved Security:
### Enhanced Container Isolation (ECI)
Docker Desktop 4.30.0 strengthens security for ECI users by improving how it handles "docker build" commands within rootless containers.
ECI provides an additional layer of security by limiting the capabilities of containers. With Docker Desktop 4.30.0, there are improvements in how ECI handles "docker build" commands within rootless containers. This likely strengthens the isolation between the build process and the host system.
Imagine you're building a Docker image that installs system packages. In a non-ECI environment, the build process might have access to install system packages on the host machine as well. With ECI, such access would be restricted, enhancing security.
### Linux Kernel Update
The update includes the latest Linux kernel version (v6.6.26).
This includes various security patches and improvements to the core of the Linux kernel used within Docker Desktop. These patches address vulnerabilities and potential exploits in the kernel code.
A recent kernel vulnerability might have allowed attackers to gain unauthorized access to a system. The update to version 6.6.26 likely includes a fix for this vulnerability, making it more difficult for attackers to exploit.
### Mac-Specific Security Boosts
For Mac users, Docker Desktop 4.30.0 enables the `CONFIG_SECURITY=y` kernel configuration, potentially enhancing security for tools like Tetragon.
Tetragon is a runtime security scanner for containers. With CONFIG_SECURITY=y enabled, Tetragon might have access to additional kernel features that improve its ability to detect and prevent security threats within containers.
## Streamlined Workflows:
### SOCKS5 Proxy Support (Business Only)
This update allows users with a Business subscription to leverage SOCKS5 proxies for container network connections.
A company might use a SOCKS5 proxy to restrict outbound traffic from containers to specific allowed destinations. This could be useful for development environments where you only want containers to access internal resources.
```
docker run --rm -h my-container --network my-network \
--proxy socks5://your-proxy-server:1080 \
my-image:latest
```
In this example, the `--proxy` option specifies the SOCKS5 proxy server address and port.
### Improved Build UI
The build user interface offers better bulk deletion of build records and the ability to launch relevant web pages for container images and Git sources used in builds. Additionally, users can now download Provenance and OpenTelemetry traces in Jaeger or OTLP formats for easier analysis.
- Bulk deletion of build records: This allows you to easily remove multiple build history entries at once.
- Launching web pages for build dependencies: You can quickly access the web pages for container images and Git sources used in your builds directly from the build UI.
- Downloading Provenance and OpenTelemetry traces: These trace files provide valuable insights into the performance and behavior of your builds. You can now download them in Jaeger or OTLP formats for easier analysis with debugging tools.
Imagine you're having issues with a build and want to analyze the build process in more detail. Downloading the OpenTelemetry traces would allow you to visualize the different stages of the build and identify where the problem might be occurring.
### Kerberos and NTLM Proxy Authentication (Windows - Business Only)
Business users on Windows can now leverage Kerberos and NTLM for proxy authentication, simplifying their development workflows.
This feature simplifies development workflows for Windows users with a business subscription by enabling them to leverage existing Kerberos or NTLM proxy authentication mechanisms for container network connections.
Example:
A company might use Kerberos for internal authentication. With NTLM proxy authentication support, containerized applications can seamlessly access resources that require Kerberos or NTLM credentials without needing additional configuration within the containers themselves.
## Platform-Specific Fixes:
### Mac Bug Fixes
Docker Desktop 4.30.0 addresses several Mac-specific issues, including a segmentation fault with the Virtualization Framework, enabling SQUASHFS compression support again, and resolving a bug that prevented startup if Rosetta was not installed.
### Windows Bug Fixes
This update fixes several Windows-related bugs, including a regression in host file binding, issues with Docker CLI bash completions in WSL environments, and a problem that caused a new version of Docker Desktop to be marked as damaged. Additionally, Docker Desktop 4.30.0 introduces a simplified provisioning mode for WSL2, potentially streamlining the setup process.
By incorporating these improvements and bug fixes, Docker Desktop 4.30.0 aims to make the container development experience smoother, more secure, and more efficient for developers across all platforms.
| ajeetraina | |
1,873,581 | How to Create an Effective To-Do List | Project:- 1/500 To-Do List Project Description The To-Do List project is... | 27,575 | 2024-06-02T09:03:25 | https://dev.to/raajaryan/to-do-list-project-57dp | javascript, html, beginners, opensource | ## Project:- 1/500 To-Do List Project
## Description
The To-Do List project is designed to help users efficiently manage their daily tasks. This project demonstrates how to build a simple yet functional application using fundamental web development technologies. It allows users to add, update, and delete tasks, making task management straightforward and intuitive.
## Features
- **Add New Tasks**: Users can easily add new tasks by entering a task name and optional details in an input form. Each task is then added to the to-do list for tracking.
- **Mark Tasks as Complete**: Users can mark tasks as complete by clicking on them, which will visually differentiate completed tasks from those that are still pending.
- **Delete Tasks**: Users can remove tasks that are no longer needed by clicking a delete button, ensuring their to-do list remains clean and organized.
## Technologies Used
- **JavaScript**: Handles the dynamic aspects of the application, such as adding, updating, and deleting tasks.
- **HTML**: Provides the structure of the web page, including the form for adding tasks and the list for displaying them.
- **CSS**: Styles the application, ensuring it is visually appealing and responsive across different devices.
## Setup
Follow these steps to set up and run the To-Do List project on your local machine:
1. **Clone the Repository**:
First, clone the project repository from GitHub:
```bash
git clone https://github.com/deepakkumar55/ULTIMATE-JAVASCRIPT-PROJECT.git
cd Basic Projects/1-to_do_list
```
2. **Navigate to the Project Directory**:
Use the terminal or file explorer to go to the project folder:
```bash
cd Basic Projects/1-to_do_list
```
3. **Open `index.html` in Your Browser**:
Open the `index.html` file in your preferred web browser to view and interact with the to-do list application. You can do this by double-clicking the file or using a command like:
```bash
open index.html
```
4. **Customize the Application (Optional)**:
- **HTML**: Modify the structure to add more features or change the layout.
- **CSS**: Update the styles to match your preferred design.
- **JavaScript**: Enhance the functionality by adding features like task deadlines, priority levels, or categories.
## Contributing
We welcome contributions to improve and extend the To-Do List project. Whether you're fixing bugs, adding new features, or enhancing the documentation, your input is valuable. Here’s how you can get involved:
1. **Fork the Repository**:
Click the "Fork" button at the top right of the repository page on GitHub to create your own copy of the project.
2. **Clone Your Fork**:
Clone your forked repository to your local machine:
```bash
git clone https://github.com/deepakkumar55/ULTIMATE-JAVASCRIPT-PROJECT.git
cd Basic Projects/1-to_do_list
```
3. **Create a New Branch**:
Create a new branch for your feature or bug fix:
```bash
git checkout -b feature-name
```
4. **Make Your Changes**:
Implement your changes in the project.
5. **Commit Your Changes**:
Commit your changes with a descriptive message:
```bash
git commit -m "Add new feature: feature description"
```
6. **Push to Your Fork**:
Push your changes to your forked repository:
```bash
git push origin feature-name
```
7. **Create a Pull Request**:
Go to the original repository on GitHub and create a pull request to merge your changes into the main branch.
## Get in Touch
If you have any questions or need further assistance, feel free to open an issue on GitHub or contact us directly. Your contributions and feedback are highly appreciated!
---
Thank you for your interest in the To-Do List project. Together, we can build a more robust and feature-rich application. Happy coding! | raajaryan |
1,873,580 | How can you solve any captcha type with automatic captcha-solving technology? | In the digital age, ensuring the security of online platforms is paramount. CAPTCHAs (Completely... | 0 | 2024-06-02T09:00:37 | https://dev.to/media_tech/how-can-you-solve-any-captcha-type-with-automatic-captcha-solving-technology-12pa | In the digital age, ensuring the security of online platforms is paramount. CAPTCHAs (Completely Automated Public Turing tests to tell Computers and Humans Apart) have been widely used to differentiate between human users and automated bots. However, CAPTCHAs can often become a barrier for legitimate users. This article delves into automatic captcha-solving technology and how it can help overcome this challenge efficiently.
**Understanding CAPTCHA and Its Types**
CAPTCHAs are designed to protect websites from spam and abuse by presenting tests that are easy for humans but difficult for automated systems to solve. There are several types of CAPTCHAs:
**Text-based CAPTCHAs:** Users are required to type characters displayed in a distorted image.
**Image-based CAPTCHAs:** Users are asked to select certain images from a set, such as all pictures containing traffic lights.
**ReCAPTCHA:** Google’s version that often involves clicking checkboxes or selecting images based on a prompt.
Each type of CAPTCHA has its own complexities and solving them manually can be time-consuming. This is where automatic captcha-solving technology comes into play.
**How Automatic Captcha-Solving Technology Works**
Automatic captcha-solving technologies leverage advanced algorithms and artificial intelligence to interpret and solve CAPTCHAs. Here’s a closer look at the core technologies involved:
**Optical Character Recognition (OCR)**
OCR technology is pivotal in solving text-based CAPTCHAs. It scans the image for text, recognizes the characters, and converts them into machine-encoded text. Modern OCR systems are highly accurate and can handle various distortions and font variations used in CAPTCHAs.
**Machine Learning and AI**
Machine learning models, particularly those using deep learning, are trained on large datasets of CAPTCHAs. These models learn to recognize patterns and features that distinguish different types of CAPTCHAs. As a result, they can solve both text and image-based CAPTCHAs with high precision.
**Automated Scripts and Bots**
Automated scripts and bots can mimic human interaction with CAPTCHAs. They simulate mouse movements, clicks, and keystrokes, making it possible to solve CAPTCHAs that require user interaction, such as ReCAPTCHA.
**Benefits of Using Automatic Captcha-Solving Technology**
Implementing automatic captcha-solving technology offers numerous advantages:
**Enhanced User Experience**
Automatic captcha-solving technologies streamline the user experience by eliminating the need for manual CAPTCHA entry. This leads to faster access to online services and reduces frustration.
**Increased Efficiency**
Automated systems can solve CAPTCHAs at a much faster rate than humans, which is particularly beneficial for businesses that rely on high-volume transactions.
**Cost-Effective Solutions**
By reducing the need for manual labor, businesses can save on operational costs. Automated systems can handle large-scale CAPTCHA solving tasks without the need for additional human resources.
**Scalability**
Automatic captcha-solving technologies can easily scale to meet the demands of growing businesses. Whether it's for a small website or a large enterprise, these solutions can handle increasing volumes of CAPTCHA challenges.
**Best Practices for Implementing Automatic Captcha-Solving Technology**
To effectively implement automatic captcha-solving technology, businesses should follow these best practices:
**Choose Reliable Solutions**
Select technologies and vendors with a proven track record. Look for solutions that offer high accuracy rates and have been tested extensively.
**Maintain Transparency**
Inform users about the use of automatic captcha-solving technologies. Transparency builds trust and helps users understand the measures in place to protect their data.
**Regular Updates and Maintenance**
Technology evolves rapidly, and so do CAPTCHA challenges. Ensure that your automatic captcha-solving solutions are regularly updated to handle new types of CAPTCHAs and security measures.
**Monitor and Adapt**
Continuously monitor the performance of your captcha-solving technologies. Be prepared to adapt your strategies to address emerging threats and changes in CAPTCHA mechanisms.
**In conclusion,**
automatic captcha-solving technology is revolutionizing the way we interact with online security measures. By leveraging advanced algorithms and AI, these technologies offer a seamless and efficient solution to CAPTCHA challenges, enhancing user experience and operational efficiency.
**As a premier captcha solving service, CaptchaAI excels in solving reCaptcha, hCaptcha, image captchas, and many other types with unmatched efficiency.**
**What sets CaptchaAI apart is its unique pricing model - instead of charging per captcha, they offer unlimited captcha solving for a fixed price. This makes it the most cost-effective reCaptcha solving service on the market. Plus, you never have to worry about speed or accuracy. With a 99.9% accuracy rate and lightning-fast performance, CaptchaAI ensures that your captcha solving needs are met promptly and reliably.**
| media_tech | |
1,873,579 | When using the pivot table of the VTable component, how to display the calculated indicator results in a separate column? | Question Description Is there any configuration that can generate derived indicators?... | 0 | 2024-06-02T09:00:17 | https://dev.to/fangsmile/when-using-the-pivot-table-of-the-vtable-component-how-to-display-the-calculated-indicator-results-in-a-separate-column-3993 | webdev, visactor, vtable, visiualization | ## Question Description
Is there any configuration that can generate derived indicators? Calculate the indicator results after aggregation, and then display them in the indicator.
Description: For example, my row dimension is region - area, column dimension is month, and indicator is target, actual, and achievement (this achievement is calculated as actual / target). Achievement is the indicator I want to derive, because there is no achievement field in my data.
Screenshot of the problem:

## Solution
Taking the pivot table on the official website of VTable as an example for similar target modifications, we add an indicator called Profit Ratio to the original demo, and use the format function to calculate the displayed value. The calculation logic depends on the values of the Sales and Profit indicators. That is, we calculate a profit ratio where profit ratio = profit / sales.
```
{
indicatorKey: 'Profit Ratio',
title: 'Profit Ratio',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
format: (value,col,row,table) => {
const sales=table.getCellOriginValue(col-2,row);
const profit=table.getCellOriginValue(col-1,row);
const ratio= profit/sales;
var percentage = ratio * 100;
return percentage.toFixed(2) + "%";
}
}
```
## Code Examples
```
let tableInstance;
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_data.json')
.then(res => res.json())
.then(data => {
const option = {
records: data,
rows: [
{
dimensionKey: 'City',
title: 'City',
headerStyle: {
textStick: true
},
width: 'auto'
}
],
columns: [
{
dimensionKey: 'Category',
title: 'Category',
headerStyle: {
textStick: true
},
width: 'auto'
}
],
indicators: [
{
indicatorKey: 'Quantity',
title: 'Quantity',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
}
}
},
{
indicatorKey: 'Sales',
title: 'Sales',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
}
}
},
{
indicatorKey: 'Profit',
title: 'Profit',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
}
}
},
{
indicatorKey: 'Profit Ratio',
title: 'Profit Ratio',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
format: (value,col,row,table) => {
const sales=table.getCellOriginValue(col-2,row);
const profit=table.getCellOriginValue(col-1,row);
const ratio= profit/sales;
var percentage = ratio * 100;
return percentage.toFixed(2) + "%";
}
}
],
corner: {
titleOnDimension: 'row',
headerStyle: {
textStick: true
}
},
dataConfig: {
sortRules: [
{
sortField: 'Category',
sortBy: ['Office Supplies', 'Technology', 'Furniture']
}
]
},
widthMode: 'standard'
};
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;
});
```
## Result Display
Just paste the code in the example code directly into the official editor to display it.

## Related documents
Tutorial on pivot table usage: https://visactor.io/vtable/guide/table_type/Pivot_table/pivot_table_useage
Demo of pivot table usage: https://visactor.io/vtable/demo/table-type/pivot-analysis-table
Related API: https://visactor.io/vtable/option/PivotTable#indicators
github:https://github.com/VisActor/VTable | fangsmile |
1,873,577 | What Really Matters in Your 20s? | I turned 23 recently and it changed my perspective of life. It usually happens often when you reach a... | 0 | 2024-06-02T08:55:39 | https://dev.to/stealc/what-really-matters-in-your-20s-4a39 | productivity, careerdevelopment, speaking, challenge | I turned 23 recently and it changed my perspective of life. It usually happens often when you reach a certain age.
People often start their sentences with _“Get good grades and your life will be sorted”._ So I did as they said and excelled in my classes.
Then they changed to “Get into a good college and your life will be sorted”. So I did. I entered one of the most prestigious universities in my country but guess what, the confusion and dilemmas did not go away.
From the beginning of life, you are told what to do and how to be happy in your life.
> **<u>Get good grades -> Stay out of trouble -> Get in a good University -> Get a job which pays good -> Start a family</u>**
Is this all that life is about?
Maybe I am not the smartest person to tell you what matters in your 20s because I have not lived them all yet — I’m still midway. But maybe I am the person who can tell you the truth without sugarcoating it. The blunt truth about how I will live the rest of my 20s.
## Embrace the 'Journey', Not the "!Destination".
I know this is a weird age to be in. Some of your friends are already earning twice as you are right now. Some as getting married and having kids. Some are living their dream of travelling around the world.
In your eyes, everyone around you is doing better in life than you currently are — be it financially, spiritually or emotionally. This just keeps making you doubt yourself.
You’ve had different problems in your life and you’ve had to face them alone. Your twenties are not about proving anyone wrong, they’re about finding the things that make you happy. Embrace the twists and turns, the highs and lows, and the unexpected detours that shape your path.
So, instead of fixating on where you think you should be by a certain age, focus on the journey of self-discovery and personal growth.
"Life isn’t a checklist; it’s an adventure. Enjoy the process of figuring out who you are and what truly makes you happy."
## Pursue Passion with Purpose
Let me tell you a secret. I have a degree in engineering. So after spending all my money on getting this degree, I should logically be pursuing engineering.
Your twenties are where you pursue your passions. Find the things you love and experiment as much as possible. You’re just out in the adult life — think of it as your second birth.
>**_Make mistakes. Take chances. Do what you love._**
Sometimes, the logical path isn’t the right one. If you’re unhappy in your chosen field, consider making a change.
##Take Good Care of Yourself
> _**Don’t. Compromise. Your. Health.**_
That’s it. Your decisions and habits today shape the person you’re going to be. This is your time to make the most of your body and energy. Go out for runs. Pick a sport and play it frequently. Don’t just sit in front of your gaming setup or watch series all day (no matter how leisurely it may be).
Eat healthy and sleep early.
It’s easy to neglect your physical and mental health in the hustle and bustle of life, but your twenties are the perfect time to prioritize self-care. Start by nourishing your body with nutritious food, getting regular exercise, and making time for activities that bring you joy and fulfilment. Remember, taking care of yourself now will pay dividends in the long run.
##Dreams Require Sacrifice
If you have big dreams, be prepared to make big sacrifices.
Success rarely comes easy, and achieving your goals will demand hard work, dedication, and perseverance. You’ll have to learn how to say NO.
Your friends will be out partying. Someone will call you to come out and spend it in a way that you don’t want to. Now I’m not saying to skip all social gatherings. I’m saying you should learn how to pick which gathering you want to go to.
It means putting in the hours, making sacrifices, and staying committed to your vision, even when the going gets tough. Remember, every sacrifice brings you one step closer to your dreams.
##Live Like a Typical Bachelor
Make as many memories as you can, and it requires you to step out of your comfort zone. To put it in an even better way.
> _**Before getting anything ask yourself — “Do I need it or do I want it”**_
The day you master answering this question truthfully — you’re going to save so much time and money. Live on things that make your life easy not comfortable. Step out with your friends, go to parties and socialise but never at an expense where your work or personal life suffers.
Don’t hesitate to make new friends and talk to more people. You’ll be surprised at how much you can learn from a diverse group of people.
##Teach Yourself What Your School Didn’t Teach
Taxes, investing and saving up money have got to be the key to becoming financially sound. Start learning about them as soon as possible. I enrolled myself in classes that taught me how to invest in stocks and save my money smartly.
Your twenties will teach you that there are so many things that you should’ve learned a long time ago but since no one else taught you, you’ll have to teach these things to yourself. You’ll have to put in the extra hours and make yourself smarter — never shy away from these opportunities.
Be hungry for knowledge and save money where you can.
## People Will Change, Don’t Force It
As you are mitigating your twenties, you’ll notice that the behaviour of some people around you is changing. Sometimes it is a good change, sometimes it reeks of trouble.
You’ll find that a friend is distancing themselves from you or your thoughts just no longer align. Know that it is no one's fault. They are also growing with time and discovering themselves. Everyone is in a journey of their own and you cannot force people to remain the same. You have to grow too.
It’s heartbreaking because you’re growing apart from people you thought would play a big role in your future, and making good friends again can sound like extremely hard. It takes a lot more work to see and spend time with friends, and at times you will realize they’re not willing to put in the effort.
You cannot expect people to take care of you like you take care of them. With time, you will find the people who stick with you and are happy to make room for you in your life.
## Know You’re Enough
Maybe nothing matters in your twenties. Maybe everything does. Maybe you’ll find the answers early. Maybe you’ve figured it all out already.
There is no right way you can live your life but there is only one thing that never changes — know your value and know you’re enough.
In case no one has told you yet — you’re not supposed to have it all figured out. It’s okay if you’re taking time to pave your way. Take this time to understand what you want from your life and live it without fearing any societal pressures.
---
@ Article by chinnanj | stealc |
1,873,576 | How to Build a Shopping Cart AI Chatbot | In our last article we demonstrated our new AI functions. By building on top of these, we can build... | 0 | 2024-06-02T08:50:35 | https://ainiro.io/blog/how-to-build-a-shopping-cart-ai-chatbot | ai, webdev, openai, chatgpt | In our [last article](https://ainiro.io/blog/create-ai-assistents-with-magic-cloud) we demonstrated our new AI functions. By building on top of these, we can build any amount of complexity into our AI chatbots - Including a shopping cart AI chatbot, such as illustrated in this article. If you want to try the AI chatbot we're building in this article you can find it below.
* [Spy Gear Shopping Cart AI Chatbot](https://thomastest-team.us.ainiro.io/spyshop)
## Video demonstration
In the following video I am demonstrating the shopping cart AI chatbot, by going through the entire shopping experience using nothing but the AI chatbot to shop. In addition I am showing additional features almost impossible to implement using a more traditional UI-based chopping cart, such as the ability to tell the AI chatbot the following, and having it intelligently respond back to you.
> _"I've got 1 million to spend, what items can I add without exceeding my budget?"_
{% embed https://www.youtube.com/watch?v=csIy6924Z8w %}
The above video is only 7 minutes long. I **seriously recommend you watch it** to understand the power of this feature.
## How it works
The whole idea of the chatbot is to allow you to use natural language to guide you through your entire shopping experience. Below is an example of how to add two items to your cart. If you look carefully at the image below you will see two green icons. These implies the AI chatbot invoked two AI functions, one for each product I asked it to add for me.
<img alt="Adding two items to your shopping cart AI chatbot" src="https://ainiro.io/assets/images/blog/buying-spy-gear-from-shopping-cart-ai-chatbot.png" style="max-width: 550px;margin-left: auto;margin-right: auto;">
In addition to adding items, it also has the following functions.
* Remove item from cart
* List all products
* List all items in my cart
* Checkout and pay for my items
The checkout process simply creates a summary email that it sends to you, but this part could easily be integrated with WooCommerce or Shopify to perform a real sale.
## Implementation
The most important part of our AI chatbot is its system message. Our system message contains references to AI functions, such as follows.
```
## Adding items to shopping cart
If the user informs you that he or she wants to buy an item and you know
the item's SKU, then respond with this EXACT response, only exchanging the
[sku] and the [quantity].
___
FUNCTION_INVOCATION[/modules/shopping-cart-demo/workflows/add-item.hl]:
{
"sku": "[sku]",
"quantity": "[quantity]"
}
___
If the user did not provide a quantity then do not ask the user for a quantity
but use a value of 1 by default. If you don't know the item's SKU, ask the
user to provide some more keywords for what item he or she wants to buy such
that you can find the correct SKU before responding with the above function
invocation.
```
The above instructs OpenAI to return a `FUNCTION_INVOCATION` if the user says he or she wants to add an item to his shopping cart. Such function invocations will be executed on the cloudlet, and contains references to AI workflows. Below is the AI workflow for the above function.
```
/*
* Adds an item to your shopping cart
*
* [product_id] is mandatory and has to be an existing product_id from an
* item existing in your database, and [quantity] will default to 1 if not
* specified.
*/
.arguments
sku:string
quantity:int
session:string
.description:Adds an item to your shopping cart
.type:public
// Defaulting [quantity] to 1 if not specified.
validators.default:x:@.arguments
quantity:int:1
/*
* Invokes the SQL CRUD Read slot with the specified parameters.
*
* Provide [connection-string], [database-type], [database], and [table] to
* inform the action of what database/table you want to execute your SQL
* towards, and add [and] or [or] arguments to filter your returns, in
* addition to [limit] and [offset] to apply paging. Use [order]
* and [direction] to sort either ascending or descending. Notice, you can
* only use one of [or] or [and], and not both.
*/
execute:magic.workflows.actions.execute
name:sql-read-products
filename:/misc/workflows/actions/sql/sql-read.hl
arguments
columns
.:product_id
database:shopping-cart-demo
table:products
and
sku:x:@.arguments/*/sku
/*
* Invokes the SQL CRUD Create slot with the specified parameters.
*
* Provide [connection-string], [database-type], [database], and [table]
* to inform the action of what database/table you want to execute your
* SQL towards, and [values] for your actual values to insert.
*/
execute:magic.workflows.actions.execute
name:sql-create-shopping-cart-item
filename:/misc/workflows/actions/sql/sql-create.hl
arguments
database:shopping-cart-demo
table:items
values
product_id:x:--/execute/=sql-read-products/*/*/product_id
quantity:x:@.arguments/*/quantity
session_id:x:@.arguments/*/session
// Returns the result of your last action.
return-nodes:x:@execute/*
```
Such AI functions can also be declared as training snippets, allowing you to have literally thousands of them - And 98% of the above code was created without coding using our [Hyperlambda Workflow feature](https://docs.ainiro.io/workflows/).
The end result of the above becomes that if we say stuff such as _"I want to buy the flying car"_ to our AI chatbot, then OpenAI will return a function invocation declaration that our machine learning type will execute. Our function invocation inserts a new record into our _"items"_ table in our _"shopping-cart-demo"_ database. This allows the AI chatbot to keep track of which items have been added. You can see the database schema below.
<img alt="Our shopping cart database schema" src="https://ainiro.io/assets/images/blog/shopping-cart-database-schema.png" style="max-width: 750px;margin-left: auto;margin-right: auto;">
It's a fairly naive shopping cart, but it also allows for integrating with Shopify, WooCommerce, or any other e-commerce platform you have - So don't be fooled by its simplicity.
## Security
Unless you implement this correctly, you could in theory prompt engineer the AI chatbot to return function invocations that are unsafe. We guard against this by checking if the function invocation is declared either in the system message or the type's training data before we allow for a function to being executed.
This completely eliminates _"function injection attacks"_, that are similar in nature to SQL injection attacks. However, you still have to be careful when adding function declarations to your type, and only add functions you know for a fact are safe to allow the user to execute.
In the future we might also implement support for functions that requires the user to belong to some role, in addition to some authentication and authorisation mechanism, to allow for the user to log in to the AI chatbot, changing his or her rights in regards to what functions are allowed to being executed by the user. But currently we don't have anything here. But this is a high priority feature we are working on a lot, so expect things to rapidly change here.
## Wrapping up
AI functions is the by far funniest and most rewarding thing I've worked on since I started working with OpenAI. In a way it turns a _"boring text-producing LLM"_ into a fully fledged AI assistent. Such AI assistents can be created to do incredible things, especially once we add authentication and authorisation to them. Below is a list if things we could easily do using AI functions.
* Order a plane ticket to New Zealand
* Check the weather in Los Angeles tomorrow
* What's the stock price for Apple
* Send Mike an email and tell him I'll be late for our meeting
* I need to call Jane, give me her phone number
* Create a new customer in my CRM system
* Etc, etc, etc ...
All of the above would literally be _"15 minutes job"_ using Magic Cloud. If you're interested in seeing what we can do for your organisation related to this, you can contact us below.
* [Contact us](https://ainiro.io/contact-us)
| polterguy |
1,873,572 | How to make text automatically omitted based on cell width when using custom rendering with VTable components? | Question Description When using custom rendering with VTable in the product, the cell... | 0 | 2024-06-02T08:41:08 | https://dev.to/fangsmile/how-to-make-text-automatically-omitted-based-on-cell-width-when-using-custom-rendering-with-vtable-components-4266 | visactor, vtable, webdev, visiualization | ## Question Description
When using custom rendering with VTable in the product, the cell contains icon and text elements. It is expected that the column width can be automatically calculated based on the content at initial, and when manually dragging to resize the column width, the text can automatically be omitted instead of having the button float over the text. I am not sure how to write the code to achieve this effect of shrinking the column width and making the text turn into an sign '...'

## Solution
We use the customLayout provided by VTable, which can automatically layout and automatically measure the width to adapt to the cell width. The specific writing method is as follows:
```
customLayout: (args) => {
const { table,row,col,rect } = args;
const record = table.getRecordByCell(col,row);
const {height, width } = rect ?? table.getCellRect(col,row);
const container = new VTable.CustomLayout.Group({
height,
width,
display: 'flex',
flexWrap:'no-wrap',
alignItems: 'center',
justifyContent: 'flex-front'
});
const bloggerAvatar = new VTable.CustomLayout.Image({
id: 'icon0',
width: 20,
height: 20,
image:record.bloggerAvatar,
cornerRadius: 10,
});
container.add(bloggerAvatar);
const bloggerName = new VTable.CustomLayout.Text({
text:record.bloggerName,
fontSize: 13,
x:20,
fontFamily: 'sans-serif',
fill: 'black',
maxLineWidth:width===null?undefined:width-20+1
});
container.add(bloggerName);
return {
rootContainer: container,
renderDefault: false,
};
}
```
CustomLayout needs to return a rootContainer, usually a Group object, to serve as a container for other content. Here, flexWrap is set so that internal elements (icon and text) do not wrap, and alignItems and justifyContent are used for horizontal and vertical alignment. The Group contains an Image and Text. If you want the text to automatically truncate with... when the space is compressed, you need to configure maxLineWidth. A special point here is that when column is set to 'auto', the value of width received by the customLayout function is null, so you need to check if it is null. If it is null, set maxLineWidth to undefined to automatically expand the width of the cell. If it is not null, set maxLineWidth according to the value of width. Subtracting 20 here avoids the width of the image, and the additional +1 is a buffer value that can be ignored.
## Code Examples
```
const option = {
columns:[
{
field: 'bloggerId',
title:'order number'
},
{
field: 'bloggerName',
title:'anchor nickname',
width:'auto',
style:{
fontFamily:'Arial',
fontWeight:500
},
customLayout: (args) => {
const { table,row,col,rect } = args;
const record = table.getRecordByCell(col,row);
const {height, width } = rect ?? table.getCellRect(col,row);
const container = new VTable.CustomLayout.Group({
height,
width,
display: 'flex',
flexWrap:'no-wrap',
alignItems: 'center',
justifyContent: 'flex-front'
});
const bloggerAvatar = new VTable.CustomLayout.Image({
id: 'icon0',
width: 20,
height: 20,
image:record.bloggerAvatar,
cornerRadius: 10,
});
container.add(bloggerAvatar);
const bloggerName = new VTable.CustomLayout.Text({
text:record.bloggerName,
fontSize: 13,
x:20,
fontFamily: 'sans-serif',
fill: 'black',
maxLineWidth:width===null?undefined:width-20+1
});
container.add(bloggerName);
return {
rootContainer: container,
renderDefault: false,
};
}
},
{
field: 'fansCount',
title:'fansCount',
fieldFormat(rec){
return rec.fansCount + 'w'
},
style:{
fontFamily:'Arial',
fontSize:12,
fontWeight:'bold'
}
},
],
records:[
{
'bloggerId': 1,
"bloggerName": "Virtual Anchor Xiaohua duoduo",
"bloggerAvatar": "https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/flower.jpg",
"introduction": "Hi everyone, I am Xiaohua, the virtual host. I am a little fairy who likes games, animation and food. I hope to share happy moments with you through live broadcast.",
"fansCount": 400,
"worksCount": 10,
"viewCount": 5,
"city": "Dream City",
"tags": ["game", "anime", "food"]
},
{
'bloggerId': 2,
"bloggerName": "Virtual anchor little wolf",
"bloggerAvatar": "https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/wolf.jpg",
"introduction": "Hello everyone, I am the virtual anchor Little Wolf. I like music, travel and photography, and I hope to explore the beauty of the world with you through live broadcast.",
"fansCount": 800,
"worksCount": 20,
"viewCount": 15,
"city": "City of Music",
"tags": ["music", "travel", "photography"]
}
],
defaultRowHeight:30
};
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option);
window['tableInstance'] = tableInstance;
```
## Result Display
Just paste the code in the example code directly into the official editor to present it.

## Related documents
Tutorial on customLayout usage: https://visactor.io/vtable/guide/custom_define/custom_layout
Demo of customLayout usage: https://visactor.io/vtable/demo/custom-render/custom-cell-layout
Related API: https://visactor.io/vtable/option/ListTable-columns-text#customLayout
github:https://github.com/VisActor/VTable | fangsmile |
1,873,571 | Babylon.js Browser MMO - DevLog - Update #2 - 8 way WASD movement | Hello, Here's another brief update on the progress. I've been considering different movement types... | 0 | 2024-06-02T08:33:58 | https://dev.to/maiu/babylonjs-browser-mmo-devlog-update-2-8-way-wasd-movement-39e8 | babylonjs, gamedev, indie, mmo | Hello,
Here's another brief update on the progress. I've been considering different movement types for the game: go-to-click, WASD, 8-way WASD, or something else. While go-to-click is easy to implement, it often feels clumsy and makes the gameplay static. WASD, like in WoW, is a good option but not quite what I'm aiming for.
I've decided that an 8-way WASD setup would be the best fit. It's more dynamic and provides a gameplay feel similar to Diablo. It might end up being a hybrid with go-to-click, but we'll see how it evolves. :)
The implementation is not perfect yet and has some bugs, but I think it's sufficient for now. :) The jittering you see is due to the lack of client-side prediction. I plan to add that in the near future :)
Hope You like it!
{% youtube Pp0fiRF2UhM %} | maiu |
1,873,570 | Digital marketing courses in pashaim vihar | software program created by Microsoft that uses spreadsheets to organize numbers and data with... | 0 | 2024-06-02T08:23:52 | https://dev.to/ankit_singh_3e66791910310/digital-marketing-courses-in-pashaim-vihar-5868 | digital, marketing, javascript, beginners | - software program created by Microsoft that uses spreadsheets to organize numbers and data with formulas and functions. Excel analysis is ubiquitous around the world and used by businesses of all sizes to perform financial analysis. Check out CFI's free Excel Crash Course here) | ankit_singh_3e66791910310 |
1,866,637 | Network Policy in Kubernetes | Secure communication between pods is critical in maintaining secure deployments. In this post, I will... | 0 | 2024-06-02T08:17:13 | https://dev.to/sirlawdin/network-policy-in-kubernetes-47i9 | kubernetes, devsecops, cilium | Secure communication between pods is critical in maintaining secure deployments. In this post, I will demonstrate how Kubernetes Network Policy can enforce fine-grained security controls in Kubernetes.
I will demonstrate how to set up and enforce network policies in a Minikube environment, ensuring a MYSQL pod in one namespace cannot be accessed by a client pod in another namespace after applying the policy.
## Prerequisites
- A working installation of Minikube
- Basic Knowledge of Kubernetes concepts and resources
- '_kubectl_' configured to interact with the Minikube cluster.
### Start Minikube
setup the Kubernetes environment with Minikube
`minikube start`

### Create Namespaces and Deploy Pods
Create two namespaces: _database_ namespace; for the MySQL pod and _client_ namespace; for the client pod connecting to the MYSQL Database.
### Deploy a MYSQL pod in the 'database' namespace:
```
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: mysql
namespace: database
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:5.7
env:
- name: MYSQL_ROOT_PASSWORD
value: password
EOF
```
### Deploy a Client pod in the `client` namespace:
```
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: client
namespace: client
labels:
app: client
spec:
containers:
- name: client
image: mysql:5.7
command: ["sleep", "3600"]
EOF
```

## Test Connectivity Before Apply Network Policy
Verify that the client pod can connect to the MYSQL pod:
`kubectl exec -it client -n client -- sh`
Connect to MySQL:
`mysql -h <pod ip address> -u root -p`

## Implementing Kubernetes Network Policy
Now, we can create a Kubernetes Network Policy to deny access from the `client` namespace to the `database` namespace.
I prefer using the [Cilium Kubernetes Network Policy Generator](https://cilium.io/blog/2021/02/10/network-policy-editor/). This tool provides a user-friendly UI to interpret policies at a glance and create them in a few clicks. It can be used to develop [Kubernetes Network policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) and [Cilium Network Policy](https://editor.cilium.io/)
Cilium offers a more robust and feature-rich alternative to Kubernetes' built-in network policies, enabling advanced security features like deep packet inspection and layer 7 (Application Layer) policies.
### Generate a Kubernetes Network Policy with Cilium Policy Generator
[How to use the UI policy Generator](https://share.zight.com/yAuzDN9x)
```
kubectl --apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-client-access
namespace: database
spec:
podSelector:
matchLabels:
app: mysql
policyTypes:
- Ingress
- Egress
ingress: []
egress: []
EOF
```
## Test Connectivity After Applying Network Policy
Verify that the client pod can no longer connect to the MySQL pod:
`kubectl exec -it -n client -- sh`
`mysql -h <pod ip address> -u root -p`

By implementing Kubernetes Network Policies, we can effectively control the communication between pods across namespaces, enhancing the security of our Kubernetes cluster. For more advanced and robust network policies, technologies like cilium can be used.
| sirlawdin |
1,873,525 | I Created a Password Manager with AI: Powered by GPT-4 | Introduction In today's digital age, managing passwords securely is crucial. Recognizing... | 0 | 2024-06-02T08:11:33 | https://dev.to/king_triton/i-created-a-password-manager-with-ai-powered-by-gpt-4-4jml | gpt4o, python, api, openai | ## Introduction
In today's digital age, managing passwords securely is crucial. Recognizing the need for a robust solution, I developed a password manager application for Windows that leverages GPT-4 for generating and analyzing passwords. This application, available on GitHub under the MIT license, is currently in its version 1.0.0 (Alpha). In this article, I will delve into the features, functionalities, and future enhancements planned for this innovative tool, all powered by GPT-4.
## Features of the Password Manager
## GPT-4-Driven Password Generation
The standout feature of this password manager is its integration with GPT-4, enabling the generation of highly secure passwords. By utilizing advanced algorithms, GPT-4 can create passwords that are both complex and unique, significantly enhancing security against potential breaches. The use of GPT-4 ensures that each password is crafted with the latest AI advancements in mind, providing unparalleled security.
## Password Analysis with GPT-4
Another significant feature is the password analysis tool, which also utilizes GPT-4. This tool evaluates the strength of existing passwords, providing users with insights into potential vulnerabilities. The analysis covers various aspects, including password length, complexity, and the presence of common patterns that could be easily guessed. Thanks to GPT-4's sophisticated understanding, this analysis is incredibly accurate and helpful.
## User-Friendly Interface
The application is designed with user experience in mind. Its intuitive interface allows users to store, manage, and retrieve their passwords effortlessly. Each password entry is encrypted and securely stored, ensuring that sensitive information is well protected. The integration of GPT-4 ensures that the application remains user-friendly while offering advanced security features.
## Open-Source and Community-Driven
Being available on GitHub under the MIT license means that the application is open-source. This allows developers from around the world to contribute to its development, ensuring continuous improvement and adaptation to emerging security challenges. The open-source nature of the project, combined with GPT-4's capabilities, makes it a powerful tool for the community.
## Future Enhancements
## Offline Mode
In future updates, the application will offer an offline mode. Users will be able to manage their passwords without requiring a GPT-4 API key. However, the AI-driven password generation and analysis features will be disabled in this free version. This change will make the application more accessible to users who do not wish to rely on an external API, while still offering robust password management features.
## Design Overhaul
A significant design overhaul is planned to improve the user interface and user experience. The new design will focus on enhancing usability, making it even easier for users to navigate through their stored passwords and utilize the application's features. The integration of GPT-4 will ensure that the new design remains intuitive and efficient.
## Improved Encryption Logic
The upcoming versions will include changes to the encryption and decryption logic. These improvements aim to further secure the stored passwords, making it even more challenging for unauthorized users to gain access to sensitive information. With GPT-4, the encryption logic will be more advanced, providing top-notch security.
## Master Password Implementation
To add an extra layer of security, a master password feature will be introduced. Users will need to create a master password that will be required to access the password manager. This feature ensures that even if the device is compromised, the stored passwords remain protected. GPT-4 will aid in creating a secure and memorable master password for users.
## Conclusion
Creating a password manager with GPT-4 integration has been a rewarding endeavor. The current version, 1.0.0 (Alpha), already provides a robust tool for managing passwords securely. With planned future enhancements, the application is set to become even more user-friendly and secure. I invite you to explore the project on GitHub and contribute to its development. Together, we can build a more secure digital future.
You can find the project on GitHub [here](https://github.com/king-tri-ton/keypassai). | king_triton |
1,873,524 | Bring back lost users on your website with emojis ✨ | Do you have an E-commerce website and are tired of losing customers to competitors? NO MORE!!... | 0 | 2024-06-02T08:09:44 | https://dev.to/manpreet2000/bring-back-lost-users-on-your-website-with-emojis-1k72 | marketing, productivity, javascript, startup | Do you have an E-commerce website and are tired of losing customers to competitors? NO MORE!!
**TabRizz [https://tabrizz.com/] is here to change the game.**
### Turn your Tab with Emoji animations
TabRizz is designed to bring back lost users with emoji animation.
As soon as users leave your website, emojis appear on your website tab, making it different, cool, and attractive.
It is a FREE, NO-CODE solution and compatible with all the platforms including Shopify, Wix, WordPress, React apps, etc.
Here's how it works:
1 Select emojis

2 Select Time for animations

3 Generate script
That's it.
use this script in your website and it's done.
Visit https://tabrizz.com and give it a try!! ✨
Thanks | manpreet2000 |
1,810,772 | GitHub Fundamentals Exam - Import topics to revise | Alpha vs beta version in github How to start the code spaces Different kinds of charts - current... | 27,667 | 2024-06-02T08:05:40 | https://dev.to/learnwithsrini/import-topics-in-github-fundamentals-2ph8 | github, fundamentals | 1. Alpha vs beta version in github
2. How to start the code spaces
3. Different kinds of charts - current charts vs historical charts
https://docs.github.com/en/issues/planning-and-tracking-with-projects/viewing-insights-from-your-project/about-insights-for-projects
4. You can view everyone who has starred a public repository or a private repository you have access to. To view everyone who has starred a repository, add /stargazers to the end of the URL of a repository. For example, to view stargazers for the github/docs repository, visit https://github.com/github/docs/stargazers.
5. which language is used to enter the comments in github. - markdown
6. codespaces can be opened using
- click on +
7. Differences btn github.dev and codespaces
8. stages in github codespaces
9. ISSUE Templates will be in which folder?
10. Github teams can be created as secrets and which is available to members
11.Copilot individual vs business and what are extra features individual subscription will have?
12. Git hub repo topics -similar to SEO Tags
https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels
13.What Project descriptor will automatically save when you change it?
Project name
A GitHub Project's name is the only descriptor that saves automatically.
Project description
You need to ensure your click save after writing your description to save it.
14.What's the best way to make sure you're integrating the most secure versions of your project dependencies?
Configure your package files to always use the latest versions of dependencies.
Check each project's security details closely before adding it to your dependencies by confirming its version status across multiple advisory sites.
Even if this practice helps you start off with a secure version of a given dependency, it won't ensure that you're safe from future vulnerabilities. You would need to constantly monitor every package to ensure compliance, which might be infeasible.
Enable Dependabot for your repository.
Dependabot scans your repository's dependency manifests and notifies you via pull request whenever a version you rely is marked as insecure.
15.Draft pull request - When you create a pull request, you can choose to either create a pull request that’s ready for review or a draft pull request. A pull request with a draft status can’t be merged, and code owners aren’t automatically requested to review draft pull requests.
https://learn.microsoft.com/en-us/training/modules/manage-changes-pull-requests-github/2-what-are-pull-requests
If you enjoyed reading this blog post and found it informative, please take a moment to share your thoughts by leaving a review and liking it 😀 and follow me in [dev.to ](https://dev.to/srinivasuluparanduru), [linkedin](https://linkedin.com/in/srinivasuluparanduru/) and [buy me a coffee](https://buymeacoffee.com/srinivasuluparanduru)
| srinivasuluparanduru |
1,873,521 | Async React with Suspense | As React devs we deal with async stuff every day. We know firsthand how awkward and complicated async... | 0 | 2024-06-02T08:02:53 | https://dev.to/varenya/async-react-with-suspense-3d1o | react, suspense, javascript, beginners |
As React devs we deal with async stuff every day. We know firsthand how awkward and complicated async logic can get.
Now add components into the mix it only gets more complicated.
Suspense was the solution that React came up with to solve for that. Announcement of Suspense happened in 2018. It took a while to stabilize. Finally, with React 19, we will have all the pieces to use it.
The most fascinating thing about Suspense was the use of throw. Yes, you read it right!
Suspense uses throw statements,
intended for error handling, as a control flow mechanism.
Yup, 🤯.
Before we dive into the heavy stuff, let's review what `async` JS is:
### Async JavaScript
Let's take this async function:
```typescript
function fetchText({ text, delay }: DelayText): Promise<string> {
return new Promise<string>((resolve) =>
setTimeout(() => {
resolve(text);
}, delay),
);
}
```
It takes in two parameters:
* a text — which will be returned after a delay
* a delay — a specified duration after which the text is returned
How would we go about consuming such a function?
Variant 1:
```typescript
import { fetchText } from "./sample.ts";
async function getTexts(): Promise<[string, string]> {
const text1 = await fetchText({ text: "hello 1", delay: 1000 });
const text2 = await fetchText({ text: "hello 2", delay: 2000 });
return [text1, text2];
}
console.time("gettingTexts");
getTexts().then((res) => {
console.log({ res });
console.timeEnd("gettingTexts");
});
```
If you run this on say `node`, you should see an output like this:
```js
{
res: [ "hello 1", "hello 2" ]
}
[3.01s] gettingTexts
```
If you notice here, I have used `console.time` that prints out the time taken to execute.
Which in the above case is approximately 3 seconds, i.e., (1 sec for `text1`) + (2 seconds for `text2`)
Can we do better?
Variant 2:
```ts
import { fetchText } from "./sample.ts";
async function getTexts(): Promise<[string, string]> {
const text1 = fetchText({ text: "hello 1", delay: 1000 });
const text2 = fetchText({ text: "hello 2", delay: 2000 });
return [await text1, await text2];
}
console.time("gettingTexts");
getTexts().then((res) => {
console.log({ res });
console.timeEnd("gettingTexts");
});
```
By making a small change i.e., moving `await` to the bottom, we have already improved the runtime of the above script:
```js
{
res: [ "hello 1", "hello 2" ]
}
[2.01s] gettingTexts
```
Now it takes 2 seconds! i.e., instead of `time of request 1 + time of request 2` it has become `max (time of request 1, time of request 2)`
Ain't that pretty cool?
This is the essence of `concurrent` programming. We dispatch requests at the same time and wait for them to finish.
So instead of running one thing at a time, i.e., synchronously. We are running things concurrently and achieving net better performance.
Picture worth a thousand words.

Okay, now what about error handling?
We have good old `try/catch`.
We just have to wrap the `async` code in it :
```ts
async function getTexts(): Promise<[string, string]> {
try {
const text1 = fetchText({ text: "hello 1", delay: 1000 });
const text2 = fetchText({ text: "hello 2", delay: 2000 });
return [await text1, await text2];
} catch (e) {
console.error("Error fetching texts");
return ["error fetching text 1", "error fetching text 2"];
}
}
```
Now that we have gotten an understanding of what async JS is, let's dive into Async React:
## Suspend React
Up until now, we dealt with `async` resources directly. But what about components that have a `async` dependency?
For example, let's take the same `fetchText` function. Instead of logging that value on the console, I want to show it in UI.
The common way of doing this in `React` is via `useEffect` (Variant 1):
```javascript
import { useEffect, useState } from "react";
import { fetchText } from "../async/sample.ts";
import { Card } from "./Card/Card.tsx";
function EffectCard() {
const [text, setText] = useState("loading..");
useEffect(() => {
fetchText({ text: "hello, world!", delay: 1000 })
.then((res) => {
setText(res);
})
.catch(() => {
setText("error");
});
}, []);
return <Card text={text} />;
}
```
### Sidenote
For more info on why this may not be a good idea, please read this post by core contributor from `react-query` :
{% embed https://tkdodo.eu/blog/why-you-want-react-query %}
Despite looking straightforward, `useEffect` has too many gotchas. Using it properly is challenging. I would recommend using a library which does it for you and `react-query` is a great option.
Now, this looks fine and well, but there is a problem with this.
If you think about it, this is similar to what we had in `Variant 1` for `async` handling:
```javascript
const text1 = await fetchText({ text: "hello 1", delay: 1000 });
const text2 = await fetchText({ text: "hello 2", delay: 2000 });
```
Why so?
Because, `useEffect` runs after the render is completed.
So we are running things like this:

This is `sequential` instead of `concurrent`. You — ***fetch after render.***
Let's see how we can improve this (Variant 2):
```typescript
// move promise outside of React!
const helloTextPromise = fetchText({ text: "hello, world!", delay: 1000 });
function EffectCard() {
const [text, setText] = useState("loading..");
useEffect(() => {
helloTextPromise
.then((res) => {
setText(res);
})
.catch(() => {
setText("error");
});
}, []);
return <Card text={text} />;
}
```
With this small change, we have them running concurrently!

Now that is much better. It's easy to get caught up in the framework/library and forget we are still using vanilla JS 😀
Okay, let's extend the above example (Variant 3):
```typescript
import { EffectCard } from "./EffectCard.tsx";
function Input() {
const [name, setName] = useState("");
return (
<input
name={"userName"}
value={name}
onChange={(e) => setName(e.target.value)}
/>
);
}
function EffectAndInput() {
return (
<div>
<Input />
<EffectCard /> {/*Same as above*/}
</div>
);
}
```
Now we have two components loading instead of one. One is the`EffectComponent` other is an input text element.
The effect can be slow or fast. Since we are emulating things here, let's make it slow.
This means that while the async stuff is still running if the user tries to type, it can create a janky experience. I am sure everyone has experienced this at one time or another.
When we try to type something but nothing shows up after a few moments it shows up at once.
This is because of this.
Here we are trying to unblock UI. i.e., we don't want to “await” on something that can take a lot of time to run. In this case, it's a component.
How can we let React know this?
### Enter Suspense.
To signal React that this component is loading something that will take some time.
As I mentioned at the beginning we need to:
`throw promise`
Yup 🤯 (it still does).
By throwing a promise from a component, you let React know that there is some async activity going on. So React will suspend the component.
React can do other things while suspending the component!
This is ***Async React***!
Let's refactor the above example to use Suspense.
We need to add a little logic to stop throwing the `promise` when it's finished. For that, we have this small utility:
```typescript
type Status = "Loading" | "Done" | "Error";
function createResource<T>(promise: Promise<T>) {
let status: Status = "Loading";
let result: T | null = null;
let error: Error | null = null;
promise
.then((res) => {
status = "Done";
result = res;
})
.catch((err) => {
status = "Error";
error = err;
});
return {
read(): T {
switch (status) {
case "Loading":
throw promise; /* throw until promise is still running */
case "Error":
throw error;
case "Done":
return result!; /* return once done */
default: {
return status;
}
}
},
};
}
```
As you can see, we are `throwing` the `promise` till it's in `Loading` state and returning the result once it's done.
With this, let us convert the `EffectCard` to a `SuspendedCard`:
```typescript
import { fetchText } from "../async/sample.ts";
import { Card } from "./Card/Card.tsx";
import { createResource } from "../async/create-resource.ts";
// Same as before - start the promise outside of React life cycle
const helloTextResource = createResource(
fetchText({ text: "hello, world!", delay: 1000 }),
);
function SuspendedCard() {
const helloText = helloTextResource.read();
return <Card text={helloText}></Card>;
}
```
⚠️ Don't create the resource inside the `Component`! Because that would mean that a new resource will be created each time the component re-renders. Which is not something we wish to have (Infinite loops!).
Keep the components `idempotent`.
Now let's refactor `Variant 3` to use the `SuspendedCard`:
```typescript
import { Suspense } from "react";
import { SuspendedCard } from "./SuspendedCard.tsx";
import { Input } from "./Input.tsx";
function SuspendedEffectAndInput() {
return (
<Suspense fallback={<h1>loading..</h1>}>
<Input />
<SuspendedCard />
</Suspense>
);
}
export { SuspendedEffectAndInput };
```
Now isn't this cool?
Few things to note here though:
* The `Suspense` the wrapper is called the `Suspense Boundary`. This is where you provide a `fallback` i.e., while the component is suspended you can show something else. A loading indicator, for example.
* The Suspense boundary is granular. You can put it anywhere you like. Directly above the `<SuspendedCard />` or like I have done in the snippet.
The Suspense boundary is so flexible because we are literally ***throwing*** the ***promise***!
When you throw something, we can have any number of layers above. We handle it wherever we wish. Now throwing stuff other than errors makes sense. Also, we must handle it!
What about errors? 🤔
If you had noticed in the `createResouce` function, we had this case too:
```ts
case "Loading":
throw promise;
case "Error":
throw error; /* error scenario */
case "Done":
return result!;
default: {
return status;
```
So, in case of an error, we throw the error instead of the original promise.
To handle it, we need to wrap it in a `ErrorBoundary`:
```typescript
import { Suspense } from "react";
import { SuspendedCard } from "./SuspendedCard.tsx";
import { Input } from "./Input.tsx";
import { ErrorBoundary } from "react-error-boundary"; /* you have to install this library */
function SuspendedEffectAndInput() {
return (
<ErrorBoundary fallback={<h1>Some error occurred!</h1>}>
<Suspense fallback={<h1>loading..</h1>}>
<Input />
<SuspendedCard />
</Suspense>
</ErrorBoundary>
);
}
export { SuspendedEffectAndInput };
```
This is similar to wrapping it with `try/catch` block!
This whole approach is called `render as you fetch`
Let's push this a bit further.
We can even load the component code `dynamically` via `lazy` .
So that means that both `code` and `data` can be loaded concurrently!
Let's see how that can be accomplished:
```typescript
import { lazy, Suspense } from "react";
import { Input } from "./Input.tsx";
import { ErrorBoundary } from "react-error-boundary";
import { createResource } from "../async/create-resource.ts";
import { fetchText } from "../async/sample.ts";
const Card = lazy(() =>
import("./Card/Card.tsx").then((mod) => ({ default: mod.Card })),
); /* async logic to get code */
const helloTextResource = createResource(
fetchText({ text: "hello, world!", delay: 1000 }),
); /* async logic to get data */
function SuspendedResourceCard({
resource: { read },
}: {
resource: { read: () => string };
}) {
const helloText = read();
return <Card text={helloText}></Card>;
}
function FinalVariant() {
return (
<ErrorBoundary fallback={<h1>Some error occurred!</h1>}>
<Suspense fallback={<h1>loading..</h1>}>
<Input />
<SuspendedResourceCard resource={helloTextResource} />
</Suspense>
</ErrorBoundary>
);
}
```
As you can see, we are loading both code and data concurrently!
Suspense boundaries can handle both of them together without us having to manage the low-level details. The best part is React can do other things like update UI when the user types on the input (no more jank!)
Another cool thing is now with `RSC` we have a way to start loading `promises` on the server and then `Suspend` them on the client!
Some additional resources if you want to deeper into this:
{% embed https://overreacted.io/algebraic-effects-for-the-rest-of-us/ %}
This `Youtube` video by Jack details on how to leverage these things on the server:
{% embed https://www.youtube.com/watch?v=ViVa5JPGrf4 %}
Also, we don't have to use the `createResource` method. The React team is shipping with a new `hook` in `React 19` called `use` :
For a live version of all the code samples you can check them out here:
{% embed https://github.com/varenya/react-suspense-blog %}
All right folks that's it, I hope this was helpful! | varenya |
1,873,522 | Master AI Integration : How to Integrate AI in Your Application | Full Article In the ideal world, we'd design our software systems with AI in mind from the very... | 0 | 2024-06-02T08:00:32 | https://dev.to/exploredataaiml/master-ai-integration-how-to-integrate-ai-in-your-application-c66 | machinelearning, rag, aiagent, llm | [Full Article] (https://medium.com/ai-advances/master-ai-integration-how-to-integrate-ai-in-your-application-6b936376df61)
In the ideal world, we'd design our software systems with AI in mind from the very beginning. But in the real world, that's not always possible. Many businesses have large, complex systems that have been running for years, and making significant changes to them is risky and expensive.

What this Article is About?
● This article aims to convince you that even when changing existing systems is not an option, you can still seamlessly integrate AI into your business processes. It explores real-world scenarios and shows how a company (though simulated) has successfully incorporated AI without overhauling their existing infrastructure.
Why Read This Article?
● By reading this article, you will learn the critical skill of integrating AI into your existing business ecosystem without making significant changes to your stable workflows. This skill is becoming increasingly important as more and more companies recognize the value of AI while also acknowledging the challenges of overhauling their existing systems.

What is Our Business Use Case?
● The article uses a simulated supply chain management company as a business use case. This company has multiple departments, each exposing its own REST API, and to get an inquiry answered, the request has to go through various departments, their respective APIs, and database calls. The article introduces AI capabilities to enhance the company's operations without modifying the existing system architecture.
Our Supply Chain Management Company AI Integration Design
● The article describes the various components of the simulated supply chain management company, including the "Data Processing System," "Company Data Handling System," "AI Integration System," "Mapping System," and "System Admin Dashboard."
Let's Get Cooking!
● This section provides the code and explanations for implementing the AI integration system in the simulated supply chain management company.
It covers the following:
○ Dashboard & AI Integration System ○ Company Data Handling System ○ Data Processing System ○ Mapping System
Let's Setup
● This section shows the expected output when setting up the simulated supply chain management system with AI integration.
Let's Run it
● This section demonstrates how to run the system and ask questions related to supply chain management, showcasing the AI integration in action.
Closing Thoughts
The supply chain management project we have explored in this article serves as a powerful example of how to seamlessly integrate cutting-edge AI capabilities into existing business systems without the need for significant overhauls or disruptions. By leveraging the flexibility and power of modern AI technologies, we were able to enhance the functionality of a simulated supply chain management system while preserving its core operations and workflows.
Throughout the development process, we placed a strong emphasis on minimizing the impact on the existing system architecture. Rather than attempting to replace or modify the established components, we introduced an “AI Integration System” that acts as a bridge between the existing infrastructure and the AI-powered capabilities. This approach allowed us to maintain the integrity of the existing systems while simultaneously leveraging the benefits of AI.
One of the key advantages of this integration strategy is the ability to leverage the wealth of data already available within the existing systems. By accessing and processing this data through the AI models, we were able to generate more informed and intelligent responses to user queries, providing valuable insights and recommendations tailored to the specific supply chain activities and scenarios.
As we look towards the future, the importance of seamlessly integrating AI into existing business ecosystems will only continue to grow. With the rapid pace of technological advancements and the increasing demand for intelligent automation and decision support, organizations that embrace this approach will be better positioned to capitalize on the opportunities presented by AI while minimizing disruptions to their operations.
It is my hope that through this simulated real-world example, you have gained a deeper understanding of the potential for AI integration and the various strategies and best practices that can be employed to achieve successful implementation. By embracing this approach, businesses can unlock the transformative power of AI while preserving the investments and institutional knowledge embedded in their existing systems. | exploredataaiml |
1,873,520 | How to package and deploy a Lambda function as a container image | Introduction: AWS Lambda allows you to run your code inside Docker containers! This feature opens up... | 0 | 2024-06-02T07:54:39 | https://dev.to/aws-builders/how-to-package-and-deploy-a-lambda-function-as-a-container-image-3d1a | containers, aws, lambda, devops | **_Introduction:_**
AWS Lambda allows you to run your code inside Docker containers! This feature opens up a lot of possibilities. You can use any programming language or framework by packaging it into a container image.
There are no limitations from Lambda's built-in runtimes. Deploying Lambda functions also becomes much easier.
Instead of zipping up code and dependencies, we can build a Docker image with everything our function needs. Just push the image to Amazon's container registry and configure Lambda to use it.
In this blog post, we'll show you how to create a Lambda function that runs in a Docker container.
**_Amazon ECR:_**
Amazon Elastic Container Registry (ECR) is a fully managed container registry provided by AWS. It allows you to store, manage, and deploy container images securely.
_Key points about ECR:_
- Eliminates the need to operate your own container repository.
- Integrates natively with other AWS services like ECS, EKS, and Lambda.
- Provides high-performance hosting for your images.
- Automatically encrypts images at rest and transfers them over HTTPS.
- Offers resource-based permissions and lifecycle policies for images.
## Using ECR with AWS Lambda:
Traditionally, you deployed Lambda functions by uploading a ZIP file containing your code and dependencies. However, AWS now allows you to package your Lambda function code as a container image and deploy it from ECR.
The main benefits of using container images for Lambda functions include:
- Use any programming language, framework, or base image by customizing the container.
- Larger deployment packages up to 10GB compared to 50MB zipped archives.
- Easier dependency management and code organization within the container.
- Consistent build and deployment process across different environments.
To use a container image for your Lambda function, you first build and push the Docker image to an ECR repository. Then, you create the Lambda function and specify the ECR image URI as the deployment package.

## Hands-On walkthrough:
To show how this works in practice, this walkthrough uses an environment with the AWS CLI, python, and Docker installed.
Create a `Dockerfile` file and paste the following code:
```
FROM amazon/aws-lambda-python:3.10
COPY app.py ./
CMD ["app.handler"]
```
Create `app.py` as lambda handler:
```
import sys
def handler(event, context):
return 'Hello from AWS Lambda using Python container image' + sys.version + '!'
```
Next, run the following command in the console to authenticate to the ECR registry.
Replace with the account ID of the AWS account you are using and with the code of the region you are using.
```
aws ecr get-login-password --region <Region> | docker login --username AWS --password-stdin <Account-ID>.dkr.ecr.<Region>.amazonaws.com
```
Create a new repository in ECR and push the Docker image to the repo.
```
aws ecr create-repository --repository-name demo-lambda --image-scanning-configuration scanOnPush=true
```
After that, run the following command to create the container image:
```
docker build -t demo-lambda .
```
Then, run the following commands to tag and push the image:
```
docker tag get-customer:latest <Account-ID>.dkr.ecr.<Region>.amazonaws.com/get-customer:latest
docker push <Account-ID>.dkr.ecr.<Region>.amazonaws.com/get-customer:latest
```
Next step is to create the Lambda function:
```
aws lambda create-function \
--function-name demo-lambda \
--package-type Image \
--code ImageUri=<Account-ID>.dkr.ecr.<Region>.amazonaws.com/demo-lambda:latest \
--role arn:aws:iam::<Account-ID>:role/execution_role \
--region <Region> \
--timeout 15 \
--memory-size 512 \
--description "A Lambda function created using a container image."
```
- `--function-name`: The name you want to assign to your Lambda function (demo-lambda).
- `--package-type Image`: Specifies that the deployment package is a container image.
- `--code ImageUri=...`: The URI of the container image in ECR.
- `--role`: The ARN of the IAM role that Lambda assumes when it executes your function. Ensure this role has the necessary permissions.
- `--region`: The AWS region where you want to create the Lambda function.
- `--timeout`: The maximum execution time in seconds for the function.
- `--memory-size`: The amount of memory available to the function at runtime.
- `--description`: A description of the function.
Make sure to replace placeholders like with your actual values.
After, you can invoke the container image as a Lambda function:
```
$ aws lambda invoke --function-name demo-lambda --region <Region> outfile
{
"StatusCode": 200,
"ExecutedVersion": $LATEST"
}
$ cat outfile
"Hello from AWS Lambda using Python3.10.2 (default, June 01 2024, 09:22:02) \n[GCC 8.3.0]!"
```
## Conclusion
This blog post showed an easy way to use Docker containers with AWS Lambda functions.
By building a Docker image with your code, you can run any programming language or tools on Lambda. Deploying is simple - just upload your container image to AWS. Give it a try to make Lambda more flexible for your apps!
Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘
🔰 Keep Learning !! Keep Sharing !! 🔰
## References:
- https://dev.to/vumdao/deploy-python-lambda-functions-with-container-image-5hgj
- https://www.pluralsight.com/resources/blog/cloud/packaging-aws-lambda-functions-as-container-images
- https://community.aws/content/2Z4KyWJP5qXDD6StOWJZFXzoRZq/creating-a-lambda-function-with-a-container-based-runtime
| seifrajhi |
1,873,519 | เริ่มต้น Quarkus 3 part 2.1 Web | ใน part นี้เราจะเริ่มเพิ่ม html template Qute เพื่อให้ render html ที่ server side เริ่ม ! quarkus... | 0 | 2024-06-02T07:54:03 | https://dev.to/pramoth/erimtn-quarkus-3-part-2-web-4bkm | ใน part นี้เราจะเริ่มเพิ่ม html template Qute เพื่อให้ render html ที่ server side
เริ่ม !
`quarkus dev` ก่อนเลย เพราะว่ามันจะ auto reload dependency ให้ด้วย สุดยอดดดด
จากนั้นเราแก้ pom.xml โดยเพิ่ม
```xml
<dependency>
<groupId>io.quarkiverse.qute.web</groupId>
<artifactId>quarkus-qute-web</artifactId>
</dependency>
```
เมื่อเซฟมันก็จะไปโหลด deps มาให้เลย (เราไม่ต้องสนใจ dev ต่อ)
เราเริ่มสร้าง template แรกเลยโดย qute จะไปอ่าน template จาก 2 ที่ด้วยกัน
1. แบบไม่มี controller มันจะไปอ่านที่ `src/main/resource/templates/pub/` เวลาเข้าถึงก็เข้าถึงได้ตรงๆ ที่ path /file เลย เช่น `src/main/resource/templates/pub/foo.html ` จะเข้าถึงได้ที่ `/foo` and `/foo.html` ได้เลย
2. แบบอ้างอิงกับ Rest controller อันนี้เราจะวางที่ `src/main/resources/templates` และเข้าถึงผ่าน rest endpoint ของเรา
เราเน้นแบบ rest นะ(ใน part1 เรามี rest ใน project แล้ว)
ให้เราเพิ่ม controller แบบนี้ (ลบ GreetingResource ออกด้วยนะครับ มันพาธเดียวกัน)
ดังนั้น เพื่อให้มันรองรับ rest endpoint แบบไม่ต้องเมนวลให้เพิ่ม
```xml
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-qute</artifactId>
</dependency>
```
> ใน https://quarkus.io/guides/qute เขาไม่ได้ใส่ quarkus-rest-qute คิดว่าเอกสารผิดนะ ถ้าไม่ใส่ เราต้องเรียก TemplateInstance.data().render() เอง ContainerResponseFilter จะไม่ทำงาน

ที่ capture รูปมาให้ดูเพราะจะได้เห็น template path จากในโค๊ด `@Inject Template hello` เป็นการ inject qute template instance เข้ามา ซึ่ง template file เราอยู่ที่ `src/main/resources/templates/hello.html` ซึ่งจะชื่อเดียวกับ instance variable(hello) ถ้าเราอยาก custom path ให้ใช้ `@Location`
มาดู hello.html กัน
```html
<!DOCTYPE html>
<html lang="en">
<body>
<h1>Hello {name}!</h1>
</body>
</html>
```
จะมีการใช้ Qute expression {name} ซึ่งกันนี้เราจะส่งเป็นพรามิเตอร์มาจาก cpntroller จากตรงนี้ `return hello.data("name", name); `
## Type-safe templates
1. เราจะจัดโครงสร้าง directory ด้วย `ชื่อคลาส/template_method` เช่น คลาส HelloResource และมี template method ชื่อ hello เทมเพลทจะอยู่ `src/main/resources/templates/HelloResource/hello.html`
2. ให้สร้าง static inner class Rest controller `@CheckedTemplate static class Template {}` ซึ่งให้กำหนด template method ไว้ในนั้น
3. method กำหนด แบบนี้ `public static native TemplateInstance template_method_name(String template_param)`
ตัวอย่าง

อ้างอิง
https://quarkus.io/guides/qute
part 1 https://dev.to/pramoth/erimtn-quarkus-3-part-1-ane
| pramoth | |
1,873,518 | A Farcaster Frame Starter For Slides | What With this starter, you can create a frame for slides on Farcaster in one minute. The... | 0 | 2024-06-02T07:53:41 | https://dev.to/foxgem/a-farcaster-frame-starter-for-slides-gfg | farcaster, frames, blockchain, web3 | ## What
With this starter, you can create a frame for slides on Farcaster in one minute.
The sweeter thing is you can use markdown and no need to touch any code for frame.
## How
This is how:
1. create a direct for your new slides in `contents`.
1. write the slides in markdown.
1. `pnpm convert`
1. review it locally with `pnpm dev`
1. publish it on vercel with `pnpm deploy`
Done!
### Known Issues
Using relative paths for images in slides won't generate the final images for the sliedes correctly.
But you can start a local http server for a workaround. See the example in [this example](contents/doc/01-what.md):
```markdown

```
To setup a local http server:
```shell
python3 -m http.server 9000
```
## The Frames Site
The default site generated is organized as below:
1. `/` is the index of the whole site.
1. `/submit` is the target frame for the `Go` button.
1. `/:slide` presents the selected `slide` in a frame. The value of `slide` is one of the names of the subdirectories in `contents`.
## Customization
This starter is using [mdimg](https://github.com/LolipopJ/mdimg) and the site builder is in [convert.ts](./scripts/convert.ts). So:
- for style, read `mdimg` document.
- for generation, change `convert.ts` and update `/api/index.tsx`.
## Showcase
Read this document in [this frame](https://warpcast.com/foxgem/0xaebf8686).
If you are interested in it, here is the [code](https://github.com/foxgem/a-farcaster-frame-starter-for-slides). | foxgem |
1,873,517 | Temu Coupon Codes{acp856709} 2024: Latest Offers Available | Temu offers a range of coupon codes for 2024, allowing you to save significantly on your purchases.... | 0 | 2024-06-02T07:45:00 | https://dev.to/ansu_e73f66d62b35d92c316d/temu-coupon-codesacp856709-2024-latest-offers-available-pld | temu, coupon, code, temucouponcode | Temu offers a range of coupon codes for 2024, allowing you to save significantly on your purchases. Here are some of the latest and verified offers:
$100 Off Coupon Code: Use code "acp856709" to get $100 off your order.
90% Off Coupon Code: Use code "acp856709" to get 90% off your order.
50% with free shipping Off Coupon Code: Use code "acp856709" to get off your order.
How to Redeem These Coupon Codes:
Add Products to Cart: Add the items you want to buy to your Temu cart.
Proceed to Checkout: Go to the checkout page.
Enter Coupon Code: Enter the coupon code in the designated field.
Apply Discount: The discount will be applied to your order.
Please note that these coupon codes are subject to change and may have specific terms and conditions. Always verify the coupo | ansu_e73f66d62b35d92c316d |
1,873,516 | Javascript Template Engines Benchmark (2024) | TLDR About Template engines have long been a cornerstone of web development,... | 0 | 2024-06-02T07:40:12 | https://dev.to/devcrafter91/javascript-template-engine-benchmark-2024-2m3j | javascript, ejs, handlebars, pug | ## TLDR

## About
Template engines have long been a cornerstone of web development, enabling developers to dynamically generate HTML using logic and data. As the landscape of JavaScript library and framework options has expanded, so too has the variety of template engines available. This article explores the performance characteristics of several popular JavaScript template engines through rigorous benchmarking.
## What tested
The primary goal of a template engine is to separate the presentation layer from the business logic, making it easier to manage and maintain code. Given the rapid evolution of web applications and the intensive demands placed upon them, performance is a critical consideration. To help you make an informed decision, we will benchmark a selection of contemporary template engines:
1. Eta.js
1. Liquid.js
1. Handlebars
1. Nunjucks
1. EJS
1. Edge.js
## Source
https://github.com/crafter999/template-engine-benchmarks
## Support
If you liked this article follow me on Twitter, it's free!
https://twitter.com/devcrafter91
| devcrafter91 |
1,873,515 | Temu Coupon "act200019" Codes : Enjoy 90% Off Instant Savings | Based on the provided sources, the query about Temu coupon codes "act200019" to enjoy 90% off instant... | 0 | 2024-06-02T07:38:07 | https://dev.to/sonam11/temu-coupon-act200019-codes-enjoy-90-off-instant-savings-f3 | Based on the provided sources, the query about Temu coupon codes "act200019" to enjoy 90% off instant savings is not directly supported. The available information focuses on a $100 discount rather than a 90% discount. The Temu coupon codes "act200019" mentioned in the sources offer $100 off for both new and existing customers, not a 90% discount. Therefore, there is no specific mention of a 90% discount in the provided search results.
| sonam11 | |
1,873,514 | Use Temu coupon Code [aci384098] : Get $100 And 30% Discount | To use the Temu coupon code act200019 and get $100 off and 30% discount, follow these steps: Sign Up... | 0 | 2024-06-02T07:31:02 | https://dev.to/sonam11/use-temu-coupon-code-aci384098-get-100-and-30-discount-1k6k | To use the Temu coupon code act200019 and get $100 off and 30% discount, follow these steps:
Sign Up for a New Account: Ensure you are a new user by signing up for a Temu account using your email address or social media login.
Browse and Add Items to Your Cart: Browse through the various categories and add items to your cart. Make sure your total purchase amount meets the minimum requirement for the coupon to be applied.
Proceed to Checkout: After adding all desired items to your cart, click on the cart icon and proceed to checkout.
Enter the Coupon Code: During the checkout process, enter the code act200019 in the field labeled "Promo Code" or "Coupon Code" and click "Apply".
Verify Discount: Ensure that the $100 discount and 30% off have been applied to your order before completing the purchase. The total amount should reflect the discounts.
By following these steps and using the correct coupon code, you can enjoy the $100 off and 30% discount on your Temu purchase. | sonam11 | |
1,873,513 | Choosing Between Node.js with JavaScript and Node.js with TypeScript | Node.js has become a cornerstone for server-side development, leveraging JavaScript outside the... | 0 | 2024-06-02T07:30:39 | https://dev.to/vyan/choosing-between-nodejs-with-javascript-and-nodejs-with-typescript-41d8 | webdev, node, react, beginners | Node.js has become a cornerstone for server-side development, leveraging JavaScript outside the browser. However, the decision to use JavaScript or TypeScript with Node.js is crucial and can significantly affect your project's development. This blog will provide a concise comparison of both options to help you make an informed choice.
## Node.js with JavaScript
### Benefits
1. **Simplicity and Familiarity**: Most developers are familiar with JavaScript, allowing for a quicker start and easier learning curve.
2. **Large Ecosystem**: JavaScript has a vast library ecosystem, facilitating rapid development and third-party integrations.
3. **Flexibility**: JavaScript's dynamic typing allows for rapid prototyping and less boilerplate code.
4. **Community Support**: A large, active community offers extensive resources and support.
### Challenges
1. **Lack of Type Safety**: Dynamic typing can lead to runtime errors that are harder to debug.
2. **Scalability Issues**: Managing large codebases can be challenging without strict type definitions.
3. **Tooling and Configuration**: Requires additional configuration for linting, testing, and building.
### Example
```javascript
// app.js
const express = require('express');
const app = express();
const port = 3000;
app.use(express.json());
app.get('/', (req, res) => {
res.send('Hello, World!');
});
app.post('/data', (req, res) => {
const data = req.body;
res.send(`Received data: ${JSON.stringify(data)}`);
});
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
```
## Node.js with TypeScript
### Benefits
1. **Type Safety**: Statically typed, catching errors at compile time, leading to more reliable code.
2. **Improved Developer Experience**: Enhanced IDE support with autocompletion, navigation, and refactoring tools.
3. **Scalability**: Better code organization and maintainability for large applications.
4. **Modern Features**: Access to the latest JavaScript features and additional TypeScript-specific enhancements.
### Challenges
1. **Learning Curve**: Requires understanding additional syntax and concepts.
2. **Configuration Overhead**: More setup complexity with the TypeScript compiler and configurations.
3. **Build Step**: Requires a compile step, adding to the development workflow.
### Example
1. **Install Dependencies**:
```bash
npm init -y
npm install express
npm install --save-dev typescript @types/node @types/express ts-node
```
2. **Create `tsconfig.json`**:
```json
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
```
3. **Create TypeScript Server**:
```typescript
// src/app.ts
import express, { Request, Response } from 'express';
const app = express();
const port = 3000;
app.use(express.json());
app.get('/', (req: Request, res: Response) => {
res.send('Hello, World!');
});
app.post('/data', (req: Request, res: Response) => {
const data = req.body;
res.send(`Received data: ${JSON.stringify(data)}`);
});
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
```
4. **Run the Server**:
```bash
npx ts-node src/app.ts
```
## Conclusion
- **JavaScript**: Best for smaller projects, rapid prototyping, or teams already proficient in JavaScript.
- **TypeScript**: Ideal for large-scale applications requiring high reliability and type safety.
Both languages have their strengths and challenges. Choose JavaScript for flexibility and speed, or TypeScript for scalability and robust code management. Node.js will remain a powerful platform regardless of your choice. | vyan |
1,873,512 | [DAY 39-41] I Built 2 Minigames & Solved 4 Leetcode Challenges | Hi everyone! Welcome back to another blog where I document the things I learned in web development. I... | 27,380 | 2024-06-02T07:29:07 | https://dev.to/thomascansino/day-39-41-i-built-2-minigames-solved-4-leetcode-challenges-4k28 | beginners, learning, javascript, webdev | Hi everyone! Welcome back to another blog where I document the things I learned in web development. I do this because it helps retain the information and concepts as it is some sort of an active recall.
On days 39-41, I built a platform game (a type of game like super mario or geometry dash), a dice game, and solved 4 leetcode challenges which are:
1. **Find The Maximum Achievable Number** - in which you are given 2 integers and must return the maximum achievable number after applying the operation at a certain amount of times.
2. **Build Array From Permutation** - where you are given an array1 and must build a new array2 of the same length where the elements must meet a certain criteria of the array1.
3. **Permutation Difference between Two Strings** - in which you are given 2 strings and must get the index of similar letters and get their absolute differences then get their sum.
4. **Final Value of Variable After Performing Operations** - where you are given an array of strings which specify if you are going to increment or decrement the output.




In the platformer game, you must pass through all 3 checkpoints and finish the game by getting to the end. The program is pretty straightforward and can be used as a template for future platform game projects.
While building, I learned more about class keywords and objects. I also learned how to design and organize game elements using APIs to be efficient and gain insights into problem-solving and code reusability.
In utilizing the class keyword, I was able to set the base position, velocity, and size of the main character.
I also learned a simple syntax to check if every element in the array is truthy (e.g `.every((rule) => rule)`) while this syntax (e.g. `.every((rule) => !rule)`) to check if every element in the array is falsy.
Working with a bunch of classes in the platformer game project, some of the code made sense to me like class keywords and constructor instances. But honestly, if you’d ask me to re-code this project by myself, I would not have been able to do it. In my current skill level, I’ll probably need some template or a guide before I start doing this solo.




Moving on, in this dice game, you are given 6 rounds, for each round, you can roll the dice 3 times, for each roll, there is a random chance of activating certain radio buttons that gives you a score based on the combination of numbers you rolled on your dice. At the end of the 6th round, your scores will be totalled and that’s game. You can use this program to play with someone and whoever gathers a higher score, wins.
While building, I learned how to manage game state, implement game logic for rolling dice, keeping score, and applying rules for various combinations.
This project covers concepts such as event handling, array manipulation, conditional logic, and updating the user interface dynamically based on game state.
Anyways, that’s all for now, more updates in my next blog! See you there! | thomascansino |
1,873,511 | Temu Coupons code "act200019" $100 off: Unlock Amazing Deals Today | To unlock amazing deals today at Temu, you can use the following coupon codes and tips: 30% Off... | 0 | 2024-06-02T07:28:26 | https://dev.to/sonam11/temu-coupons-code-act200019-100-off-unlock-amazing-deals-today-1l82 | To unlock amazing deals today at Temu, you can use the following coupon codes and tips:
30% Off Sitewide for New Customers
Use the code act200019 to get 30% off your first order. This code is exclusive to new users and can be applied during checkout.
£100 Off App Orders
Apply the code act200019 to get £100 off your first app order. This code is also exclusive to new users and can be used in the Temu app.
30% Off Orders Over £10
Use the code act200019 to get 30% off orders over £10. This code can be applied during checkout and is valid for all users.
Free Shipping and Returns
Temu offers free shipping on all orders and free returns within 90 days. This is a great way to save on shipping costs and ensure you can return items if needed.
Clearance Section
Temu has a clearance section where you can find discounted items. These items are often reduced to clear and sell out quickly, so be sure to check this section regularly for great deals.
Stacking Coupons
Unfortunately, you cannot apply two or more Temu coupon codes per order. Make sure you are applying the best Temu promo code to your order.
Additional Tips
Ensure you are using the correct coupon code, as different codes may have different terms and conditions.
Check the expiration date of the coupon code to avoid missing the deadline.
Verify the terms and conditions of the coupon code to ensure it is applicable to your purchase.
By following these steps and using the correct coupon codes, you can unlock amazing deals today at Temu. | sonam11 | |
1,873,498 | How to Get a Free Custom Domain as a Student | Introduction As developers and tech enthusiasts, having a custom domain name can be... | 0 | 2024-06-02T06:59:21 | https://dev.to/ryoichihomma/how-to-get-a-free-custom-domain-4d56 | customdomain, dns, freecustomdomain, namecheap | ## Introduction
As developers and tech enthusiasts, having a custom domain name can be essential for branding, professional appearance, and online identity. In this article, I am going to walk you through a step-by-step process to obtain a custom domain for free using Namecheap.
## Step 1: Sign Up for Namecheap as a Student
To obtain a free custom domain, you have to provide a valid school-issued email address. There are two ways to sign up for Namecheap as a student.
**1st way: Join GitHub Education First**
GitHub offers a free education plan for students. I highly recommend to join if you haven't joined yet. Here is a [step-by-step process](https://dev.to/ryoichihomma/github-education-free-plan-recommended-for-students-3hbj).
After joining GitHub Education, you will visit [GitHub Student Developer Pack page](https://education.github.com/pack/offers), and then scroll down to Namecheap.  Once you click the first offer link of Namecheap, your status will be automatically verified with GitHub.

**1-2. Directly Join Namecheap as a Student**
If you skip joining GitHub Education, you'll be required to submit your valid school-issued email when you order the custom domain. 
## Step 2: Enter Your Desired Custom Domain
You simply enter your desired custom domain and then click the "find" button. If the input domain is already taken, you have to choose or enter a different domain name. On the next page, you will see your-custom-domain.me is available for free. You can see other available custom domains that are not free though, Namecheap offers a lot of popular domains available at cheaper prices than other domain registers. Then, add it to your shopping cart and complete the order.  The custom domain is finally yours!
| ryoichihomma |
1,873,510 | Temu Coupon "act200019": Save Big on Your Next Purchase | To save big on your next Temu purchase, you can use the following coupon codes: 30% Off Sitewide for... | 0 | 2024-06-02T07:25:06 | https://dev.to/sonam11/temu-coupon-act200019-save-big-on-your-next-purchase-29j9 | To save big on your next Temu purchase, you can use the following coupon codes:
30% Off Sitewide for New Customers: Use the code act200019 to receive a 30% discount on your first purchase. This offer is exclusive to new customers and can be redeemed at checkout.
£100 Off App Orders: Apply the code act200019 to receive a £100 discount on your first order through the Temu app. This code is exclusively for new users.
30% Off Orders Over £10: "Use the code TEMU30 to get 30% off orders over £10. This code can be applied during checkout and is valid for all users."
Free Shipping and Returns:"Use the code TEMU30 to get 30% off orders over £10. This code can be applied during checkout and is valid for all users."
Clearance Section: Temu has a clearance section where you can find discounted items. These items are often reduced to clear and sell out quickly, so be sure to check this section regularly for great deals.
By following these tips and using the correct coupon codes, you can save big on your next Temu purchase. | sonam11 | |
1,873,509 | Easiest Way to Tinker with Your Laravel Application | Tinkering with your Laravel application is an excellent way to interact with your application,... | 0 | 2024-06-02T07:24:17 | https://dev.to/bedram-tamang/easiest-way-to-tinker-with-your-laravel-application-1aaj | laravel, tinker | Tinkering with your Laravel application is an excellent way to interact with your application, explore your database, and debug your code. Laravel provides a console command, `php artisan tinker`, which allows you to play with every part of your application interactively. However, using a PHP file for tinkering can be even more convenient, as it allows you to write, modify, and save your code easily.
In this blog post, we will demonstrate how to tinker with your Laravel application using a PHP file. This method is advantageous because it is easier to work with a PHP file than with a console command.
## Getting Started
First, create a PHP file named `tinker.php`, If you are using an IDE like PhpStorm, you can create a scratch file so that you don't have to delete it each time you commit your code. This approach ensures a cleaner and more organized workflow.
Next, set up the Laravel application in tinker.php as follows:
```php
<?php
const BASE_PATH = '/Users/ellite/code/jobins';
require_once BASE_PATH.'/vendor/autoload.php';
use Illuminate\Foundation\Console\Kernel;
$app = require BASE_PATH.'/bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
dd(\App\Model\AdminModel::query()->first());
```
## Explanation
Autoload Dependencies:
```php
const BASE_PATH = '/Users/Bedram/code/example';
require_once BASE_PATH.'/vendor/autoload.php';
# This line sets the base path to your Laravel project directory.
```
Bootstrap the Laravel Application:
```php
use Illuminate\Foundation\Console\Kernel;
$app = require BASE_PATH.'/bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
```
These lines initialize the Laravel application by requiring the app.php file and bootstrapping the Kernel. That's it, That all you need to setup your tinkering.
## Additional Examples
Fetching All Records:
```php
dd(\App\Model\AdminModel::all());
dd(\App\Model\AdminModel::where('status', 'active')->get());
```
Handling Relationships:
```php
$admin = \App\Model\AdminModel::with('roles')->first();
dd($admin);
```
Creating a New Record:
```php
$newAdmin = \App\Model\AdminModel::create([
'name' => 'New Admin',
'email' => 'newadmin@example.com',
'password' => bcrypt('password123'),
'status' => 'active',
]);
dd($newAdmin);
```
Updating a Record:
```php
$admin = \App\Model\AdminModel::first();
$admin->update(['status' => 'inactive']);
dd($admin);
Deleting a Record:
```
Deleting a Record
```php
$admin = \App\Model\AdminModel::first();
$admin->delete();
dd('Record deleted');
```
## Conclusion
Laravel's Eloquent ORM and the php artisan tinker command make it incredibly easy to interact with your application and database. However, using a PHP file for tinkering can offer even more flexibility and ease of use. By following the steps outlined in this blog post, you can quickly set up a PHP file to explore and debug your Laravel application efficiently.
Happy tinkering! | bedram-tamang |
1,873,500 | Temu Coupon Code "act200019": Get Exclusive Discounts Now | To get exclusive discounts on Temu, you can use the following coupon codes: act200019: This code... | 0 | 2024-06-02T07:19:13 | https://dev.to/sonam11/temu-coupon-code-act200019-get-exclusive-discounts-now-520h | To get exclusive discounts on Temu, you can use the following coupon codes:
act200019: This code offers $100 off for new users. To apply the code, follow these steps:Sign up for a new Temu account using the referral code act200019.
After signing up, you will receive the $100 off coupon bundle bonus.
Use the act200019 code during checkout to apply the $100 bonus and 30% discount on your purchase.
acp856709: This code offers a 30% discount. To apply the code, follow these steps:Ensure you are a new user by signing up for a Temu account using your email address or social media login.
Browse through the various categories and add items to your cart. Make sure your total purchase amount meets the minimum requirement for the coupon to be applied.
Proceed to checkout and enter the code act200019 in the field labeled "Promo Code" or "Coupon Code" and click "Apply".
Verify that the 30% discount has been applied to your order before completing the purchase.
By following these steps and using the correct coupon codes, you can enjoy exclusive discounts on your Temu purchases. | sonam11 | |
1,873,499 | API Versioning in Minimal API. | Hello guys, Sorry I took so so so soooooooooo, long break, I came back with this topic, I know I... | 0 | 2024-06-02T07:18:52 | https://dev.to/ayush_k_mandal/api-versioning-in-minimal-api-1omi | aspdotnet, dotnet, csharp, learning | Hello guys, Sorry I took so so so soooooooooo, long break, I came back with this topic, I know I haven't covered properly my previous posts, but I'll continue again. Apart from this, let's continue this topic, as you seen in the title, Its API versioning in Minimal API, but in ASP.NET Core 8, yes you can do that with .NET 6 or higher version.
## What is API Versioning?
As you've seen in the fake API sites, which provide the fake API for your building and learning skills of Web Apps, or other Platforms, If you don't know about the Fake APIs, then visit the given links down below:
- [JSON Placeholder](https://jsonplaceholder.typicode.com)
- [Platzi](https://fakeapi.platzi.com/)
As you can see their given fake API URL segment have `/v1` in the **Platzi** API, that's indicating the `URLSegmentVersioning` which can be access by passing the `v1` to define, that its using the API `version 1.0` and you can define which API endpoints can use as `v1` or `v2` or `depricated`. If you don't get my point, then you can search more on internet.
### Prerequisite
- .NET 8 SDK.
- Visual Studio Code
- Knowledge about the extension method.
- Asp.Versioning.Http
- Asp.Versioning.Mvc.ApiExplorer
You can start with default template of dotnet and start creating your first, Minimal API, maybe you know already because you're smarter, but still, I'll do the developer thing Copy and Paste 😁.
```bash
dotnet new web -o MinimalApi -f .net8.0
```
`Tadow` Your Minimall API template is created, open that folder into your **Visual Studio Code**, you code will look like this simple, example given below:

Install packages
```bash
dotnet add package Asp.Versioning.Http
```
```bash
dotnet add package Asp.Versioning.Mvc.ApiExplorer
```
Now create a service folder inside your project folder and add a file `ApiVersionExtension.cs`, your file look like this:

Now use this extension method into you `Program.cs` file, so that it can be defined globally, as you can see in the extension method, there's line
```CSharp
config.ApiVersionReader = ApiVersionReader.Combine(
new QueryStringApiVersionReader("api-version"),
new HeaderApiVersionReader("api-x-version")
);
```
This class `QueryStringApiVersionReader` defines that you can give your API version as `/endpoint?api-version=1` and same goes to the second class `HeaderApiVersionReader` which defines that you can pass the `api-x-version` property to Header of API and give the version value, to the endpoint.
Next and final step, to define the API endpoints and give the api-endpoints version.

In variable `apiVersionSet` I've provided 2nd version as current and 1st version as deprecated.
```bash
dotnet run
```
OR
```bash
dotnet watch
```
You can run one of those commands to run your API, from first of all you'll see your browser as this:

Now change the URL on the search bar to `http://localhost:5202?api-version=2` and your API executed and display the text message.

As you can see in the Header, the deprecated and supported API version. I hope this post is helpful for you and now you can create your own API versions. | ayush_k_mandal |
1,871,553 | Pytest with Django | Steps and code to set up Django Rest Framework (DRF) test cases with database mocking. Set up... | 0 | 2024-05-31T03:14:53 | https://dev.to/dhirajpatra/pytest-with-django-3d9b |
Steps and code to set up Django Rest Framework (DRF) test cases with database mocking.
1. Set up Django and DRF
Install Django and DRF:
```sh
pip install django djangorestframework
```
Create a Django project and app:
```sh
django-admin startproject projectname
cd projectname
python manage.py startapp appname
```
2. Define Models, Serializers, and Views
models.py (appname/models.py):
```python
from django.db import models
class Item(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
```
serializers.py (appname/serializers.py):
```python
from rest_framework import serializers
from .models import Item
class ItemSerializer(serializers.ModelSerializer):
class Meta:
model = Item
fields = '__all__'
```
views.py (appname/views.py):
```python
from rest_framework import viewsets
from .models import Item
from .serializers import ItemSerializer
class ItemViewSet(viewsets.ModelViewSet):
queryset = Item.objects.all()
serializer_class = ItemSerializer
```
urls.py (appname/urls.py):
```python
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import ItemViewSet
router = DefaultRouter()
router.register(r'items', ItemViewSet)
urlpatterns = [
path('', include(router.urls)),
]
```
projectname/urls.py:
```python
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('appname.urls')),
]
```
3. Migrate Database and Create Superuser
```sh
python manage.py makemigrations appname
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```
4. Write Test Cases
tests.py (appname/tests.py):
```python
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from .models import Item
from .serializers import ItemSerializer
class ItemTests(APITestCase):
def setUp(self):
self.item1 = Item.objects.create(name='Item 1', description='Description 1')
self.item2 = Item.objects.create(name='Item 2', description='Description 2')
def test_get_items(self):
url = reverse('item-list')
response = self.client.get(url, format='json')
items = Item.objects.all()
serializer = ItemSerializer(items, many=True)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, serializer.data)
def test_create_item(self):
url = reverse('item-list')
data = {'name': 'Item 3', 'description': 'Description 3'}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Item.objects.count(), 3)
self.assertEqual(Item.objects.get(id=3).name, 'Item 3')
def test_update_item(self):
url = reverse('item-detail', kwargs={'pk': self.item1.id})
data = {'name': 'Updated Item 1', 'description': 'Updated Description 1'}
response = self.client.put(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.item1.refresh_from_db()
self.assertEqual(self.item1.name, 'Updated Item 1')
def test_delete_item(self):
url = reverse('item-detail', kwargs={'pk': self.item2.id})
response = self.client.delete(url, format='json')
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
self.assertEqual(Item.objects.count(), 1)
```
5. Run Tests
```sh
python manage.py test
```
This setup provides a basic Django project with DRF and test cases for CRUD operations using the database. The test cases mock the database operations, ensuring isolation and consistency during testing.
Now diving into some more feature tests with Mock, patch etc.
Here are steps and code to write Django Rest Framework (DRF) test cases using mocking and faking features for scenarios like credit card processing.
1. Set up Django and DRF
Install Django and DRF:
```sh
pip install django djangorestframework
```
Create a Django project and app:
```sh
django-admin startproject projectname
cd projectname
python manage.py startapp appname
```
2. Define Models, Serializers, and Views
models.py (appname/models.py):
```python
from django.db import models
class Payment(models.Model):
card_number = models.CharField(max_length=16)
card_holder = models.CharField(max_length=100)
expiration_date = models.CharField(max_length=5)
amount = models.DecimalField(max_digits=10, decimal_places=2)
status = models.CharField(max_length=10)
```
serializers.py (appname/serializers.py):
```python
from rest_framework import serializers
from .models import Payment
class PaymentSerializer(serializers.ModelSerializer):
class Meta:
model = Payment
fields = '__all__'
```
views.py (appname/views.py):
```python
from rest_framework import viewsets
from .models import Payment
from .serializers import PaymentSerializer
class PaymentViewSet(viewsets.ModelViewSet):
queryset = Payment.objects.all()
serializer_class = PaymentSerializer
```
urls.py (appname/urls.py):
```python
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import PaymentViewSet
router = DefaultRouter()
router.register(r'payments', PaymentViewSet)
urlpatterns = [
path('', include(router.urls)),
]
```
projectname/urls.py:
```python
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('appname.urls')),
]
```
3. Migrate Database and Create Superuser
```sh
python manage.py makemigrations appname
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```
4. Write Test Cases with Mocking and Faking
tests.py (appname/tests.py):
```python
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from unittest.mock import patch
from .models import Payment
from .serializers import PaymentSerializer
class PaymentTests(APITestCase):
def setUp(self):
self.payment_data = {
'card_number': '4111111111111111',
'card_holder': 'John Doe',
'expiration_date': '12/25',
'amount': '100.00',
'status': 'Pending'
}
self.payment = Payment.objects.create(**self.payment_data)
@patch('appname.views.PaymentViewSet.create')
def test_create_payment_with_mock(self, mock_create):
mock_create.return_value = self.payment
url = reverse('payment-list')
response = self.client.post(url, self.payment_data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.data['card_number'], self.payment_data['card_number'])
@patch('appname.views.PaymentViewSet.perform_create')
def test_create_payment_fake_response(self, mock_perform_create):
def fake_perform_create(serializer):
serializer.save(status='Success')
mock_perform_create.side_effect = fake_perform_create
url = reverse('payment-list')
response = self.client.post(url, self.payment_data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.data['status'], 'Success')
def test_get_payments(self):
url = reverse('payment-list')
response = self.client.get(url, format='json')
payments = Payment.objects.all()
serializer = PaymentSerializer(payments, many=True)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, serializer.data)
@patch('appname.views.PaymentViewSet.retrieve')
def test_get_payment_with_mock(self, mock_retrieve):
mock_retrieve.return_value = self.payment
url = reverse('payment-detail', kwargs={'pk': self.payment.id})
response = self.client.get(url, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['card_number'], self.payment_data['card_number'])
@patch('appname.views.PaymentViewSet.update')
def test_update_payment_with_mock(self, mock_update):
mock_update.return_value = self.payment
updated_data = self.payment_data.copy()
updated_data['status'] = 'Completed'
url = reverse('payment-detail', kwargs={'pk': self.payment.id})
response = self.client.put(url, updated_data, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], 'Completed')
@patch('appname.views.PaymentViewSet.destroy')
def test_delete_payment_with_mock(self, mock_destroy):
mock_destroy.return_value = None
url = reverse('payment-detail', kwargs={'pk': self.payment.id})
response = self.client.delete(url, format='json')
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
self.assertEqual(Payment.objects.count(), 0)
```
5. Run Tests
```sh
python manage.py test
```
This setup uses `unittest.mock.patch` to mock the behavior of various viewset methods in DRF, allowing you to simulate different responses without hitting the actual database or external services. | dhirajpatra | |
1,873,497 | Top 5 tools to improve your Web Page Designs | Web page design is an art that combines creativity, technical skills, and user-centric thinking. The... | 0 | 2024-06-02T06:55:57 | https://dev.to/amanagnihotri/top-5-tools-to-improve-your-web-page-designs-hpe | webdev, coding, html, css | Web page design is an art that combines creativity, technical skills, and user-centric thinking. The tools you use can significantly impact the quality and efficiency of your design process. Here are the top five tools that can help you enhance your web page designs, ensuring they are visually appealing, functional, and user-friendly.
**1.unDraw**
unDraw is an open-source project that provides designers and developers with access to a vast library of customizable, high-quality illustrations. These illustrations can be used to enhance web pages, making them more visually appealing and engaging. Created by Katerina Limpitsouni, unDraw is designed to help you easily incorporate beautiful graphics into your projects without the hassle of attribution or licensing issues.
**2. Gradiant Backgrounds**
As a curated list of the best gradient websites across the internet, Gradient Backgrounds allows you to explore, try and choose from hundreds of beautiful blended color palettes. The project merges two ideas developed while building a gradient color picker CSS Gradient and a background image tool Cool Backgrounds.
**3. haikei**
Haikei is a web-based tool that allows designers and developers to create unique and dynamic SVG backgrounds for their websites or applications. It offers a diverse range of customizable patterns and shapes that can be combined and adjusted to create intricate and eye-catching backgrounds. With Haikei, designers can quickly generate high-quality backgrounds without the need for complex design software or manual coding.
**4. Loading Backgrounds**
Loading is a typical situation to use animation, but never the least. With loading.io, making animation becomes so easy that you will probably want to animate everything that can be animated.
With semantic animations and our dedicated online editor, loading.io helps you quickly customize and generate your own animations without worrying about the complex timeline thing. Furthermore, animations are provided in various formats so it won’t be a problem to use them in different platforms or framworks.
**5. Smooth Shadow Generator**
Shadows.brumm.af is a web-based tool created by Philipp Brumm that allows designers and developers to easily generate CSS code for dynamic shadows. It provides a simple and intuitive interface for creating custom shadow effects that can be applied to various elements on a web page. With Shadows.brumm.af, designers can quickly experiment with different shadow configurations and export the corresponding CSS code for use in their projects.
Hope this will definitely help you improve you web development game and please do share this article as much as you can that will really motivate me for writing more such articles. | amanagnihotri |
1,873,488 | เริ่มต้น Quarkus 3 part 1 | blog นี้จะพาเรียนรู้ quarkus step by step เพราะว่าการเริ่มต้น Quarkus มันมีหลาย plugin... | 0 | 2024-06-02T06:55:51 | https://dev.to/pramoth/erimtn-quarkus-3-part-1-ane | quarkus | blog นี้จะพาเรียนรู้ quarkus step by step เพราะว่าการเริ่มต้น Quarkus มันมีหลาย plugin มากทำให้คนที่เริ่มเรียนจับต้นชนปลายยาก ผมจึงจะจะเอามาเรียบเรียง เริ่มทำตั้งแต่เริ่มต้น โดยเราจะทำ web app ที่ render ด้วย server side โดยใช้ Qute template engine หน้าบ้านใช้ HTMX,AlpineJS
1. Rest
2. web (static,server side rendering)
- Qute
- web bundler
- Renarde
3. hibernate orm
ทีมผมใช้ Spring boot เป็นหลัก แต่ในปีนี้เรามีบางส่วนจะย้ายมา Quarkus เพราะว่าเราต้องการ dev ที่เร็วซึ่ง quarkus มำ livereload ได้ดีมากๆอารมร์เหมือนเขียนพวก dynamic lang เลย
อีกประเด็นที่เราเลือก Quarkus ก็คือ เราต้องการใช้ server side renderer เราจึงต้องการ template engine แต่เราต้องการ template engine ที่ **typesafety** เมื่อหาอยู่นาน java template engine ที่ typesafe ก็จะมีแค่ jsp และ qute เท่านั้น
ส่วนเรื่อง performance ของ Quarkus ที่ดีกว่า boot นั้นไม่ได้เป็นจุดที่เราเลือก เพราะว่ามันไม่ได้สำคัญในแง่มากใน enterprise app ที่เราทำไป optimize หลังบ้านให้ดีๆ ดีกว่า แต่ก็ถือว่าดีที่ได้ความเร็วเพิ่มมา
##Intro
Quarkus จะต่างจาก boot ตรงที่มันจะทำการ**build**หรือประกอบร่าง bean ต่างๆตอน build เช่น แทนที่จะ scan หา annotation `@Entity` ตอน start app มันก็หาตอน build แล้วเตียม code ที่ setup EntityManager ให้เลยตอนรันก็พร้อมใช้เลย ข้อดีทำให้ start เร็วและสามารถขจัดโค๊ดที่ไม่ได้ใช้ และยังเป็นการเตรียมพร้อมกับการทำ native image ได้ด้วย(เพราะ build image ต้องการรู้ว่าจะใช้ควาสไหนตอน build เช่นกัน)
## Part1 Rest
หลังจากติดตั้ง quarkus CLI แล้ว ก็เริ่มใช้สร้าง project เลยครับโดยใช้คำสั่ง
`quarkus create app th.co.geniustree.quarkus:demo1 -P 3.11.0`
`quarkus create` จะใช้สร้าง project โดยโปรเจคจะมี 3 แบบ app,extension,cli เราจะสร้างเวบแอพ เราเลือก app (ส่วน extension สำหรับคนที่จะทำปลั๊กอิน quarkus เด๋วเราจะมีทำในขั้น advance) สำหรับ cli ก็ตามชื่อเลย ส่วน `-P 3.11.0` จะบกว่าเราจะใช้ quarkus platform version อะไร (เครื่องผม quarkus cli เจน version เก่าให้ตลอด)
เราจะได้ project maven ที่มี Rest controller มาให้ Quarkus จะใช้ microprofile api ซึ่งเป็น subset ของ JakataEE แทน spring
```java
@Path("/hello")
public class GreetingResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "Hello from Quarkus REST";
}
}
```
เราสารถรันใน dev โหมดโดย `quarkus dev` แล้วลองเข้า http://localhost:8080 จะเห็น devUI ของ Quarkus ซึ่งมี rest endpoint /hello อยู่

ให้ทดลองแก้โค๊ด แล้วยิง rest ใหม่ มันจะ auto reload ให้ความรู้สึกฟินมากๆ
อ้างอิง
https://quarkus.io/get-started/
**Part2** https://dev.to/pramoth/erimtn-quarkus-3-part-2-web-4bkm
| pramoth |
1,871,658 | Rebuilding TensorFlow 2.8.4 on Ubuntu 22.04 to patch vulnerabilities | Table of contents: Context My process Summary of method & results TLDR: DeepCell + ... | 27,298 | 2024-06-02T06:55:16 | https://dev.to/dchaley/rebuilding-tensorflow-284-on-ubuntu-2204-to-patch-vulnerabilities-3j3m | docker, tensorflow, ai, security | Table of contents:
1. Context
2. My process
3. Summary of method & results
TLDR:
| | DeepCell + tensorflow-2.8.4 | DeepCell + tensorflow-2.8.4-redux | Delta |
| ------ | --- | --- | --- |
| **Compressed size** | 3.2GB | 4.0 GB | **+0.8 GB (+25%)** |
| **VULNs** | 553 | 125 | **-428 (-77%)** |
| Critical | 1 | 1 | 0 (0%) |
| High | 80 | 29 | -51 (-63%) |
| Medium | 349 | 53 | -296 (-85%) |
| Low | 123 | 42 | -81 (-66%) |
Read on for the how, why, wherefore, and finally.
## Context & motivation
Previously we [switched](https://dev.to/dchaley/container-size-analysis-tensorflow-28-base-image-vs-deep-learning-4dbj) from the DeepLearning container to the base TensorFlow container.
Unfortunately the container has 553 security of vulnerabilities according to Google's scanner:

The 553 issues break down this way:
- 1 critical [[vuln](https://github.com/advisories/GHSA-gw97-ff7c-9v96)]
- 80 high
- 349 medium
- 123 low
The [official 2.8.4 container](https://hub.docker.com/layers/tensorflow/tensorflow/2.8.4-gpu/images/sha256-4351b59baf4887bcf47eb78b34267786f40460a81fef03c9b9f58e7d58f1c7b7?context=explore) was published in Nov 2022. That's 1.5 years of OS updates **at least**. I looked up the [2.8.4 source](https://github.com/tensorflow/tensorflow/tree/v2.8.4) and found that it's [using Ubuntu 20.04](https://github.com/tensorflow/tensorflow/blob/v2.8.4/tensorflow/tools/dockerfiles/partials/ubuntu/version.partial.Dockerfile) as the base OS. Of note, we're using the x86_64 architecture according to the container image layer: `ENV NVARCH=x86_64`.
So the obvious thing to do is to switch to the most recent Ubuntu version 24.04 right? Well no, that's a short party: NVIDIA doesn't have CUDA packages for 24.04 in their [repository](https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/). So it's off to 22.04 – still two years more recent, and more importantly with [CUDA packages](https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/).
## My process, as I did it
I wouldn't do it this way again, but this is how I did it.
### Updating the base Ubuntu image + dependencies.
First, I forked the tensorflow repository. I did a master-only clone so I needed to fetch the tag information after clone. Then, I could reset to the 2.8.4 version.
```bash
# Add upstream branch.
git remote add upstream https://github.com/tensorflow/tensorflow.git
git fetch upstream
# Reset master branch to 2.8.4
git checkout master
git reset --hard v2.8.4
git push --force
# Clean out local copy (everything after 2.8.4)
git gc
```
Then, I updated the build steps. Here's what I did, following the instructions in the [containers readme](https://github.com/dchaley/tensorflow-2.8.4-redux/blob/master/tensorflow/tools/dockerfiles/README.md).
**1\. Build the `tf-tools` build tools container:**
```bash
cd tensorflow/tools/dockerfiles
docker build -t tf-tools -f tools.Dockerfile .
```
**2\. Set up aliases:**
```bash
alias asm_dockerfiles="docker run --rm -u $(id -u):$(id -g) -v $(pwd):/tf tf-tools python3 assembler.py "
alias asm_images="docker run --rm -v $(pwd):/tf -v /var/run/docker.sock:/var/run/docker.sock tf-tools python3 assembler.py "
```
**3\. Update build settings.** I started with changing the file `partials/ubuntu/version.partial.Dockerfile` to use Ubuntu 22.04.
**4\. Regenerate the dockerfiles.**
```bash
asm_dockerfiles --release dockerfiles --construct_dockerfiles
```
**5\. Rebuild the desired TF-2.8 image.** This builds a container tagged with the `2.8.4-rebuilt` version, which causes the build system to tag the GPU-accelerated container `2.8.4-rebuilt-gpu`.
```bash
asm_images --release versioned --arg _TAG_PREFIX=2.8.4-rebuilt --build_images --only_tags_matching="^2.8.4-rebuilt-gpu$"
```
**6\. Done, or need to fix.** Fix build errors & loop to step 3.
#### Dependency updates
Following this process here's what I [fixed at first](https://github.com/dchaley/tensorflow-2.8.4-redux/commit/7249644d7188d9512986781bd150a1be1af7b87f):
* Downgrade requests & urllib libraries (see [github bug](https://github.com/docker/docker-py/issues/3256))
* Update base Ubuntu to 22.04.
* Update CUDA from 11.2.1 to 11.8.0
* Parameterize CUDA patch level (to support `.0` instead of `.1`)
* Update CUDNN from `8.1.0.77-1` to `8.6.0.163-1`
* Update `libvinfer` from `7.2.2-1` to `8.5.3-1`.
* I didn't love the major version update. But things seem fine.
At this point the container built, and I could run DeepCell. It output a segmentation image that seems plausible.
However a new error message popped up in the logs…
```
2024-05-28 19:38:34.423093: W tensorflow/stream_executor/gpu/asm_compiler.cc:80] Couldn't get ptxas version string: INTERNAL: Couldn't invoke ptxas --version
2024-05-28 19:38:34.423903: I tensorflow/core/platform/default/subprocess.cc:304] Start cannot spawn child process: No such file or directory
2024-05-28 19:38:34.424006: W tensorflow/stream_executor/gpu/redzone_allocator.cc:314] INTERNAL: Failed to launch ptxas
Relying on driver to perform ptx compilation.
Modify $PATH to customize ptxas location.
This message will be only logged once.
```
Is this an error? Is it a problem to rely on the driver? I don't know, but I wanted to clear out the error.
#### Finding ptxas
I found a [GitHub issue](https://github.com/google/jax/discussions/6843) that seemed similar (missing ptxas) and saw a suggestion to install nvidia-cuda-toolkit. Alright: but that exploded the container size from 6.5 GB to 12.13 GB … unacceptable 😤 (Incidentally, this is too large for Cloud Shell to build on its limited persistent disk.)

At this point I struggled for a couple hours. The `nvidia-cuda-toolkit` [package info](https://packages.ubuntu.com/jammy/nvidia-cuda-toolkit) says it uses CUDA 11.5. But the [prebuilt containers](https://hub.docker.com/r/nvidia/cuda/tags?page=1&page_size=100&name=ubuntu22.04&ordering=) had 11.7 and 11.8 not 11.5 (I'd previously selected 11.8). The 11.5 packages weren't available in NVIDIA's [Ubuntu 22.04 package repo](https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/).
Along the way, I [switched the base container](https://github.com/dchaley/tensorflow-2.8.4-redux/commit/ad79db46b6504c06aa42b03b65c1ba8afd99d7b6) from NVIDIA's [`nvidia/cuda:11.8.0-base-ubuntu22.04`](https://hub.docker.com/layers/nvidia/cuda/11.8.0-base-ubuntu22.04/images/sha256-942f9a2455c62479908e6e6b7fc0eeff38a6daac2f67a0410594e0a04d688db0?context=explore) to [`nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04`](https://hub.docker.com/layers/nvidia/cuda/11.8.0-cudnn8-runtime-ubuntu22.04/images/sha256-8e6794c967a86219264f3ef770036fd7da4f6adcdc0d145074dcd61b2405fda4?context=explore). Rather than pick the versions myself, I figured going with an official NVIDIA container with the files I was installing anyhow made sense.
I eventually found this "[ptxas version issue](https://github.com/google/jax/discussions/10327)" linked from a [TensorFlow discussion](https://discuss.tensorflow.org/t/should-i-worry-about-this-warning-while-training-a-tensorflow-lite-object-detection-model-will-it-affect-my-training/24143) asking whether to worry about a version mismatch warning. Not the same as our message that it's missing, but close enough.
This part caught my eye:
```
You may not need to update to CUDA 11.1; cherry-picking the ptxas binary is often sufficient.
```
Interesting idea. I cherry-picked the binary by launching a container from the rebuilt image, and installing the very large `nvidia-cuda-toolkit`:
```bash
apt-get install nvidia-cuda-toolkit
Need to get 1603 MB of archives.
After this operation, 4505 MB of additional disk space will be used.
Do you want to continue? [Y/n]
```
Gulp. One very long download later, I had a ptxas binary.
```
root@33eda96a19a0:/# which ptxas
/usr/bin/ptxas
```
Now to copy it back to the host, so I can add it to the redux repo for direct insertion into the container. Back on the host:
```
docker cp 33eda96a19a0:/usr/bin/ptxas .
```
Then I [installed it](https://github.com/dchaley/tensorflow-2.8.4-redux/commit/a9ff10438e92d2fd916fee56323922c71cff1bfe) into `/usr/bin/ptxas` in the dockerfile.
Lo and behold: no more ptxas error when running DeepCell.
-----
## Summary
The container was rebuilt by:
- Forking TensorFlow 2.8.4 from source.
- Switching to the `nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04` base image.
- Cherry-picking ptxas from `nvidia-cuda-toolkit` (avoids ~4GB unnecessary files).
The container rebuild yielded these changes:
| | DeepCell + tensorflow-2.8.4 | DeepCell + tensorflow-2.8.4-redux | Delta |
| ------ | --- | --- | --- |
| **Compressed size** | 3.2GB | 4.0 GB | **+0.8 GB (+25%)** |
| **VULNs** | 553 | 125 | **-428 (-77%)** |
| Critical | 1 | 1 | 0 (0%) |
| High | 80 | 29 | -51 (-63%) |
| Medium | 349 | 53 | -296 (-85%) |
| Low | 123 | 42 | -81 (-66%) |
It's too bad we added 25% to the container size. This may be because I [moved away](https://github.com/dchaley/tensorflow-2.8.4-redux/commit/ad79db46b6504c06aa42b03b65c1ba8afd99d7b6) from the TensorFlow container build's selective dependencies to the full runtime package.
Still, 77% reduction in VULNs (and 63% for the highs) is very good.
The [critical VULN]([[vuln](https://github.com/advisories/GHSA-gw97-ff7c-9v96)]) is in TensorFlow pre 2.11.1. It allows malicious users running custom TensorFlow python code to access memory that's not theirs in some cases. Since we're running our own Python code, and DeepCell's, we're safe as long as nobody sticks in naughty code in those layers. But, we're also stuck with 2.8.4 and can't upgrade to 2.11 so the rationalization is rationalized.
If I were to do it again, I'd skip hand-picking library versions & move straight to an official NVIDIA runtime container.
-----
## Appendix
Helpful command to get into the TF container shell to poke around for files:
```
docker run --user $(id -u):$(id -g) -it -v $(pwd):/tf tensorflow:2.8.4-rebuilt-gpu bash
```
I ran out of disk space on cloud shell a few times. Clear out the docker cache like so:
> ⚠️ Don't run these as-is if you have other containers/images you want to keep!
```bash
docker system prune
# Delete the previously build image
# (make room for new one)
docker image rm tensorflow:2.8.4-rebuilt-gpu
```
In the end, Cloud Shell (which has a limited disk) became a hassle for iterating on builds. I considered a [Cloud Workstation](https://cloud.google.com/workstations/docs/create-workstation) however there's a fixed $0.20/hr cost whether or not you have a workstation running … and I really just need a place to run Docker with disk space, so I used my local computer (a mac). The downloads weren't as fast as on cloud, but hey.
Side note: I'm super impressed with how easy it was to rebuild TF from source. Nice job y'all 🤩
Tools used in the rebuild:
* GCP Cloud Shell
* GCP Artifact Registry container scanner
* Docker (local + cloud shell)
* git & GitHub
* TensorFlow
* apt-file (to look up which package installed a file) | dchaley |
1,873,496 | Jiu Jitsu School in Hutto | Am I Too Old to Get Adult Jiu Jitsu Classes in Hutto? Age is merely more than a few, specifically... | 0 | 2024-06-02T06:50:14 | https://dev.to/pragmajiu08/jiu-jitsu-school-in-hutto-1j9d | Am I Too Old to Get Adult Jiu Jitsu Classes in Hutto?
Age is merely more than a few, specifically whilst mastering something as invigorating as Brazilian Jiu Jitsu! This martial art shape, blended with self-defense strategies and bodily conditioning, isn’t just for the younger and spry— it’s a journey open to every person, even those questioning if they could have missed the beginning gun.
Fear no longer. As the antique saying goes, the excellent time to start become the day prior to this; the subsequent great time is now! So, permit’s discover why venturing into Adult Jiu Jitsu Classes in Hutto might be a recreation-changer for you, no matter the wide variety of candles for your last birthday cake!
Age is Just a Number for Brazilian Jiu-Jitsu As Long As You Don’t Have Any Physical Issues:
The age diversity in Jiu Jitsu is phenomenal, catering to a wide age bracket, from the ones in their 30s to people in their 40s, 50s, and even those brimming with energy of their 60s, 70s, 80s, and 90s.
Why?
Because Brazilian Jiu-Jitsu, or BJJ as it’s fondly regarded, is less approximately brute electricity and greater about method, approach, and leverage. This approach it’s on hand to humans of all ages so long as they're physically match and capable.
**_[Jiu Jitsu School in Hutto](https://www.pragmajiujitsu.com/jiu-jitsu-school-in-hutto/)_**
The Grand Master Carlos Gracie Example
Ever heard of Grand Master Carlos Gracie? He’s the stuff of legends in the martial arts world and has an entirely inspiring tale. Practicing martial arts till he turned into 92, he’s a testomony to the pronouncing, “Age is simply a number of.”
His determination to Brazilian Jiu-Jitsu became unwavering, and he proven that no matter age, with passion and perseverance, anything is workable.
Anthony Bourdain’s Journey in Brazilian Jiu-Jitsu
Let’s talk about a celebrity who located his martial arts stride later in lifestyles — the overdue chef Anthony Bourdain. Known global for his culinary competencies and tour shows, he took up Brazilian Jiu-Jitsu on the age of 58. Yes, you read that proper, fifty-8!
Bourdain didn’t simply dabble in Brazilian Jiu Jitsu Classes. He fully immersed himself, often schooling seven days per week. He even earned his blue belt, a huge achievement within the world of BJJ, proving that it’s usually possible to research, develop, and succeed in a new endeavor.
So, if you’re annoying approximately your age, consider Bourdain. His journey is an inspiring testament to the truth that age does no longer define what we are able to or can't do.
Remember, age is simply quite a number with regards to Brazilian Jiu-Jitsu. As lengthy as you don’t have any fundamental physical problems, there’s no motive why you can’t be part of the ranks of BJJ lovers in Hutto.
But Doesn’t Recovery After Training Take Longer for Older Age People?
Dealing with Current and Previous Injuries
Our grownup Jiu Jitsu classes in Hutto keep in mind the unique care that needs to be taken for older-elderly freshmen. Just because your body has been thru some battles, it doesn’t imply you need to take a seat on the sidelines. In fact, Brazilian Jiu Jitsu is an tremendous manner to enhance and preserve your bodily fitness, even if you’ve had previous injuries or fitness issues.
Let’s take, for example, a 50-12 months-vintage individual with an antique knee damage. This person can still take part in lessons because the teachers are nicely-trained to tailor the program to suit man or woman desires. They can modify sure actions, strategies, or drills to ensure they’re safe and effective for this man or woman at the same time as still letting them research and revel in the art of Brazilian Jiu Jitsu.
Listening to Your Body
One of the most important elements of restoration, specifically for the ones within the older age bracket, is to pay attention for your frame. If some thing doesn’t feel proper at some point of or after schooling, it’s important to take it smooth and permit your frame heal.
This would possibly mean choosing a lighter schooling consultation or taking an additional rest day. Remember, it’s no longer a race. The purpose of Brazilian Jiu Jitsu Classes in Hutto is to foster a lifelong ardour for the martial arts, no longer to push you to the point of damage.
Giving Time for Adequate Recovery
Yes, it’s genuine that as we age, our our bodies would possibly take a bit longer to recover after a exercising. But this doesn’t suggest older people can’t participate in Brazilian Jiu Jitsu. It definitely approach that recuperation desires to be factored into your training agenda.
For instance, if a forty-12 months-vintage guy starts offevolved schooling in Brazilian Jiu Jitsu, he might find that he's sore for an afternoon or after every consultation. That’s flawlessly regular. Instead of training every day, he would possibly train each different day, giving his body a danger to relaxation and get better in between.
Health and Recovery in BJJ Training
Regardless of the age institution, it’s crucial to control fitness and recuperation in BJJ training. Instructors frequently assist put together a plan that fits an person’s physical competencies.
For example, if someone experiences muscle pain after an afternoon of training, teachers may suggest rest days, stretching sporting events, or maybe therapeutic massages. This ensures that you will keep enjoying Brazilian Jiu Jitsu classes in Hutto without risking their fitness.
Remember, BJJ is a lifelong journey. It’s not approximately how speedy you could get a black belt however how plenty you experience the procedure and develop along the way.
Types and Levels of BJJ Training Offered for Different Age Groups
Kids (3-12):
Training for youngsters on this age group is normally tailor-made to be fun and tasty even as still coaching the fundamentals of Brazilian Jiu Jitsu. Kids Jiu Jitsu Classes in Hutto introduce young ones to the sport thru playful sports that mirror real BJJ techniques.
For example, a commonplace game involves trying to maintain balance at the same time as any other child tries to push them over, mimicking the grappling and stability strategies utilized in real fits.
Statistics display that kids who have interaction in martial arts have progressed cardiorespiratory health, speed, agility, flexibility, electricity, coordination, and balance. So, no longer only will your toddlers have fun, but they’ll also be gaining knowledge of essential life skills!
Teens (thirteen-19 years)
At this age, teenagers are usually brought to novice Brazilian Jiu Jitsu training in Hutto. These instructions basically cognizance on presenting fundamental strategies and enhancing fitness levels. It’s additionally an first rate time to instill subject in younger minds, paving the manner for a extra structured lifestyle.
For instance, a standard elegance might contain getting to know a simple shield bypass or a fundamental submission maintain. Teens also get to practice drills, which help enhance their cardio, power, and agility.
Young Adults (20-30 years)
As a younger grownup, training can range from novice to advanced ranges. This in large part relies upon on an individual’s preceding revel in, fitness, and talent level. For example, a person who has been training since their teenage years may be at a greater advanced degree compared to a entire amateur.
Adult Jiu Jitsu training in Hutto frequently encompass a selection of strategies, from basic sweeps and submissions to more complex ones. They additionally involve rigorous bodily training to improve persistence, strength, and versatility.Am I Too Old to Get Adult Jiu Jitsu Classes in Hutto?
Adults (31-40 years)
For adults on this age group, amateur, intermediate, and advanced schooling are usually provided. Those continually practicing BJJ can also have possibilities for more intense education and competitive sparring.
For example, a 35-year-vintage who has been training for a decade might be equipped for a black belt magnificence, in which they can learn superior techniques and techniques.
It’s also essential to keep in mind that this age organization may have sure physical constraints or health problems. Hence, it’s important to pay attention to frame signals and allow for adequate restoration.
Middle Age (forty one-50 years)
At this level, education often consists of beginner and intermediate stages. The classes are designed to hold bodily fitness and intellectual agility.
There may be possibilities for superior education or opposition depending on bodily health and experience.
Seniors (51-60 years)
Don’t permit the age organization fool you! BJJ lessons for seniors are just as attractive and beneficial. Often, these classes emphasize health, flexibility, and self-protection.
The schooling is usually changed to admire the bodily obstacles of the age institution, however don’t assume for a 2d that it’s any less hard or rewarding! Adult Jiu Jitsu Classes in Hutto frequently contain factors of aerobic and anaerobic exercising, that have been confirmed to lower the danger of coronary heart disease and enhance standard fitness.
For example, a category might involve a heat-up with aerobic sports, observed through technique drills and then associate paintings, in which students exercise the techniques on every different.
Late Seniors (sixty one-70 years)
Even to your sixties and seventies, it’s in no way too past due to begin getting to know BJJ! At this age organization, training is typically centered on mild techniques, fitness, and, most importantly – amusing. Adult Brazilian Jiu Jitsu Classes in Hutto for late seniors are often amateur-focused, with additional protection precautions to defend college students from injuries.
For instance, training might also contain extra groundwork, disposing of the danger of falls from status positions. Techniques can also be practiced in slow movement to make certain every move is executed effectively and effectively.
Elderly (71-80 years)
For our golden-elderly pals, maximum gyms provide mild training centered on fitness, flexibility, and basic self-defense techniques. While BJJ may be physically stressful, the adaptability of the sport lets in for adjustments to healthy any age or physical situation.
For instance, an ordinary elegance may involve stretching physical games, mild aerobic to get the blood flowing, after which some basic BJJ strategies practiced at a gentle pace. The aim isn't to emerge as a world champion however to stay lively, have amusing, and research a few self-protection alongside the way.
Older Elderly (81-ninety years)
It’s by no means too past due to start some thing new, and Brazilian Jiu-Jitsu (BJJ) is no exception. For our older individuals, in particular those aged eighty one-ninety years, we provide a unique form of Adult Jiu Jitsu Classes in Hutto. These instructions are designed to be mild and gentle, that specialize in retaining mobility and versatility.
In these lessons, the emphasis is on something aside from competition or physical prowess. Rather, we aim to foster a experience of network and camaraderie. Many of our older individuals locate these classes to be a brilliant manner to socialize and keep an energetic lifestyle.
In terms of specifics, this might appear like practicing soft rolling, a shape of sparring that emphasizes technique over strength. Techniques which include the “upa” or bridge get away are beneficial for preserving mobility and may be without problems changed to accommodate any physical barriers.
Very Elderly (ninety+ years)
When it comes to supplying Adult Jiu Jitsu Classes in Hutto for our very elderly individuals (90+ years), we take a quite individualized approach. At this age, BJJ training is exceedingly light and recreational. The benefits consist of mobility physical games, basic strategies, and a welcoming social surroundings.
For example, a member on this age institution might take part in a category wherein they practice seated self-defense techniques. This may be a fun and attractive manner to maintain each the thoughts and frame active.
The training is likewise exceptionally customizable to the character’s bodily capability. We recognize that everyone’s health stage and capability are distinctive. So, whether or not it’s practising stability sports or easy stretches, we make certain every body can take part competently and simply. | pragmajiu08 | |
1,873,494 | Length of slope calculator | In construction and landscaping, accurately calculating the slope length is crucial for projects... | 0 | 2024-06-02T06:47:53 | https://dev.to/robyngknapp/length-of-slope-calculator-ngk | In construction and landscaping, accurately calculating the slope length is crucial for projects involving inclined surfaces, such as ramps, driveways, or hillside terraces. The [length of slope calculator](https://lengthcalculators.com/length-of-slope-calculator/) assists by providing precise measurements based on the rise and run of the slope. By entering the vertical rise and horizontal run, the calculator computes the length of the slope, ensuring proper design and compliance with safety standards. This tool is indispensable for architects, engineers, and DIY enthusiasts, helping to create functional and aesthetically pleasing inclined structures. | robyngknapp | |
1,855,070 | How to Commit Multiline Messages in git commit | As developers, when using Git to commit code to a remote repository, we need to write information... | 0 | 2024-06-02T06:44:39 | https://webdeveloper.beehiiv.com/p/commit-multiline-messages-git-commit | git, webdev, programming, javascript | As developers, when using Git to commit code to a remote repository, we need to write information about this modification. On the command line, we use the `git commit` command, such as `git commit -m` which allows you to add a line of information. But sometimes a multi-line message with a title and a specific description may be more indicative of your intent, such as the following:
```txt
Commit Title: Briefly describe what I changed
Commit Description: Detailed instructions for changing it
```
So how to achieve this?
* * *
### 1. Use a text editor
Use `git commit` without the `-m` or `git commit -v`, which will take you to a text editor. So then you can add multiple lines of text using your favorite text editor.
### 2. Multiple `-m` options
If you don’t want to see wordy diffs, you can use multiple `-m` options. Just like this:
```txt
$ git commit -m "Commit Title" -m "Commit Description"
```
This is because if multiple `-m` options are given, their values will be concatenated into separate paragraphs, which can be found in the [git documentation](https://git-scm.com/docs/git-commit?utm_source=webdeveloper.beehiiv.com&utm_medium=newsletter&utm_campaign=how-to-commit-multiline-messages-in-git-commit#Documentation/git-commit.txt--mltmsggt).
Next `git log` will look like this:
```txt
$ git log
commit 1e8ec2c4e820fbf8045b1c7af9f1f4f23262f755
Author: Your Name you@example.com
Date: Sat Sep 24 20:18:15 2022 -0700
Commit Title
Commit Description
```
### 3. Open quotes, press Enter
Another easier way is to type `git commit -m "` and hit `Enter` to enter the multiline, and use closing quotes when closing. This looks like this:
```txt
$ git commit -m "
> Commit Title
> Commit Description"
```
Next `git log` will look like this:
```txt
$ git log
commit 7d75a73e41b578a1e2130372a88a20ed1a0a81e4
Author: Your Name you@example.com
Date: Sat Sep 24 20:22:02 2022 -0700
Commit Title
Commit Description
```
### 4. Shell Environment Variables
Don’t forget that you can define environment variables in the shell, for example, you can define temporary environment variables with newlines:
```txt
$ msg="
> Commit Title
> Commit Description"
# or
$ msg="$(printf "Commit Title\nCommit Description")"
```
Next, you can:
```txt
$ git commit -m "$msg"
```
That’s it, `git log` will output:
```txt
$ git log
commit 056e35c37d199c0f3904e47d2107140267608c4a
Author: Your Name you@example.com
Date: Sat Sep 24 20:42:11 2022 -0700
Commit Title
Commit Description
```
### 5. Use the `-F` option
Introduction from the [documentation](https://git-scm.com/docs/git-commit?utm_source=webdeveloper.beehiiv.com&utm_medium=newsletter&utm_campaign=how-to-commit-multiline-messages-in-git-commit#Documentation/git-commit.txt--Fltfilegt):
> -F <file>
> — file=<file>
> Take the commit message from the given file. Use ` -` to read the message from the standard input.
So you can write a multi-line message in a temporary file before committing. Like the following:
```txt
$ printf "Commit Title\nCommit Description" > "temp.txt"
$ git commit -F "temp.txt"
```
Or use standard input instead of temporary files:
```txt
$ printf "Commit Title\nCommit Description" | git commit -F-
```
### Conclusion
Here are a few methods I saw, you can choose one of them according to your preference. If you have other ways, feel free to share.
*If you find this helpful, [**please consider subscribing**](https://webdeveloper.beehiiv.com/) to my newsletter for more insights on web development. Thank you for reading!* | zacharylee |
1,873,493 | Why RRMALL is the Best Place for Premium Quality Replicas at Wholesale Rates | 도매 가격으로 프리미엄 품질의 복제품을 찾는 것은 종종 건초 더미에서 바늘을 찾는 것처럼 느껴질 수 있습니다. 하지만 RRMALL은 최고의 복제품을 파격적인 가격에 제공하면서 시장의... | 0 | 2024-06-02T06:34:49 | https://dev.to/replica-shopping-mall/why-rrmall-is-the-best-place-for-premium-quality-replicas-at-wholesale-rates-31fh |
도매 가격으로 프리미엄 품질의 복제품을 찾는 것은 종종 건초 더미에서 바늘을 찾는 것처럼 느껴질 수 있습니다. 하지만 RRMALL은 최고의 복제품을 파격적인 가격에 제공하면서 시장의 판도를 바꾸는 업체로 부상했습니다. 공장과의 직거래를 활용하여 탁월한 품질과 경제성을 보장합니다. 이 글에서는 RRMALL이 프리미엄 품질의 복제품을 도매가로 구매할 수 있는 최고의 장소인 이유를 살펴봅니다.
## 광범위한 제품 범위
RRMALL은 다양한 고객 취향에 맞는 다양한 [레플리카](https://rrmall02.com) 제품을 제공합니다. 하이패션 의류와 액세서리부터 첨단 전자제품까지 모두를 위한 제품이 있습니다. 광범위한 제품군을 통해 쇼핑객은 스타일, 성능, 경제성을 완벽하게 결합하여 필요한 제품을 정확하게 찾을 수 있습니다.
## 공장 직거래: 전략적 이점
RRMALL의 비즈니스 모델은 공장과의 직거래를 중심으로 운영되며, 이는 가격 경쟁력의 핵심 요소입니다. 중개인을 배제함으로써 비용을 크게 절감하고 이러한 절감액을 고객에게 직접 전달합니다. 이 전략은 가격을 낮출 뿐만 아니라 제공되는 제품의 무결성과 품질도 유지합니다.
## 우수한 품질에 대한 약속
복제품을 구매할 때 품질은 종종 주요 관심사입니다. RRMALL은 우수한 장인 정신과 소재를 우선시하여 이 문제를 해결합니다. 각 제품은 외관과 기능 모두에서 원본을 재현하도록 세심하게 설계되었습니다. 패션, 액세서리, 전자제품 등 RRMALL의 제품은 높은 기준을 충족하여 고객에게 원본과 거의 동일한 복제품을 제공합니다.
## 타의 추종을 불허하는 도매 가격
경제성은 RRMALL의 사명의 핵심입니다. 공장에서 직접 제품을 소싱함으로써 RRMALL은 시장에서 가장 경쟁력 있는 가격을 유지할 수 있습니다. 이러한 접근 방식을 통해 고객은 품질 저하 없이 탁월한 가치를 누릴 수 있으며, RRMALL은 예산에 민감한 쇼핑객이 자주 찾는 곳이 되었습니다.
## 고객 만족에 집중
고객 만족을 위한 RRMALL의 노력은 비즈니스의 모든 측면에서 분명하게 드러납니다. 고품질 복제품을 도매가로 제공하는 데 주력한 결과 충성도 높은 고객층을 확보할 수 있었습니다. 광범위한 제품 범위 탐색의 용이성부터 구매의 편리함까지, RRMALL은 원활하고 만족스러운 쇼핑 경험을 보장합니다.
## 결론
품질과 가격의 균형을 맞추기 어려운 시장에서 RRMALL은 우수성의 신호등으로 돋보입니다. 공장 직거래를 통해 프리미엄 품질의 복제품을 도매가로 제공하는 RRMALL은 고객에게 탁월한 가치를 제공합니다. RRMALL이 프리미엄 품질의 복제품을 도매가로 구매할 수 있는 최고의 장소인 이유를 알아보고 합리적인 가격과 탁월한 품질이 만나는 쇼핑 경험을 즐겨보세요.
| replica-shopping-mall | |
1,873,492 | Maximizing the 1 bits | Weekly Challenge 271 Each week Mohammad S. Anwar sends out The Weekly Challenge, a chance... | 0 | 2024-06-02T06:32:00 | https://dev.to/simongreennet/maximizing-the-1-bits-m8a | perl, python, theweeklychallenge, githubcopilot | ## Weekly Challenge 271
Each week Mohammad S. Anwar sends out [The Weekly Challenge](https://theweeklychallenge.org/), a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. It's a great way for us all to practice some coding.
[Challenge](https://theweeklychallenge.org/blog/perl-weekly-challenge-271/), [My solutions](https://github.com/manwar/perlweeklychallenge-club/tree/master/challenge-271/sgreen)
## Task 1: Maximum Ones
### Task
You are given a `m x n` binary matrix.
Write a script to return the row number containing maximum ones, in case of more than one rows then return smallest row number.
### My solution
For this task, I use two values, both initialized with `0`. The `max_count` variable stores the number of ones in the matching row, while the `max_row` variable stores the (0-based) row number.
I then iterate over each row in the matrix. If the number of ones (calculated by summing the row) is greater than `max_count`, then I update the `max_count` and `max_row` values.
Finally, I return the (1-based) row number by adding one to `max_row`.
```python
def maximum_ones(matrix: list) -> int:
rows = len(matrix)
max_row = 0
max_count = 0
for row in range(rows):
if sum(matrix[row]) > max_count:
max_row = row
max_count = sum(matrix[row])
return max_row + 1
```
### Examples
```bash
$ ./ch-1.py "[[0, 1],[1, 0]]"
1
$ ./ch-1.py "[[0, 0, 0],[1, 0, 1]]"
2
$ ./ch-1.py "[[0, 0],[1, 1],[0, 0]]"
2
```
## Task 2: Sort by 1 bits
### Task
You are give an array of integers, `@ints`.
Write a script to sort the integers in ascending order by the number of 1 bits in their binary representation. In case more than one integers have the same number of 1 bits then sort them in ascending order.
### Hello Copilot
Bit of a tangent on my commentary of this task. I've always been a late adopter to new technology, very much of the thinking "if it ain't broke, don't fix it". I still spell 'Internet' and 'e-mail' like we did in the 90s.
Until three years ago, vim was my primary code editor, and I still don't have a ChatGPT account. I prefer my answers from websites I know have the right information, like python.org, stack overflow, and a few others.
However, my day job is giving us all access to Github Copilot, and I'm the guinea pig for our team. So I installed the extension in VS Code, and was immediately blown away. Typed "CREATE TABLE foo_bar (", and it automatically knew what to do (three columns: id, foo_id and bar_id, foreign keys, etc). I'm converted overnight.
Having said that, I'm only using Copilot to write things I already know what I want. It's just saving me a lot of key presses in doing it. And likely reducing the chance of errors.
So back to this task. I already knew what the Python solution looked like. As usual, I have function definition "def sort_by_1_bits(ints: list) -> list:" and started typing "sorted_ints =". Low and behold Copilot has already written the rest for me.
Then it came to writing the doc string. Up until now, I've used the [autoDocString](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring) extension to write the boiler plate doc string, and filled in the blanks. This week Copilot did the whole thing, with only a few modifications by me.
Copilot didn't do the Perl solution by itself. It definitely did a few things, but still required some manual changes. Guess Copilot isn't as good as Perl as it is in Python. :)
My take-away from the first week of using Copilot is that it is great, but you still need to understand what it is doing rather than just blindly trusting its output.
### My solution
This is a one liner in Python:
```python
sorted_ints = sorted(ints, key=lambda x: (bin(x).count('1'), x))
```
The `bin` function converts an integer into a string of `0b` followed by the binary representation. The `count` function (as the name suggests) counts the occurrences of that value in an iterable object. In Python, the `str` type is iterable with each iteration being a character from the string.
Perl doesn't have a similar function¹, so I create a function called one_bits that counts the number of 1-bits in for a given integer.
```perl
sub one_bits($int) {
my $bin = sprintf( "%b", $int );
return ($bin =~ tr/1/1/);
}
```
I then use the [sort](https://perldoc.perl.org/functions/sort) function as it's been documented in my 90s copy of Programming Perl book.
```perl
my @sorted = sort { one_bits($a) <=> one_bits($b) || $a <=> $b } @ints;
```
¹ the best I could do was `scalar(grep { $_ } split //, sprintf("%b", 63)`, but that is not easy to read or understand.
### Examples
```bash
$ ./ch-2.py 0 1 2 3 4 5 6 7 8
(0, 1, 2, 4, 8, 3, 5, 6, 7)
$ ./ch-2.py 1024 512 256 128 64
(64, 128, 256, 512, 1024)
```
| simongreennet |
1,873,491 | Tile Calculator | Thinking about tiling your floors or walls? Here’s a quick guide to measuring the area you’ll be... | 0 | 2024-06-02T06:26:53 | https://dev.to/tilecalculator/tile-calculator-3aog | Thinking about tiling your floors or walls? Here’s a quick guide to measuring the area you’ll be tiling. If you get stuck with the calculations, feel free to call our team at (02) 9709 5836 or email us sales@showtile.com.au for assistance.
Website: https://showtile.com.au/tile-calculator/
Phone: 0297095836
Address: 65 Canterbury Road
https://www.funddreamer.com/users/tile-calculator
https://mstdn.social/@tilecalculator
https://controlc.com/fc865f42
https://cr8r.gg/@tilecalculator
https://dribbble.com/tilecalculator/about
https://www.wpgmaps.com/forums/users/tilecalculator/
https://ieji.de/@tilecalculator
https://www.mixcloud.com/tilecalculator/
https://bandori.party/user/201929/tilecalculator/
https://mas.to/@tilecalculator
https://mastodon.uno/@tilecalculator
https://irsoluciones.social/@tilecalculator
https://www.zazzle.com/mbr/238099864897748812
https://www.facer.io/u/tilecalculator
https://burningboard.net/@tilecalculator
https://www.dnnsoftware.com/activity-feed/my-profile/userid/3199616
https://h4.io/@tilecalculator
https://doodleordie.com/profile/tilecalculator
https://maps.roadtrippers.com/people/tilecalculator
https://developer.tobii.com/community-forums/members/tilecalculator/
https://pastelink.net/xe18i60l
https://getinkspired.com/fr/u/tilecalculator/
http://forum.yealink.com/forum/member.php?action=profile&uid=344006
https://flipboard.com/@TileCalculator
http://molbiol.ru/forums/index.php?showuser=1353228
https://nhattao.com/members/tilecalculator.6537228/
https://www.penname.me/@tilecalculator
https://www.chordie.com/forum/profile.php?id=1969000
https://wakelet.com/@TileCalculator91578
https://rotorbuilds.com/profile/43096/
https://hachyderm.io/@tilecalculator
https://www.kickstarter.com/profile/tilecalculator/about
https://teletype.in/@tilecalculator
https://www.reverbnation.com/tilecalculator
https://mastodon-japan.net/@tilecalculator
https://linkmix.co/23560761
https://community.tableau.com/s/profile/0058b00000IZZq0
https://www.creativelive.com/student/tile-calculator?via=accounts-freeform_2
https://bookstodon.com/@tilecalculator
https://www.passes.com/tilecalculator
https://lewacki.space/@tilecalculator
https://mastodon.scot/@tilecalculator
https://toot.io/@tilecalculator
https://vimeo.com/user220532175
https://app.roll20.net/users/13401930/tile-c
https://audiomack.com/tilecalculator
| tilecalculator | |
1,873,490 | 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-06-02T06:25:48 | https://dev.to/whitemartin045/buy-verified-cash-app-account-3h46 | 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.
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].
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.
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.
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.
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.
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.
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.
https://dmhelpshop.com/product/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.
https://dmhelpshop.com/product/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.
https://dmhelpshop.com/product/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.
https://dmhelpshop.com/product/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.
https://dmhelpshop.com/product/buy-verified-cash-app-account/
Contact Us / 24 Hours Reply
Telegram:dmhelpshop
WhatsApp: +1 (980) 277-2786
Skype:dmhelpshop
Email:dmhelpshop@gmail.com
| whitemartin045 | |
1,873,489 | پیشرفتهترین مدلهای دستگاه کنترل تردد کارتی موجود در بازار | دستگاه کنترل تردد کارتی یکی از راههای آسان برای نظارت بر تردد افراد به سازمان است که در دستگاه حضور... | 0 | 2024-06-02T06:22:02 | https://dev.to/maxasecurity/pyshrfthtryn-mdlhy-dstgh-khntrl-trdd-khrty-mwjwd-dr-bzr-1mg2 | دستگاه کنترل تردد کارتی یکی از راههای آسان برای نظارت بر تردد افراد به سازمان است که در دستگاه حضور و غیاب برای ثبت تردد افراد از کارت تردد استفاده میشود و همه افراد کارت مختص خود دارند که برای ورود و خروج یا ثبت تردد خود آن را ارائه میدهد. در این روش کد منحصربه فرد هر شخص مختص او تعریف شده است و با نزدیک کردن کارت به دستگاه کنترل تردد ساعات ورود و خروج خود را ثبت میکنند. از مهمترین مزایای این روش میتوان به جلوگیری از تردد افراد غیرمجاز، کاهش هزینههای جانبی از جمله استخدام نگهبان و استفاده آسان آن به منظور ثبت ورود و خروج اشاره کرد. از این رو در این مطلب قصد داریم به معرفی برخی از پیشرفتهترین مدلهای دستگاه حضور و غیاب کارتی بپردازیم.
**بهترین مدل دستگاه کنترل تردد کارتی
**
در این بخش ضمن معرفی برخی از بهترین دستگاههای کنترل تردد کارتی به مقایسه ویژگیهای هر یک از آنها پرداخته شده است.
**دستگاه کنترل تردد کارتی virdi ac1100
**
**[دستگاه حضور و غیاب کارتی](https://maxasecurity.com/product-category/attendance-hardware/attendance-card/)** virdi ac1100از جمله محصولات برند ویردی کشور کره جنوبی است که امکان احراز هویت از طریق کارت بدون تماس، شناسه و رمز را برای کاربران فراهم کرده است. از جمله ویژگیهای این دستگاه حضور و غیاب میتوان به کارتخوان proximity، صفحه نمایش lcd، رابط کاربری گرافیکی 4 اینچی و دوربین عکاسی vga با فلش اشاره کرد. این دستگاه کنترل تردد کارتی فاقد حسگر اثرانگشت است و جایگزین نمونه قدیمیتر برند ویردی با نام Ac1000 شده است.
دستگاه کنترل تردد کارتی virdi ac1100با وجود حافظه داخلی خود می تواند تعداد 200000 کاربر، 1000000 گزارش تردد و 15000 تصویر را ذخیره و نگهداری کند. همچنین دیگر مزیت این دستگاه امکان اتصال به دیگر دستگاههای کنترل دسترسی از طریق voip و شبکه است. در نهایت مهمترین ویژگیهای دستگاه کنترلتردد کارتی virdi ac1100 شامل ثبت تردد کاربران با شناسه، رمز و کارت بدون تماس، صفحه نمایش lcd 4 اینچی، پشتیبانی از rfid با فرکانس 125 کیلوهرتز و 13.56 کیلوهرتز، اتصال به شبکه tcp/ip، بلوتوث، RS 232، Wiegand In & Out، LAN میشود.
**دستگاه کنترل تردد کارتی virdi ac5000
**
دستگاه کنترل تردد کارتی virdi ac5000 دیگر دستگاه مدیریت تردد برند ویردی است که با استفاده از فناوریهای روز دنیا امکانات و قابلیتهای فراوانی را برای مدیران سازمانها فراهم کرده است. این دستگاه کنترل تردد کارتی با استفاده از تشخیص چهره و کارت ساعتزنی احراز هویت و حضور و غیاب افراد را انجام می دهد. کارت ساعت زنی مختص هر فرد طراحی شده و فقط توسط همان فرد قابل استفاده است. این دستگاه همچنین با برخورداری از پردازنده 1.4 گیگاهرتزی در کمتر از 1ثانیه اقدام به تشخیص چهره 4000 تردد می کند. عملکرد سریع و دقت بالای این **[دستگاه حضور و غیاب](https://maxasecurity.com/product-category/attendance-hardware/)** موجب شده که از آن به سادگی در بسیاری از سازمانها و کسب و کارها استفاده شود.
همچنین دستگاه کنترل تردد کارتی virdi ac5000با استفاده از فناوری ir و تکنیک نوری سوپریما قابلیت تشخیص چهره افراد در شرایط نوری مختلف و با روشنایی عملیاتی 25000لوکس را دارد. در نهایت تفاوت اصلی این دستگاه کنترل تردد از سایر محصولات مشابه در پشتیبانی از استانداردهای rfid و برقراری ارتباط با تلفن همراه هوشمند با suprema mobile access از طریق بلوتوث و nfc است.
**دستگاه کنترل تردد کارتی virdi ac2100plus
**
دستگاه کنترل تردد کارتی virdi ac 2100 plus از جمله پیشرفتهترین مدلهای برند ویردی است که با نظارت بر تردد کارکنان سازمان و ثبت تردد آنها، گزارشهای جامعی از ورود و خروج، مرخصی ها و ماموریتهای کاری آنها ارائه میدهد. این دستگاه یکی از دستگاههای کنترل تردد اثرانگشتی است که با وجود پردازنده قوی و سنسور تشخیص اثرانگشت در کمتر از 1 ثانیه تعداد 1500 اثرانگشت را شناسایی و ثبت میکند. الگوریتم تشخیص اثرانگشت زنده قادر به تشخیص اثرانگشت جعلی(ساخته شده از لاستیک، سیلیکون، کاغذ و ... ) است و احتمال جعل یا تقلب را از بین میبرد. این دستگاه همچنین امکان احراز هویت از طریق کارت ساعتزنی را نیز فراهم کرده است. بنابراین با وجود برخورداری از ظرفیت 100000 ثبت تردد می توان آن را به عنوان گزینه ایدهآل برای کسب و کارها و صنایع برشمرد.
از ویژگیهای مهم دستگاه کنترل تردد کارتی virdi ac2100plusنیز میتوان به پشتیبانی از استانداردip65 (ضد گرد و غبار و آّب)، پشتیبانی از فناوری بلوتوث، تشخیص اثرانگشت زنده و برخورداری از دوربین دیجیتال پیشرفته اشاره کرد.
**سخن پایانی
**
در این مطلب به معرفی و بیان ویژگیهای برخی از پیشرفتهترین مدلهای دستگاه حضور و غیاب موجود در بازار پرداخته شد. برای آشنایی بیشتر با انواع مدلهای دستگاه کنترل تردد کارتی و تهیه لیست قیمت میتوانید به وبسایت شرکت مهندسی مکسا به آدرس www.maxasecurity.com مراجعه کنید و ضمن تماس با شماره تلفن 02178756000 از همکاران مشاور و پشتیبانی شرکت راهکارهایی مناسب با نیاز سازمان خود را دریافت کنید.
| maxasecurity | |
1,873,487 | Cassandra installation on Windows | Hi all, i try to install cassandra on my windows pc. But when run command cassandra inside a git... | 0 | 2024-06-02T06:01:05 | https://dev.to/walter66/cassandra-installation-on-windows-j8f | help | Hi all,
i try to install cassandra on my windows pc. But when run command cassandra inside a git bash windows command i have the follow error: unable to find java home. Anyone can help me to fix it ?
Walter
| walter66 |
1,873,486 | Calcula RFC | Cuando necesitas calcula RFC, Calcularrfc.mx es tu mejor opción. Nuestro sistema está diseñado para... | 0 | 2024-06-02T05:52:43 | https://dev.to/robyngknapp/calcula-rfc-3lgc | Cuando necesitas [calcula RFC](https://calcularrfc.mx/), Calcularrfc.mx es tu mejor opción. Nuestro sistema está diseñado para ser intuitivo y accesible, permitiendo a cualquier persona, sin importar su nivel de experiencia tecnológica, obtener su RFC fácilmente. | robyngknapp | |
1,873,484 | Keyoxide Identity Proof | I, Benjamin N. Zelnick, hereby claim that: I am @zelnickb on dev.to; and I control the PGP key with... | 0 | 2024-06-02T05:40:10 | https://dev.to/zelnickb/keyoxide-identity-proof-22b0 | I, Benjamin N. Zelnick, hereby claim that:
1. I am @zelnickb on dev.to; and
2. I control the PGP key with fingerprint `4B5640333BA17168146867FD693BF6E258B852B8`.
## Machine-Readable Proof
openpgp4fpr:4B5640333BA17168146867FD693BF6E258B852B8 | zelnickb | |
1,873,411 | Membuat Project Python yang mudah untuk dimaintain | Bayangkan kamu memiliki project python pribadi di github kamu yang sudah tidak kamu buka selama... | 0 | 2024-06-02T03:48:05 | https://dev.to/bimaadi/membuat-project-python-yang-mudah-untuk-dimaintain-442p | python, indonesia, datascience, softwaredevelopment | Bayangkan kamu memiliki project python pribadi di github kamu yang sudah tidak kamu buka selama berbulan-bulan. Ketika dicoba di laptop kamu ternyata tidak jalan entah karena kurang depedencies atau versi python kamu tidak cocok dan lain-lain. Seharian kamu berusaha menyelesaikan masalah tersebut dan akhirnya project tersebut bisa berjalan dilaptop kamu. Sekarang bayangkan jika hal tersebut terjadi di kantormu. Program itu selain harus bisa jalan di laptop kamu tetapi harus bisa jalan juga di server dan laptop teman kerja. Menyelesaikan masalah ini berulang-ulang itu tidak produktif.
Pada blog ini saya akan memberikan tips dan trik untuk membuat project python kalian lebih mudah dimaintain. Menggunakan best practice di python.
## 1. Definisikan versi python yang digunakan
Setiap depedencies python memiliki minimum versi python tersendiri. Contohnya Django 1.8 cuma bisa diggunakan oleh python 2.7 (Siapa yang masih pake python 2.7 di 2024??). Untuk menggunakan fastapi minimum versinya adalah python 3.5 karena fitur typehint pertama kali dikenalkan di pyhton 3.5.
Dimana saya harus mendefinisikan versi python yang digunakan? Saya pribadi mendifinisikan versi python di README.md. Saya membuat satu bagian yang berjudul requirement lalu mendefinisikanya di bagian tersebut. Contohnya bisa kalian lihat di repository github berikut [https://github.com/BimaAdi/Make-Maintainable-Python-Project](https://github.com/BimaAdi/Make-Maintainable-Python-Project).
## 2. Menggunakan Virtual Environtment
Secara default ketika menggunakan pip ketika kita melakukan `pip install {nama package}` pip akan menyimpan depedency secara global jadi bisa diakses oleh semua project di laptop kita. Masalahnya adalah tidak semua project menggunakan depedency tersebut. Contohnya kamu memiliki 2 project satu project mengenai machine learning satu lagi project mengenai backend development. Project machine learning menggunakan depedency yang berhubungan dengan machine learning seperti numpy, pandas, scikit learn dan lain-lain, Sedangkan project backend development menggunakan web framework seperti django. Project machine learning tidak membutuhkan django begitu pula project backend development tidak membutuhkan numpy, pandas maupun scikit learn. Dengan menggunakan virtual environtment kita mengelompokan depedencies berdasarkan kebutuhan project-project kita.
Untuk membuat virtual environtment pada folder project jalankan perintah:
```
python -m venv env
```
Pada folder project kalian akan melihat satu folder baru yang namanya env/. Folder ini menyimpan python intepreter dan depedency python. Untuk menggunakan python pada folder env jalankan perintah:
linux dan macos (bash or zsh)
```
source env/bin/activate
```
windows (command promt)
```
env\Scripts\activate.bat
```
windows (powershell)
```
env\Scripts\activate.ps1
```
Setelah menjalankan perintah diatas pada tampilan kiri terminal/command promt/powershell terdapat icon (env).

Ini menandakan python yang digunakan adalah python yang terdapat pada folder env (virtual environtmet) bukan python yang terinstalasi secara global. Kalau kalian coba jalankan perintah `pip list` tidak ada depedency apa pun kecuali bawaan python kalian.

Kalau kalian jalankan `pip install {nama depedency}` ketika terdapa icon (env) maka depedency tersebut akan disimpan di folder env. Coba lakukan `pip install Faker pandas` lalu `pip list` depedencies akan tersimpan di folder env.

Untuk menggunakan python intepreter global bisa dengan 2 cara. Cara yang pertama dengan membukan terminal/command promt/powershell baru. Cara kedua dengan mematikan environtmentnya menggunakan perintah `deactivate`.
Pastikan folder env tidak masuk ke git repository jika menggunakan git. tambahkan folder env pada file .gitignore.
## 3. Catat depedency project pada file requirements.txt
Semakin besar suatu project semakin banyak depedency yang dibutuhkan. Mengintall depedency satu per satu pasti akan memakan banyak waktu. Selain itu kita juga harus mendefinisikan versi depedency apa yang digunkan. Untuk menyelesaikan masalah tersebut bisa menggunakan requirements.txt. requirements.txt itu hanya file txt biasa yang menyimpan depedency python dan versi yang digunakan.
Untuk membuat file requirements.txt ketika dalam kondisi menjalankan virtual environtment jalankan perintah `pip freeze > requirements.txt`. Perintah `pip freeze` menampilkan semua depedencies dan versinya pada virtual environtment. Perintah `> requirements.txt` untuk menyimpan hasilnya pada file requirements.txt.

Agar lebih jelas. Saya memiliki contoh project yang menggunakan semua tips diatas. Kalian bisa melihatnya di repository github [https://github.com/BimaAdi/Make-Maintainable-Python-Project](https://github.com/BimaAdi/Make-Maintainable-Python-Project)
Sebenarnya masih banyak tips lain untuk memmpermudah memaintain project python seperti menggunakan testing, formater dan lain-lain. Namun pada blog ini saya ingin specific hanya di python dan seminimal mungkin. Jika kalian memiliki tips lain atau solusi lain silahkan ditambah di kolom komentar.
| bimaadi |
1,873,483 | Reactive vs. Template-Driven Approaches: Exploring Angular Forms | Handling user input with forms is a fundamental aspect of many applications, allowing users to log... | 0 | 2024-06-02T05:39:21 | https://dev.to/bytebantz/reactive-vs-template-driven-approaches-exploring-angular-forms-e2f | angular, webdev, javascript | Handling user input with forms is a fundamental aspect of many applications, allowing users to log in, update profiles, and perform various data-entry tasks. In Angular development, managing user input through forms is a fundamental aspect. Angular offers two main approaches for handling forms: reactive forms and template-driven forms. Let’s delve into each approach to understand their characteristics, use cases, and implementation examples.
## Common Building Blocks:
Both reactive and template-driven forms use common building blocks:
**- FormControl:** Tracks the value and validation status of an
individual form control.
**- FormGroup:** Tracks values and status for a fixed set of form
controls.
**- FormArray:** Tracks values and status for an array of form
controls. FormArray allows you to add and remove form
controls at runtime.
**- ControlValueAccessor:** Creates a bridge between Angular
FormControl instances and built-in DOM elements. It serves as a
middleman, helping Angular understand how to read and update
the value of custom form controls.
## Reactive Forms
In reactive forms, you define the form model directly in the component class. The form model is explicitly created using **FormControl** instances, providing direct access to the form API.
Reactive forms offer scalability, reusability, and ease of testing, making them a preferred choice for complex applications.
## Key Features:
**· Scalability**
Reactive forms, with direct access to the form API and synchronous data flow, are more scalable, reusable, and easier to test than template-driven forms. If scalability is essential, opt for reactive forms.
**· Data Flow**
In reactive forms, each form element in the view is directly linked to a FormControl instance. Updates from the view to the model and vice versa are synchronous.
## View-to-Model Data Flow
1. The user interacts with an input field by typing a value, such
as “Blue.”
2. The input element emits an “input” event, conveying the latest
value.
3. The ControlValueAccessor, responsible for handling events on
the input element, promptly relays the new value to the
associated FormControl instance.
4. The FormControl instance emits the updated value through the
valueChanges observable.
5. Any subscribers to the valueChanges observable receive the new
value, ensuring real-time synchronization between the view and
the model.
## Model-to-View Data Flow
1. A programmatic change to the model, initiated by calling the
**setValue()** method on the FormControl instance, updates its
value.
2. The updated value is emitted through the valueChanges
observable.
3. Subscribers to the valueChanges observable are notified of the
change, allowing them to react accordingly.
4. The control value accessor associated with the input element
updates the view, ensuring that the displayed value reflects
the updated model state.
**· Validation**
_Form validation_ is used to ensure that user input is complete and correct.
Define custom validators as functions receiving a control to validate.
**· Mutability**
Reactive forms keep the data model pure by providing it as an immutable structure. Each change triggers the creation of a new data model rather than updating the existing data model, improving change detection efficiency e.g. each update to the favorite color triggers the **FormControl** instance to return a new value, maintaining the immutability of the data model.
**Reactive Form Example:**
```
import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
@Component({
selector: 'app-reactive-favorite-color',
standalone: true,
imports: [ReactiveFormsModule],
template: `
Favorite Color: <input type="text" [formControl]="favoriteColorControl">
`,
})
export class ReactiveFavoriteColorComponent {
favoriteColorControl = new FormControl('');
}
```
In this example, the **favoriteColorControl** represents the **FormControl** instance, which acts as the form model. The **formControlName / [formControl]** directive binds this **FormControl** to the **\<input\>** element, enabling seamless interaction between the view and the component class.
## Template-Driven Forms
**Template-driven** forms have an **implicit** form model created by directives in the template. The **NgModel** directive manages a **FormControl** instance for a given form element. They are suitable for simple scenarios and are easy to add to an app.
## Key Features:
**· Data Flow**
In template-driven forms, form elements are linked to a directive managing the form model internally. Data flow is asynchronous.
**View-to-Model Data Flow**
1. User input, such as typing “Blue” into an input element, triggers an “input” event.
2. The input element emits the event containing the entered
value.
3. The control value accessor, attached to the input, invokes the
**setValue()** method on the underlying FormControl instance.
4. Similar to reactive forms, the FormControl emits the updated
value through the valueChanges observable.
5. Additionally, the control value accessor triggers the
**NgModel.viewToModelUpdate()** method, emitting an
**ngModelChange** event.
6. Utilizing **two-way data binding**, the component’s property
bound to **NgModel** is updated with the emitted value,
ensuring synchronization between the view and the component.
**Model-to-View Data Flow**
1. A change in the model, such as the favoriteColor property
transitioning from “Blue” to “Red,” triggers change detection.
2. During change detection, the **ngOnChanges** lifecycle hook is
invoked on the **NgModel** directive instance.
3. The **ngOnChanges()** method queues an asynchronous task to
update the **FormControl** instance’s value.
4. Upon completion of change detection, the task to set the
FormControl value is executed.
5. The updated value is emitted through the **valueChanges**
observable, notifying subscribers of the change.
6. The control value accessor updates the view element with the
latest model value, ensuring consistency between the model and
the view.
**· Validation**
Validation is tied to template directives
**· Mutability**
Template-driven forms rely on mutability with two-way data binding, making change detection less efficient as there are no unique changes to track on the data model e.g. the favorite color property is directly modified to its new value, reflecting the mutable nature of the data model
**Template-Driven Form Example:**
```
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
@Component({
selector: 'app-template-favorite-color',
standalone: true,
imports: [FormsModule],
template: `
Favorite Color: <input type="text" [(ngModel)]="favoriteColor">
`,
})
export class FavoriteColorComponent {
favoriteColor = '';
}
```
In this example, the **[(ngModel)]** directive binds the **favoriteColor** property to the input element, effectively creating and managing a FormControl instance behind the scenes. When you use **[(ngModel)]** on an element, you must define a name attribute for that element. Angular uses the assigned name to register the element with the **NgForm** directive attached to the parent **\<form\>** element.
## Using the FormBuilder service to generate controls
**Step 1: Import the FormBuilder Class**
The first step is to import the FormBuilder class from the **@angular/forms** package into your Angular component. This class provides the necessary methods for creating form controls, form groups, and form arrays.
```
import { FormBuilder } from '@angular/forms';
```
**Step 2: Inject the FormBuilder Service**
Inject the FormBuilder service into your component by adding it to the constructor. This allows you to access the FormBuilder methods within your component.
```
constructor(private formBuilder: FormBuilder) {}
```
**Step 3: Generate Form Controls**
Now, let’s create the form controls using the **FormBuilder** service. We’ll use the **group()** method to create a form group, which represents a collection of form controls.
```
profileForm = this.formBuilder.group({
firstName: [''],
lastName: [''],
address: this.formBuilder.group({
street: [''],
city: [''],
state: [''],
zip: [''],
}),
});
```
In conclusion, Angular offers developers powerful tools for managing user input through reactive and template-driven forms. Understanding the strengths and use cases of each approach enables developers to build robust and efficient web applications. | bytebantz |
1,873,482 | 8 Best Books to Learn System Design in 2024 | My favorite books to learn System design and Software architecture. | 0 | 2024-06-02T05:20:40 | https://dev.to/javinpaul/8-best-books-to-learn-system-design-in-2024-15p | programming, systemdesign, softwaredevelopment, development | ---
title: 8 Best Books to Learn System Design in 2024
published: true
description: My favorite books to learn System design and Software architecture.
tags: programming, systemdesign, softwaredevelopment, development
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-06-02 05:03 +0000
---
*Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article.*

Hello guys, if you are preparing for system design interview or just want to learn System design and looking for resources then you have come to the right place.
In the past, I have shared [best system design courses](https://www.java67.com/2019/09/top-5-courses-to-learn-system-design.html). [cheat sheets](https://medium.com/javarevisited/top-3-system-design-cheat-sheets-templates-and-roadmap-for-software-engineering-interviews-53012952db28), and [websites](https://medium.com/javarevisited/7-best-places-to-learn-system-design-79e2d261f343) for learning System design, and today I am going to share best System design books you can read to master this topic.
Since a lot of books can confuse you, I have only select 5 best and must-read books from the software architect's perspective, with a couple of System design and Software development books.
Since System Design is a very vast subject and highly depends upon the domain you are working, it's not possible to learn everything you need to design software from top to bottom, but these books will give you the necessary tools and techniques required to build robust, secure, and [maintainable](http://javarevisited.blogspot.sg/2016/12/10-tips-to-make-java-application-more-maintainable-easy-to-support.html) software.
They will also help you to develop the mindset required to focus on essentials rather than details, which is a crucial difference between how a developer thinks and how an architect thinks.
In general, developers focus on low-level details, like class and methods while architects focus on high-level details, like how individual components should communicate? how the persistence layer should behave? which technology stack to use? and what will be the non-functional requirements like reporting, archiving, logging, security, scalability, resiliency etc.
These books are also full of good advice in terms of [object-oriented design](https://dev.to/javinpaul/top-10-object-oriented-design-principles-for-writing-clean-code-4pe1), [good coding practices](http://javarevisited.blogspot.sg/2014/10/10-java-best-practices-to-name-variables-methods-classes-packages.html), and how to avoid costly mistakes in the initial phase of software development.
By the way, If you are looking for an affordable online course to learn System Design and prepare for interviews in 2024 then I also suggest you to checkout Frank Kane's [**Mastering the System Design Interview**](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fsystem-design-interview-prep%2F)course on Udemy. Frank is an ex Amazon hiring manager and know what it takes to crack System design interview of those big FAANG companies in 2024.
[](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fsystem-design-interview-prep%2F)
-------
## 8 Best System Design Books for Experienced Developers
Without any further ado, here is my list of some of the books every experienced developers can read to master System design and also prepare well for tech interviews.
These books will expand your knowledge and fill gaps in your understanding. They will also help you to understand the big picture instead of focusing on technical details.
### 1\. [System Design Interview Part 1 and 2 By Alex Xu](https://www.amazon.com/System-Design-Interview-insiders-Second/dp/B08CMF2CQF/?tag=javamysqlanta-20)
[](https://www.amazon.com/System-Design-Interview-insiders-Second/dp/B08CMF2CQF/?tag=javamysqlanta-20)
As the title suggests, this is the perfect book for everyone who is preparing for a system interview. Trust me, this book is the finest on the internet right now. This book is created by Alex Xu who has gone through the same process.
You will get access to a number of drawings and diagrams that will assist you in gaining an understanding of the real system. You will be able to understand what the recruiters are looking for in your answers to questions.
Alex also have a companion **[System design course on ByteByteGo](https://bytebytego.com?fpr=javarevisited)**, where you will not only find all the content of this book and the second part of System Design Interview Book by Alex Wu but also new content, deep dive into popular system questions like how to design YouTube and WhatsApp as well as proven System design framework to solve Software design problem.
Here are my favorite free System design tutorial from ByteByteGo:
1. [YouTube Design Tutorial](https://bit.ly/3bbNnAN)
2. [How to design a Chat system like WhatsApp, Discord, or Facebook Messenger](https://bit.ly/3SbA9Eu)
3. [Scalability](https://bit.ly/3C17oTN)
4. [System Design Interview Framework](https://bit.ly/3C4rRXI)
In short, if you read this book, you will be able to breeze through your next system design interview. This is also one of the most recommend System design books on Reddit, Quora, Hacker News, Twitter, and other online platforms and its obvious from the number of reviews this book have on Amazon.
[](https://www.amazon.com/System-Design-Interview-insiders-Second/dp/B08CMF2CQF/?tag=javamysqlanta-20)
-----
### 2\. [Designing Data-Intensive Applications By Martin Kleppmann](https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321?tag=javamysqlanta-20)
In this fantastic book on system design, Martin Kleppmann will help you understand the pros and cons of all the different technologies that are used for storing and processing data.
It is a book that is written in a lucid style and presents a very broad overview of data storage systems.
You will get a very good grasp of fundamental concepts, algorithms, as well as practical applications of various technologies.
This is also one of the most popular book when it comes to learn Software design and System Design and I highly recommend this book to all kind of software developers .
The book is also good for beginners and experienced, developers and software architects and anyone who wants to be better at software design in depth.
If you want, you can also combine this book with the **[Mastering the System Design Interview](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fsystem-design-interview-prep%2F&u1=JAVAREVISITED)** by Frank Kane (Ex Amazon Hiring Manager) on Udemy for better preparation.
[](https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321?tag=javamysqlanta-20)
-----
### 3\. [Hacking the System Design Interview: Real Big Tech Interview Questions and In-depth Solutions](https://www.amazon.com/Hacking-System-Design-Interview-depth/dp/B0B7QHRK5Q?tag=javamysqlanta-20)
This is another book you can read to prepare for FAANG System Design interview. This book not just cover essential System design concepts which every software architect should know but also cover many popular System design questions and coding problems.
Created by **Stanley Chiang**, a Google Software Engineer, this is also one of the best selling book on System design on Amazon. The best thing about this book is that it walk you through key components which are used to build any system like below:
- Web server
- API gateway
- Load balancer
- Distributed cache
- Asynchronous queue
- Object storage
- CDN
- Fan-out service
- Unique ID generator
This book also includes real interview questions based on hundreds of interviews conducted at big tech companies like Google and Meta, and their detailed solutions. I highly recommend this book to anyone preparing for technical interviews.
You can also combine this with the [**Algomonster**](https://shareasale.com/r.cfm?b=1836542&u=880419&m=114505&urllink=https%3A%2F%2Falgo.monster%2F&afftrack=) or [**Exponent**](https://www.tryexponent.com/?ref=javinpaul2) **System design course for better preparation.
[](https://medium.com/javarevisited/top-3-system-design-cheat-sheets-templates-and-roadmap-for-software-engineering-interviews-53012952db28)
-----
### 4\. [Fundamentals of Software Architecture: An Engineering Approach by Mark Richards and Neal Ford](https://www.amazon.com/Fundamentals-Software-Architecture-Comprehensive-Characteristics/dp/1492043451?tag=javamysqlanta-20)
"Fundamentals of Software Architecture: An Engineering Approach 1st Edition" by Mark Richards and Neal Ford stands as an invaluable guide for developers aspiring to transition into the role of a software architect, a position consistently ranked among the top 10 best jobs in salary surveys globally.
This first-of-its-kind book offers a comprehensive overview of software architecture, covering a wide array of topics such as architectural characteristics, patterns, component determination, diagramming, evolutionary architecture, and more.
Written by hands-on practitioners with extensive experience in teaching software architecture classes, Mark Richards and Neal Ford focus on universal architecture principles applicable across various technology stacks.
The book delves into critical aspects like architecture patterns, component identification, soft skills, modern engineering practices, and treating architecture as an engineering discipline.
With a modern perspective that incorporates innovations from the past decade, this book equips both aspiring and existing architects with the necessary tools and insights to navigate the complexities of software architecture, making it an indispensable resource in the field. I highly recommend this book to any senior developer who also want to become a software architect.
[](https://javarevisited.blogspot.com/2018/02/5-must-read-books-to-become-software-architect-solution.html)
------
### 5\. [Software Engineering at Google: Lessons Learned from Programming Over Time](https://www.amazon.com/Software-Engineering-Google-Lessons-Programming/dp/1492082791?tag=javamysqlanta-20)
"Software Engineering at Google: Lessons Learned from Programming Over Time," co-authored by Titus Winters, Hyrum Wright, and Tom Manshreck, offers an insightful exploration into the intricacies of developing and maintaining a sustainable and healthy codebase, emphasizing the distinction between programming and software engineering.
Drawing on their experiences at Google, the authors provide a detailed look at the practices employed by some of the world's leading software engineers to navigate the challenges of evolving codebases in response to changing requirements and demands.
This [software design book](https://www.linkedin.com/pulse/8-best-system-design-books-programmers-developers-soma-sharma) delves into Google's unique engineering culture, processes, and tools, shedding light on how these elements contribute to the effectiveness of their engineering organization.
Throughout the book, three fundamental principles are highlighted: the impact of time on software sustainability, the influence of scale on software practices within an organization, and the trade-offs engineers must consider when making design and development decisions.
With a focus on practical insights and real-world examples, this book serves as a valuable resource for software engineers seeking to enhance their understanding of software engineering principles and practices.
While this book [book](https://medium.com/javarevisited/top-10-system-design-interview-books-in-2024-3e69e182e092) is not exclusively focused on System design it has many valuable lessons on trade-offs developers must consider when making design and development decisions, which is quite important for senior developers and software architects.
[](https://www.java67.com/2015/03/10-books-every-programmer-and-software-engineer-read.html)
------
### 6. [Software Architecture in Practice](https://www.amazon.com/Software-Architecture-Practice-3rd-Engineering/dp/0321815734?tag=javamysqlanta-20)
This book is a good start for those who are curious or want to understand the basic concepts and ideas behind Software Architecture but it somewhat abstract, which many programmers might not enjoy.
What I like about the books is stories and anecdotes about incidents in history. Since I firmly believe that its stories which teach you what to do and what not do and our mind is more open to remember stories then concept, I found this book worth mentioning in this list.
You can use this book as a textbook to learn about software architecture and If you want, you can also combine this book with Coursera's popular [**Software Architecture online course**](https://coursera.pxf.io/c/3294490/1164545/14726?u=https%3A%2F%2Fwww.coursera.org%2Flearn%2Fsoftware-architecture) for more active learning.
[](http://www.java67.com/2016/02/5-books-to-improve-coding-skills-of.html)
----
### 7\.[Clean Architecture](https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164?tag=javamysqlanta-20)
This is one of the first books you should read on Software architect. Uncle Bob, who is also the author of [Clean Code](http://javarevisited.blogspot.sg/2017/10/clean-code-by-uncle-bob-book-review.html) and [Clean Coder](http://www.java67.com/2015/03/10-books-every-programmer-and-software-engineer-read.html), two of the must-read books for professional programmers, has presented his years of experience on how to build a clean architecture.
Something, which is robust, maintainable, and adaptable to change. In this book, you not only learn about essential concepts of architecting software but also about terminology used at that level.
You will also learn about [SOLID design principles](http://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fprinciples-oo-design) and good coding practices required for writing clean code. The book also gives practical advice on evaluating different design and architecture by comparing their pros and cons.
In short, one of the most fundamental books on software architecture, which every senior programmer or someone aspires to become a solution architect should read.
[](http://javarevisited.blogspot.sg/2017/09/clean-architecture-by-uncle-bob-martin.html#axzz4tzMEHSJw)
-----
### 8\. [Building Microservices: Designing Fine-Grained Systems](https://www.amazon.com/Building-Microservices-Designing-Fine-Grained-Systems/dp/1491950358/?tag=javamysqlanta-20)
Another great book to learn about the design and architecture of modern, distributed software, particularly Microservices, which are powering this generation is the greatest apps, like Uber, Facebook, Netflix, etc.
If you want to move away from monolithic applications to the world of Microservices, then this is the book you should read. And if you want to learn from courses, you can also check out the **[Master Microservices with Spring Boot and Spring Cloud](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmicroservices-with-spring-boot-and-spring-cloud%2F&u1=JAVAREVISITED)** course by Ranga Karnam on Udemy. It's one of the best and up-to-date courses to learn how to build Microservices in Java using Spring Boot and other tech stacks.
[](http://javarevisited.blogspot.sg/2017/12/top-20-java-books-of-2017-which-you-can-read-in-2018.html#axzz57PdlALCn)
That's all about some of the **best system design books software developers can read*. If you are a senior Java developer of 8 to 10 years of experience and want to move the next step in your career towards an end goal of becoming a software architect, these are the books to read to expand your vision and knowledge.
Other **System Design Tutorials and Resources** you may like:
[**How to become an Outstanding Solution Architect**](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fhow-to-become-an-outstanding-solution-architect%2F&u1=JAVAREVISITED)
- [Top 5 Places to learn System design and Software design](https://javarevisited.blogspot.com/2022/08/top-7-websites-to-learn-system-design.html)
- [Is DesignGuru's System Design Course worth it](https://medium.com/javarevisited/is-designgurus-ios-grokking-system-design-and-coding-interview-courses-worth-it-review-1ed486913fa7)
- [100+ System Design Interview Questions and Problems](https://javarevisited.blogspot.com/2024/05/100-system-design-interview-questions.html)
- [Is Exponent's System Design Course worth it?](https://medium.com/javarevisited/is-exponents-system-design-interview-course-worth-it-review-aad2034d3dd7)
- [10 Reasons to Learn System Design in 2024](https://medium.com/javarevisited/10-reasons-to-learn-system-design-in-2024-fa795d301f62)
- [Top 5 System Design YouTube Channels for Engineers](https://medium.com/javarevisited/top-8-youtube-channels-for-system-design-interview-preparation-970d103ea18d)
- [10 Best Places to Learn System Design in 2024](https://medium.com/javarevisited/7-best-places-to-learn-system-design-79e2d261f343)
- [How to Prepare for System Design Interview in 2024](https://javarevisited.blogspot.com/2022/03/how-to-prepare-for-system-design.html)
- [Is ByteByteGo really worth the hype?](https://javarevisited.blogspot.com/2022/12/is-bytebytego-by-alex-xu-worth-it-for.html)
- [My Favorite Software Design Courses for 2024](https://javinpaul.medium.com/7-best-software-design-course-for-programmers-and-developers-da3e18e9135)
- [3 Places to Practice System Design Mock interviews](https://medium.com/javarevisited/3-best-mock-interview-platforms-for-system-design-and-coding-interviews-in-2024-7283f1579b17)
- [20 System Design Interview Questions for Practice](https://javarevisited.blogspot.com/2022/06/system-design-interview-question-answer.html)
- [Is Designing Data intensive application book worth reading?](https://medium.com/javarevisited/review-is-designing-data-intensive-applications-by-martin-kleppman-worth-it-b3b7dfa17a5c)
Thanks for reading this article so far. If you like these books, then please share it with your friends and colleagues. If you have any questions or feedback, then please drop a note.
**P.S. -** If you prefer online courses over books then you can also check out **[10 best system design courses ](https://javarevisited.blogspot.com/2022/08/top-5-system-design-interview-courses.html)**. These courses will not only teach you useful system design principles and coding best practices required for creating robust software. | javinpaul |
1,873,478 | Understanding Nodes in Java: The Building Blocks of Data Structures | When diving into the world of data structures in Java, you'll frequently encounter the term "node."... | 0 | 2024-06-02T05:19:49 | https://dev.to/fullstackjava/understanding-nodes-in-java-the-building-blocks-of-data-structures-5di3 | dsa, programming, career, java |

When diving into the world of data structures in Java, you'll frequently encounter the term "node." A node serves as a fundamental element or building block in various data structures such as linked lists, trees, and graphs. This blog will take a detailed look at what a node is and how it functions in different data structures, including code examples for better understanding.
#### Node in a Linked List
A linked list is a linear data structure where each element is a separate object known as a node. Nodes are linked using pointers. There are different types of linked lists, such as singly linked lists and doubly linked lists, each having slightly different node structures.
**Singly Linked List**
In a singly linked list, each node contains data and a reference (or link) to the next node in the sequence. Here’s a simple implementation of a node in a singly linked list:
```java
public class Node {
int data;
Node next;
// Constructor
public Node(int data) {
this.data = data;
this.next = null;
}
}
```
In this example:
- `data` stores the value of the node.
- `next` is a reference to the next node in the list.
**Doubly Linked List**
A doubly linked list is similar to a singly linked list, but each node contains references to both the next and the previous nodes, allowing traversal in both directions.
```java
public class Node {
int data;
Node next;
Node prev;
// Constructor
public Node(int data) {
this.data = data;
this.next = null;
this.prev = null;
}
}
```
Here, the `prev` reference allows navigation backward, enhancing the flexibility of the linked list.
#### Node in a Binary Tree
A binary tree is a hierarchical data structure in which each node has at most two children, referred to as the left child and the right child. Nodes in a binary tree are structured as follows:
```java
public class TreeNode {
int data;
TreeNode left;
TreeNode right;
// Constructor
public TreeNode(int data) {
this.data = data;
this.left = null;
this.right = null;
}
}
```
In this setup:
- `data` holds the node's value.
- `left` is a reference to the left child node.
- `right` is a reference to the right child node.
Binary trees are the foundation for more complex structures like binary search trees (BSTs), heaps, and more.
#### Node in a Graph
In graph theory, a node is often referred to as a vertex. Each node in a graph can connect to multiple nodes, known as neighbors. A node in a graph might look like this:
```java
import java.util.List;
import java.util.ArrayList;
public class GraphNode {
int data;
List<GraphNode> neighbors;
// Constructor
public GraphNode(int data) {
this.data = data;
this.neighbors = new ArrayList<>();
}
// Add a neighbor
public void addNeighbor(GraphNode neighbor) {
this.neighbors.add(neighbor);
}
}
```
Here:
- `data` holds the value of the node.
- `neighbors` is a list of adjacent nodes (vertices).
Graphs can be used to represent networks, such as social networks or transportation systems, making them a powerful and versatile data structure.
#### Summary
Nodes are essential elements in many data structures, each with specific characteristics and purposes. Understanding the role of nodes is crucial for grasping the functionality and implementation of these data structures in Java.
- In a **singly linked list**, a node has data and a reference to the next node.
- In a **doubly linked list**, a node has data and references to both the next and previous nodes.
- In a **binary tree**, a node has data and references to its left and right children.
- In a **graph**, a node has data and a list of adjacent nodes.
These structures provide the foundation for complex and efficient algorithms, enabling developers to solve various computational problems effectively. By mastering nodes and their implementations, you'll be well-equipped to handle a wide range of programming challenges in Java. | fullstackjava |
1,873,473 | Middleware to Asp.net Core MVC Application + Custom Middleware | Hello everyone, Today, I’m excited to guide you through the process of adding custom middleware to... | 0 | 2024-06-02T05:02:01 | https://dev.to/harshchandwani/middleware-to-aspnet-core-mvc-application-custom-middleware-4k4h | aspdotnet, middleware, programming, webdev | Hello everyone,
Today, I’m excited to guide you through the process of adding custom middleware to your application. Middleware is a vital component of any application, and understanding how to effectively use it can greatly enhance your development process.
## Why Middleware Matters
Middleware is crucial in handling all requests and responses in your application. By leveraging middleware, you can streamline and manage various tasks such as:
**Authentication**: Verifying user identity.
**Authorization**: Checking user permissions.
**Logging**: Recording details about requests and responses.
**Error Handling**: Catching and managing exceptions.
Using middleware can save you significant time and effort by centralizing and simplifying these common tasks.

## What is Middleware?
Middleware is a piece of code (or a component) that sits in the HTTP request-response pipeline. It has access to all incoming requests and outgoing responses, allowing it to process or manipulate them. Middleware can log information, modify requests/responses, or even terminate requests early.
## Common Examples of Middleware
Some commonly used middleware includes:
**Authentication Middleware**: Verifies user identity.
**Authorization Middleware**: Checks user permissions.
**Logging Middleware**: Logs details about requests and responses.
**Exception Handling Middleware**: Catches and handles exceptions.
**Static Files Middleware**: Serves static files like images, CSS, and JavaScript.
```
public class Startup
{
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
// Add custom middleware
app.Use(async (context, next) =>
{
await context.Response.WriteAsync("Hello from Middleware");
await next(); // Call the next middleware in the pipeline
});
// Other middleware registrations
app.UseStaticFiles();
app.UseAuthentication();
app.UseMvc();
}
}
```
## Adding Custom Middleware
Let’s walk through the process of adding a custom middleware that writes "Hello from Middleware" to every response.
**Steps to Add Custom Middleware**
Open Startup.cs: This file configures your application's request pipeline.
Modify the Configure Method: Add your custom middleware within the Configure method.
I hope this helps you understand how to integrate custom middleware into your application. Happy coding!` | harshchandwani |
1,873,471 | Casino101: Pioneering Casino Reviews for the Australian Gambler | Introduction to Casino101 Casino101 stands out as a leading authority in the realm of online casino... | 0 | 2024-06-02T04:48:08 | https://dev.to/hamish_noah/casino101-pioneering-casino-reviews-for-the-australian-gambler-4h | **Introduction to Casino101**
Casino101 stands out as a leading authority in the realm of online casino reviews, specifically tailored for the Australian gambling community. Unlike generic review platforms, Casino101 dives deep into the nuances that matter to Australian players, providing insights that are both practical and valuable to novices and seasoned gamblers alike.
**Unmatched Expertise in Australian Gambling**
What sets Casino101 apart is its focus on the Australian gambling scene. The site is crafted by Australians, for Australians, ensuring that every piece of content resonates with local players. This local expertise allows Casino101 to provide tailored advice on the best casinos that adhere to Australian gambling laws and preferences.
**Comprehensive Reviews That You Can Trust**
At the heart of Casino101’s offering are its comprehensive and unbiased reviews. Each review is meticulously researched and written by experts with years of industry experience. Casino101 evaluates casinos on a variety of factors, including game selection, user experience, customer support, and, crucially, their compliance with Australian regulations. This thorough approach ensures that Australian players get reliable and up-to-date information that enhances their gambling experience.
**A User-Friendly Experience**
Navigating Casino101 is a breeze. The website is designed with the user in mind, featuring an intuitive layout that makes it easy to find the exact information you need. Whether you’re searching for the latest reviews, seeking tips on how to play, or looking for bonuses that work in Australia, Casino101 has you covered with its well-organized categories and search functionalities.
**Unique Insights and Game Strategies**
Beyond reviews, Casino101 is an invaluable resource for game strategies and gambling tips. The site offers unique content that ranges from basic strategies for beginners to advanced tactics for experienced players. [https://casino101.net/](https://casino101.net/) This content is specially designed to help Australian players maximize their winnings and enjoy a more fulfilling gambling experience.
**Dedicated to Safe and Responsible Gambling**
Casino101 is deeply committed to promoting safe and responsible gambling. The site includes important resources on gambling safety and provides support and advice for maintaining control. They emphasize the importance of playing within limits and knowing when to stop, underlining their commitment to the welfare of their readers.
**Interactive Community Features**
Casino101 also distinguishes itself with its interactive community features. Readers can leave comments on reviews, share their own experiences, and even rate casinos. This community feedback helps to ensure that the reviews on Casino101 stay current and reflective of the real user experience, adding another layer of trust and authenticity.
**Conclusion**
Casino101 is not just a review site; it’s a comprehensive platform that catifies to the needs of Australian gamblers with precision and care. By providing expert reviews, insightful strategies, and a focus on safe gambling, Casino101 helps Australian players navigate the complex world of online gambling with ease and confidence. Whether you are new to the world of online gambling or looking to enhance your strategies at the casino, Casino101 is your go-to resource for all things gambling in Australia.
Find the complete article at: [https://www.sfgate.com/market/article/best-casino-bonuses-17179995.php](https://www.sfgate.com/market/article/best-casino-bonuses-17179995.php) | hamish_noah | |
1,873,470 | The best personal Note-taking app 📙 Fast 🚀 Secure 🔐 and Free 💯 | Hello everyone, about a month ago, I shared my intention to develop a note-taking app, and today I am... | 0 | 2024-06-02T04:41:59 | https://dev.to/hoaitx/the-best-personal-note-taking-app-fast-secure-and-free-257k | note, notetalking, opensource | Hello everyone, about a month ago, I shared my intention to develop a note-taking app, and today I am delighted to announce that it has officially launched at https://opennotas.io. Github at https://github.com/tonghoai/opennotas. I hope it will be helpful for those who are looking for a simple yet effective note-taking solution.
To get started, there are two ways:
1. Visit https://opennotas.io and click on the "Install" button.
2. Build from the source code on Github.
You can also refer to the documentation at https://docs.opennotas.io.
The app has all the features of a note-taking application, but the highlights are:
1. Simple and easy to use, allowing you to create notes with just one touch.
2. Cross-platform based on PWA, so it can be used on any device with a modern browser. From Android, iOS to Windows, Linux, MacOS...
3. Synchronize notes across devices through an Adapter or self-implemented storage system.
4. End-to-End Encryption (E2EE) ensures data security by encrypting it before storing it on the server.
Although I have spent a lot of time perfecting OpenNotas, there may still be some undiscovered issues while using it. Therefore, if you encounter any problems, please open an Issue on Github for the fastest support.
In addition, I am also running a Launch campaign on the Product Hunt platform, aiming to compete with countless other products worldwide. I hope you can show your interest by giving me an upvote or leaving a comment about your experience here 😊 https://www.producthunt.com/products/opennotas
Lastly, the roadmap for OpenNotas is still long, and it will definitely continue to evolve, so you can use it with peace of mind for the long term. Thank you.
P/S: The app installation button may sometimes freeze or lag, and clicking on it may not show anything. This is because the PWA install API is still in experimental phase and may not be fully stable. Please try refreshing the page a few times or manually install it by pinning the website to your home screen (For example, in Chrome, go to Menu > Install App). | hoaitx |
1,873,469 | Rails on Docker - Simplify Your Development with Docker and DevContainers | Sick of environment inconsistencies causing problems in your Ruby-on-Rails projects? Docker and... | 0 | 2024-06-02T04:38:21 | https://dev.to/shettigarc/simplify-your-rails-development-with-docker-and-vscode-3ld8 | devcontainers, vscode, docker, rails | ---
title: Rails on Docker - Simplify Your Development with Docker and DevContainers
published: true
tags: DevContainers, VSCode, docker, RubyOnRails
---
Sick of environment inconsistencies causing problems in your Ruby-on-Rails projects? Docker and VSCode Dev Containers let you create a perfectly reproducible and consistent development environment.
Even if you've never used Docker before you'll be surprised how easy it is to get started. No more worrying about messy dependencies or "it works on my machine" issues. Dev Containers lets you create a perfect sandbox for your Ruby-on-Rails projects.
Ready to see it in action? Check out this quick tutorial on Dockerizing a Rails app with Dev Containers in VSCode:
{% embed https://www.youtube.com/embed/xfeQ6vDuidA %}
You'll learn how to:
- Set up a new Rails project inside a Docker container.
- Easily connect your app to a MySQL database (runs as docker container).
- Optimize your setup for both development and production.
- Code and test your app entirely within VSCode and Docker Desktop
Why use Docker and Dev Containers for Rails?
- **Consistency**: Everyone on your team has the same environment, making collaboration a breeze.
- **Reproducibility**: If something breaks, you can recreate your setup in seconds.
- **Portability**: Take your project anywhere without having to re-install anything.
- **Isolation**: Keep your main system clean and tidy.
I hope this tutorial helps you take your Rails development to the next level. It's a fantastic way to boost your productivity and make your coding life easier.
If you found this helpful, be sure to follow me on [LinkedIn](https://www.linkedin.com/in/shettigarc/) and subscribe to my [YouTube channel](https://www.youtube.com/c/ChandraShettigar) for more tips and tutorials. Happy coding! | shettigarc |
1,873,468 | let vs var vs Const | Let’s dive into the differences between var, let, and const in JavaScript. These three keywords are... | 0 | 2024-06-02T04:23:32 | https://dev.to/kameshoff/let-vs-var-vs-const-197c | javascript, programming, beginners, webdev | Let’s dive into the differences between var, let, and const in JavaScript. These three keywords are used for variable declaration, but they behave differently. Here’s a breakdown:
## var:
Scope: Variables declared with var are either globally scoped or function/locally scoped.
Globally scoped: If a var variable is declared outside a function, it’s available for use throughout the entire window.
Function scoped: If declared within a function, it’s accessible only within that function.
Hoisting: var variables are hoisted to the top of their scope and initialized with a value of undefined.
Re-declaration and Updates: You can re-declare and update var variables within the same scope without errors.
```
var greeter = "hey hi";
var times = 4;
if (times > 3) {
var greeter = "say Hello instead";
}
// greeter is now "say Hello instead"
```
## let:
Scope: Variables declared with let have block-level scope. They’re limited to the block they’re declared in (e.g., within loops or conditionals).
Hoisting: Like var, let variables are hoisted but not initialized until the actual declaration.
Reassignment: You can reassign let variables, making them useful when you need to change a value over time.
```
let greeting = "hello";
if (true) {
let greeting = "hi"; // Different scope
}
// greeting is still "hello"
```
## const:
Scope: Like let, const also has block-level scope.
Reassignment: Variables declared with const cannot be reassigned after their initial assignment.
Use Case: Use const for values that should remain constant (e.g., mathematical constants, configuration settings).
```
const pi = 3.14;
// pi cannot be reassigned
```
Advantage: It improves code readability by clearly indicating immutability.
In summary:
Use let when you need to reassign variables within a block.
Use const for constants that shouldn’t change.
Minimize the use of var due to its function scope and potential issues
| kameshoff |
1,873,467 | What kind of content is available on PikaShow? | Have you ever found yourself endlessly scrolling through different streaming platforms, struggling to... | 0 | 2024-06-02T04:04:35 | https://dev.to/zikkam_gimm_9a55b4726481f/what-kind-of-content-is-available-on-pikashow-6c5 | pikashow, pikashowapk, downloadpikashow, movies | Have you ever found yourself endlessly scrolling through different streaming platforms, struggling to find something that catches your interest? If yes, then you might want to **_[check out PikaShow](https://www.pikashowgeeks.com/)_**. This platform has taken the online streaming world by storm, offering a wide array of content that caters to various tastes and preferences. Whether you're a movie buff, a sports enthusiast, or someone looking for kid-friendly content, PikaShow seems to have it all. But what exactly can you find on PikaShow? Let's dive in and explore the diverse content available on this platform.
## Exploring PikaShow
**What is PikaShow?**
PikaShow is an online streaming application that provides users access to a vast library of movies, TV shows, live TV channels, sports, and much more. It’s a one-stop-shop for all your entertainment needs, combining the best features of multiple streaming services into one.
**How to Access PikaShow?**
Accessing PikaShow is relatively simple. It can be downloaded on various devices, including smartphones, tablets, and smart TVs. The app is available for Android users and can be easily installed from their official website or other trusted sources. Once installed, you can explore the content without needing to go through lengthy sign-up processes.
## Movie Buff's Paradise
**Latest Movie Releases**
If you’re always on the hunt for the latest blockbusters, PikaShow has got you covered. The platform regularly updates its library with the newest releases from Hollywood, Bollywood, and other film industries around the globe. Whether it's a recent superhero flick or a much-anticipated sequel, you can find it here.
**Classic Movies**
Nostalgia hits hard, and sometimes you just want to kick back and watch a classic. PikaShow features a wide selection of timeless movies that have left an indelible mark on cinema. From golden-age Hollywood classics to evergreen Bollywood hits, there's plenty to choose from.
## Diverse Genres
**Action and Adventure**
For those who crave adrenaline-pumping action and thrilling adventures, PikaShow offers a rich collection of movies and shows that will keep you on the edge of your seat.
**Comedy**
Laughter is the best medicine, and PikaShow’s comedy section promises just that. From light-hearted rom-coms to stand-up specials, there's something to tickle everyone's funny bone.
**Drama**
If you enjoy intense storylines and complex characters, the drama category on PikaShow won't disappoint. You can find a range of critically acclaimed dramas that explore various facets of human emotion and relationships.
**Horror and Thriller**
Looking for something that will send shivers down your spine? The horror and thriller section on PikaShow offers a spine-chilling collection of movies and series that are perfect for a scary movie night.
**Sci-Fi and Fantasy**
For fans of the fantastical and futuristic, PikaShow's sci-fi and fantasy genres offer an escape into worlds beyond imagination. From space operas to magical realms, there's plenty to explore.
## TV Shows Galore
**Popular TV Series**
Binge-watching your favorite TV shows has never been easier. PikaShow hosts a plethora of popular TV series, spanning various genres and appealing to different tastes. Whether you’re into crime dramas, comedies, or fantasy epics, you'll find plenty to keep you entertained.
**Exclusive Web Series**
In addition to mainstream TV shows, PikaShow also offers exclusive web series that you might not find on other platforms. These unique series often bring fresh and innovative storytelling that can become your next binge-worthy obsession.
## Global Content
**Hollywood**
Hollywood continues to dominate the global entertainment industry, and PikaShow has a vast collection of Hollywood movies and TV shows. From the latest releases to classic hits, there’s a wealth of content to dive into.
**Bollywood**
For fans of Indian cinema, PikaShow provides an extensive selection of Bollywood movies, ranging from the latest blockbusters to timeless classics. The platform ensures that you stay updated with the vibrant world of Bollywood.
**Regional Cinema**
PikaShow isn’t limited to just Hollywood and Bollywood. It also features a variety of regional films from across India and other countries. Whether it's Tamil, Telugu, Malayalam, or Marathi cinema, you can explore diverse storytelling from different cultures.
## Live TV Streaming
**News Channels**
Stay informed with real-time updates from various news channels available on PikaShow. Whether it’s national or international news, you can keep yourself updated with the latest happenings around the world.
**Sports Channels**
Never miss a game with PikaShow’s extensive selection of sports channels. From cricket to football, you can watch live matches and stay updated with scores and highlights.
**Entertainment Channels**
For those who enjoy regular TV programming, PikaShow offers a variety of entertainment channels that include reality shows, soap operas, and more. It’s like having a cable subscription right on your streaming device.
## Kid-Friendly Content
**Animated Series**
PikaShow is a treasure trove for kids, with a vast array of animated series that cater to various age groups. From educational cartoons to fun animated adventures, there’s something for every young viewer.
**Educational Shows**
In addition to entertaining content, PikaShow also offers educational shows that can help children learn while they watch. These shows cover a range of subjects, including science, history, and geography, making learning fun and engaging.
## Sports Content
**Live Sports Events**
Sports enthusiasts can enjoy live streaming of various sports events on PikaShow. Whether it’s cricket, football, basketball, or any other sport, you can catch all the live action as it happens.
**Sports Highlights**
Missed the big game? No worries! PikaShow provides highlights and recaps of major sports events, so you can catch up on all the exciting moments you missed.
**Sports Documentaries**
For those who love to dive deep into the world of sports, PikaShow offers a range of sports documentaries. These films provide behind-the-scenes insights into the lives of athletes, historic games, and more.
## Music and Concerts
**Music Videos**
Whether you’re a fan of pop, rock, classical, or any other genre, PikaShow has an extensive library of music videos. You can watch your favorite artists and discover new music all in one place.
**Live Concerts**
Experience the thrill of live music from the comfort of your home with PikaShow’s collection of live concerts. From iconic performances to recent shows, you can enjoy a concert-like experience anytime.
## Documentaries and Specials
**Nature and Wildlife**
For nature enthusiasts, PikaShow offers a range of documentaries that showcase the beauty and diversity of the natural world. These films provide an immersive experience into the wonders of wildlife and the environment.
**Historical Documentaries**
History buffs can indulge in a variety of documentaries that explore significant events, historical figures, and ancient civilizations. These films provide educational insights and captivating storytelling.
**Biographical Specials**
PikaShow also features biographical documentaries that delve into the lives of famous personalities from various fields. These specials offer an in-depth look at the achievements and challenges of notable individuals.
## User Experience on PikaShow
**Interface and Usability**
One of the standout features of PikaShow is its user-friendly interface. The app is designed to be intuitive, making it easy for users to navigate through the vast content library. Whether you’re searching for a specific title or browsing through genres, everything is just a few clicks away.
**Download Options**
PikaShow offers the option to download content for offline viewing. This feature is particularly useful for those who want to watch their favorite movies and shows without worrying about internet connectivity.
**Subscription Plans and Pricing**
While PikaShow offers a lot of content for free, it also has premium options that provide access to exclusive content and additional features. The subscription plans are reasonably priced, making it accessible for a wide audience.
## Safety and Legal Concerns
**Content Legality**
One important aspect to consider is the legality of the content available on PikaShow. It’s crucial to ensure that the platform complies with copyright laws and offers licensed content to avoid any legal issues.
**Safety Measures for Users**
PikaShow implements various safety measures to protect its users. This includes secure payment options for subscriptions and regular updates to fix any potential security vulnerabilities.
## Alternatives to PikaShow
**Comparison with Other Streaming Services**
While PikaShow offers a diverse range of content, it’s always good to know about alternatives. Platforms like Netflix, Amazon Prime Video, and Disney+ also provide extensive libraries of movies, TV shows, and more. Comparing these services can help you choose the best option based on your preferences.
## Conclusion
In summary, PikaShow is a versatile streaming platform that offers a wide array of content to cater to different tastes. From the latest movie releases and popular TV shows to live sports and kid-friendly content, there’s something for everyone. The user-friendly interface, coupled with the option to download content, enhances the viewing experience. However, it's important to consider the legality of the content and explore alternative streaming services to make an informed choice.
## FAQs
**Is PikaShow free to use?**
Yes, PikaShow offers a lot of content for free, but it also has premium options that provide access to exclusive content and additional features.
**Can I download content from PikaShow?**
Absolutely! PikaShow allows users to download movies and TV shows for offline viewing, which is great for watching content without an internet connection.
**Is PikaShow safe for kids?**
PikaShow offers a range of kid-friendly content, including animated series and educational shows. However, it’s always advisable for parents to monitor their children’s viewing habits.
**How often is new content added to PikaShow?**
PikaShow regularly updates its library with the latest movies, TV shows, and other content, ensuring that there’s always something new to watch.
**Are there any ads on PikaShow?**
While the free version of PikaShow may include ads, subscribing to the premium plan can provide an ad-free viewing experience. | zikkam_gimm_9a55b4726481f |
1,873,280 | Mobilizing Others: Some Reflections | I just realized that I am not good at managing. Here are some reflections: I expected teammates to... | 0 | 2024-06-02T04:02:35 | https://dev.to/rossli/mobilizing-others-some-reflections-eic | management | I just realized that I am not good at managing. Here are some reflections:
I expected teammates to work at a certain standard and in a certain way that I hadn't specify or encourage. I feel a lack of vocabulary and awareness of praising others or saying positive things in general.
Although I was the team leader, I didn't feel like leading because I associate leadership with manipulation and coercion, which obviously I don't like therefore I don't want to project these influences towards my teammates.
I don't feel like repeating things (sticking to a certain format when writing the API document) because I thought words of team leader should be executed if no objection was raised. But that is not true.
I wanted to be a software developer partially because of the possibility of creating something great just by myself learning and developing. But that is not true for software developers. SDEs work with other SDEs with different skill levels and technical background, and staff from other departments such as design and product management with less tech-literacy. I can develop by myself and make cool stuff, but that is only for side-projects. For the "day job" (so to speak), working with others is a absolute necessity.
When I watch short videos (which I shouldn't) on platforms such as YouTube, one of the video types I watch is powerful figures commanding the team and getting things done. I guess it's me wanting to do the same thing but lacking the courage to do it.
So today is my first day of correcting these mistakes. I asked one of my roommates whether he was using my tools because I noticed the tools was misplaced. I have been putting this conversation off for a few days. My roommate said no and he didn't blame me at all for bringing up this issue. I felt a bit reassured. It's could be the most trivial thing to mention in a blog like this, but I want to start to do something to correct my habits no matter how small it is. | rossli |
1,873,466 | Where To Buy Bpc157 | Our user-friendly website makes navigating and purchasing products seamless, ensuring a hassle-free... | 0 | 2024-06-02T03:55:10 | https://dev.to/bernieperisie/where-to-buy-bpc157-2a58 | product | 
Our user-friendly website makes navigating and purchasing products seamless, ensuring a hassle-free experience from start to finish. Detailed product descriptions and transparent information empower our customers to make informed decisions about their purchases. Our dedicated customer service team is always available to assist with any inquiries, providing personalized support and guidance.
[Buy Now](https://primepeptides.co/products/bpc-157) | bernieperisie |
1,873,465 | Detailed Explanation of LangChain | 1. Preface With the rapid development of artificial intelligence technology, language... | 0 | 2024-06-02T03:54:04 | https://dev.to/happyer/detailed-explanation-of-langchain-1917 | ai, langchain, image, development | ## 1. Preface
With the rapid development of artificial intelligence technology, language models are increasingly being applied in the field of natural language processing (NLP). LangChain, as an emerging framework, is a comprehensive AI-driven language processing toolchain designed to provide developers and enterprises with a powerful, flexible, and easily extensible platform to accomplish various language processing tasks. This article will detail the background, core functions, application scenarios, and future development directions of LangChain.
## 2. Principles of LangChain
### 2.1. Input Parsing
When a user inputs text into LangChain, the system first uses NLP techniques to perform tokenization, part-of-speech tagging, named entity recognition, and other processes. This step aims to convert raw text data into structured information for subsequent processing. For example, for the question "How is the weather today?", the input parsing stage might identify "today" as a temporal adverb, "weather" as a noun, and "how" as an interrogative adverb.
### 2.2. Intent Recognition
After input parsing, LangChain further analyzes the text's intent. This usually involves machine learning classifiers trained to recognize user intent. For example, the question "How is the weather today?" might be classified as having the intent of "querying the weather."
### 2.3. Model Selection and Invocation
Once the user's intent is determined, LangChain needs to select one or more appropriate AI models to handle the request. These models might be pre-trained, such as GPT-3 or BERT, or fine-tuned for specific tasks. For example, for a weather query, LangChain might invoke a model specifically designed for weather forecasting.
### 2.4. Result Generation
Finally, LangChain converts the AI model's output into natural language text for the user to understand. This process may involve template filling, semantic deduplication, and other techniques to ensure the output text is both accurate and fluent.
## 3. Steps in LangChain
In LangChain, the implementation of principles mainly relies on the combination of natural language processing (NLP) techniques and artificial intelligence (AI) models.
### 3.1. Natural Language Processing (NLP)
NLP is the foundation of LangChain, responsible for parsing and understanding user input. NLP techniques include:
#### 3.1.1. Tokenization
Splitting text into words, phrases, or other meaningful elements (called tokens). This is the prerequisite for all subsequent processing steps.
#### 3.1.2. Part-of-Speech Tagging
Assigning a part-of-speech tag to each token in the text, such as noun, verb, adjective, etc. This helps understand the grammatical structure of the sentence.
#### 3.1.3. Named Entity Recognition (NER)
Identifying and classifying specific entities in the text, such as names of people, places, organizations, etc. This is crucial for understanding the user's specific intent.
#### 3.1.4. Dependency Parsing
Determining the dependency relationships between words in the text to reveal the deep structure of the sentence. This helps understand the meaning of the sentence.
#### 3.1.5. Intent Recognition
Based on the above NLP techniques, LangChain uses machine learning models to recognize user intent. This usually involves training a classifier, such as a support vector machine (SVM), random forest, or deep learning models like recurrent neural networks (RNN) or Transformers.
### 3.2. Artificial Intelligence (AI) Models
Once NLP processing reveals the user's intent, LangChain invokes the corresponding AI models to handle the request. These models can be:
#### 3.2.1. Pre-trained Models
Such as OpenAI's GPT or Google's BERT. These models are pre-trained on large-scale corpora and can understand and generate natural language text.
#### 3.2.2. Fine-tuned Models
Models fine-tuned for specific tasks or domains. These models are further trained on specific domain data based on pre-trained models to improve performance on specific tasks.
#### 3.2.3. Custom Models
Developers can build and train their own models according to LangChain's API and tools to meet specific business needs.
### 3.3. Result Generation
Finally, LangChain needs to convert the AI model's output back into natural language text for the user to understand. This process may involve:
#### 3.3.1. Template Filling
Using predefined templates to construct output text. This method is simple and fast but may lack flexibility.
#### 3.3.2. Generative Models
Using generative AI models, such as the GPT series, to generate natural language text. This method is more flexible and can generate more natural output but requires more computational resources.
#### 3.3.3. Post-processing
Performing necessary post-processing on the generated text, such as correcting grammatical errors, eliminating ambiguities, etc., to ensure the quality of the output.
## 4. Architectural Design
LangChain's architectural design follows these principles:
### 4.1. Modularity
Each component of LangChain is an independent module that can be developed, tested, and deployed separately. This design makes LangChain easy to maintain and upgrade.
### 4.2. Scalability
Through an API gateway, LangChain can easily integrate new components and services to meet changing needs.
### 4.3. Performance Optimization
LangChain uses efficient algorithms and hardware acceleration technologies to ensure processing speed and response time.
### 4.4. Security
LangChain is designed with security in mind, providing multi-layered security measures, including data encryption, access control, etc.
## 5. Technical Advantages
LangChain's technical advantages are reflected in:
### 5.1. Flexibility
LangChain supports multiple languages and dialects and can customize language models according to specific needs.
### 5.2. Extensibility
Through the API gateway, LangChain can seamlessly integrate with other systems and applications.
### 5.3. High Performance
Optimized algorithms and hardware acceleration ensure that LangChain maintains high performance when processing large amounts of data.
### 5.4. Security
LangChain provides strict data protection measures to ensure the security and privacy of user data.
## 6. Functions of LangChain
### 6.1. Multimodal Interaction
LangChain supports various input methods, including text, voice, and images. This means users can interact with the AI system in different ways, depending on their preferences and context. For example, users can query the weather via voice input or upload an image to get related information.
### 6.2. Intelligent Recommendations
By analyzing users' historical interaction data and external data sources, LangChain can provide personalized recommendations. For example, if a user frequently queries about healthy eating, LangChain might recommend some healthy recipes or nutritional advice.
### 6.3. Sentiment Analysis
LangChain can perform sentiment analysis on user input to understand the user's emotional state. This is particularly important for providing high-quality customer service, as the system can adjust its response tone and content based on the user's emotions.
### 6.4. Knowledge Graph Integration
By integrating knowledge graphs, LangChain can provide richer and more accurate information. A knowledge graph is a graphical data structure that represents and organizes knowledge, helping AI systems understand the relationships and attributes between entities. For example, when answering a question about the "Eiffel Tower," LangChain can use the knowledge graph to provide information about its history, location, and architectural features.
### 6.5. Custom Models
LangChain allows developers to customize AI models according to their needs. This means that enterprises or individuals can train and deploy their models based on specific business logic and datasets to achieve personalized functions and services.
## 7. Future Development Directions
As technology continues to advance, LangChain is also evolving. In the future, it may achieve breakthroughs in the following areas:
### 7.1. Stronger Model Support
#### 7.1.1. New Model Integration
With the continuous emergence of new models, LangChain will continue to integrate the latest and most powerful language models to maintain technological leadership. By integrating new models, LangChain can play a role in more application scenarios.
#### 7.1.2. Model Fusion
In the future, LangChain may introduce model fusion technology, combining the advantages of multiple models to enhance overall performance. Model fusion technology can achieve better results in different tasks, improving the model's generalization ability.
### 7.2. Smarter Data Processing
#### 7.2.1. Automatic Data Augmentation
In the future, LangChain may introduce more intelligent data processing tools, such as automatic data augmentation and intelligent data cleaning, to further improve data processing efficiency. Automatic data augmentation tools can automatically generate diverse training samples based on data characteristics, enhancing the model's robustness.
#### 7.2.2. Data Quality Assessment
LangChain may also introduce data quality assessment tools to help developers evaluate and improve data quality. Through data quality assessment tools, developers can promptly identify and correct issues in the data, ensuring high-quality training data.
### 7.3. More Convenient Development Experience
#### 7.3.1. Development Tool Optimization
LangChain will continuously optimize the developer experience, providing more user-friendly development tools and documentation to lower the development threshold. By optimizing development tools, LangChain can improve development efficiency and reduce developers' workload.
## 8. Application Scenarios of LangChain
### 8.1. Intelligent Customer Service
#### 8.1.1. Automatic Response
By integrating powerful language models, LangChain can build intelligent customer service systems that automatically answer user questions, improving customer satisfaction. Intelligent customer service systems can handle a large number of user requests, reducing the workload of human customer service.
#### 8.1.2. Sentiment Analysis
Intelligent customer service systems can also use sentiment analysis to understand the emotional state of users and provide more personalized services. Through sentiment analysis, businesses can better understand user needs and optimize products and services.
### 8.2. Content Generation
#### 8.2.1. Automatic Writing
LangChain can be used to automatically generate high-quality articles, reports, code, and other content, greatly improving productivity. Automatic writing tools can generate text content that meets requirements based on given topics and keywords.
#### 8.2.2. Text Summarization
LangChain can also be used to generate text summaries, helping users quickly grasp key information. With text summarization functionality, users can understand the main content of long articles in a short time.
### 8.3. Language Translation
#### 8.3.1. Multilingual Support
With multilingual support, LangChain can build high-precision machine translation systems to facilitate cross-language communication. Machine translation systems can automatically translate text from one language to another, improving communication efficiency.
#### 8.3.2. Real-time Translation
LangChain also supports real-time translation, enabling instant translation of user speech during conversations to facilitate cross-language communication. Real-time translation is valuable in international conferences, cross-border business, and other scenarios.
### 8.4. Sentiment Analysis
#### 8.4.1. User Feedback Analysis
By performing sentiment analysis on text, LangChain can help businesses understand user emotions and optimize products and services. Sentiment analysis tools can automatically identify emotional tendencies in user feedback, providing data support.
#### 8.4.2. Social Media Monitoring
LangChain can also be used to monitor user sentiment on social media, helping businesses stay informed about market dynamics. Through social media monitoring, businesses can quickly respond to user needs and enhance market competitiveness.
### 8.5. Medical Diagnosis
#### 8.5.1. Medical Record Analysis
In the medical field, LangChain can be used to analyze medical records and assist in diagnosis, improving the quality of medical services. Medical record analysis tools allow doctors to quickly access patient history information and make accurate diagnoses.
#### 8.5.2. Medical Literature Retrieval
LangChain can also be used to retrieve medical literature, helping doctors access the latest medical research findings. With medical literature retrieval tools, doctors can stay updated on the latest advancements in the medical field, enhancing their diagnostic capabilities.
### 8.6. Education Sector
In the education sector, LangChain can serve as an intelligent assistant for students, providing course recommendations, homework assistance, and learning resources. Additionally, it can help teachers assess students' learning progress and comprehension levels.
### 8.7. Smart Home
By integrating with smart home devices, LangChain can enable voice control, intelligent scene settings, and other functionalities. For example, users can say "turn on the living room lights" or "set the bedroom temperature to 22 degrees."
### 8.8. Entertainment Industry
LangChain can provide personalized entertainment content recommendations, such as music, movies, and games, based on user interests and behavior. This helps enhance user experience and increase content consumption.
## 9. Codia AI's products
Codia AI has rich experience in multimodal, image processing, and AI.
1.[**Codia AI DesignGen: Prompt to UI for Website, Landing Page, Blog**](https://codia.ai/t/pNFx)

2.[**Codia AI Design: Screenshot to Editable Figma Design**](https://codia.ai/d/5ZFb)

3.[**Codia AI VectorMagic: Image to Full-Color Vector/PNG to SVG**](https://codia.ai/v/bqFJ)

4.[**Codia AI Figma to code:HTML, CSS, React, Vue, iOS, Android, Flutter, Tailwind, Web, Native,...**](https://codia.ai/s/YBF9)

## 10. Conclusion
As an AI-driven language processing toolchain, LangChain not only provides developers and enterprises with a powerful platform but also has the potential to become a leader in the language processing field through continuous technological innovation and optimization. With ongoing advancements, LangChain will drive the widespread application and innovation of artificial intelligence technology, bringing more value to society. | happyer |
1,873,462 | Unifi Autobackup Data Recovery and Restore | Unifi Autobackup Data Recovery and Restore Unifi controller is a great piece of software... | 0 | 2024-06-02T03:52:45 | https://dev.to/kurtmc/unifi-autobackup-data-recovery-and-restore-1fc4 | unifi, bash, go | ---
title: Unifi Autobackup Data Recovery and Restore
published: true
tags: unifi, bash, go
---
# Unifi Autobackup Data Recovery and Restore
[Unifi controller](https://community.ui.com/releases/UniFi-Network-Application-8-0-24/43b24781-aea8-48dc-85b2-3fca42f758c9) is a great piece of software that allows you to easily manage hundreds of WiFi access points, configuring multiple SSIDs, VLAN, etc. The insights dashboard can help you identify clients performance issue and rogue APs. In general I think Unifi is a great tool for home or small business use. So you might have guess, this is a cautionary tale that I hope you don't have to experience yourself since you have a robust backup process that is tested regularly!
Some background: at my work we run Unifi network controller on AWS EC2. There is a redundant backup process, each day we make a full snapshot of the data directory of the Unifi controller application. We do this by first stopping the application, running a simple tar command `tar -czvf $(unifi--data-$(date +%s).tar.gz) config/data`, upload the file to AWS S3 then starting the application back up again. Simple and effective. The restore process has been tested many times and works just as you'd expect. Just for good measure, Unifi provides an incremental backup file that it creates each day too, it creates an autobackup up with a name that looks something like this `autobackup_8.0.24_20240527_1200_1716811200004.unf`, and these are synced to AWS S3 as an insurance policy.
We made a couple mistakes with our S3 backup approach, we put a lifecycle rule on the bucket to delete files after a certain age. The intention was to be able to keep the last `n` backups, but in practice if something goes wrong with the backup process after a few days all the backups will get deleted. We should have implemented a monitor that checks that backups are being produced and alarm early if something is wrong so it can be fixed before any backups get deleted. Hindsight is 20/20.
Some work was being carried out on the EC2 instance that runs Unifi and as part of a normal procedure with these types of third party applications that we run, the instance was terminated and a new one created that would usually look for the latest backup and run the restore procedure automatically. The new instance never restored the data and when it was investigated, we noticed that all the backups were missing.
No worries, the autobackups were still on S3, surely we can just use that right?!

```
Error restoring backup
"{filename}" is not a valid backup.
```
*For the purposes of helping out others who might be in this situation, this all relates to version 8.0.24 of Unifi controller and specifically we were using this docker image https://hub.docker.com/r/linuxserver/unifi-controller which is now deprecated and you should be using the following instead https://hub.docker.com/r/linuxserver/unifi-network-application *
**WHAT!**
Ok, there must be something useful in the HTTP response:
```
HTTP/1.1 400
X-Frame-Options: DENY
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Date: Sun, 02 Jun 2024 03:00:25 GMT
Connection: close
{"meta":{"rc":"error","msg":"api.err.InvalidBackup"},"data":[]}
```
Nope just a 400.
## Can anything be done?
So there is some hope here, I found some things online which can help us inspect the data. First step, there is this repository which provides a bash script to decrypt the backup: https://github.com/zhangyoufu/unifi-backup-decrypt
```
wget https://raw.githubusercontent.com/zhangyoufu/unifi-backup-decrypt/master/decrypt.sh
chmod +x decrypt.sh
./decrypt autobackup_8.0.24_20240527_1200_1716811200004.unf autobackup.zip
```
This produces a zip file, that seems to be completely broken:
```
$ unzip autobackup.zip
Archive: autobackup.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of autobackup.zip or
autobackup.zip.zip, and cannot find autobackup.zip.ZIP, period.
```
but, this can be extracted further if you use [7zip](https://www.7-zip.org/download.html), which can be installed on Linux or Mac:
```
# Ubuntu
sudo apt install p7zip-full
# Arch Linux
pacman -S p7zip
# Mac
brew install p7zip
```
Now extract the zip:
```
7z x autobackup.zip
```
This produces `db.gz`, which can further be extacted with `gunzip` to produce a BSON file named `db`
```
gunzip db.gz
```
Now the `db` file can be converted to plain text with MongoDB Database Tools, which can be downloaded from here: https://www.mongodb.com/try/download/database-tools
```
bsondump db > dump.json
```
This may produce a very large file depending on your Unifi deployment size and if you look into the data you see sections and data that seems to be for that section. For for example the lines after `{"__cmd":"select","collection":"devices"}` contain all the mongodb objects in the `devices` collection
I wrote a [small program in go](https://github.com/kurtmc/blog/blob/master/2024-06/unifi-autobackup-data-recovery-and-restore/files/main.go) that can be used to load this data directly into the mongodb database. Which you can do by following these steps:
Copy the `dump.json` file into the container:
```
docker container cp dump.json 5ab135e2d58b:/dump.json
```
Download and run the program:
```
docker exec -it 5ab135e2d58b bash
curl -O https://github.com/kurtmc/blog/raw/master/2024-06/unifi-autobackup-data-recovery-and-restore/files/unifi-restore
./unifi-restore /dump.json
```
Depending on the size of your backup, this can take hours, but once it has completed you should restart the Unifi application. If the program fails, make sure you read the error, it may be due to the buffer size being too small or the max token size being too small, both of which can be configured using environment variables.
I hope you don't find yourself in this situation where you must rely on the autobackups, but if you do, I hope this helps!
| kurtmc |
1,873,464 | Bug Bounty Recon <nmap> | Bug Bounty Recon with Nmap Step 1: Install Nmap If you're using Kali Linux, Nmap should... | 0 | 2024-06-02T03:50:51 | https://dev.to/hax/bug-bounty-recon-3mgf | tutorial, beginners | ## Bug Bounty Recon with Nmap
**Step 1: Install Nmap**
If you're using Kali Linux, Nmap should already be installed. If not, you can install it using the following command:
```bash
sudo apt update
sudo apt install nmap
```
**Step 2: Determine Target Scope**
Decide on the scope of your bug bounty reconnaissance. This could be a specific domain, IP range, or target organization.
**Step 3: Scan for Live Hosts**
Run an initial scan to identify live hosts within your target scope. Replace `target` with your desired target (domain, IP range, etc.).
```bash
nmap -sn target
```
**Step 4: Perform Service Detection**
Once you've identified live hosts, perform service detection to determine which services are running on each host. This will help you identify potential attack vectors.
```bash
nmap -sV target
```
**Step 5: Scan for Open Ports**
Conduct a comprehensive scan to identify open ports and services on each live host. This will provide more detailed information about potential entry points.
```
nmap -p- target
```
**Step 6: Conduct Version Detection**
Perform version detection to identify specific versions of services running on open ports. This information can help you determine if any known vulnerabilities exist.
```
nmap -sV -p<ports> target
```
Replace `<ports>` with a comma-separated list of ports you want to scan.
Example:
```
nmap -sV -p80,443 example.com
```
**Step 7: Conduct OS Detection (Optional)**
Optionally, you can conduct OS detection to determine the operating system running on each host.
```
nmap -O target
```
**Step 8: Perform Aggressive Scan (Optional)**
For a more aggressive scan, use the `-A` flag to enable OS detection, version detection, script scanning, and traceroute.
```
nmap -A target
```
**Step 9: Analyze Results**
Review the scan results to identify potential vulnerabilities or misconfigurations. Pay attention to open ports, services, and version numbers.
**Step 10: Further Enumeration (Optional)**
Depending on the results of your initial scans, you may want to conduct further enumeration using additional tools or techniques, such as vulnerability scanners, web application scanners, or manual testing.
Remember especially being newer to bug bounty utilize sites like HackerOne and the HackerOne Academy and tons of other free resources to help you learn anything you want!! | hax |
1,873,385 | Make Maintainable Python Project | Imagine you have personal python project several months ago. You try to re run it on your pc but it... | 0 | 2024-06-02T03:49:37 | https://dev.to/bimaadi/make-maintainable-python-project-4jme | python, softwaredevelopment, datascience | Imagine you have personal python project several months ago. You try to re run it on your pc but it not work. You face some error like missing depedencies, incompatible python version etc. It take a day to solve that issue. Imagine if this in your day job. Your python project must work on production server and your
college pc as well. Facing this issue over and over is not productive.
In this blog I will show you how to eleminate this problem to make your python project maintainable. Using some common python project best practice.
## 1. Define your python version
Every python depedencies has diffrent python version requirement. For example python 2.7 (who still use python 2.7 in 2024??) it can only work with django version 1.8. Fastapi need minimum python 3.5 because feature typehint first introduce on python 3.5.
Where should I define python version? personally I put it on README.md. I create section called requirement then I put it on their. You can see on this github repo [https://github.com/BimaAdi/Make-Maintainable-Python-Project](https://github.com/BimaAdi/Make-Maintainable-Python-Project).
## 2. Using virtual environtment
By default when using pip if you do `pip install {some package}` it will store globaly and will be available to all your project.The problem is not all your project use that all depedencies. For example you have multiple project one about machine learning and other about backend development.Machine learning project use some machine learning related package such as numpy, pandas, scikit learn etc while backend project use some backend related packagesuch as Django. Your machine learning project doesn't need django and neither your backend project doesn't need numpy nor scikit learn. By using virtual environtment you
encapsulated depedencies for every project.
To create virtual environtment on your project folder run command:
```
python -m venv env
```
On your project folder you will see an env folder. This folder will store your python intepreter and python depedencies. To use your newly created environtment you can use command:
linux and macos (bash or zsh)
```
source env/bin/activate
```
windows (command promt)
```
env\Scripts\activate.bat
```
windows (powershell)
```
env\Scripts\activate.ps1
```
After run that command you notice that your terminal/command promt/powershell have (env) on the left side.

This mark that you no longer use your global python intepreter, but you use python intepreter on your env folder. If you perform `pip list` you also notice that you don't have any package depedencies.

When you perform `pip install {some package}` while you have (env) you will store it on your env folder. Try `pip install Faker pandas` then `pip list` you will see that it installed on your env folder.

To use my global python intepreter back. You can create new terminal/command promt/powershell or you deactivate the environtment using command `deactivate`. Don't push env folder to git repository. Make sure to add env folder to your .gitignore.
## 3. Note your project depedencies using requirements.txt
When your project grow larger you need more depedencies. Install all depedencies manualy is not efective. You also need to define what version your python depedencies need. To solve that problem we can use requirements.txt. requirements.txt it just a txt file that store your python depedencies.
To generate that file on terminal while you using virtual environtment run command `pip freeze > requirements.txt`. `pip freeze` will print all depedencies and it's version in your virtual environtment on terminal while `> requirements.txt` to put output on requirements.txt.

After you run that file you notice new file requirements.txt. To reinstall python depedencies you just need run command `pip install -r requirements.txt`. Make sure whenever you add new depedencies to your
project update your requirements.txt using `pip freeze > requirements.txt`.
To make it more clear I have some code example that generate fake user data then stored in csv that use all these tips. You can see it from this github repo
[https://github.com/BimaAdi/Make-Maintainable-Python-Project](https://github.com/BimaAdi/Make-Maintainable-Python-Project)
That's all guys there are still more tips to make maintainable python project such as project structure, using testing, formater, etc, But I want to scope it just to python specific project, general and as minimal as possible. If you have more tips or you have diffrent opinion you can add it on comment section below. Cheers.
| bimaadi |
1,873,288 | Transform Game Visuals Using Meta AI | Overview In my last article, I ended with a promise to explain how I prepared the assets... | 0 | 2024-06-01T22:03:03 | https://giftmugweni.hashnode.dev/transform-game-visuals-using-meta-ai | whatsapp, ai, imagegeneration | ## Overview
In my last article, I ended with a promise to explain how I prepared the assets for the Flappy Bird clone I made. The game is simple, so basic features like sound and fonts could be easily sourced or created. As such, the true difficulty for me lay in the visual assets.
Now, I have a confession to make. I have zero art skills and it might lean in the negative. For some reason, I find the field more difficult than any engineering or calculus classes I attended with many difficult topics like colouring, proportions, framing, lighting, symmetry, placement, and probably other things I don't even know I don't know.
This was a problem considering I in my infinite wisdom gave myself the challenge of producing my assets for the games I would be making within reason. So what to do?... what to do? This was the question that troubled me as I explored the rabbit hole of learning pixel art. Initially, I just stuck to my guns and continued learning about pixel art. And for my effort, I obtained these wonderful images as assets for my Flappy Bird game.
### The Background

### The Bird

### The Pipe

🤔🤔🤔 Now I don't know about you but I was mighty pleased with my pipe image ... Though the bird and background left a lot to be desired.
## Solution
As I was coding forward and ignoring the funky visuals, I habitually opened the WhatsApp app on my phone and after getting annoyed by the new update that changed the layout of things, I noticed the new shiny blue button for conversing with the Meta AI bot.
Like everyone, I was very aware of the current hype regarding AI tools like ChatGPT, and Github Copilot. I even remembered about the image generation models like Stable Diffusion. Though I personally never found much practical use with them, and hence ended up not using them all that much, Something about the Llama model being just there on my WhatsApp without me having to go to separate sites or download dodgy apps just compelled me to test it out.
Initially, I just typed random messages and tried conversing with the bot. I quickly realized that was a dead end and gave up on that vector. I then learnt that it can also generate images which was great and so I gave it a prompt to test it out.
> **/imagine** *an anime fight scene between superman and micky mouse*
To which I got.

At that moment, it clicked for me. Why don't I use this bot to generate my game assets? It obviously wouldn't be perfect but I was sure if I prompted it just right I should be able to get something reasonably decent.
To test if my idea was feasible, I proudly asked the bot.
> /imagine a pixel sprite of a dog
To which it fully complied and gave me the below image.

😅Yeah this one was on me. I should have seen it coming but I refused to give up and made a follow-up response.
> Use only 8 of color bits
This finally gave me what I was looking for.

After this point, there's not much more to tell really. I just went about prompting the bot and tweaking my responses to get images more aligned with what I wanted. I found this strategy worked great for big background scenes which was truly a sight to behold.
### The New Background
> /imagine an 8 bit image background showing clouds floating in the air and mountains down below... There's bright green grass with trees and flowers dotting the land scape

> /imagine an 8 bit pixel image background of rolling hills

> Make the image so that it can be tilled in both left and right directions

The last one is the image used in the game though I had to edit it a bit to remove the none nonexistent tree which was way easier than trying to draw this scene in any reasonable amount of time.
### The New Bird
Like the background, the bird was also relatively easy to make with only a few minor prompts here and there.
> /image an 8 bit image of a bird flying through a forest in a side scroller game

> make the bird yellow

> make the bird more simplistic

> increase the pixel density

### The New Pipe
Now for this one, I gotta be honest. It wasn't worth it. Sadly I realized belatedly that the model struggled quite a lot with creating the pipe which was likely caused by the dataset it learnt from and my use case probably falling on the fringes. In the spirit of completeness and sharing here are some of the responses I got.
> /image an 8 bit green pipe like in Mario with a forest background for a side scroller game

> /image an 8 bit green pipe shooting from the ground and sky with a forest background for a side scroller game

This one was interesting in how it generated a watermark in front to hide the AI watermark 🤷♂️.
> simplify the pipe and remove the bends

> /image a green 8 bit vertical pipe in a side scroller game

Anyways... these are a few of the responses I was getting and this back-and-forth went on for quite some time before I got the somewhat passable pipe I ended up using in the game.
In all honesty, though I probably should have just used the one I made. It would have been quicker and more in line with what I had envisioned in my head.
## Conclusion
Overall, I was quite impressed with how useful the Meta AI bot was in helping me create assets that are not only presentable but downright beautiful. Even when it failed to create what I had in mind, I still found myself in awe at the visuals it created.
From a more utilitarian perspective though, the bot excels greatly at generating large background scenes and characters which gives some much-needed life to your game's visuals and I plan to continue using it for these use cases going forward. However, it must be noted that for much simpler objects like the pipe, it's probably best to just make those on your own. | gift_mugweni_1c055b418706 |
1,868,463 | Unleash The Power of Azure: Creating A Linux VM with SSH keys Security. | Hey dev.to community! Ready to level up your cloud game? Today we're diving into Microsoft Azure to... | 0 | 2024-06-02T03:30:27 | https://dev.to/fola2royal/unleash-the-power-of-azure-creating-a-linux-vm-with-ssh-keys-security-17i4 | cloudengineering, virtualmachines, vmcreations, azure | Hey dev.to community! Ready to level up your cloud game? Today we're diving into Microsoft Azure to create a Linux virtual Machine(VM) with the added security of SSH keys. Ditch those risky passwords and embrace a more secure way to access your cloud resources.
**Why SSH keys on Azure?**
Let's kick things off with a quick rundown of why SSH keys are the way to go for your Azure VMs:
- Fortress-like Security: SSH keys offer solid protection against brute-force attacks, making your VM virtually impenetrable.
- Streamlined Access: Say goodbye to typing passwords every time you log in. SSH keys make connecting to your VM seamless.
- Automation Ace: SSH keys are a delight for automating y=tasks like deployments, updates and maintenance on your VM
**What You'll Need For This Adventure**
- An Azure Account: No account? No problem! Sign up for a free Azure trial to get started.
- Linux Knowledge: Basic familiarity with Linux commands, and Azure portal will make it a breeze.
Let's Build Your Linux Fortress!
**Step 1: log in to Azure portal**
Head over to Azure portal(_https://portal.azure.com/_) and log in with your credentials.
**Step 2: Create a New Virtual Machine**
Just like creating a windows VM from our last post:
- Go to the search box and type "virtual machine" then click.
- On the Virtual machine page, click "Create", under create click on the option "Azure virtual machine"

3. Create a Resource group
4. Name your VM (e.g. "MyLinuxVM").
5. Select your region(for optimal performance, choose one close to you).
6. Choose an Availability zone(e.g. Zone 1, 2 or any other option peculiar to you)
7. Leave security type in its default state(Trusted Launch)
8. Under "Image", pick your preferred Linux distribution e.g. Ubuntu.

**Step 3: Authentication**
- Under "Authentication Type" select "SSH public key"
**Configure Your VM**
- Choose the VM size that matches your needs, start small; you can always scale up later
- Set up network if needed:; you can leave at default network provided by Azure.

- Inbound port should be on SSH(22)
_ Leave every other configuration at their default for now as our main focus is creating a VM with Linux OS


**Step 5: Review and Create**
Give your settings a final check and click "Create". Azure will get to provisioning your Linus VM once your validation is passed.
N:B Validation may not get passed when some of your configurations(Network, image, region, resource and others) are not complete or unsupported by Azure at the moment or by Azure services. Once you get such feedback, you can go back and double check where the error lies, then align.

- While Azure is provisioning your Linux VM, copy the prompt on your screen "Download private key and create resource"
Just like the windows VM, your deployment gets complete

**Step 6: Connect with your SSH key**
- Click on "Go to resources" select "Connect" then "Native SSH" this opens up instructions on how to connect to your Linux VM, but we shall connect using the CLI or the Powershell.

- Open a CLI or Powershell from your PC
- Type in the following command "ssh -i /path/to/your/private key/ your vmuser@yourvmpublicIP for example:
ssh C:\Users\User\Documents\Mytestubuntu_key.pem azureuser@ 20.75.82.93 press "Enter"
And Voila! here comes your Linux VM interface

| fola2royal |
1,873,461 | Essential Helper Functions for Your JavaScript Projects | When working on various JavaScript projects, I often find myself needing some handy helper functions... | 0 | 2024-06-02T03:23:44 | https://dev.to/utkuyceng/essential-helper-functions-for-your-javascript-projects-1o7e | react, nextjs, javascript, webdev | When working on various JavaScript projects, I often find myself needing some handy helper functions to simplify repetitive tasks. Below are some of the helper functions that have proven to be very useful in my projects. These functions cover a range of tasks from string manipulation to number checks and date formatting.
**1. Capitalize the First Letter of a String**
This function takes a string and capitalizes the first letter while converting the rest of the string to lowercase. This is particularly useful for formatting names or titles.
```
export const capitalizeFirstLetter = (word?: string) => {
return word ? word.charAt(0).toUpperCase() + word.toLocaleLowerCase().slice(1) : '';
};
```
**2. Format an Array to a Sentence**
When you have an array of strings that you need to format as a sentence, this function joins the array elements with commas and replaces the last comma with "and".
```
export const formatArrayToSentence = (stringArr: string[]) => {
if (!stringArr?.length) return '';
return stringArr.join(', ').replace(/, ([^,]*)$/, ' and $1.');
};
```
**3. Format Date**
This function uses the moment library to format dates. It can format a date to DD/MM/YYYY or to a time format HH:mm A based on the isTime flag.
```
import moment from 'moment';
export const formatDate = (date: string, isTime = false) => {
if (!date) return '';
const parsedDate = moment(date);
if (isTime) return parsedDate.format('HH:mm A');
return parsedDate.format('DD/MM/YYYY');
};
```
**4. Truncate Text**
To shorten a text string to a specified length and append an ellipsis (...), use this function. It ensures the text does not exceed the desired length.
```
export const truncateText = (text: string, maxLength: number) => {
if (text.length <= maxLength) return text;
return text.substring(0, maxLength) + '...';
};
```
**5. Check for Uppercase, Lowercase, Numbers, and Special Characters**
These functions use regular expressions to check if a string contains at least one uppercase letter, one lowercase letter, one number, or one special character. These are particularly useful for password validation.
```
export const containsAtleastOneUpperCase = (val: string) => /(?=.*?[A-Z])/.test(val);
export const containsAtleastOneLowerCase = (val: string) => val ? /(?=.*?[a-z])/.test(val) : false;
export const containsAtleastOneNumber = (val: string) => /(?=.*[0-9])/.test(val);
export const containsAtLeastOneSpecialChar = (val: string) => /(?=.*[$&+,:;=?@#|'<>.^*_()%!-])/.test(val);
```
**Conclusion**
These helper functions are designed to make common tasks easier and your code more readable. By incorporating them into your projects, you can save time and ensure consistency across your codebase. Whether it's formatting strings, validating inputs, or checking object properties, these utilities cover a broad range of use cases that are essential in everyday JavaScript development. | utkuyceng |
1,873,428 | VS Code extensions for React developers | Introduction Visual Studio Code, often abbreviated as VS Code, is a free and open-source... | 0 | 2024-06-02T03:20:07 | https://dev.to/utkuyceng/vs-code-extensions-for-react-developers-4i7a | react, javascript, webdev, programming |
### Introduction
Visual Studio Code, often abbreviated as **VS Code**, is a free and open-source source code editor developed by Microsoft. It's known for its versatility, lightweight design, and extensive customization options, making it one of the most popular choices among developers across various programming languages and platforms.
### Essential Extensions
#### ESLint
**ESLint** is a powerful static code analysis tool widely used in React development for enforcing coding standards, identifying potential errors, and ensuring code consistency. Here's a breakdown of its benefits and features specifically tailored for React.
**Benefits for React development**
- **Code Consistency:** ESLint helps maintain consistent coding styles across React projects, even in teams with multiple developers. This is crucial for readability and maintainability.
- **Catch Common Errors:** React applications often have complex component hierarchies and state management. ESLint can catch common errors and pitfalls specific to React, such as missing key props, unused variables, or incorrect usage of lifecycle methods.
- **Enforce Best Practices:** ESLint can enforce React best practices, such as using propTypes, defaultProps, and proper usage of JSX, ensuring that React code follows established guidelines for performance and reliability.
- **Integration with Build Pipelines:** ESLint seamlessly integrates into build pipelines, enabling automatic code analysis during development or as part of continuous integration (CI) processes. This helps catch errors early in the development lifecycle.
**Features and functionality**
- **Customizable Rules:** ESLint comes with a wide range of built-in rules covering common JavaScript and React patterns. Additionally, it allows developers to create custom rules tailored to specific project requirements.
- **Extensible:** ESLint is highly extensible and supports plugins, enabling integration with tools like TypeScript, JSX, and frameworks beyond React.
- **Automatic Fixes:** ESLint not only identifies issues but can also automatically fix many of them through the `--fix` option or with editor integrations. This feature saves developers time by automating code cleanup tasks.
- **Editor Integrations:** ESLint seamlessly integrates with popular code editors like Visual Studio Code, Atom, and Sublime Text, providing real-time feedback and suggestions as developers write code.
- **Shareable Configurations:** ESLint allows teams to define shareable configurations, ensuring consistent rule sets across projects and enabling easy adoption of best practices.
- **Support for JSX:** ESLint has built-in support for JSX syntax, enabling it to analyze React-specific patterns and provide feedback on JSX usage.
#### Prettier
**Prettier** is a code formatting tool that automatically formats your code to ensure consistency and readability. Here's why it's particularly valuable for React development.
**Automatic code formatting**
- **Consistency:** Prettier enforces consistent code formatting across the entire codebase, ensuring that all developers adhere to the same style conventions. This consistency improves code readability and maintainability.
- **Time-Saving:** Instead of manually formatting code, Prettier automates the process, saving developers time and effort. This allows developers to focus on writing code rather than worrying about formatting details.
- **Error Reduction:** Manual code formatting can lead to errors, such as inconsistent indentation or misplaced brackets. Prettier eliminates these errors by automatically applying formatting rules, reducing the risk of bugs in the codebase.
- **Configurability:** While Prettier comes with sensible default formatting rules, it also offers configuration options to customize formatting preferences according to project requirements. Developers can adjust settings such as indentation size, line length, and whether to use single or double quotes.
**Integration with React projects**
- **Seamless Integration:** Prettier seamlessly integrates with React projects, supporting JSX syntax out of the box. This means it can format JSX elements, props, and expressions without any additional configuration.
- **Editor Integrations:** Prettier provides plugins or extensions for popular code editors like Visual Studio Code, Atom, and Sublime Text. These integrations enable developers to format code directly within their editor with a simple keystroke or automatically save.
- **Pre-commit Hooks:** Prettier can be set up as a pre-commit hook in version control systems like Git. This ensures that all code commits adhere to formatting standards before being pushed to the repository, maintaining consistency in collaborative projects.
- **Build Pipeline Integration:** Prettier can be integrated into build pipelines and CI/CD processes to automatically format code during development or as part of the deployment pipeline. This ensures that code formatting is consistently applied across all environments.
#### React-specific Extensions
##### React Developer Tools
**React Developer Tools** is a browser extension that provides developers with debugging and profiling capabilities specifically tailored for React applications. While it primarily operates within web browsers like Chrome and Firefox, it can complement the development workflow in Visual Studio Code (VS Code) through the following means:
**Integration with VS Code**
- **Direct Integration:** While React Developer Tools primarily functions as a browser extension, developers can use it in conjunction with VS Code by running their React applications in a browser window while simultaneously editing code in the VS Code editor.
- **Code Inspection:** While debugging React applications in the browser, developers can switch back and forth between the browser's developer tools and VS Code. They can inspect React component code in VS Code to understand and debug issues identified in the browser.
- **Code Navigation:** VS Code's built-in features, such as Go to Definition and Find All References, can be utilized to navigate through React component code, making it easier to trace the source of bugs identified using React Developer Tools.
**Features for debugging React applications**
- **Component Hierarchy:** React Developer Tools visually represents the component hierarchy for the currently rendered React application. Developers can inspect the hierarchy to understand how components are nested and composed.
- **Props and State Inspection:** Developers can inspect the props and state of individual components, allowing them to understand how data flows through the application and identify any inconsistencies or unexpected behavior.
- **Component Highlighting:** React Developer Tools highlights components in the browser's DOM inspector, making it easier to identify which components correspond to specific elements on the page.
- **Component Tree Navigation:** Developers can navigate through the component tree to inspect the props and state of parent, child, and sibling components, facilitating a deeper understanding of the application's structure and behavior.
- **Performance Profiling:** React Developer Tools includes features for performance profiling, allowing developers to identify performance bottlenecks and optimize rendering performance by analyzing component render times and re-renders.
##### ES7 React/Redux/GraphQL/React-Native Snippets
**ES7 React/Redux/GraphQL/React-Native Snippets** is a Visual Studio Code extension that provides developers with a collection of shortcut commands for quickly inserting common code snippets related to React, Redux, GraphQL, and React Native development. Here's why it's valuable for React developers:
**Shortcut commands for common React code snippets**
- **Efficient Code Writing:** This extension offers a set of predefined code snippets for commonly used React patterns, such as creating functional components, class components, stateless components, hooks, and more. Instead of typing out boilerplate code manually, developers can use these shortcuts to insert code snippets with minimal effort.
- **Standardized Code Structure:** By providing predefined snippets, the extension helps ensure consistent coding practices across projects and among team members. Developers can easily adhere to established coding conventions and patterns without needing to remember specific syntax or structure.
- **Support for Multiple Technologies:** In addition to React, the extension includes snippets for Redux, GraphQL, and React Native, allowing developers to quickly scaffold code for common tasks in these technologies. This versatility is particularly useful for full-stack developers or those working on projects that utilize multiple technologies.
**Increased productivity for React developers**
- **Faster Development Workflow:** With shortcut commands readily available, developers can significantly speed up their development workflow by reducing the time spent on repetitive tasks. This increased efficiency allows developers to focus more on implementing features and solving complex problems rather than on writing boilerplate code.
- **Improved Code Quality:** By standardizing code structure and reducing the likelihood of manual errors, the extension contributes to improved code quality. Developers can quickly generate code snippets that follow best practices, resulting in cleaner, more maintainable codebases.
- **Focus on Core Functionality:** With the ability to quickly insert common code snippets, developers can devote more time and attention to implementing business logic and application features, rather than getting bogged down in writing mundane code.
- **Reduced Cognitive Load:** The availability of shortcut commands alleviates the need for developers to remember specific syntax or patterns for common tasks. This reduction in cognitive load allows developers to maintain focus and productivity throughout the development process.
#### Extensions for State Management
##### Redux DevTools
**Redux DevTools** is an essential tool for React developers working with Redux, offering invaluable features for monitoring and debugging Redux state changes. Here's why it's crucial for React development:
**Monitoring Redux state changes**
- **Real-time State Inspection:** Redux DevTools provides a visual representation of the Redux store, allowing developers to monitor the application's state in real-time. They can view the current state and track changes made to the state over time, facilitating a deeper understanding of how data flows through the application.
- **Time-Travel Debugging:** One of the standout features of Redux DevTools is its ability to perform time-travel debugging. Developers can rewind and replay actions dispatched to the Redux store, enabling them to step through the application's state at different points in time. This feature is invaluable for diagnosing bugs, understanding application behavior, and reproducing issues reported by users.
- **Action Log:** Redux DevTools maintains a log of actions dispatched to the Redux store, along with the corresponding state changes triggered by each action. This action log provides developers with a comprehensive history of application events, making it easier to trace the flow of data and identify potential issues.
- **State Comparison:** Redux DevTools allows developers to compare different states of the application side-by-side, helping them identify differences and anomalies between states. This feature is particularly useful for
troubleshooting complex state management scenarios and optimizing application performance.
**Integration with VS Code for streamlined development**
- **Seamless Integration:** While Redux DevTools primarily operates within web browsers like Chrome and Firefox, developers can integrate it with VS Code by running their React applications in a browser window while simultaneously editing code in the VS Code editor.
- **Code Inspection:** While debugging React applications in the browser using Redux DevTools, developers can switch back and forth between the browser's developer tools and VS Code. They can inspect Redux-related code, such as action creators, reducers, and middleware, in the VS Code editor to understand and debug issues identified in the browser.
- **Code Navigation:** VS Code's built-in features, such as Go to Definition and Find All References, can be utilized to navigate through Redux-related code, making it easier to trace the source of bugs and understand the flow of data within the application.
- **Enhanced Development Workflow:** By integrating Redux DevTools with VS Code, developers can streamline their development workflow, seamlessly transitioning between writing code and debugging application state changes. This integration enhances productivity and facilitates more efficient development and debugging processes.
##### MobX React Developer Tools
**MobX React Developer Tools** is an extension designed to aid React developers who use MobX for state management. Here's why it's essential and the benefits it offers.
**Support for MobX state management**
- **Integration with MobX:** MobX React Developer Tools seamlessly integrates with MobX, providing developers with insights and debugging capabilities specific to MobX-powered React applications.
- **State Observation:** The extension allows developers to observe and inspect the MobX state tree in real-time. This feature enables developers to understand how data flows through the application and how changes to the state affect the UI.
- **Reaction Tracking:** MobX uses reactions to automatically update components when relevant data changes. MobX React Developer Tools help developers track these reactions, making it easier to identify which components are being updated in response to state changes.
- **Action Tracking:** MobX encourages the use of actions to modify the state in a predictable and observable manner. The extension tracks these actions, providing developers with a clear view of the actions that triggered state changes.
**Features and benefits for React developers**
- **Real-time State Inspection:** MobX React Developer Tools provide developers with a real-time view of the application's state, allowing them to inspect and debug the state tree as it evolves during runtime. This feature is invaluable for diagnosing bugs and understanding application behavior.
- **Action Replay:** Similar to Redux DevTools, MobX React Developer Tools support time-travel debugging by allowing developers to replay actions and inspect the state at different points in time. This feature simplifies the process of reproducing and debugging complex state-related issues.
- **Component Tracking:** The extension tracks which components are observing specific parts of the MobX state tree. This information helps developers understand the data dependencies between components and optimize re-rendering performance by minimizing unnecessary updates.
- **Performance Monitoring:** MobX React Developer Tools provide insights into the performance of MobX reactions and actions, allowing developers to identify potential bottlenecks and optimize the application's performance.
- **Enhanced Development Experience:** By offering features tailored specifically for MobX-powered React applications, MobX React Developer Tools enhance the development experience, making it easier for developers to build, debug, and maintain MobX-based React applications.
#### Testing and Debugging Extensions
##### Jest
**Jest** is a popular testing framework for JavaScript applications, particularly favored by React developers for its simplicity and robustness. Here's why it's essential and how it integrates with Visual Studio Code for testing React applications:
**Integration with VS Code for Jest testing**
- **Test Explorer Integration:** VS Code provides extensions like "Jest Test Explorer" that integrate Jest directly into the editor's interface. This integration displays a tree view of your test suite within VS Code, allowing you to run and debug tests without leaving the editor.
- **Debugging Support:** With Jest Test Explorer, you can debug your tests directly within VS Code. Set breakpoints, step through test code, and inspect variables—all within the familiar VS Code debugging interface.
- **Output Display:** VS Code captures Jest's output and displays it within its console, providing a seamless testing experience without cluttering your terminal window.
- **Configuration Options:** VS Code allows you to configure Jest directly from its settings, enabling you to customize Jest's behavior for your specific project needs without needing to modify configuration files manually.
**Streamlined test execution and debugging**
- **Fast Test Execution:** Jest's parallel test execution and smart test filtering capabilities ensure that your tests run quickly, even as your test suite grows. This enables developers to get rapid feedback on code changes, facilitating a faster development cycle.
- **Snapshot Testing:** Jest's snapshot testing feature allows you to capture the output of your React components and compare it against previously stored snapshots. This simplifies regression testing, ensuring that your UI components render consistently across code changes.
- **Built-in Matchers and Utilities:** Jest provides a rich set of built-in matchers and utilities for asserting test expectations, mocking dependencies, and handling asynchronous code. This reduces the need for external libraries and streamlines the testing process.
- **Interactive Watch Mode:** Jest's interactive watch mode automatically re-runs tests as you make changes to your code, providing immediate feedback on test results. This iterative testing approach encourages test-driven development (TDD) and helps catch regressions early in the development process.
#### Productivity Enhancers
##### Auto Import
**Auto Import** is a Visual Studio Code extension that automatically suggests and inserts import statements for modules and components in your JavaScript or TypeScript code. Here's how it benefits React developers and streamlines the development workflow:
**Automatic Import Suggestions for React Components:**
- **Effortless Import Management:** Auto Import analyzes your code and suggests import statements for modules and components that are not yet imported. For React developers, this means that when you reference a React component in your code, Auto Import will suggest the corresponding import statement, eliminating the need to manually write or search for imports.
- **Support for JSX and TSX:** Auto Import understands JSX syntax in React components and TSX files, allowing it to suggest imports for React components used within JSX expressions. This ensures that React components are properly imported and included in your codebase without errors.
- **Completion for Component Names:** When typing the name of a React component, Auto Import provides suggestions based on the available components in your project. This helps prevent typos and ensures that you import the correct component with the correct name.
**Streamlining Development Workflow:**
- **Time-Saving:** Manually managing import statements can be tedious and time-consuming, especially in large React projects with many components and modules. Auto Import automates this process, saving developers time and effort by suggesting and inserting import statements with a simple keystroke or automatically as you type.
- **Reduced Cognitive Load:** With Auto Import handling import statements, developers can focus more on writing code and implementing features, rather than worrying about managing imports. This reduces cognitive load and allows developers to maintain focus and productivity throughout the development process.
- **Prevent Errors:** Missing or incorrect import statements can lead to errors and runtime issues in React applications. Auto Import helps prevent these errors by ensuring that all required modules and components are properly imported and available for use in your code.
- **Consistent Code Structure:** By automatically inserting import statements according to predefined rules and conventions, Auto Import promotes consistency in code structure and organization across your React project. This makes it easier for developers to navigate and understand the codebase, especially when collaborating with team members.
##### GitLens
**GitLens** is a powerful Visual Studio Code extension that enhances the Git version control experience directly within the editor. Here's how it benefits React developers and supports collaborative development.
**Git Version Control within VS Code:**
- **Integrated Git View:** GitLens provides a comprehensive view of your Git repository directly within the VS Code interface. This includes information such as commit history, branches, tags, remotes, and more, allowing you to visualize and navigate your repository without leaving the editor.
- **Commit Annotations:** GitLens annotates each line of code with information about the most recent commit that modified it. This allows you to see who made changes to the code and when, providing valuable context while reviewing or debugging code changes.
- **Blame and History Views:** GitLens offers interactive blame and history views that allow you to explore the evolution of a file over time. You can easily navigate through previous revisions, view commit details, and understand the changes introduced in each commit.
- **Code Lens Integration:** GitLens integrates with VS Code's Code Lens feature to provide additional information and actions related to Git. This includes displaying commit and blame information inline with your code, as well as providing shortcuts for common Git operations such as comparing changes and navigating to commits.
**Features for Collaborative React Development:**
- **Collaborative Code Review:** GitLens facilitates collaborative code review by providing rich visualizations of code changes and commits history directly within the VS Code editor. This allows team members to review each other's code, provide feedback, and discuss changes without switching between different tools or platforms.
- **Branch Management:** GitLens offers features for managing branches, including creating, renaming, merging, and deleting branches directly from within VS Code. This streamlines the branch workflow and helps ensure that team members are working on the correct branches and collaborating effectively.
- **Conflict Resolution:** In collaborative development environments, conflicts may arise when multiple developers make changes to the same code simultaneously. GitLens provides tools for resolving merge conflicts within VS Code, helping teams to quickly and efficiently address conflicts and maintain code integrity.
- **Remote Repository Integration:** GitLens seamlessly integrates with remote Git repositories hosted on platforms like GitHub, GitLab, and Bitbucket. This allows team members to view and interact with remote branches, pull requests, and commits directly within the VS Code editor, simplifying the collaboration process.
### Conclusion
In conclusion, **Visual Studio Code (VS Code)** stands as a cornerstone for React development, offering a plethora of essential extensions tailored to enhance productivity, streamline workflows, and ensure code quality. With its lightweight design and extensive customization options, VS Code provides a versatile environment for developers across various programming languages and platforms.
| utkuyceng |
1,873,427 | Elegance in Simplicity Female Cassock Clergy Robes in White | Introduction Our White Female Clergy Cassock are designed for comfort and elegance. Perfect for women... | 0 | 2024-06-02T03:16:22 | https://dev.to/muzzamal_manzoor_725aa2d2/elegance-in-simplicity-female-cassock-clergy-robes-in-white-e24 | **Introduction**
Our [White Female Clergy Cassock](https://clergywearshop.com/product-category/clergy-robes-for-women/womens-cassock/) are designed for comfort and elegance. Perfect for women in religious roles, these robes blend tradition with modern style. Made from high-quality fabric, they are durable and easy to move in.
Symbolizing purity and dedication, these cassocks are ideal for all liturgical occasions. Tailored for a flattering fit, they offer a professional and graceful look. Embrace tradition and celebrate the important role of women in the clergy with our beautifully crafted white cassocks.

**Embracing Symbolism The Spiritual Significance of White**
**Purity and Holiness**
White has long been associated with purity and holiness in religious contexts, making it a fitting choice for clergy attire. Women who don white cassock robes not only embody these virtues but also serve as beacons of light and inspiration to their communities.
**Transparency and Clarity**
In addition to purity, the color white symbolizes transparency and clarity of purpose. Female clergy members don white cassock robes to convey their commitment to truth, honesty, and spiritual enlightenment in their roles as leaders and guides.
**Style and Design The Beauty of White Cassock Clergy Robes**
**Tailored Elegance**
White cassock clergy robes for women are crafted with meticulous attention to detail, featuring tailored cuts and graceful silhouettes that flatter the feminine form. These robes are designed to be both dignified and comfortable, allowing clergy members to move with ease during religious ceremonies and rituals.
**Subtle Embellishments**
While white cassock clergy robes exude simplicity, they often feature subtle embellishments such as delicate embroidery, lace trims, or decorative buttons. These embellishments add a touch of refinement and beauty to the robes without detracting from their overall purity and elegance.
**Clergy Cassock For Women**
The [Clergy Cassock for Women](https://clergywearshop.com/product-category/clergy-robes-for-women/) is a long robe worn by religious leaders. Traditionally worn by men, women are now also wearing cassocks as they take on more roles in the church.
Women’s cassocks are often designed to fit better, with small changes to make them more comfortable. This change shows that women are now being accepted as important leaders in religious communities.
While some people resist this change, more and more are welcoming it. The cassock for women is a sign of moving toward equality, keeping traditions alive while making room for everyone in religious leadership.

**Versatility and Practicality of White Cassock Clergy Robes for Every Occasion**
**Ceremonial Wear**
White cassock clergy robes are commonly worn during religious ceremonies, including baptisms, weddings, and funerals. Their pristine appearance adds a sense of solemnity and reverence to these sacred occasions, enhancing the spiritual experience for participants and observers alike.
**Everyday Attire**
Beyond ceremonial wear, white cassock clergy robes serve as everyday [Clergy Attire](https://clergywearshop.com/) for female clergy members, symbolizing their ongoing dedication to their faith and ministry. Whether presiding over worship services, conducting pastoral visits, or engaging in community outreach, these robes are a constant reminder of their sacred calling.
**Personalization and Customization: Making the Robes Your Own
Tailoring Options**
Many suppliers offer customization services for white cassock clergy robes, allowing women to tailor the fit and style to their preferences. From neckline options to sleeve lengths, these customization options ensure that each robe is uniquely suited to its wearer.
**Embroidered Details**
For a personal touch, some clergy members choose to embroider their white cassock robes with meaningful symbols, scriptures, or personal monograms. These embroidered details not only add aesthetic appeal but also serve as powerful reminders of the wearer's faith and journey.
**Where purchase Cassock and Robes**
Welcome to our clergy wear shop, your one-stop destination for all your religious attire needs. We offer a wide range of high-quality garments designed to meet the needs of clergy members from various denominations. Our collection includes cassocks, albs, stoles, surplices, and more, all crafted with attention to detail and comfort.
**Conclusion: Radiant in White**
In conclusion, female cassock clergy robes in white are more than just garments; they are symbols of purity, devotion, and spiritual clarity. From their timeless elegance to their profound symbolism, these robes speak volumes about the women who wear them and the sacred calling they embrace. With their graceful design, versatile wearability, and personalization options, white cassock clergy robes continue to inspire reverence and awe in both wearers and observers alike.
**FAQs (Frequently Asked Questions)**
**Q. Are white cassock clergy robes only worn by women?**
Ans. No, white cassock clergy robes are worn by clergy members of all genders, symbolizing purity and spiritual clarity.
**Q. Can white cassock clergy robes be customized?**
Ans. Yes, many suppliers offer customization options, allowing wearers to tailor the fit and style of their robes to their preferences.
**Q. What occasions are appropriate for wearing white cassock clergy robes?**
Ans. White cassock clergy robes are commonly worn during religious ceremonies, including baptisms, weddings, and funerals, as well as for everyday ministry activities.
**Q. How should white cassock clergy robes be cared for?**
Ans. It is recommended to follow the care instructions provided by the manufacturer, which may include gentle washing or dry cleaning to maintain the robes' pristine appearance.
**Q. Where can I purchase white cassock clergy robes?**
Ans. White cassock clergy robes can be purchased from specialty religious apparel stores, as well as online retailers that cater to clergy attire.
| muzzamal_manzoor_725aa2d2 | |
1,873,425 | Avoiding Pitfalls: The Case Against Passing setState as a Prop in React | React's state management is a powerful feature that allows developers to create dynamic and... | 0 | 2024-06-02T03:10:44 | https://dev.to/utkuyceng/avoiding-pitfalls-the-case-against-passing-setstate-as-a-prop-in-react-5018 | javascript, react, web, programming | React's state management is a powerful feature that allows developers to create dynamic and interactive user interfaces. A common practice in React applications is to manage state at higher levels in the component hierarchy and pass down state values and state-modifying functions (such as setState) as props to child components. However, this approach can lead to unexpected issues and is generally discouraged. This article explores the reasons why passing setState as a prop is not recommended and provides alternative strategies for state management in React.
**Understanding setState in React**
Before diving into why passing setState as a prop can be problematic, it is essential to understand how setState works in React. setState is a method used to update the state object of a component. When setState is called, React schedules an update to the component's state and subsequently re-renders the component and its children with the new state.
## Reasons to Avoid Passing setState as a Prop
**1. Violation of Encapsulation**
Passing setState as a prop breaks the encapsulation of the component's internal state. Encapsulation is a fundamental principle in software design that keeps the internal workings of a component hidden from the outside. When setState is passed down as a prop, child components gain direct access to modify the parent's state, leading to tightly coupled components. This makes the codebase harder to maintain and understand.
**2. Increased Risk of State Inconsistency**
When multiple child components have access to the same setState function, it increases the risk of state inconsistency. Different components might attempt to update the state simultaneously, leading to unpredictable behavior and difficult-to-debug issues. Proper state management ensures that updates are controlled and predictable.
**3. Complicates Component Reusability**
One of the core strengths of React is the ability to create reusable components. When setState is passed as a prop, the child component becomes dependent on the parent's state management logic. This dependency reduces the reusability of the child component since it cannot function independently or with a different state management approach.
**4. Hinders Testing and Debugging**
Components with encapsulated state are easier to test and debug because their behavior is self-contained. When setState is passed down as a prop, it introduces external dependencies that complicate unit testing. Tests must now account for the state management logic of parent components, making them more complex and less reliable.
## Alternative Strategies for State Management
**1. Lifting State Up**
A common pattern in React is to lift the state up to the nearest common ancestor of components that need to share state. Instead of passing setState down as a prop, you can pass the state itself and any necessary state-modifying functions. This approach keeps the state management logic centralized and maintains component encapsulation.
```
function ParentComponent() {
const [state, setState] = useState(initialState);
return (
<ChildComponent state={state} updateState={newState => setState(newState)} />
);
}
```
**2. Using Context API**
The Context API provides a way to share state across the entire component tree without passing props manually at every level. Context is especially useful for global state management, such as theming or user authentication.
```
const StateContext = createContext();
function ParentComponent() {
const [state, setState] = useState(initialState);
return (
<StateContext.Provider value={{ state, setState }}>
<ChildComponent />
</StateContext.Provider>
);
}
function ChildComponent() {
const { state, setState } = useContext(StateContext);
// Use state and setState as needed
}
```
**3. Custom Hooks**
Custom hooks can encapsulate stateful logic and make it reusable across multiple components. This approach keeps the state management logic separate from the component hierarchy, promoting better separation of concerns.
```
function useCustomState() {
const [state, setState] = useState(initialState);
const updateState = newState => {
setState(newState);
};
return [state, updateState];
}
function ParentComponent() {
const [state, updateState] = useCustomState();
return <ChildComponent state={state} updateState={updateState} />;
}
```
**Conclusion**
While passing setState as a prop might seem like a convenient solution for state management in React, it introduces several issues related to encapsulation, state consistency, reusability, and testing. By leveraging alternative strategies such as lifting state up, using the Context API, or creating custom hooks, developers can maintain cleaner, more maintainable, and predictable state management in their React applications. Adopting these best practices ensures that components remain encapsulated, reusable, and easier to debug and test. | utkuyceng |
1,873,424 | Email Marketing Made Easy: Leveraging Amazon SES for Powerful Campaigns | Email Marketing Made Easy: Leveraging Amazon SES for Powerful Campaigns Email marketing is... | 0 | 2024-06-02T03:07:16 | https://dev.to/virajlakshitha/email-marketing-made-easy-leveraging-amazon-ses-for-powerful-campaigns-1opp | # Email Marketing Made Easy: Leveraging Amazon SES for Powerful Campaigns
Email marketing is a powerful tool for businesses of all sizes. It allows you to reach your target audience directly, build relationships, and drive conversions. However, managing an email infrastructure can be complex and expensive. This is where Amazon SES (Simple Email Service) comes in.
### What is Amazon SES?
Amazon SES is a cost-effective, reliable, and scalable email service offered by Amazon Web Services (AWS). It allows developers to send transactional and marketing emails, with a focus on sending emails at scale and managing sending reputation. With SES, you don't need to manage your own email servers or infrastructure, freeing you to focus on your core business.
### Use Cases for Amazon SES
Amazon SES offers a wide range of use cases for businesses of all sizes. Here are five examples:
**1. Transactional Emails:**
Transactional emails are crucial for customer engagement and communication. Examples include:
* **Password Reset:** When a user forgets their password, sending a password reset email via SES ensures a secure and efficient process.
* **Order Confirmation:** Automating order confirmation emails through SES provides immediate feedback to customers, enhancing satisfaction.
* **Shipping Notifications:** Keeping customers informed about their order status through SES fosters trust and reduces customer inquiries.
* **Account Verification:** Sending account verification emails after registration ensures user authenticity and security.
**2. Marketing Campaigns:**
SES is a powerful tool for sending large-scale marketing campaigns. Examples include:
* **Newsletter Distribution:** Using SES, businesses can easily distribute newsletters to their subscriber base, providing valuable content and updates.
* **Promotional Emails:** Promote special offers, discounts, or new products through targeted email campaigns, leveraging SES's features for segmentation and personalization.
* **Welcome Emails:** Welcome new customers with a personalized email, encouraging engagement and loyalty.
* **Survey & Feedback Requests:** Gather valuable customer feedback using SES to send out surveys and feedback requests.
**3. Customer Support:**
SES can significantly improve customer support communication:
* **Automated Response Emails:** Create automated responses to common inquiries, freeing up support teams to focus on more complex issues.
* **Escalation Notifications:** Use SES to notify the appropriate team when a support ticket needs attention, ensuring prompt resolution.
**4. Lead Generation:**
SES can be utilized for lead generation campaigns:
* **Lead Nurturing Emails:** Automate email sequences to nurture leads, providing valuable information and encouraging conversion.
* **Lead Capture Forms:** Integrate SES with lead capture forms to collect contact information and nurture potential customers.
**5. Application Notifications:**
SES can send application-related notifications to users:
* **System Alerts:** Notify users about critical system events, updates, or security issues.
* **Progress Updates:** Provide users with updates on the progress of their tasks, applications, or services.
### Alternatives to Amazon SES
While Amazon SES is a robust service, other cloud providers offer similar solutions:
* **Google Cloud Platform (GCP): **Google Cloud offers **Cloud SendGrid** which provides features similar to SES, including transactional and marketing email sending, email analytics, and integrations.
* **Microsoft Azure:** Microsoft Azure provides **Azure Communication Services** which can be used for email sending, though it's more focused on communication services.
### Comparison of Features
| Feature | Amazon SES | Google Cloud SendGrid | Azure Communication Services |
|-------------------|------------------------------------------------|-------------------------|-----------------------------|
| Transactional Emails | Excellent | Excellent | Good |
| Marketing Emails | Excellent | Excellent | Moderate |
| Deliverability | Excellent, with robust features like sending reputation and feedback loops | Excellent | Good |
| Pricing | Pay-per-use, with competitive pricing | Pay-per-use | Pay-per-use |
| Integrations | Excellent, with numerous integrations available | Excellent | Good |
| Scalability | Highly scalable | Highly scalable | Highly scalable |
### Advanced Use Case: Building a Personalized Customer Journey with SES and Other AWS Services
Here's how we can utilize SES in conjunction with other AWS services to create a robust customer journey:
**Scenario:** An e-commerce company wants to personalize the shopping experience for its customers and increase conversions.
**Solution:**
1. **Customer Data Storage:** Use Amazon DynamoDB, a fully managed NoSQL database, to store customer data such as purchase history, browsing behavior, and preferences.
2. **Personalization Engine:** Implement a personalization engine using AWS Lambda, a serverless compute service, to analyze customer data and recommend relevant products or promotions.
3. **Email Triggering:** Integrate SES with the personalization engine to send personalized emails based on customer behavior. For example, send emails with product recommendations based on browsing history or abandoned cart reminders.
4. **Email Segmentation:** Utilize Amazon Pinpoint, a marketing automation service, to segment customers based on their demographics, purchase history, and engagement with emails. This allows for targeted email campaigns.
5. **Email Analytics:** Use Amazon CloudWatch, a monitoring and logging service, to track email performance metrics like open rates, click-through rates, and unsubscribes. This data can be used to optimize future campaigns.
**Benefits of this approach:**
* **Increased Conversion Rates:** Personalized emails and targeted campaigns lead to higher engagement and conversion rates.
* **Enhanced Customer Experience:** Customers feel valued when they receive personalized recommendations and communications.
* **Improved Data-Driven Decision-Making:** Email analytics provide insights that can be used to improve future marketing efforts.
### Conclusion
Amazon SES is a powerful and versatile email service that can help businesses of all sizes to send emails reliably, cost-effectively, and at scale. Whether you need to send transactional emails, run marketing campaigns, or manage customer support communications, SES offers the tools and features you need to succeed. By integrating SES with other AWS services like DynamoDB, Lambda, Pinpoint, and CloudWatch, you can create advanced solutions that personalize the customer journey and drive business outcomes.
| virajlakshitha | |
1,873,423 | Percona XtraDB Multi-Master Replication cluster setup between 3 nodes | This guide describes the steps to establish a Percona XtraDB Cluster v8.0 among three Ubuntu 22.04... | 0 | 2024-06-02T03:03:28 | https://dev.to/bidhanahdib/percona-xtradb-multi-master-replication-cluster-setup-between-3-nodes-45lb | database, devops, linux, systems | This guide describes the steps to establish a Percona XtraDB Cluster v8.0 among three Ubuntu 22.04 nodes.
Install Percona XtraDB Cluster on all hosts that you are planning to use as cluster nodes and ensure you have root access to the MySQL server on each node. In this setup, Multi-Master replication is implemented.
https://bidhankhatri.com.np/system/percona-xtradb-multi-master-replication-cluster-setup-between-3-nodes/
| bidhanahdib |
1,873,421 | Site-to-Site VPN between Mikrotik router and Ubuntu 22.04 through strongSwan using IPsec IKEv2 | We will configure a site-to-site IPsec IKEv2 tunnel between the Mikrotik Router and the StrongSwan... | 0 | 2024-06-02T03:02:21 | https://dev.to/bidhanahdib/site-to-site-vpn-between-mikrotik-router-and-ubuntu-2204-through-strongswan-using-ipsec-ikev2-3ola | networking, devops, beginners, linux | We will configure a site-to-site IPsec IKEv2 tunnel between the Mikrotik Router and the StrongSwan server. This will enable secure communication between devices connected behind the Mikrotik router and the StrongSwan server.
https://bidhankhatri.com.np/vpn/site-to-site-vpn-between-mikrotik-router-and-ubuntu-22.04-through-strongswan-using-ipsec-ikev2/ | bidhanahdib |
1,873,420 | HTTP request from Obsidian notes | Are you an Obsidian user looking to elevate your note-taking experience with dynamic data... | 0 | 2024-06-02T02:59:26 | https://dablog.pages.dev/en/articles/http_request_from_obsidian/ | obsidian, plugin, tutorial, productivity | Are you an [Obsidian](https://obsidian.md/) user looking to elevate your note-taking experience with dynamic data integration? Look no further than APIR ([api-request](https://rooyca.github.io/obsidian-api-request/)) – an Obsidian plugin designed to streamline HTTP requests directly into your notes.
## ⚡ How to Use
With APIR, integrating HTTP requests into your notes is a breeze. Simply create a code-block within your note, specifying the language as `req`. Inside this code-block, customize parameters such as URL, method, body, headers, and more to tailor your request precisely to your needs.
### 👨🏻💻 Example Code-block
~~~markdown
```req
url: https://my-json-server.typicode.com/typicode/demo/comments
method: post
body: {"id":1}
headers: {"Accept": "application/json"}
format: <h1>{}</h1>
req-id: id-persona
disabled
```
~~~
This example demonstrates how to send a POST request to a server, displaying the response 'id' field within an HTML heading tag. For more info about all the `flags` you can visit [APIR docs](https://rooyca.github.io/obsidian-api-request/).
Ready to revolutionize your note-taking workflow? **Try APIR today!** 🌟
---
P.S. If you find any bug, have any problem, doubt or want to add any functionality don't hesitate to write me. (You can also leave your issue at [https://github.com/Rooyca/obsidian-api-request/issues](https://github.com/Rooyca/obsidian-api-request/issues)) | rooyca |
1,873,285 | Hello World AVS: Dev Entrypoint | Welcome to the second post in our series on EigenLayer. Today, we'll dive into a practical example... | 0 | 2024-06-01T21:45:22 | https://dev.to/gaj/hello-world-avs-dev-entrypoint-f92 | crypto, blockchain, ethereum, solidity | Welcome to the second post in our series on EigenLayer. Today, we'll dive into a practical example with the "Hello World" AVS (Actively Validated Service). This guide will help you understand the basic components and get started with your own AVS on EigenLayer.
#### What is the Hello World AVS?
The "Hello World" AVS is a simple implementation designed to demonstrate the core mechanics of how AVSs work within the EigenLayer framework. This example walks you through the process of requesting, generating, and validating a simple "Hello World" message.
#### Key Components of Hello World AVS

1. **AVS Consumer**: Requests a "Hello, {name}" message to be generated and signed.
2. **AVS**: Takes the request and emits an event for operators to handle.
3. **Operators**: Picks up the request, generates the message, signs it, and submits it back to the AVS.
4. **Validation**: Ensures the operator is registered and has the necessary stake, then accepts the submission.
#### Setting Up Your Environment
Before you start, ensure you have the following dependencies installed:
- **npm**: Node package manager
- **Foundry**: Ethereum development toolchain
- **Docker**: Containerization platform
#### Quick Start Guide

1. **Start Docker**:
Ensure Docker is running on your system.
2. **Deploy Contracts**:
Open a terminal and run:
```sh
make start-chain-with-contracts-deployed
```
This command builds the contracts, starts an Anvil chain, deploys the contracts, and keeps the chain running.
3. **Start the Operator**:
Open a new terminal tab and run:
```sh
make start-operator
```
This will compile the AVS software and start monitoring for new tasks.
4. (Optional) **Spam Tasks**:
To test the AVS with random names, open another terminal tab and run:
```sh
make spam-tasks
```
### Hello World AVS: Code Walkthrough
In this section, we'll break down the code behind the "Hello World" Actively Validated Service (AVS) to understand its functionality and how it leverages EigenLayer.
#### Smart Contract: `HelloWorldServiceManager`
The `HelloWorldServiceManager` contract is the primary entry point for procuring services from the HelloWorld AVS. Here's a step-by-step explanation:
1. **Imports and Contract Declaration**:
```solidity
import "@eigenlayer/contracts/libraries/BytesLib.sol";
import "@eigenlayer/contracts/core/DelegationManager.sol";
import "@eigenlayer-middleware/src/unaudited/ECDSAServiceManagerBase.sol";
import "@eigenlayer-middleware/src/unaudited/ECDSAStakeRegistry.sol";
import "@openzeppelin-upgrades/contracts/utils/cryptography/ECDSAUpgradeable.sol";
import "@eigenlayer/contracts/permissions/Pausable.sol";
import {IRegistryCoordinator} from "@eigenlayer-middleware/src/interfaces/IRegistryCoordinator.sol";
import "./IHelloWorldServiceManager.sol";
contract HelloWorldServiceManager is
ECDSAServiceManagerBase,
IHelloWorldServiceManager,
Pausable
{
// ...
}
```
This section imports necessary libraries and defines the contract, inheriting from `ECDSAServiceManagerBase`, `IHelloWorldServiceManager`, and `Pausable`.
2. **Storage Variables**:
```solidity
uint32 public latestTaskNum;
mapping(uint32 => bytes32) public allTaskHashes;
mapping(address => mapping(uint32 => bytes)) public allTaskResponses;
```
- `latestTaskNum`: Keeps track of the latest task index.
- `allTaskHashes`: Maps task indices to task hashes.
- `allTaskResponses`: Maps operator addresses and task indices to responses.
3. **Constructor**:
```solidity
constructor(
address _avsDirectory,
address _stakeRegistry,
address _delegationManager
)
ECDSAServiceManagerBase(
_avsDirectory,
_stakeRegistry,
address(0),
_delegationManager
)
{}
```
Initializes the contract with the necessary addresses.
4. **Creating a New Task**:
```solidity
function createNewTask(
string memory name
) external {
Task memory newTask;
newTask.name = name;
newTask.taskCreatedBlock = uint32(block.number);
allTaskHashes[latestTaskNum] = keccak256(abi.encode(newTask));
emit NewTaskCreated(latestTaskNum, newTask);
latestTaskNum = latestTaskNum + 1;
}
```
This function creates a new task, assigns it a unique index, and stores its hash on-chain.
5. **Responding to a Task**:
```solidity
function respondToTask(
Task calldata task,
uint32 referenceTaskIndex,
bytes calldata signature
) external onlyOperator {
require(
operatorHasMinimumWeight(msg.sender),
"Operator does not have match the weight requirements"
);
require(
keccak256(abi.encode(task)) ==
allTaskHashes[referenceTaskIndex],
"supplied task does not match the one recorded in the contract"
);
require(
allTaskResponses[msg.sender][referenceTaskIndex].length == 0,
"Operator has already responded to the task"
);
bytes32 messageHash = keccak256(abi.encodePacked("Hello, ", task.name));
bytes32 ethSignedMessageHash = messageHash.toEthSignedMessageHash();
address signer = ethSignedMessageHash.recover(signature);
require(signer == msg.sender, "Message signer is not operator");
allTaskResponses[msg.sender][referenceTaskIndex] = signature;
emit TaskResponded(referenceTaskIndex, task, msg.sender);
}
```
This function allows operators to respond to tasks, verifying their identity and the integrity of their response.
6. **Helper Function**:
```solidity
function operatorHasMinimumWeight(address operator) public view returns (bool) {
return ECDSAStakeRegistry(stakeRegistry).getOperatorWeight(operator) >= ECDSAStakeRegistry(stakeRegistry).minimumWeight();
}
```
Checks if an operator meets the minimum weight requirement.
#### Operator Client Code
The operator client code interacts with the smart contract to register operators, monitor tasks, and respond to them.
1. **Setup**:
```javascript
import { ethers } from "ethers";
import * as dotenv from "dotenv";
import { delegationABI, contractABI, registryABI, avsDirectoryABI } from "./abis";
dotenv.config();
const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
```
Configures the provider and wallet using environment variables.
2. **Registering an Operator**:
```javascript
const registerOperator = async () => {
const tx1 = await delegationManager.registerAsOperator({ ... });
await tx1.wait();
console.log("Operator registered on EL successfully");
const salt = ethers.utils.hexlify(ethers.utils.randomBytes(32));
const expiry = Math.floor(Date.now() / 1000) + 3600;
const digestHash = await avsDirectory.calculateOperatorAVSRegistrationDigestHash(wallet.address, contract.address, salt, expiry);
const signingKey = new ethers.utils.SigningKey(process.env.PRIVATE_KEY);
const signature = signingKey.signDigest(digestHash);
const operatorSignature = { expiry, salt, signature: ethers.utils.joinSignature(signature) };
const tx2 = await registryContract.registerOperatorWithSignature(wallet.address, operatorSignature);
await tx2.wait();
console.log("Operator registered on AVS successfully");
};
```
Registers the operator with both the delegation manager and the AVS.
3. **Monitoring and Responding to Tasks**:
```javascript
const signAndRespondToTask = async (taskIndex, taskCreatedBlock, taskName) => {
const message = `Hello, ${taskName}`;
const messageHash = ethers.utils.solidityKeccak256(["string"], [message]);
const messageBytes = ethers.utils.arrayify(messageHash);
const signature = await wallet.signMessage(messageBytes);
const tx = await contract.respondToTask({ name: taskName, taskCreatedBlock }, taskIndex, signature);
await tx.wait();
console.log(`Responded to task.`);
};
const monitorNewTasks = async () => {
await contract.createNewTask("EigenWorld");
contract.on("NewTaskCreated", async (taskIndex, task) => {
console.log(`New task detected: Hello, ${task.name}`);
await signAndRespondToTask(taskIndex, task.taskCreatedBlock, task.name);
});
console.log("Monitoring for new tasks...");
};
```
Monitors for new tasks and responds with a signed message.
4. **Main Function**:
```javascript
const main = async () => {
await registerOperator();
monitorNewTasks().catch(console.error);
};
main().catch(console.error);
```
Initializes the process by registering the operator and starting task monitoring.
#### Task Spammer
A simple script to create tasks at regular intervals for testing purposes.
1. **Setup**:
```javascript
import { ethers } from 'ethers';
const provider = new ethers.providers.JsonRpcProvider(`http://127.0.0.1:8545`);
const wallet = new ethers.Wallet('your-private-key', provider);
const contractAddress = 'your-contract-address';
const contractABI = [ ... ];
const contract = new ethers.Contract(contractAddress, contractABI, wallet);
```
2. **Generating Random Names**:
```javascript
function generateRandomName() {
const adjectives = ['Quick', 'Lazy', 'Sleepy', 'Noisy', 'Hungry'];
const nouns = ['Fox', 'Dog', 'Cat', 'Mouse', 'Bear'];
return `${adjectives[Math.floor(Math.random() * adjectives.length)]}${nouns[Math.floor(Math.random() * nouns.length)]}${Math.floor(Math.random() * 1000)}`;
}
```
3. **Creating New Tasks**:
```javascript
async function createNewTask(taskName) {
try {
const tx = await contract.createNewTask(taskName);
const receipt = await tx.wait();
console.log(`Transaction successful with hash: ${receipt.transactionHash}`);
} catch (error) {
console.error('Error sending transaction:', error);
}
}
function startCreatingTasks() {
setInterval(() => {
const randomName = generateRandomName();
console.log(`Creating new task with name: ${randomName}`);
createNewTask(randomName);
}, 15000);
}
startCreatingTasks();
```
### Conclusion
This post delved into the "Hello World" AVS example, exploring the smart contract and operator client code in detail. This foundational understanding sets the stage for more advanced applications and custom AVS development.
Stay tuned as we continue this series, where we will cover more AVS examples and provide comprehensive guides to building with AVSs on EigenLayer. Exciting innovations await as we leverage the full potential of this powerful protocol! | gaj |
1,873,419 | Monitor HA Cluster running Pacemaker and Corosync using Prometheus and Grafana using Docker | We will use Grafana with prometheus in container to monitor High availability cluster running by... | 0 | 2024-06-02T02:58:57 | https://dev.to/bidhanahdib/monitor-ha-cluster-running-pacemaker-and-corosync-using-prometheus-and-grafana-using-docker-3pfp | webdev, monitoring, docker, devops | We will use Grafana with prometheus in container to monitor High availability cluster running by Pacemaker and Corosync.
Grafana dashboard which we will be using shows the details of a HA cluster running Pacemaker/Corosync. It is built on top of ha_cluster_exporter but it also requires Prometheus node_exporter to be configured on the target nodes, and it also assumes that the target nodes in each cluster are grouped via the job label.
https://bidhankhatri.com.np/monitoring/monitor-ha-cluster-running-pacemakr-and-corosync/
| bidhanahdib |
1,873,418 | Call Boy Job Bangalore 8584874078 | Call boy job Bangalore WhatsApp me on 8584874078 We are Hiring Of Call boy job in Bangalore it's a... | 0 | 2024-06-02T02:57:40 | https://dev.to/raju_c9935a9f18828c71b46c/call-boy-job-bangalore-8584874078-2jmn | Call boy job Bangalore WhatsApp me on 8584874078 We are Hiring Of Call boy job in Bangalore it's a trending job in Bangalore so If you want to join then simply WhatsApp on given number and start working from same days of joining.... | raju_c9935a9f18828c71b46c | |
1,873,417 | Redefining Career Specialization | ❤️ This post was originally published on my blog ❤️ In my short career, I've spent a bit of time... | 0 | 2024-06-02T02:55:32 | https://jeffmorhous.com/redefining-career-specialization/ | programming, career, softwareengineering | ❤️ This post was [originally published on my blog](https://jeffmorhous.com/redefining-career-specialization/) ❤️
In my short career, I've spent a bit of time thinking about:
- How do I be the best software engineer?
- What goes into an outstanding career?
- How can I be considered a valuable individual contributor?
Conversations I've had with peers and mentors quickly turn to the topic of specialization. If you read around online, you'll find a lot of arguments about whether it's better to be a specialist or a generalist in terms of the skills you build.
This is an especially notable topic when considering software engineering careers, because there's *so much to learn, you can't possibly be the best at all of it*.
## Specialist vs Generalist
Cal Newport writes often that if you want something above-average from your career, you have to provide above-average value.
In his "So Good They Can't Ignore You", he puts it clearly:
> If you want something that’s both rare and valuable, you need something rare and valuable to offer in return—this is Supply and Demand 101. It follows that if you want a great job, you need something of great value to offer in return.
The whole question of specializing vs generalizing for me is really a question of **how I can offer the best value to my team.** If I were superhuman, I would just become the best at all programming things and while I'm at it become the best at business things too. But that's not realistic, so many of us find ourselves wondering where best to focus our limited energy.
It seems to be common advice, at least in software, that specializing *after building a foundation of knowledge* is a good way to differentiate yourself. **But what does it mean to specialize?**
Saying that it's good to specialize isn't specific enough.
- If I specialize in Ruby, am I really specialized?
- What about Ruby on Rails?
- What about backend Ruby on Rails?
Even knowing that it's a good move to specialize still isn't enough information to make an actionable decision about what to get good at.
## Keep Redefining What You Do
We already know that being the best at what you do is great.
I don't know about you, but becoming the world's best programmer seems like a daunting task for me. [Naval talks a bit about how redefining what you do](https://nav.al/rich) to make it easier to stand out:
>If you really want to get paid in this world, you want to be number one at whatever you do. It can be niche—that’s the point. Become the best in the world at what you do. Keep redefining what you do until this is true.
Just becoming the best programmer is too hard. Becoming the best ruby programmer is hard, but not as hard. Becoming the best Ruby on Rails backend developer is a little easier. Becoming the best person at improving tests for Ruby on Rails apps is niche enough to be achievable.
**It's a lot easier to be the best in a category of 10 than best in a category of 10,000.**
## Dual Mastery
I've found that a good way to continue refining what I do is to develop mastery in more than one thing. This is sort of specializing - Steph Ango, creator of Obsidian, calls it **hybridizing**:
> The hybrid path means developing expertise in two or more distinct areas. Having several specialties allows you to see patterns that no one else can see, and make contributions that no one else would think of. The world needs more hybrid people.
My favorite flavor of Hybrid that Steph describes is the **U-shaped hybrid, where one develops a wide base of skills with 2 specialties.**
I'm still figuring out what this means for myself. I like to write backend code with Rails, but I'm also trying to develop my skills in infrastructure. I like to write code, but I also like to teach people how to write code through long-form tutorials. Fortunately, both of these paths are complimentary.
In the end, careers are long and these aren't one-way doors. I'm having fun experimenting and learning - I hope you are too. | jeffmorhous |
1,873,481 | I Have Reviewed 150+ Technical Writers - Here’s What I Found!🔥 | Before starting the main discussions, let’s have a quick background on how I reviewed 150+ technical... | 0 | 2024-06-02T18:13:48 | https://mranand.com/blogs/reviewed-150+-technical-writers-heres-what-i-found/ | productivity, writing, technology | ---
title: I Have Reviewed 150+ Technical Writers - Here’s What I Found!🔥
published: true
date: 2024-06-02 02:55:05 UTC
tags: productivity, writing, technology
canonical_url: https://mranand.com/blogs/reviewed-150+-technical-writers-heres-what-i-found/
cover_image: https://cdn.hashnode.com/res/hashnode/image/upload/v1717295811734/308b81f2-9a98-4adc-be25-7feca5be19af.png
---
Before starting the main discussions, let’s have a quick background on how I reviewed 150+ technical writers. I was searching for a few good technical writers who could publish great blogs about AI/ML, web development tutorials, or even general articles. For this, I reviewed technical writers from Hashnode, Dev, Medium, other platforms, and many from the portfolios shared on my X post. Most were good writers, but their profiles lacked a few things as technical writers.
In this article, I’ll be sharing my findings from their portfolios so that you can make your profile better as a technical writer.
> **This article addresses beginners and writers eager to improve themselves as technical writers.**
## Casual Writer or Technical Writer
Many writers have published a few articles based on their learnings, but this doesn’t necessarily make them technical writers. These articles may be as brief as social media posts, raising doubts about whether the authors can produce substantial technical blogs. Being a technical writer means regularly publishing articles that cover a diverse range of topics in a well-explained and detailed manner.
It’s important to differentiate between those who write occasional technical briefs and dedicated technical writers who produce comprehensive and in-depth articles. While casual writers may create technically accurate content, their work often lacks the depth and detail required for true technical writing.
This distinction is crucial, as technical writing demands not only expertise but also the ability to convey complex information clearly in a professional or simple manner.
> **Don’t write just for money, write if you love or care to contribute to the tech community as a writer.**
## Lack of Ownership
I’ve observed that many writers don’t take full ownership of their work. Even though they have articles published on company blogs or platforms like freeCodeCamp, these pieces often don’t make it into their personal portfolios or websites.
Scattered links aren’t effective, even for established writers. It’s important to claim your content and make sure your name is prominently associated with it. Here are some steps to improve your ownership:
1. **Take Credit for Your Work** : Make sure your name is on every article you write. If you’re publishing on third-party platforms, ask for a byline or include a headshot.
2. **Use a Professional Profile Picture** : Adding a professional profile picture helps readers connect with you on a personal level.
3. **Centralize Your Work** : Collect all your published articles in one place, such as a personal website or an online portfolio. This makes it easier for potential clients or employers to see the evidence of your work.
By taking these steps, you can better showcase your skills and accomplishments, making it easier for others to recognize and appreciate your work.
## No Personal Profiles
Another significant gap I noticed is the absence of personal blogging profiles among many technical writers. While contributing to company blogs or external platforms can be valuable, having a personal blog that you control is essential for establishing your unique voice and showcasing your expertise.
A personal blog allows you to:
- **Demonstrate Expertise** : Regularly publish content that highlights your knowledge and skills in technical writing.
- **Showcase Work** : Share detailed case studies, project overviews, and examples of your writing.
- **Build Authority** : Establish yourself as a thought leader in your field by discussing industry trends, best practices, and innovative techniques.
- **Engage with Community** : Foster a community of peers, potential clients, and employers who can interact with your content, providing feedback and building professional relationships.
- **Enhance SEO** : Improve your visibility online through search engine optimization, making it easier for others to find and connect with you.
Investing in a personal blog can significantly enhance your career prospects and professional reputation, offering a platform that you fully control to present your best work and insights.
## Lack of Branding
Another significant gap is the lack of personal branding among many technical writers. Closely related to personal profiles, personal branding involves establishing a unique identity that sets you apart from others in your field. It entails consistently presenting yourself and your work in a way that reflects your values, expertise, and professional goals.
Effective personal branding can help you:
- **Stand Out in a Crowded Market** : Differentiate yourself from other technical writers by showcasing your unique skills and perspective.
- **Attract More Opportunities** : Gain visibility and appeal to potential clients, employers, and collaborators.
- **Command Higher Rates** : Establish a reputation for quality and expertise, allowing you to charge premium rates for your services.
Building a strong personal brand requires a strategic approach, including:
- **A Professional Website** : Create a central hub for your portfolio, services, and contact information.
- **A Cohesive Social Media Presence** : Maintain consistent and professional profiles across various platforms.
- **Regular Audience Engagement** : Share your insights through blogs, articles, or speaking engagements to demonstrate your knowledge and stay connected with your audience.
Investing in personal branding can significantly enhance your career prospects and professional reputation, positioning you as a leader in your field.
> **for eg; to see how branding helps, search “Astrodevil” on Google and let me know in the comments what you found.😅**
**Keep this in mind:**
- `💡When applying for technical writing jobs, share a single link that includes all your live blog posts and articles. This makes it easier for employers to review your work.`
- `💡Technical writers with personal blogs tend to attract more opportunities organically.`
- `💡Always share portfolios/profiles with live links to your blogs instead of PDF or GitHub files for better credibility.`
- `💡Avoid spamming DMs or links when seeking writing opportunities. Instead, create a good profile on one social media platform that aligns with your blogging profile.`
## Conclusion
Reviewing over 150 technical writers has been an enlightening experience, revealing key areas for improvement and growth. Whether you’re a casual writer or a dedicated technical writer, focusing on ownership, consistency, personal profiles, and branding can improve your work and enhance your career. By addressing these common mistakes, you can develop the skills and reputation needed to succeed in the competitive field of technical writing.
[](https://www.buymeacoffee.com/Astrodevil) | astrodevil |
1,873,355 | Software Engineers Learn More from Failures than Wins: A Perspective | In the world of software engineering, success stories often dominate discussions, but it’s the... | 0 | 2024-06-02T00:06:08 | https://dev.to/bede_hampo/software-engineers-learn-more-from-failures-than-wins-a-perspective-3a6b | In the world of software engineering, success stories often dominate discussions, but it’s the failures that truly shape and hone an engineer’s skills. While wins provide validation and motivation, failures offer invaluable lessons that drive growth and innovation. Here’s why failures are so crucial in the learning process for software engineers:
1. Uncovers Weaknesses: Failures expose underlying weaknesses in code, architecture, or development processes that often go unnoticed during successful projects. For instance, a failed deployment might reveal gaps in the continuous integration pipeline or highlight insufficient test coverage.
2. Encourages Problem-Solving Skills: When a project fails, engineers must dissect the issue, understand its root cause, and devise a solution. This process of troubleshooting and debugging enhances critical thinking and methodical problem-solving abilities.
3. Promotes Innovation: Failures push engineers out of their comfort zones, encouraging them to explore new technologies, tools, or methodologies. A failed approach might lead to the discovery of more efficient or effective alternatives, fostering innovation.
4. Teaches Resilience and Adaptability: The frequent uncertainties in software development teach engineers resilience. They learn to cope with setbacks and adapt quickly, which is essential in a rapidly evolving industry.
5. Enhances Understanding of Systems: Failures often provide a deeper understanding of the systems and technologies involved. For example, a memory leak issue might lead to a deeper knowledge of memory management, which is crucial for designing robust software.
6. Improves Collaboration and Communication: Resolving failures often requires collaboration, improving communication skills and teamwork. Engineers learn to articulate problems clearly, listen to diverse perspectives, and work together to find solutions.
7. Build a Culture of Continuous Improvement: Embracing failure fosters a culture of continuous improvement. Organizations that see failure as a learning opportunity encourage their engineers to take calculated risks and innovate without fear of blame.
Embracing failure not as a setback but as a stepping stone is crucial for continuous learning and growth in the ever-evolving field of software engineering. By learning from their mistakes, software engineers can improve their skills, innovate, and contribute to building more resilient and efficient systems.
| bede_hampo | |
1,873,416 | We made a page visualization to build an open source project | Dooring has been open-sourced since its first version in 2020. Up to now, four years have passed.... | 0 | 2024-06-02T02:48:43 | https://dev.to/alex_xu/we-made-a-page-visualization-to-build-an-open-source-project-1l1p | webdev, react, opensource, frontend | **Dooring** has been open-sourced since its first version in 2020. Up to now, four years have passed. Based on the ultimate pursuit of technology and user experience, we have made a large number of updates and iterations every year, expecting to achieve the best building experience for users and cover more usage scenarios. Also, I am very grateful to the partners who work with me on Dooring, which enables the Dooring series of building products to continuously precipitate and evolve in the trend of technology.

Some achievements obtained by the end of 2023:
- GitHub star: 8.6k+
- Cumulative online registered users: 10,000+
- Total number of online pages: 10,000+
- Total number of templates: 1000+
- Total number of components: 50+ (continuously in production)
- Cumulative PV (page views): 500w+
- Cumulative UV (unique user visits): 10w+
I drew a picture so that everyone can better understand the technical solution of Dooring.

**github**:[h5-dooring](https://github.com/MrXujiang/h5-Dooring)
**website**: https://dooring.net
If you want to learn the technology and implementation ideas it uses, you can refer to the above GitHub address.
### Schema design and component development

The Schema is divided into two parts:
- The array of editable attributes of the editData component;
- The data actually consumed by the component config.
### Detailed Explanation of editData
editData is an array of editable attributes of the component, and each item contains the following fields:
- key: Attribute name
- name: Chinese display of the attribute name
- type: Editable type of the attribute
- isCrop (optional)
- cropRate (optional)
- range (array of options when type is 'Radio' or 'Select')
- It may be expanded in the future (the detailed structure can be referred - to the open-source version of Dooring)
Both key and name can be determined according to the semantics of the component attributes. Here, it is worth mentioning type. The value types of different attributes are different, so the type of our editing item is also different. All the types are as follows:
- Upload: Upload component
- Text: Text box
- RichText: Rich text
- TextArea: Multi-line text
- Number: Numeric input box
- DataList: List editor
- FileList: File list editor
- InteractionData: Interaction settings
- Color: Color panel
- MutiText: Multi-text
- Select: Select dropdown box
- Radio: Radio button
- Switch: Switch toggle
- CardPicker: Card panel
- Table: Table editor
- Pos: Coordinate editor
- FormItems: Form designer
For more detailed code, you can refer to the directory of `editor/src/core/FormComponents` in the private deployment version.
### Detailed Explanation of config
Essentially, config is an object, that is, the set of attributes that the component can expose, which is consistent with the key in each item of the editData array, as follows:
```js
{
cpName: 'Header',
logoText: '',
fontSize: 20,
color: 'rgba(47,84,235,1)',
height: 60,
fixTop: false,
menuList: [
{
id: '1',
title: 'Home',
link: '/'
},
{
id: '2',
title: 'Product',
link: '/'
},
]
}
```
editData and config constitute the schema structure of a Dooring component. Therefore, we can find that each Dooring component has the following structure:
- index.tsx, the main file of the component (can integrate any third-party open-source libraries);
- index.less, the style file of the component;
- schema.ts, the schema of the component (component description protocol);
- editData;
- config.
Of course, the schema of the component can also be expanded according to one's own needs. If there are any questions in component design, you can communicate with me at any time.
### Code generation capability
The code generation module mainly includes:
1. Generating the code of the compiled version page.
2. Generating the mini-program.
3. Generating the page JSON schema file.

### Design of reference lines

This mainly draws on the veteran design software PhotoShop. We can conveniently generate reference lines (including the x-axis and y-axis) by double-clicking on the ruler in Dooring. We can drag the reference lines to any position on the canvas to realize the reference for the positioning of elements.
### Communication of components
I have also shared several commonly used component communication schemes before, as follows:
- props/$emit
- Passing values from child components to parent components
- eventBus($emit/$on)
- vuex / redux
- $attrs/$listeners
- provide/inject
The specific implementation methods have been introduced in detail in the review of the communication scheme between components of the low-code platform. Here, I would like to share with you a communication scheme between components that I designed recently - custom event communication.
Yes, we are using CustomEvent.
Events are essentially a way of communication, a message mechanism. When we encounter multi-object and multi-module scenarios, using events for communication is a very effective way. In multi-modular development, custom events can be used for inter-module communication.

like this:
```js
const form = document.querySelector("form");
const textarea = document.querySelector("textarea");
const eventAwesome = new CustomEvent("awesome", {
bubbles: true,
detail: { text: () => textarea.value },
});
form.addEventListener("awesome", (e) => console.log(e.detail.text()));
textarea.addEventListener("input", (e) => e.target.dispatchEvent(eventAwesome));
```
### Future Planning of Dooring Product
In 2024, Dooring will continuously optimize the user experience and launch more practical components and templates. The specific plans are as follows:
- Enrich the component library (more than 100) and template library (more than 1000)
- Support multi-person collaborative building capability
- Design a hierarchical permission system
- Application-level state management
- AI-assisted building + content generation
- Upgrade the form building engine to support distributed form building
- Launch the page analysis panel to empower the value of user data
If you have better ideas and practices, welcome to communicate and discuss with me.
Github address: https://github.com/MrXujiang/h5-Dooring
| alex_xu |
1,873,415 | Retirement Calculator | The Retirement Calculator is a web application designed to help users estimate their retirement... | 0 | 2024-06-02T02:42:00 | https://dev.to/vinkalprajapati/retirement-calculator-5fka | retirementcalculator, vinkalprajapati, vinkal041, calculator |
{% codepen https://codepen.io/vinkalPrajapati/pen/GRaWdbx %}
The Retirement Calculator is a web application designed to help users estimate their retirement corpus based on various financial parameters. Users input their current age, retirement age, monthly savings, and expected return rate, and the calculator provides an estimate of their retirement corpus.
Usage:
Input Parameters: Users enter their current age, retirement age, monthly savings, and expected return rate into the respective input fields.
Calculation: Upon clicking the "Calculate" button, the application computes the future value of investments over the years until retirement based on the provided parameters.
Result Display: The estimated retirement corpus is displayed below the input fields.
Chart Visualization: Additionally, a chart is generated to visually represent the monthly investment and accumulated corpus over time.
Dynamic Updates: The chart updates dynamically whenever new values are inputted, providing users with real-time visual feedback.
Benefits:
Financial Planning: Helps users plan for their retirement by providing an estimate of their future financial resources.
Visual Representation: The chart offers a clear visual representation of how their investments grow over time, aiding in better understanding and decision-making.
User-Friendly: Simple and intuitive interface makes it easy for users to input their data and interpret the results.
Future Enhancements:
Additional Features: Incorporating additional features such as expense projections, inflation adjustments, and alternative investment scenarios.
Improved Responsiveness: Enhancing the responsiveness of the application for better usability across various devices and screen sizes.
Customization Options: Adding options for users to customize their inputs and chart preferences according to their specific needs and preferences. | vinkalprajapati |
1,873,413 | Buy Verified Paxful Account | https://dmhelpshop.com/product/buy-verified-paxful-account/ Buy Verified Paxful Account There are... | 0 | 2024-06-02T02:40:03 | https://dev.to/ahsubsuvsjfw2/buy-verified-paxful-account-a88 | javascript, beginners, programming, tutorial | ERROR: type should be string, got "https://dmhelpshop.com/product/buy-verified-paxful-account/\n\nBuy 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\n \n\nContact Us / 24 Hours Reply\nTelegram:dmhelpshop\nWhatsApp: +1 (980) 277-2786\nSkype:dmhelpshop\nEmail:dmhelpshop@gmail.com" | ahsubsuvsjfw2 |
1,873,412 | Buy verified cash app account | https://dmhelpshop.com/product/buy-verified-cash-app-account/ Buy verified cash app account Cash app... | 0 | 2024-06-02T02:31:28 | https://dev.to/ahsubsuvsjfw2/buy-verified-cash-app-account-2ae3 | javascript, beginners, programming, tutorial | ERROR: type should be string, got "https://dmhelpshop.com/product/buy-verified-cash-app-account/\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" | ahsubsuvsjfw2 |
1,873,386 | programming clock | Hi , My Hour of Code with its design is easy and simple to organize an event like it. 1-Understand... | 0 | 2024-06-02T02:19:08 | https://dev.to/hussein09/programming-clock-155h | codepen, javascript, webdev, html | Hi ,
My Hour of Code with its design is easy and simple to organize an event like it.
1-Understand the importance and benefits of science
Computer in all aspects of life.
2-Practice science concepts
Computer such as sequences, events, repetition, and debugging of code commands.
3-Create software solutions
To successfully complete a task or solve a problem.
4-Learn about professional fields
broad scope of computer science.
5-Analyze and solve problems using
Algorithmic thinking and dividing the problem into parts.
**Follow all the latest news via:**
**github:** https://github.com/hussein-009
**codepen:** https://codepen.io/hussein009
**Contact me if you encounter a problem**
**instagram :** @h._.56n
{% codepen https://codepen.io/hussein009/pen/JjqWvZX %} | hussein09 |
1,873,383 | Use CloudFlare Workers and D1 to Create a Completely Free CRUD API | CloudFlare began as a company providing content delivery network (CDN) and distributed DNS services... | 0 | 2024-06-02T02:11:40 | https://blog.designly.biz/use-cloudflare-workers-and-d1-to-create-a-completely-free-crud-api | backenddevelopment, api | CloudFlare began as a company providing content delivery network (CDN) and distributed DNS services to enhance website performance and security. It has since evolved into a major internet infrastructure provider offering a comprehensive suite of performance, security, and edge computing solutions. Compared to other cloud providers, CloudFlare provides a lot of value for a low price or even for free. With competitive pricing and unique features like built-in DDoS protection and a global network, it often offers more cost-effective solutions for web performance and security enhancements.
In this article, we're going to learn how to create a CRUD API using nothing but Cloudflare Workers (wrangler) and a D1 database (still in public beta). We'll walk through setting up the environment, creating endpoints, and integrating the D1 database to handle data storage and retrieval. While there are challenges to using Cloudflare Workers for an API, the main one being that it does not run on Node.js, limiting the packages we can depend on, with a little creativity we can make it happen. Running on Cloudflare's V8 runtime, we get a blazing fast API that leverages the power and simplicity of Cloudflare Workers and D1.
## Creating Our Project
We'll bootstrap our project using the new method to create a CloudFlare worker:
```bash
npm create cloudflare@latest cloudflare-crud-example
```
Choose "create a default hello world worker" and choose "use TypeScript." It will ask if you want to deploy your worker right away, choose "No," unless you've run `wrangler login`.
Next, we'll install our dependencies:
```bash
cd cloudflare-crud-example
npm i bcryptjs uuid tiny-request-router
npm i -D @types/bcryptjs @types/uuid
```
We'll be using `tiny-request-router` for mapping URL based routes to route handlers. The `uuid` library is for generating, well, uuids, and `bcryptjs` is a vanilla JavaScript BCRYPT implementation that we're going to use to hash user passwords.
## Creating Our Database
First, we need to define our database schema, so create a file called `schema.sql` in the root project directory:
```sql
DROP TABLE IF EXISTS users;
-- Create users table
CREATE TABLE
users (
id UUID PRIMARY KEY,
firstName TEXT,
lastName TEXT,
email TEXT UNIQUE,
phone TEXT UNIQUE,
password TEXT,
role TEXT,
status TEXT,
openIdSub TEXT NULL DEFAULT NULL,
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Seed users table
INSERT INTO
users (
id,
firstName,
lastName,
email,
phone,
password,
role,
status,
createdAt,
updatedAt
)
VALUES
(
'f34bd970-052a-4e26-bbc8-626a586023c5',
'John',
'Doe',
'john.doe@example.com',
'1234567890',
-- password: Password123! - bcrypt hash salt: 10 rounds
'$2a$10$4ix9iLrjxItWjuvS1JLT3uIB6sD6YSN5mY6..6uCZPE7fsbxsxYc.',
'admin',
'active',
CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP
);
-- Create tokens table
DROP TABLE IF EXISTS tokens;
CREATE TABLE
tokens (
id UUID PRIMARY KEY,
userId UUID,
token TEXT,
type TEXT,
device TEXT,
ipAddress TEXT,
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
expiresAt TIMESTAMP
);
```
This will create a `users` table with a test user and a `tokens` table for storing login tokens. Note that CloudFlare D1 syntax is identical to SQLite.
Next, we need to create our database resource using `wrangler`:
```bash
npx wrangler d1 create cf-crud-example
```
The result of this command will be a configuration snippet that you can copy and paste into your `wrangler.toml` project config file:
```
[[d1_databases]]
binding = "DB" # available in your Worker on env.DB
database_name = "cf-crud-example"
database_id = "<unique-ID-for-your-database>"
```
Now let's run our migration script:
```bash
npx wrangler d1 execute cf-crud-example --local --file=./schema.sql
```
This will create our tables on the local development SQLite server that wrangler automatically installs. To run against the D1 cloud instance, simply change `--local` to `--remote`.
You can test if the script worked by running:
```bash
npx wrangler d1 execute cf-crud-example --local --command="SELECT * FROM users"
```
Finally, you'll want to run `npm run cf-typegen` to add the DB variable to the `Env` global interface. You'll run this command any time you add injected services to your worker (KV, etc.)
## Putting It All Together
Now that we have our stack, let's build our API. We'll start by defining two CRUD classes to match our tables. I won't post the code for those classes here, though, for sake of brevity. The full code for the project is available on GitHub (link below).
Now let's edit our `index.ts`:
```ts
// Import CRUD Classes
import { User } from './classes/User.class';
import { Token } from './classes/Token.class';
// Import Tiny Request Router
import { Router, Method, Params } from 'tiny-request-router';
// Import route handlers
import routeTest from './routes/test';
import routeLogin from './routes/login';
import routeParams from './routes/params';
type Handler = (params: Params) => Promise<Response>;
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const { DB } = env;
// Initialize CRUD classes with the database connection
User.initialize(DB);
Token.initialize(DB);
// Initialize the router and define routes
const router = new Router<Handler>();
router.get('/test', () => routeTest(request));
router.post('/login', () => routeLogin(request));
// Define a route with a URL filename parameter called "foo"
router.get('/params/:foo', params => routeParams(request, params));
const { pathname } = new URL(request.url);
const match = router.match(request.method as Method, pathname);
if (match) {
// Call the matched route handler with the URL parameters
return match.handler(match.params);
} else {
// Return a 404 Not Found response if no route matches
return new Response('Not Found', { status: 404 });
}
},
};
```
Next, let's create another type declaration file called `index.d.ts` in the project root:
```ts
declare interface ApiResponse {
success: boolean;
message?: string;
data?: any;
}
declare type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
```
This creates our global interface for all API responses. It also create an `Optional` type that we can use for implementing interfaces in our CRUD classes.
Lastly, here is the code for our `/login` route handler:
```ts
import { User } from '../classes/User.class';
import usePost from '../hooks/usePost';
import useResponse from '../hooks/useResponse';
import { IUserPublic } from '../classes/User.class';
interface ILoginRequest {
email: string;
password: string;
}
interface ILoginResponse {
token: string;
user: IUserPublic;
}
const failLoginMessage = 'Invalid email or password';
export default async function routeLogin(request: Request) {
const post = usePost<ILoginRequest>(request);
post.requireParam('email');
post.requireParam('password');
const response = useResponse<ILoginResponse>();
try {
const data = await post.getObject();
const user = await User.findByField('email', data.email);
if (!user) {
return response.error(failLoginMessage, 400);
}
if (!user.comparePassword(data.password)) {
return response.error(failLoginMessage, 400);
}
const deviceId = 'not-implemented'; // TODO: Implement device ID based on user agent, etc.
const token = await user.createAccessToken({
device: deviceId,
ipAddress:
request.headers.get('CF-Connecting-IP') ||
request.headers.get('X-Forwarded-For') ||
request.headers.get('X-Real-IP') ||
request.headers.get('X-Client-IP') ||
request.headers.get('X-Host') ||
'',
});
const userData = user.exportPublic();
return response.success({
token: token.token,
user: userData,
});
} catch (e: any) {
return response.error(e.message, 400);
}
}
```
Note, that I've created two hooks that we can use in all our route handlers. The first `usePost` is for processing POST requests:
```ts
export default function usePost<T>(request: Request) {
const body: any = {};
const requiredParams: string[] = [];
const requireParam = (param: string) => {
requiredParams.push(param);
};
const validateParams = () => {
for (const param of requiredParams) {
if (!body[param]) {
throw new Error(`Missing required parameter: ${param}`);
}
}
};
const getObject = async () => {
try {
const json = await request.json();
Object.assign(body, json);
} catch (e) {
throw new Error('Invalid JSON Request');
}
validateParams();
return body as T;
};
return {
requireParam,
getObject,
};
}
```
It has a handy method to allow us to assert required params. Feel free to add other cool things like input validation. You could even use a library like `Yup` as it should run without issue on V8.
And here is the code for our universal response handler:
```ts
export default function useResponse<T>() {
const success = (data: T) => {
return new Response(
JSON.stringify({
success: true,
data,
}),
{
headers: {
'Content-Type': 'application/json',
},
}
);
};
const error = (message: string, status: number = 400) => {
return new Response(
JSON.stringify({
success: false,
message,
}),
{
status,
headers: {
'Content-Type': 'application/json',
},
}
);
};
return {
success,
error,
};
}
```
## Testing Our API
To fire up our dev server, simply run `npx wrangler dev`. This creates a server running on port `8787`. Now we can run a test on our login endpoint in Postman or VS Code Thunder Client.


---
## Resources
- [GutHub Repo](https://github.com/designly1/cloudflare-crud-example)
- [CloudFlare Workers Getting Started Guide](https://developers.cloudflare.com/workers/get-started/guide/)
- [CloudFlare D1 Getting Started Guide](https://developers.cloudflare.com/d1/get-started/)
---
Thank you for taking the time to read my article and I hope you found it useful (or at the very least, mildly entertaining). For more great information about web dev, systems administration and cloud computing, please read the [Designly Blog](https://blog.designly.biz). Also, please leave your comments! I love to hear thoughts from my readers.
If you want to support me, please follow me on [Spotify](https://open.spotify.com/album/2fq9S51ULwPmRM6EdCJAaJ?si=USeZDsmYSKSaGpcrSJJsGg)!
Also, be sure to check out my new app called [Snoozle](https://snoozle.io)! It's an app that generates bedtime stories for kids using AI and it's completely free to use!
Looking for a web developer? I'm available for hire! To inquire, please fill out a [contact form](https://designly.biz/contact). | designly |
1,873,382 | لا الاه إلا أنت سبحانك اني كنت من الظالمين | A post by أحمد الطيب | 0 | 2024-06-02T02:09:30 | https://dev.to/__55360e11bf0228/l-lh-l-nt-sbhnk-ny-knt-mn-lzlmyn-5fbl | __55360e11bf0228 | ||
1,873,381 | SIP Calculator | Plan your financial future with our easy-to-use SIP Calculator. Calculate the future value of... | 0 | 2024-06-02T01:53:11 | https://dev.to/vinkalprajapati/sip-calculator-pgp | codepen, sipcalculator, vinkalprajapati, vinkal041 |
{% codepen https://codepen.io/vinkalPrajapati/pen/RwmpyYZ %}
Plan your financial future with our easy-to-use SIP Calculator. Calculate the future value of your Systematic Investment Plan (SIP) investments by inputting your monthly investment amount, expected annual return rate, and investment duration. Our clean and intuitive interface ensures that you can quickly and accurately determine how much your investments will grow over time. Ideal for those looking to make informed decisions about their savings and investment strategies, our SIP Calculator is a must-have tool for achieving your financial goals. Start planning today and see how your regular investments can yield substantial returns over the years. | vinkalprajapati |
1,873,380 | Metamorphx Review (2024): Supplement For Weight Loss | Do you think weight loss requires intense activity and dieting? If you think weight loss demands... | 0 | 2024-06-02T01:52:35 | https://dev.to/metamorphxbuy/metamorphx-review-2024-supplement-for-weight-loss-6fe | metamorphx, metamorphxbuy, metamorphxorder, metamorphxsale |
Do you think weight loss requires intense activity and dieting?
If you think weight loss demands intense activity and strict dieting, you're doing it wrong. Many people want to lose weight but resist changing their diet. Today's fast-paced lifestyle leaves little room for healthy eating habits, regular exercise, and meal preparation. Merely skipping these activities won't reduce weight. Latent body factors also cause fat to accumulate in cells, leading to obesity.
Thus, the Metamorphx formula, detailed in this review, may help overcome these hidden factors and shed those unwanted pounds. Using a smart Japanese secret, Metamorphx may help people lose stubborn body fat and achieve healthier, slimmer bodies.
Official Visit:-[https://metamorphx.us/](https://metamorphx.us/)
[Try Metamorphx For Over 70% OFF Today!](https://getmetamorphx.org/video/int/?aff_id=19719)
## Why Choose Metamorphx?
**MADE IN THE USA**
Our Metamorphx dietary supplement is proudly made in the United States of America.
**GMP CERTIFIED**
Metamorphx supplement adheres to Good Manufacturing Practice standards.
**FDA APPROVED**
Metamorphx is formulated in an FDA-registered facility that complies with strict FDA regulations.
**100% NATURAL**
We are proud to say that Metamorphx is an all-natural, non-GMO, and gluten-free supplement.
## What is Metamorphx?
Metamorphx is an advanced weight loss product featuring potent Japanese ingredients. The capsules promote fat burning by stimulating cell "autophagy," a process that may restore bodily balance. This carefully formulated mixture helps eliminate waste, reduce hunger, and boost energy. Users may find it easier to lose weight with this effective solution. Metamorphx is 100% natural and works by removing harmful wastes that impede metabolism and weight loss.
Two Metamorphx pills can allegedly provide a "new Japanese weight loss innovation," making weight loss accessible for everyone. Metamorphx is designed for those who have struggled with traditional weight loss methods. If diet and exercise have failed, Metamorphx may offer the help you need.
## How Does Metamorphx Work?
Metamorphx reduces hunger and encourages healthy eating. This supplement contains pure, natural nutrients without any harmful additives. Metamorphx works naturally, supporting weight loss without drastic changes to diet or exercise. However, the company does recommend a balanced diet and regular exercise for optimal results.
Metamorphx includes adaptogens that support the body's stress response by reducing cortisol, a stress hormone that triggers fat storage. The ingredients in Metamorphx combat this hormone, aiding in weight loss. Additionally, the supplement decreases hunger and appetite, helping users maintain a caloric deficit and boost energy levels.
Metamorphx combines fiber-rich fruits and plant extracts to create a feeling of fullness. Furthermore, the ingredients help reduce stress and discomfort, speed up autophagy, remove unwanted DNA and damaged tissues, and support liver function and blood sugar regulation.
Metamorphx not only aids in weight loss but also improves digestion, strength, and endurance. Many users have reported satisfying results, with weight loss and maintained vitality. Before using Metamorphx, it is advisable to read the ingredients and consult with your doctor to ensure it is the right choice for you.
## What Are The Ingredients Included In Metamorphx?
Metamorphx ingredients are natural and derived from an ancient Japanese recipe. Here are the key ingredients and their benefits:
**Balloon Flower Root Extract**
Traditional medicine uses the root extract of the balloon flower to relieve inflammation and discomfort. It contains flavonoids, terpenes, OPCs, anthocyanins, and tannins that combat inflammation.
**Astragalus Root Extract**
Astragalus has been used in Chinese medicine for millennia to treat various health issues. It is known for its anti-inflammatory properties and benefits for cardiovascular function and liver protection.
**Eleuthero Root Extract**
Eleuthero root, also known as Eucommia ulmoides, is an adaptogen used for centuries to address numerous health issues. It typically boosts vitality, immunity, and circulation, while reducing inflammation and enhancing metabolism.
**Lycium Berry Extract**
Goji berries, or Lycium berries, are packed with antioxidants, minerals, vitamins, and other nutrients. They contain anthocyanin, a cancer-fighting antioxidant, as well as vitamin C and fiber, which strengthen collagen.
**Milk Thistle Seed Extract**
Milk thistle seed is beneficial for general health and especially for arthritis sufferers. Its laxative and anti-inflammatory properties can ease constipation and inflammation.
**Licorice Root Extract**
Licorice has been used for health care for ages. Its root glycosides are anti-inflammatory and analgesic. It is rich in flavonoids, antioxidants that support cardiovascular health.
**Schizandrae Chinese Fruit Extract**
Schizandrae Chinese fruit, also known as Schisandra Chinensis, improves memory and brain function, especially in older adults. Despite its bitterness, it is high in antioxidants, including flavonoids, which may aid weight loss and fight pollutants.
**Solomon's Seal Root Extract**
Solomon's seal root has been used for millennia to treat various diseases. It is known for improving joint health and relieving arthritic pain. It can be used both topically and ingested, depending on the condition.
**Shepherd's Purse Stem Extract**
The adaptogenic plant shepherd's purse has been used for ages to stimulate energy, mood, and vigor. It contains vitamins, minerals, amino acids, EFAs, antioxidants, and phytochemicals that promote health.
**White Mulberry Leaf Extract**
White mulberry fruits contain antioxidants and polyphenols with numerous health benefits, including reducing cancer risk, enhancing cardiovascular health, boosting cognitive function, and lowering LDL cholesterol.
**Wild Yam Root Extract**
Wild yam, a root vegetable from China, may enhance cognitive function, digestion, and vitamin absorption while reducing inflammation.
## Money-Back Guarantee of Metamorphx
Metamorphx offers a money-back guarantee for products that do not meet the advertised standards. The company may modify product descriptions, so it is important to read the policy before purchasing. For any questions, contact customer support. Additionally, Metamorphx has a 180-day refund policy.
## What are the benefits of Metamorphx?
Metamorphx targets the root causes of weight gain to help burn fat. According to the Metamorphx official website, the primary benefits include:
Weight Management: Boosts metabolism and helps shed excess weight, resulting in a healthier body shape.
Gut Health: Improves gut health by increasing good bacteria and reducing harmful bacteria.
Enhanced Digestion: Promotes better digestion and nutrient absorption, helping you stay fuller longer and reducing unhealthy cravings.
Eliminates Free Radicals: Protects against illnesses and enhances immune health by eliminating free radicals. It also supports cardiovascular health by removing fat deposits that impede blood flow.
Regulates Blood Sugar and Cholesterol: Helps maintain healthy blood glucose and cholesterol levels.
Increases Energy: Provides energy and enthusiasm for daily activities.
Improves Mood: Reduces stress and anxiety, promoting calmness throughout busy days.
## Metamorphx Pricing and Discounts
The best place to purchase Metamorphx weight loss pills is their official website:
30-day supply: $69 per bottle plus delivery.
90-day supply: $59 per bottle (3 bottles) plus free delivery.
180-day supply: $49 per bottle (6 bottles) plus free delivery.
[Try Metamorphx For Over 70% OFF Today!](https://getmetamorphx.org/video/int/?aff_id=19719)
This product is not sold in retail shops or other e-commerce sites. Ordering from the official site helps avoid counterfeit products and ensures you receive genuine Metamorphx.
## Supplement Metamorphx Bonuses
Metamorphx offers three free bonuses for purchases of 3 or more bottles. The bonuses include:
**Bonus #1: The Japanese Weight Loss Secret**
This supplementary e-book provides Japanese weight loss techniques for faster and more efficient results, complementing the use of Metamorphx.
**Bonus #2: Guilt-Free Desserts**
A recipe book featuring delicious, weight-friendly desserts to satisfy your cravings without adding extra pounds.
**Bonus #3: Access to the VIP Client Area**
Guides and workout videos to help make weight loss easier, supporting you in reaching your ideal weight quickly.
## FAQs About Metamorphx
**Is Metamorphx FDA-approved?**
Yes, domestically made Metamorphx supplements are manufactured in secure, GMP-certified facilities.
**How do I use Metamorphx?**
Using Metamorphx is simple. For best results, take two capsules 20-30 minutes before breakfast. Metamorphx is not recommended for individuals under 18, pregnant or nursing women. If you are on prescription medications or have a serious medical condition, consult a doctor before using Metamorphx.
**Is Metamorphx safe to use?**
Metamorphx is GMP-compliant, following strict health and safety guidelines. The formulation includes pure, natural components, making it safe and free from significant side effects.
## Conclusion: Metamorphx Review
In conclusion, Metamorphx is a safe and effective weight loss supplement with excellent customer ratings. Its natural ingredients are designed to support weight loss while minimizing adverse effects. Users report significant weight loss and satisfaction with the product.
Metamorphx offers numerous benefits for weight loss and overall health. Its natural components ensure safety and effectiveness. While the price might be a concern for some, the positive reviews and successful outcomes make Metamorphx worth considering for those seeking a reliable weight loss solution.
Explore the benefits of Metamorphx and start your journey to a healthier, slimmer you today! | metamorphxbuy |
1,873,379 | Metamorphx Review (2024): Supplement For Weight Loss | Do you think weight loss requires intense activity and dieting? If you think weight loss demands... | 0 | 2024-06-02T01:52:18 | https://dev.to/metamorphxbuy/metamorphx-review-2024-supplement-for-weight-loss-3783 | metamorphx, metamorphxbuy, metamorphxorder, metamorphxsale |
Do you think weight loss requires intense activity and dieting?
If you think weight loss demands intense activity and strict dieting, you're doing it wrong. Many people want to lose weight but resist changing their diet. Today's fast-paced lifestyle leaves little room for healthy eating habits, regular exercise, and meal preparation. Merely skipping these activities won't reduce weight. Latent body factors also cause fat to accumulate in cells, leading to obesity.
Thus, the Metamorphx formula, detailed in this review, may help overcome these hidden factors and shed those unwanted pounds. Using a smart Japanese secret, Metamorphx may help people lose stubborn body fat and achieve healthier, slimmer bodies.
Official Visit:-[https://metamorphx.us/](https://metamorphx.us/)
[Try Metamorphx For Over 70% OFF Today!](https://getmetamorphx.org/video/int/?aff_id=19719)
## Why Choose Metamorphx?
**MADE IN THE USA**
Our Metamorphx dietary supplement is proudly made in the United States of America.
**GMP CERTIFIED**
Metamorphx supplement adheres to Good Manufacturing Practice standards.
**FDA APPROVED**
Metamorphx is formulated in an FDA-registered facility that complies with strict FDA regulations.
**100% NATURAL**
We are proud to say that Metamorphx is an all-natural, non-GMO, and gluten-free supplement.
## What is Metamorphx?
Metamorphx is an advanced weight loss product featuring potent Japanese ingredients. The capsules promote fat burning by stimulating cell "autophagy," a process that may restore bodily balance. This carefully formulated mixture helps eliminate waste, reduce hunger, and boost energy. Users may find it easier to lose weight with this effective solution. Metamorphx is 100% natural and works by removing harmful wastes that impede metabolism and weight loss.
Two Metamorphx pills can allegedly provide a "new Japanese weight loss innovation," making weight loss accessible for everyone. Metamorphx is designed for those who have struggled with traditional weight loss methods. If diet and exercise have failed, Metamorphx may offer the help you need.
## How Does Metamorphx Work?
Metamorphx reduces hunger and encourages healthy eating. This supplement contains pure, natural nutrients without any harmful additives. Metamorphx works naturally, supporting weight loss without drastic changes to diet or exercise. However, the company does recommend a balanced diet and regular exercise for optimal results.
Metamorphx includes adaptogens that support the body's stress response by reducing cortisol, a stress hormone that triggers fat storage. The ingredients in Metamorphx combat this hormone, aiding in weight loss. Additionally, the supplement decreases hunger and appetite, helping users maintain a caloric deficit and boost energy levels.
Metamorphx combines fiber-rich fruits and plant extracts to create a feeling of fullness. Furthermore, the ingredients help reduce stress and discomfort, speed up autophagy, remove unwanted DNA and damaged tissues, and support liver function and blood sugar regulation.
Metamorphx not only aids in weight loss but also improves digestion, strength, and endurance. Many users have reported satisfying results, with weight loss and maintained vitality. Before using Metamorphx, it is advisable to read the ingredients and consult with your doctor to ensure it is the right choice for you.
## What Are The Ingredients Included In Metamorphx?
Metamorphx ingredients are natural and derived from an ancient Japanese recipe. Here are the key ingredients and their benefits:
**Balloon Flower Root Extract**
Traditional medicine uses the root extract of the balloon flower to relieve inflammation and discomfort. It contains flavonoids, terpenes, OPCs, anthocyanins, and tannins that combat inflammation.
**Astragalus Root Extract**
Astragalus has been used in Chinese medicine for millennia to treat various health issues. It is known for its anti-inflammatory properties and benefits for cardiovascular function and liver protection.
**Eleuthero Root Extract**
Eleuthero root, also known as Eucommia ulmoides, is an adaptogen used for centuries to address numerous health issues. It typically boosts vitality, immunity, and circulation, while reducing inflammation and enhancing metabolism.
**Lycium Berry Extract**
Goji berries, or Lycium berries, are packed with antioxidants, minerals, vitamins, and other nutrients. They contain anthocyanin, a cancer-fighting antioxidant, as well as vitamin C and fiber, which strengthen collagen.
**Milk Thistle Seed Extract**
Milk thistle seed is beneficial for general health and especially for arthritis sufferers. Its laxative and anti-inflammatory properties can ease constipation and inflammation.
**Licorice Root Extract**
Licorice has been used for health care for ages. Its root glycosides are anti-inflammatory and analgesic. It is rich in flavonoids, antioxidants that support cardiovascular health.
**Schizandrae Chinese Fruit Extract**
Schizandrae Chinese fruit, also known as Schisandra Chinensis, improves memory and brain function, especially in older adults. Despite its bitterness, it is high in antioxidants, including flavonoids, which may aid weight loss and fight pollutants.
**Solomon's Seal Root Extract**
Solomon's seal root has been used for millennia to treat various diseases. It is known for improving joint health and relieving arthritic pain. It can be used both topically and ingested, depending on the condition.
**Shepherd's Purse Stem Extract**
The adaptogenic plant shepherd's purse has been used for ages to stimulate energy, mood, and vigor. It contains vitamins, minerals, amino acids, EFAs, antioxidants, and phytochemicals that promote health.
**White Mulberry Leaf Extract**
White mulberry fruits contain antioxidants and polyphenols with numerous health benefits, including reducing cancer risk, enhancing cardiovascular health, boosting cognitive function, and lowering LDL cholesterol.
**Wild Yam Root Extract**
Wild yam, a root vegetable from China, may enhance cognitive function, digestion, and vitamin absorption while reducing inflammation.
## Money-Back Guarantee of Metamorphx
Metamorphx offers a money-back guarantee for products that do not meet the advertised standards. The company may modify product descriptions, so it is important to read the policy before purchasing. For any questions, contact customer support. Additionally, Metamorphx has a 180-day refund policy.
## What are the benefits of Metamorphx?
Metamorphx targets the root causes of weight gain to help burn fat. According to the Metamorphx official website, the primary benefits include:
Weight Management: Boosts metabolism and helps shed excess weight, resulting in a healthier body shape.
Gut Health: Improves gut health by increasing good bacteria and reducing harmful bacteria.
Enhanced Digestion: Promotes better digestion and nutrient absorption, helping you stay fuller longer and reducing unhealthy cravings.
Eliminates Free Radicals: Protects against illnesses and enhances immune health by eliminating free radicals. It also supports cardiovascular health by removing fat deposits that impede blood flow.
Regulates Blood Sugar and Cholesterol: Helps maintain healthy blood glucose and cholesterol levels.
Increases Energy: Provides energy and enthusiasm for daily activities.
Improves Mood: Reduces stress and anxiety, promoting calmness throughout busy days.
## Metamorphx Pricing and Discounts
The best place to purchase Metamorphx weight loss pills is their official website:
30-day supply: $69 per bottle plus delivery.
90-day supply: $59 per bottle (3 bottles) plus free delivery.
180-day supply: $49 per bottle (6 bottles) plus free delivery.
[Try Metamorphx For Over 70% OFF Today!](https://getmetamorphx.org/video/int/?aff_id=19719)
This product is not sold in retail shops or other e-commerce sites. Ordering from the official site helps avoid counterfeit products and ensures you receive genuine Metamorphx.
## Supplement Metamorphx Bonuses
Metamorphx offers three free bonuses for purchases of 3 or more bottles. The bonuses include:
**Bonus #1: The Japanese Weight Loss Secret**
This supplementary e-book provides Japanese weight loss techniques for faster and more efficient results, complementing the use of Metamorphx.
**Bonus #2: Guilt-Free Desserts**
A recipe book featuring delicious, weight-friendly desserts to satisfy your cravings without adding extra pounds.
**Bonus #3: Access to the VIP Client Area**
Guides and workout videos to help make weight loss easier, supporting you in reaching your ideal weight quickly.
## FAQs About Metamorphx
**Is Metamorphx FDA-approved?**
Yes, domestically made Metamorphx supplements are manufactured in secure, GMP-certified facilities.
**How do I use Metamorphx?**
Using Metamorphx is simple. For best results, take two capsules 20-30 minutes before breakfast. Metamorphx is not recommended for individuals under 18, pregnant or nursing women. If you are on prescription medications or have a serious medical condition, consult a doctor before using Metamorphx.
**Is Metamorphx safe to use?**
Metamorphx is GMP-compliant, following strict health and safety guidelines. The formulation includes pure, natural components, making it safe and free from significant side effects.
## Conclusion: Metamorphx Review
In conclusion, Metamorphx is a safe and effective weight loss supplement with excellent customer ratings. Its natural ingredients are designed to support weight loss while minimizing adverse effects. Users report significant weight loss and satisfaction with the product.
Metamorphx offers numerous benefits for weight loss and overall health. Its natural components ensure safety and effectiveness. While the price might be a concern for some, the positive reviews and successful outcomes make Metamorphx worth considering for those seeking a reliable weight loss solution.
Explore the benefits of Metamorphx and start your journey to a healthier, slimmer you today! | metamorphxbuy |
1,873,374 | king of hearts | Understand the importance and benefits of science Computer in all aspects of life. Analyze and... | 0 | 2024-06-02T01:46:30 | https://dev.to/hussein09/king-of-hearts-48km | html, css, javascript, codepen | Understand the importance and benefits of science
Computer in all aspects of life.
Analyze and solve problems using
Algorithmic thinking and dividing the problem into parts.
{% codepen https://codepen.io/hussein009/pen/KKLWReJ %} | hussein09 |
1,873,372 | Using AWS Credits effectively as a startup. | *Introduction * As businesses and individuals increasingly turn to cloud computing, Amazon Web... | 0 | 2024-06-02T01:30:17 | https://dev.to/nicholaschun/using-aws-credits-effectively-as-a-startup-2ola | aws | **Introduction
**
As businesses and individuals increasingly turn to cloud computing, Amazon Web Services (AWS) has emerged as a leading provider in the industry. AWS offers a range of services, and one of the enticing perks it provides to new users is the opportunity to receive free credits. However, like any promotional offer, there are facts you need to consider before using them.
AWS credits encourage you to explore almost all the services on the platform, whiles this is a good thing it can increase your cloud spend. Consider the following scenarios when using free credits;
Research Purposes: I personally use aws credits for research purposes because I am able to play around with the services and learn more about them. I mostly do this when I want to prototype an idea or build a quick MVP.
Short term prove of concept: You can also rely on AWS credits when you want to prove that a certain concept works
I had a conversation with a few founders last month and they were complaining about how they had to move their entire infrastructure to a different service provider because they were out of AWS credits and realized that the services are expensive. The pitfall of using These credits is that you turn to spin services that you do not need. (Most startups don't need 50% of the services provided by AWS.) Most often, there are cheaper alternatives you can explore on cloud platforms but because you have “Enough” credit you really won't bother about the cost of these services.
What happens when the AWS credits expire or finish?
When you become over-reliant on AWS credits you forget to draw a budget for the services you use. In the end, you will have to pay for all the services you spin up whiles using the credit.
To avoid these pitfalls
Come up with the cost of each service you want to spin using AWS pricing calculator
Draw a budget using AWS cost management tool
Monitor your usage with AWS cost explorer
Conclusion:
While AWS free credits can be a valuable resource for new users and organisations exploring the benefits of cloud computing, it is crucial to dispel the myths surrounding them. Understanding the limitations, expiration dates, and usage restrictions associated with free credits is crucial to avoid unexpected charges and make the most of your AWS experience. By familiarising yourself with the terms and conditions, monitoring your usage, and planning accordingly, you can leverage AWS free credits effectively and take full advantage of the services they provide. | nicholaschun |
1,873,370 | IOT Raspberry Pi using Azure | Creating an IOT Raspberry Pi using Azure Procedures" create an IOT using the Azure portal ... | 0 | 2024-06-02T01:16:08 | https://dev.to/emmyfx1/iot-raspberry-pi-using-azure-58m7 | iot, raspberrypi, using, azurefunctions | Creating an IOT Raspberry Pi using Azure
Procedures"
1. create an IOT using the Azure portal
-- go to Azure portal and log into your account using your username and password
--

2. after successfully logged-in search for the word "IOT hub" in the search bar on the Azure page

the image above should displayed
3. click on add on the add button at the top left corner of the page to create a new IOT hub

4.this image should display

create a resouce group, a name and a region then click on review and create

then click on create give it some dew seconds for the deployment to be complete, once it is completed this image should be displayed on the screen

then click on "go to resource" and click on device

click on "add device" and choose a name then click save

click on the device bane you added

copy the link on the primary connection string and paste on the 15th link of a pre-installed Raspberry Pi Azure app after deleting the previous connection string on the Raspberry Pi app

after pasting the copied link on the Raspberry Pi click on run the red led should blink repeatedly until you click on stop
 | emmyfx1 |
1,873,362 | Exploring the Power of Hooks in React | Introduction React is a popular JavaScript library that has gained widespread popularity... | 0 | 2024-06-02T00:34:49 | https://dev.to/kartikmehta8/exploring-the-power-of-hooks-in-react-4a1 | webdev, javascript, programming, beginners | ## Introduction
React is a popular JavaScript library that has gained widespread popularity among developers and businesses due to its efficient and intuitive user interface. One of the key features of React is its use of hooks, a tool that allows developers to easily manage state and lifecycle methods in functional components. This article will explore the power of hooks in React, and how it has revolutionized the way developers design and build applications.
## Advantages of Hooks in React
Before the introduction of hooks, developers had to use class components to handle state and lifecycle methods, making the code more complex and harder to maintain. With hooks, developers can now use functional components to manage state, making the code cleaner and easier to understand. Hooks also allow for reusable code, as they can be extracted and used in different components. This saves time and effort, and promotes better coding practices.
## Disadvantages of Hooks in React
One of the main disadvantages of using hooks is the learning curve for those who are not familiar with functional programming. It takes time to fully understand how to use hooks effectively, and developers may struggle with adapting to this new approach at first. Additionally, there may be compatibility issues with some third-party libraries that do not support hooks yet.
## Features of Hooks in React
Hooks provide a range of features that make React development more efficient. The `useState` hook allows for managing state in functional components, while the `useEffect` hook handles lifecycle methods. The `useContext` hook can also be used for state management and the `useReducer` hook can handle more complex state changes. These features make it easier for developers to write concise and reusable code, leading to faster and more efficient development.
### Examples of Common React Hooks
#### Using `useState`
```javascript
import React, { useState } from 'react';
function ExampleComponent() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
```
#### Using `useEffect`
```javascript
import React, { useState, useEffect } from 'react';
function ExampleComponent() {
const [count, setCount] = useState(0);
useEffect(() => {
document.title = `You clicked ${count} times`;
}, [count]); // Only re-run the effect if count changes
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
```
## Conclusion
In conclusion, hooks have greatly improved the development process in React, allowing for cleaner and more efficient code. While there may be a learning curve for some, the advantages of using hooks far outweigh any potential disadvantages. With its user-friendly interface and powerful features, React with hooks has become the go-to choice for building dynamic and interactive web applications. | kartikmehta8 |
1,856,121 | Running Lua C modules in a pure Lua environment (1) | Most desktop scripting languages are incomplete without a way to add extra functionality from native... | 27,568 | 2024-06-02T00:07:40 | https://dev.to/jackmacwindows/running-lua-c-modules-in-a-pure-lua-environment-part-1-2aho | lua, riscv, elf, dynamiclinking | Most desktop scripting languages are incomplete without a way to add extra functionality from native code. Modules written in C (or other compiled languages) are used to add extra functionality, expose system APIs, import high-performance libraries, and more. Lua stands out as a language that was built with C extensibility in mind - it has a simple C API which works both to extend the Lua environment, as well as to create the environment itself. As such, there's a wide ecosystem of Lua modules written in C, often wrapping system libraries in Lua APIs.
However, being targeted at embedded applications, developers often remove the ability to load C modules in the Lua environment, for security and/or compatibility reasons. This can wipe out a whole bunch of useful modules that aren't available in pure Lua form, such as complex compressors. My favorite Lua environment, ComputerCraft, is one of those - since the VM, Cobalt, is written in Java, it can't load C modules without a huge amount of work across the JNI boundary; and loading arbitrary code on a shared server is super insecure anyway.
For no particular reason, I wanted to be able to load these C modules somehow - I already managed to [run C DOOM on CC in a RISC-V VM](https://github.com/MCJack123/DOOM-CC), so there had to be a way to load the modules. I had a few main goals in mind:
- The loader has to be able to load the modules unmodified - this meant following the standard Lua loading process of calling a shared library's `luaopen_*` function.
- The module code has to be compiled unmodified, using whatever compile steps the author provides (besides configuring it to target the right compiler). This means implementing the Lua API, plus any system APIs required (such as libc).
- The module should integrate seamlessly with the rest of the outside Lua environment - all Lua values should be stored in the same environment that's loading the module, and not inside the VM (i.e. using another Lua VM on the C side, then copying the values over).
My devious solution: implement a RISC-V VM that emulates a Linux system; implement the Lua API in Lua and expose it to the VM; dynamically link and load the shared module file into the VM; and execute the functions required as one-shot calls on the VM.
## RISC-V
If you're not familiar, RISC-V is a new-ish CPU architecture that focuses on being simple to implement, but highly scalable up to desktop architectures. It has a grand total of 40 instructions in the base 32-bit integer instruction set, and uses a load/store, register-register RISC ISA.
Back when working on DOOM-CC, I chose it as my target because of its low instruction count. I only needed to implement 48 instructions (integer + multiplication extension) to have a fully working system. It also has strong compiler support in GCC, so I didn't need to fiddle with finding a compiler and runtime library. Because I already had the emulator core written, I figured I'd just scoop it out and bring it over to this new project.
Since I didn't write about the DOOM project, I'll quickly go over what I remember of the development process for the RISC-V VM. I first spent some time studying the instruction formats. RISC-V has four core instruction formats (R, I, S, U) and two modified formats (B, J), for which I wrote a decoder function for each. All formats have a 7-bit opcode field, for which each opcode maps to a certain format. To handle this, I made a table mapping each opcode to the decoder function, and the clock function takes the opcode, finds the decoder function, and passes the decoded instruction to the execution function.
After that, I wrote a function for each instruction. The instruction table is indexed by the opcode first, but some instructions are further selected by the `funct7` field in the instruction, so those instructions are further indexed by `funct7` to get the executor function. Each function takes the CPU instance (`self`) and the decoded instruction, and executes the instruction requested before returning to the tick function.
For expediency, I decided to use LuaJIT and its FFI library to store the CPU's memory, which let me have views for 8-/16-/32-bit values over the same memory block, and is much faster than normal tables. This did mean that the code only worked under LuaJIT environments, but I could easily replace it with tables later once I wanted it to work with normal Lua.
Once the instructions were initially written, I needed a way to load binaries into the CPU for testing. I wrote up a little ELF loader that would simply read the required file header fields (like entrypoint), and copy all of the program headers into the memory space. (More on ELF later.) After that, I started running the CPU tests provided by the RISC-V authors. A lot of tweaking was required, but eventually I got it to pass all the tests.
Finally, I had to implement some way to access the CC environment from inside the VM. I used the RISC-V `ECALL` instruction to do this, which is also used by Linux for system calls (which will become relevant later). The function number is passed in register `a7`/`x17`, and arguments in registers `a0`-`a6`/`x10`-`x16`. I made a table of functions for this as well, with each of them implementing some function like drawing the graphics to the screen, or accessing files on the filesystem. After a bit of tweaking, I got it working... albeit, at such a low framerate that it's completely unplayable (even with LuaJIT!).
## Lua in Lua
The first part I worked on was implementing the Lua C API. The essence of it is that all of the state is stored in Lua outside of the VM as native objects, and a shim C library calls out to the Lua side to do whatever operations are necessary. API calls are made through a single `ECALL`/syscall with ID `0x1b52`, and the function to call is the first argument.
On the Lua side, each `lua_State` object is stored in a table, with the coroutine it applies to, the CPU object for the system, and the "stack" which stores all of the values that the API uses. There is one `lua_State` object at the start, which represents the main/current calling thread; and the pointer passed to functions is actually a number indexing into the table. Because some value types that are accessible to the C API aren't representable in plain Lua (like C functions and userdata pointers), those types are wrapped in tables (as well as tables themselves, so that it can differentiate between wrapped types and table values).
On the C side, most of the functions are simple wrappers around `syscall`, casting types as necessary. However, some functions return memory blocks or strings, which Lua can't natively create - instead of expecting Lua to allocate the memory region, the C function allocates the necessary memory, then passes the pointer to Lua to fill up. There's also a few functions that only use static pointers, so those are entirely implemented in C.
Here's a brief list of issues I ran into while testing, and how I fixed them:
- Lua uses negative numbers to indicate stack positions relative to the top. However, I forgot that the RISC-V VM only deals with unsigned numbers. I had to add an extra function call to convert unsigned numbers to signed numbers before using the index.
- There are also certain negative indices that point to special values - `LUA_REGISTRYINDEX` (`-1001000`) points to a secret global table, and indices below that point to upvalues in a C function. I eventually had to implement those to be able to use most modules.
- Lua uses double floating point numbers for its native number type, but because I didn't implement the floating-point extension for RISC-V, doubles are passed in two integer registers, as according to the ABI. I had to make a quick set of functions to convert the two integers into a native Lua number, which used `string.[un]pack` to reinterpret the two integers as a double.
- Moving values between tables and the stack involves wrapping/unwrapping the stack values. I had to make a few functions to do that sanely, and it also required rewriting some code I had previously to use them instead.
## Setting up a cross-compiler
Now that I had some C code ready, I needed a compiler to turn it into RISC-V code. While I had a compiler set up for compiling 32-bit RISC-V already, it used the embedded Newlib C library and didn't target Linux systems. Since I wanted to have off-the-shelf modules run unmodified, I wanted to use the canonical C library for Linux, glibc, on top of Linux syscalls. This required building all of those components from scratch in a proper cross-compile toolchain.
I first looked through the Arch Linux AUR to see if anyone had anything for it, but only 64-bit toolchains were available. I wanted to avoid using super heavy toolchains anyway, since I only implemented the `IM` instruction set, while most Linux toolchains use the full `GC`/`IMAFDCZicsr_Zfencei` instruction set. I then proceeded to start building a cross-compiler by hand. I cloned the latest versions of GCC, glibc, and dependencies, but I soon realized that I was in over my head a bit - compiling it manually was gonna be pretty tough.
I then found that RISC-V has [a build script for GCC+glibc](https://github.com/riscv-collab/riscv-gnu-toolchain) already available, so I went and cloned that and built it. I had some issues with cloning one of the submodules (it was pointing to an invalid commit), but I was able to get around it by cloning each submodule individually, besides the one that was having problems (I didn't need it). Then I built the toolchain with:
```
./configure --prefix=/usr/riscv32-linux-gnu --with-arch=rv32im --with-abi=ilp32
make linux
```
The build went pretty quickly on my R9 5950X CPU. However, shortly into the glibc build process, I was greeted with an error - glibc requires the A (atomic) extension on RISC-V. No problem, I could implement that once required. After switching the arch to `rv32ima`, it finished successfully, and I was ready to build the project.
I first went to build "liblua" into a static library, which was just a few `gcc -c` commands to build the object files, and then an `ar` to pack them into `liblua.a`. I then tried to build a test module file against this library. My original plan was to build everything statically, so I wouldn't need any dynamic linking. I wanted to simply load the code from the module, find the symbol address in the symbol table, and then execute it. But no matter what I tried, I couldn't statically link glibc because the static library wasn't built to work with shared library files:
```
/usr/local/lib/gcc/riscv32-unknown-linux-gnu/13.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld: /usr/local/sysroot/usr/lib/libc.a(malloc.o): relocation R_RISCV_TPREL_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/gcc/riscv32-unknown-linux-gnu/13.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld: /usr/local/sysroot/usr/lib/libc.a(sysdep.o): relocation R_RISCV_TPREL_HI20 against `__libc_errno' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/gcc/riscv32-unknown-linux-gnu/13.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld: BFD (GNU Binutils) 2.42 assertion fail /home/jack/Downloads/riscv32-gcc/riscv-gnu-toolchain/binutils/bfd/elfnn-riscv.c:2565
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
```
I was able to successfully build a shared library file for the module with the dynamically linked glibc file - but this now meant I had to write a dynamic linker.
----------
The next post in the series will describe how dynamic linking works, and what I had to do to implement a dynamic linker for the virtual machine in Lua. | jackmacwindows |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.