According to Tompor, scammers are taking advantage of the Amazon Prime Day event, a popular online shopping extravaganza, to trick unsuspecting consumers
PROGRAM - 1
import turtle def bresenham_line(x1, y1, x2, y2): dx = abs(x2 - x1) dy = abs(y2 - y1) x_step = 1 if x1 < x2 else -1 y_step = 1 if y1 < y2 else -1 error = 2 * dy - dx line_points = [] x, y = x1, y1 for _ in range(dx + 1): line_points.append((x, y)) if error > 0: y += y_step error -= 2 * dx error += 2 * dy x += x_step return line_points turtle.setup(500, 500) turtle.speed(0) x1, y1 = 100, 100 x2, y2 = 400, 300 line_points = bresenham_line(x1, y1, x2, y2) turtle.penup() turtle.goto(x1, y1) turtle.pendown() for x, y in line_points: turtle.goto(x, y) turtle.exitonclick()
PROGRAM - 2
import turtle import math screen = turtle.Screen() screen.bgcolor("white") t = turtle.Turtle() t.speed(1) t.pensize(2) def draw_rectangle(x, y, width, height, color): t.penup() t.goto(x, y) t.pendown() t.color(color) for _ in range(2): t.forward(width) t.left(90) t.forward(height) t.left(90) def draw_circle(x, y, radius, color): t.penup() t.goto(x, y - radius) t.pendown() t.color(color) t.circle(radius) def translate(x, y, dx, dy): t.penup() t.goto(x + dx, y + dy) t.pendown() def rotate(x, y, angle): t.penup() t.goto(x, y) t.setheading(angle) t.pendown() def scale(x, y, sx, sy): t.penup() t.goto(x * sx, y * sy) t.pendown() draw_rectangle(-200, 0, 100, 50, "blue") translate(-200, 0, 200, 0) draw_rectangle(0, 0, 100, 50, "blue") rotate(0, 0, 45) draw_rectangle(0, 0, 100, 50, "blue") scale(0, 0, 2, 2) draw_rectangle(0, 0, 100, 50, "blue") draw_circle(100, 100, 50, "red") translate(100, 100, 200, 0) draw_circle(300, 100, 50, "red") rotate(300, 100, 45) draw_circle(300, 100, 50, "red") scale(300, 100, 2, 2) draw_circle(600, 200, 50, "red") turtle.done()
PROGRAM - 03
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.tri import Triangulation def f(x,y): return np.sin(np.sqrt(x**2+y**2)) x=np.linspace(-6,6,30) y=np.linspace(-6,6,30) X,Y=np.meshgrid(x,y) Z=f(X,Y) tri=Triangulation (X.ravel(),Y.ravel()) fig=plt.figure(figsize=(10,8)) ax=fig.add_subplot(111,projection="3d") ax.plot_trisurf(tri,Z.ravel(),cmap='cool',edgecolor='none', alpha=0.8) ax.set_title('Surface Triangulation Plot of f(x,y)=\sin(sqrt(x^2+y^2))',fontsize=14) ax.set_xlabel('x',fontsize=12) ax.set_ylabel('y',fontsize=12) ax.set_zlabel('z',fontsize=12) plt.show()
PROGRAM - 04
import cv2 import numpy as np canvas_width = 500 canvas_height = 500 canvas = np.ones((canvas_height, canvas_width, 3), dtype=np.uint8) * 255 obj_points = np.array([[100, 100], [200, 100], [200, 200], [100, 200]], dtype=np.int32) translation_matrix = np.float32([[1, 0, 100], [0, 1, 50]]) rotation_matrix = cv2.getRotationMatrix2D((150, 150), 45, 1) scaling_matrix = np.float32([[1.5, 0, 0], [0, 1.5, 0]]) translated_obj = np.array([np.dot(translation_matrix, [x, y, 1])[:2] for x, y in obj_points], dtype=np.int32) rotated_obj = np.array([np.dot(rotation_matrix, [x, y, 1])[:2] for x, y in translated_obj], dtype=np.int32) scaled_obj = np.array([np.dot(scaling_matrix, [x, y, 1])[:2] for x, y in rotated_obj], dtype=np.int32) cv2.polylines(canvas, [obj_points], True, (0, 0, 0), 2) cv2.polylines(canvas, [translated_obj], True, (0, 255, 0), 2) cv2.polylines(canvas, [rotated_obj], True, (255, 0, 0), 2) cv2.polylines(canvas, [scaled_obj], True, (0, 0, 255), 2) cv2.imshow("2D Transformations", canvas) cv2.waitKey(0) cv2.destroyAllWindows()
PROGRAM -05
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def translation_matrix(tx, ty, tz): return np.array([ [1, 0, 0, tx], [0, 1, 0, ty], [0, 0, 1, tz], [0, 0, 0, 1] ]) def scaling_matrix(sx, sy, sz): return np.array([ [sx, 0, 0, 0], [ 0, sy, 0, 0], [ 0, 0, sz, 0], [ 0, 0, 0, 1] ]) def rotation_matrix_x(theta): c, s = np.cos(theta), np.sin(theta) return np.array([ [1, 0, 0, 0], [0, c,-s, 0], [0, s, c, 0], [0, 0, 0, 1] ]) def rotation_matrix_y(theta): c, s = np.cos(theta), np.sin(theta) return np.array([ [ c, 0, s, 0], [ 0, 1, 0, 0], [-s, 0, c, 0], [ 0, 0, 0, 1] ]) def rotation_matrix_z(theta): c, s = np.cos(theta), np.sin(theta) return np.array([ [c,-s, 0, 0], [s, c, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1] ]) def transform_point(point, transformation_matrix): point_h = np.append(point, 1) transformed_point_h = transformation_matrix @ point_h return transformed_point_h[:3] def plot_points(original_points, transformed_points): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.scatter(*zip(*original_points), color='blue', label='Original Points') ax.scatter(*zip(*transformed_points), color='red', label='Transformed Points') ax.legend() plt.show() points = [ np.array([1, 1, 1]), np.array([1, -1, -1]), np.array([-1, 1, -1]), np.array([-1, -1, 1]) ] translation = translation_matrix(2, 3, 4) scaling = scaling_matrix(1.5, 1.5, 1.5) rotation_x = rotation_matrix_x(np.pi / 4) rotation_y = rotation_matrix_y(np.pi / 4) rotation_z = rotation_matrix_z(np.pi / 4) combined_transform = translation @ scaling @ rotation_x @ rotation_y @ rotation_z transformed_points = [transform_point(point, combined_transform) for point in points] print("Original points:", points) print("Transformed points:", transformed_points) plot_points(points, transformed_points)
import pygame import random pygame.init() screen_width = 800 screen_height = 600 screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption("Animation Effects") BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) num_objects = 10 objects = [] for _ in range(num_objects): x = random.randint(50, screen_width - 50) y = random.randint(50, screen_height - 50) radius = random.randint(10, 30) color = random.choice([RED, GREEN, BLUE]) speed_x = random.randint(-5, 5) speed_y = random.randint(-5, 5) objects.append({"x": x, "y": y, "radius": radius,"color": color, "speed_x":speed_x, "speed_y": speed_y}) running = True clock = pygame.time.Clock() while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False screen.fill(WHITE) for obj in objects: obj["x"] += obj["speed_x"] obj["y"] += obj["speed_y"] if obj["x"] - obj["radius"] < 0 or obj["x"] + obj["radius"] > screen_width:obj["speed_x"] = -obj["speed_x"] if obj["y"] - obj["radius"] < 0 or obj["y"] + obj["radius"] > screen_height:obj["speed_y"] = -obj["speed_y"] pygame.draw.circle(screen, obj["color"], (obj["x"], obj["y"]), obj["radius"]) pygame.display.flip() clock.tick(60) pygame.quit()
PROGRAM - 07
import cv2 import numpy as np image_path = "image.jpeg" img = cv2.imread(image_path) height, width, _ = img.shape up_left = img[0:height//2, 0:width//2] up_right = img[0:height//2, width//2:width] down_left = img[height//2:height, 0:width//2] down_right = img[height//2:height, width//2:width] canvas = np.zeros((height, width, 3), dtype=np.uint8) canvas[0:height//2, 0:width//2] = up_left canvas[0:height//2, width//2:width] = up_right canvas[height//2:height, 0:width//2] = down_left canvas[height//2:height, width//2:width] = down_right cv2.imshow("Image Quadrants", canvas) cv2.waitKey(0) cv2.destroyAllWindows()
PROGRAM - 08
import cv2 import numpy as np image_path = "image.jpeg" img = cv2.imread(image_path) height, width, _ = img.shape rotation_matrix = cv2.getRotationMatrix2D((width/2, height/2), 45, 1) scaling_matrix = np.float32([[1.5, 0, 0], [0, 1.5, 0]]) translation_matrix = np.float32([[1, 0, 100], [0, 1, 50]]) rotated_img = cv2.warpAffine(img, rotation_matrix, (width, height)) scaled_img = cv2.warpAffine(img, scaling_matrix, (int(width*1.5), int(height*1.5))) translated_img = cv2.warpAffine(img, translation_matrix, (width, height)) cv2.imshow("Original Image", img) cv2.imshow("Rotated Image", rotated_img) cv2.imshow("Scaled Image", scaled_img) cv2.imshow("Translated Image", translated_img) cv2.waitKey(0) cv2.destroyAllWindows()
PROGRAM - 09
import cv2 import numpy as np image_path = "image.jpeg" img = cv2.imread(image_path) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) edges = cv2.Canny(gray, 100, 200) kernel = np.ones((5, 5), np.float32) / 25 texture = cv2.filter2D(gray, -1, kernel) cv2.imshow("Original Image", img) cv2.imshow("Edges", edges) cv2.imshow("Texture", texture) cv2.waitKey(0) cv2.destroyAllWindows()
PROGRAM - 10
import cv2 image = cv2.imread('image.jpeg') gaussian_blur = cv2.GaussianBlur(image, (5, 5), 0) median_blur = cv2.medianBlur(image, 5) bilateral_filter = cv2.bilateralFilter(image, 9, 75, 75) cv2.imshow('Original Image', image) cv2.imshow('Gaussian Blur', gaussian_blur) cv2.imshow('Median Blur', median_blur) cv2.imshow('Bilateral Filter', bilateral_filter) cv2.waitKey(0) cv2.destroyAllWindows()
PROGRAM - 11
import cv2 import numpy as np # Load the image image = cv2.imread('image.jpeg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU) contours, hierarchy = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) contour_image = image.copy() cv2.drawContours(contour_image, contours, -1, (0, 255, 0), 2) cv2.imshow('Original Image', image) cv2.imshow('Contours', contour_image) cv2.waitKey(0) cv2.destroyAllWindows()
PROGRAM - 12
import cv2 face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') image = cv2.imread('download.jpeg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30)) for (x, y, w, h) in faces: cv2.rectangle(image, (x, y), (x + w, y + h), (0, 255, 0), 2) cv2.imshow('Face Detection', image) cv2.waitKey(0) cv2.destroyAllWindows()
According to Tompor, scammers are taking advantage of the Amazon Prime Day event, a popular online shopping extravaganza, to trick unsuspecting consumers. They send fake text messages posing as delivery notifications, claiming that a package couldn't be delivered due to an incorrect address or unpaid shipping fees. These texts often include malicious links or phone numbers, aiming to deceive recipients into providing personal information or making payments.
The author emphasizes the importance of verifying the legitimacy of any text message or notification received, especially during high-profile shopping events like Prime Day. Tompor advises recipients to independently track their orders on the official retailer's website or app instead of clicking on suspicious links. By doing so, consumers can ensure the accuracy of delivery information and avoid falling into the trap of scammers.
Tompor further recommends contacting the retailer directly if there are any concerns or doubts about a delivery notification. It is crucial to use contact information obtained from official sources rather than relying on the information provided in suspicious text messages. Retailers can verify the status of an order and provide guidance on how to proceed if there are any genuine issues with the delivery.
Furthermore, the additional tips to protect oneself from scams. One suggestion is to enable two-factor authentication for online shopping accounts, adding an extra layer of security. Reviewing credit card statements regularly can help identify any unauthorized transactions and take immediate action if necessary. Additionally, consumers should be cautious of unexpected requests for personal information or payments, as scammers often use urgency and fear tactics to pressure victims into providing sensitive data.
In conclusion, the readers to stay vigilant during Amazon Prime Day and other online shopping events to avoid falling victim to fake text messages and delivery scams. By staying cautious, verifying notifications, and taking necessary precautions, consumers can protect themselves from potential fraudulent activities. It is essential to rely on official retailer channels, independently track orders, and avoid clicking on suspicious links or sharing personal information. By following these guidelines, shoppers can have a safe and secure online shopping experience.
0 Comments