PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Most saved prompts this week
Explain the "Quicksort" algorithm. Describe how it works step-by-step, its time and space complexity (best, average, and worst-case), and its main advantages and disadvantages compared to other sorting algorithms like Mergesort.
I need to design a RESTful API for a social media application. The resources are Users, Posts, Comments, and Likes. Design the endpoints, including HTTP methods, URL structure, and request/response payloads. Provide examples for creating a new post and fetching comments for a post.
Act as a senior software engineer. Take the following code snippet and refactor it for better readability, performance, and maintainability. Explain the changes you made and why.
The colossal, golden gates of Valhalla in Asgard, shimmering in divine light. The gates are guarded by powerful Valkyries in winged helmets. The Bifrost bridge, a rainbow of light, leads up to the entrance. Epic, mythological, fantasy, Norse mythology.
Analyze the following HTML snippet for web accessibility (a11y) issues. Identify problems related to semantic HTML, ARIA attributes, color contrast, and keyboard navigation. Suggest fixes to make the component more accessible to users with disabilities.
I have a Node.js application with a package.json file. Create a Dockerfile to containerize this application. The Dockerfile should install dependencies, copy the application code, and specify the command to run the application. Optimize the Dockerfile for smaller image size and faster builds.
Take the following poorly formatted C# code and format it according to standard C# coding conventions. Ensure consistent indentation, spacing, and brace style. Point out the specific changes you made.
A majestic phoenix rising from a pile of ashes, its wings made of brilliant fire and embers. The bird is mid-cry, spreading its wings for the first time. The background is dark, making the fiery colors of the phoenix pop. Sparks and flames swirl around it. Epic, fantasy, dynamic, glowing.
A vibrant, bustling underwater kingdom built from living coral. Bioluminescent structures in shades of pink, purple, and blue illuminate the city. Merfolk with iridescent tails swim through the coral archways. Schools of exotic, glowing fish dart through the scene. Sunken ruins are visible in the background. Magical, vibrant, detailed, fantasy art.
A miniature, detailed diorama of a lush forest ecosystem inside a clear glass lightbulb. There are tiny trees, a small river, and miniature animals. The filament of the lightbulb is glowing like a sun over the tiny world. Macro photography, creative, conceptual, detailed.
Explain the problem of state management in large frontend applications. What is "prop drilling"? How do libraries like Redux or Zustand solve this problem? Describe the basic concepts of a global store, actions, and reducers (or their equivalents).
Anti-gravity racing pods speeding through a futuristic city track. The track twists and turns between skyscrapers and through tunnels. The pods have motion blur, conveying a sense of extreme speed. Spectators watch from floating platforms. Dynamic, action-packed, sci-fi, concept art, F-Zero inspired.
I have a computationally expensive task in my web app that is blocking the main UI thread. Show me how to offload this task to a Web Worker. Provide the code for the main script that creates the worker and the code for the worker script itself (`worker.js`) that performs the calculation and sends the result back.
Analyze the time complexity (Big O notation) of the following Python function, which checks if an array contains duplicate values. Explain your reasoning step-by-step. `def has_duplicates(arr): for i in range(len(arr)): for j in range(i + 1, len(arr)): if arr[i] == arr[j]: return True; return False`
I need to write a user story for our development team. The feature is a "password reset" function for our mobile app. Write a clear and concise user story using the standard format: "As a [user type], I want to [goal] so that [benefit]." Then, write a set of specific, testable acceptance criteria for this story.
Explain the difference between `std::unique_ptr`, `std::shared_ptr`, and `std::weak_ptr` in modern C++. When should each one be used? Provide a code example demonstrating a common use case for `std::shared_ptr` to manage a shared resource.
A cozy, inviting reading nook by a large window. Rain streaks down the glass, and the view outside is a blurry, wet cityscape. A comfortable armchair is piled with soft blankets and pillows. A steaming mug of tea and an open book rest on a small wooden table. A cat is sleeping on the rug. Warm, soft lighting, peaceful atmosphere, detailed, photorealistic.
Analyze the following PHP code snippet for common security vulnerabilities like SQL Injection, Cross-Site Scripting (XSS), or Insecure Direct Object References. Explain where the vulnerabilities are and how to fix them.
A dilapidated, haunted Victorian mansion on a hill under a full moon. The windows are dark and broken, and twisted, leafless trees surround the property. A thick fog creeps across the ground. A faint, ghostly light flickers in one of the top windows. Spooky, atmospheric, gothic horror, detailed.
A digital painting of a bustling Parisian street cafe in the style of Impressionism. Loose, visible brushstrokes capture the fleeting moment. People are sitting at outdoor tables, and a waiter is rushing by. The light is soft and dappled, reflecting off the wet street after a brief shower. Art style inspired by Monet and Renoir.
Explain the concept of Protocol-Oriented Programming (POP) in Swift. How does it differ from traditional Object-Oriented Programming (OOP)? Provide an example of how you can use protocol extensions to provide default implementations for methods.
Create a regular expression to validate a strong password. The password must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one number, and one special character (e.g., !, @, #, $). Explain the different parts of the regex.
A lone survivor in ragged clothes stands on the edge of a ruined skyscraper, looking out over a desolate, overgrown city. The sky is a hazy orange from dust and pollution. Vines and nature have reclaimed the crumbling buildings. The survivor has a backpack and is holding a staff. Cinematic, moody, atmospheric, concept art, The Last of Us inspired.
A surreal portrait of a woman whose face and hair are composed entirely of a beautiful arrangement of different types of flowers and leaves. The colors are vibrant and harmonious. The background is a simple, dark color to make the portrait stand out. Creative, beautiful, surreal, detailed.
Generate the YAML for a basic Kubernetes Deployment and Service. The Deployment should run 3 replicas of the `nginx:alpine` image. The Service should expose the Nginx deployment on port 80 using a `ClusterIP`.
An ancient, magical library hidden deep within an enchanted forest. The library is built into a colossal, moss-covered tree. Sunlight filters through the canopy, creating god rays that illuminate floating, glowing books and swirling dust motes. Bookshelves are carved into the wood, filled with leather-bound tomes. A wise, old elf is reading at a rustic wooden desk. Ethereal, magical, fantasy art, detailed, volumetric lighting.
Explain the "Single Responsibility Principle" (SRP) from the SOLID principles of object-oriented design. Provide a simple "before" code example in C# or Java that violates SRP, and then show an "after" example that refactors the code to adhere to the principle.
Generate a SQL schema for a simple e-commerce website. It should include tables for Products, Customers, Orders, and Order_Items. Define the columns for each table, specify data types, and set up primary and foreign key relationships.
Design an intricate steampunk mechanical device. Components: 1. Victorian-era brass gears and cogs. 2. Copper pipes with steam vents. 3. Analog gauges and pressure meters. 4. Riveted metal panels. 5. Warm sepia and bronze tones. 6. Technical blueprint annotations. Style: highly detailed, industrial, retro-futuristic. Add weathering and patina for authenticity. Perfect for game assets, concept art, or alternative history illustrations. Render in 3D or detailed 2D illustration.
Write a simple Bash script that iterates through all the `.txt` files in the current directory and prints the first line of each file. The script should handle cases where no `.txt` files are found.
I have a function that accepts a parameter which can be a `string` or a `number`. Write a custom type guard in TypeScript to check if the variable is a `string`. Then, show how to use this type guard within an `if` statement to safely access string-specific properties.
Full-body character concept art of a charismatic female space pirate captain. She has a cybernetic arm, a long leather coat over high-tech armor, and an exotic alien pet parrot on her shoulder. She stands confidently on the bridge of her spaceship, with a nebula visible through the viewport. Detailed character design, sci-fi, concept art.
A vibrant, bustling market in a fantasy city where the stalls are on boats floating on a network of canals. People from various fantasy races (elves, dwarves, orcs) are bartering and shopping. The architecture is a mix of Venetian and fantastical styles. Colorful banners and lanterns hang everywhere. Lively, detailed, fantasy, world-building.
Explain how `async` and `await` work in JavaScript for handling asynchronous operations. How do they differ from using `.then()` with Promises? Provide a code example that fetches data from an API, first using Promises with `.then()` and then refactored to use `async/await`.
Handle customization requests. Response: 1. Confirm customization options available. 2. Explain customization process. 3. Provide pricing for custom work. 4. Show examples of previous customizations. 5. Outline additional lead time. 6. Clarify return policy for custom items. 7. Request detailed specifications. 8. Assign point of contact for project. Turn inquiry into personalized sale.
Compare and contrast the microservices architecture with the monolithic architecture. Discuss the pros and cons of each in terms of development, deployment, scalability, and complexity. For a new, small-scale e-commerce startup, which architecture would you recommend and why?
Design a GraphQL schema for a blog application. The schema should define types for Author, Post, and Comment. Include queries to fetch all posts, a single post by ID, and all posts by a specific author. Also, include mutations for creating a new comment.
The interior of the last bookstore on Earth, a cozy, cluttered haven in a post-apocalyptic wasteland. The shelves are overflowing with books, and warm light from lamps creates a welcoming atmosphere. Outside the reinforced window, a desolate, dusty landscape is visible. Hopeful, atmospheric, detailed.
A narrow, rain-slicked alleyway in a futuristic cyberpunk city. Towering skyscrapers with holographic advertisements create a vibrant, neon-drenched canopy. Reflections of pink, blue, and purple neon signs shimmer on the wet pavement. A lone figure in a trench coat stands in the shadows, steam rising from a nearby vent. Moody, cinematic, high contrast, Blade Runner aesthetic, photorealistic.
A mind-bending, indescribable cosmic horror entity emerging from a tear in reality. It is a being of impossible geometry, tentacles, and countless eyes, floating against a backdrop of dying stars. The image should evoke a sense of dread and insignificance. Lovecraftian horror, dark, surreal, abstract.
A beautiful, swirling nebula and galaxy with stars and planets contained inside a small, antique glass jar. The jar is sitting on a wooden table. The galaxy inside is glowing brightly, casting a magical light into the room. Conceptual, magical, detailed, fantasy.
I want to run an A/B test on our e-commerce website's product detail page to increase the "add to cart" rate. The current button is blue and says "Add to Cart". Generate three different hypotheses for an A/B test. For each hypothesis, specify the change you would make (e.g., button color, text, placement) and the expected outcome.
A magnificent, glowing city that has been intricately carved from the inside of a single, colossal amethyst gemstone. The buildings and streets are translucent, and the entire city glows with a soft, purple light. The faceted walls of the gemstone create beautiful light refractions. Magical, fantasy, unique, detailed.
Debate the pros and cons of using an Object-Relational Mapper (ORM) like SQLAlchemy or TypeORM versus writing raw SQL queries. Discuss aspects like developer productivity, performance, security, and database abstraction. In what scenarios would you strongly prefer one over the other?
Let's code together. I want to build a simple command-line to-do list application in Node.js. Let's start by outlining the features. Then, you can help me write the code for adding a new task. I will ask questions as we go.
Apply Challenger methodology for high-value sales. Three principles: Teach, Tailor, Take Control. Teach: provide unique insight prospect doesn't know. 'Industry data shows companies like yours overspend 30% on [area] due to [reason].' Share provocative perspective that reframes their thinking. Tailor: customize message to stakeholder (CFO cares about costs, CTO cares about efficiency). Take Control: confidently push back when needed. 'I'd recommend postponing that feature discussion until we align on strategy.' Structure: 1. Warm up (build credibility). 2. Reframe (teach insight). 3. Rational drowning (overwhelming data). 4. Emotional impact (personalize consequences). 5. New way (your solution). 6. Your solution (specifics). Works best for complex, high-consideration sales.
What is the best practice for managing environment variables (e.g., API keys, database passwords) in a Node.js project? Explain the use of `.env` files and the `dotenv` package. Provide an example of how to load and access variables from a `.env` file.
I am starting a new web project. It will be a highly interactive single-page application (SPA) with real-time data updates. Compare and contrast React, Vue, and Angular for this project. Recommend one and justify your choice based on performance, learning curve, ecosystem, and scalability.
A classic film noir scene. A hardboiled detective in a fedora and trench coat sits in his dark, smoky office late at night. Light from the window blinds casts dramatic shadows across the room. He is looking at a case file on his desk. Black and white, high contrast, moody, atmospheric, 1940s aesthetic.
A photorealistic still life painting in the style of the Dutch Masters. A wooden table is laden with a silver platter of grapes, a half-peeled lemon, a loaf of bread, and a glass of red wine. A skull rests on the side, a memento mori. The lighting is dramatic, with deep shadows and rich textures (chiaroscuro). Classical art, realistic, detailed.