#binary search
Explore tagged Tumblr posts
frog707 · 1 month ago
Text
Bisection
I've encountered several otherwise-capable software developers who apparently don't know how to use bisection to locate regressions (=bugs that were introduced recently into a software project).
The basic idea is, you identify a (recent) commit A that exhibits the bug and another (older) commit B where the bug is not present. Then you pick a commit C about halfway between A and B and determine whether the bug is present there. If it is, you pick D between C and B and repeat the process. If not, you pick D between A and C.
In this way, by running a dozen or so tests, you can often identify a single commit from among thousands. It's an example of a "divide and conquer" strategy.
I spent a pleasant half hour today using bisection to locate a 3 year-old performance regression in one of my projects. Said project has 1427 commits. Back in 2022 I added code to check for OpenGL errors. For one particular workload, those changes cut the graphics frame rate by a factor of 4.
All I need now is a simple mechanism to bypass OpenGL error checking, one that won't cause me to forget that those checks are available!
3 notes · View notes
vatche-dev · 2 years ago
Text
Grokking Algorithms #1
I’m awful at algorithms. There, I said it. I could blame my college algorithms professor or the fact that I’ve never had to use fancy algorithms at work. But anytime I’m on the market for a new job, I’m confronted with the inevitable HackerRank or LeetCode challenge and I stumble, remembering my biggest weakness as a software engineer. Now that I’m happy with my current job, I figure it’s a…
Tumblr media
View On WordPress
2 notes · View notes
compsci-haikus · 8 months ago
Text
There once was a bicycle theft that left a CS nerd bereft. A binary search would have found the merch but alas, the cop's mind wasn't deft.
Tumblr media
102K notes · View notes
rahulswriteups · 1 year ago
Text
Tumblr media
Navigating Efficiency: A Comprehensive Guide to the Binary Search Algorithm
In the vast landscape of algorithms, one star shines bright in the realm of search operations—Binary Search. This comprehensive guide aims to demystify the intricacies of this algorithm, exploring not only its mechanics but also delving into the crucial aspect of time complexity. Join us on a journey to unlock the power of efficiency.
Understanding Binary Search:
Binary Search Demystified:
Imagine you have a library of books neatly arranged in alphabetical order. Binary search is like finding a specific book by repeatedly splitting the remaining possibilities in half. You start in the middle, decide if the target is in the left or right half, and continue this process until you've pinpointed the book. This systematic approach is the heartbeat of binary search.
Real-World Scenario:
Consider a scenario where you're searching for a friend in a phone book. You open it in the middle, decide whether their name would be in the first or second half, and repeat until you locate the right entry. This mirrors the efficiency of binary search in swiftly finding elements in a sorted collection.
Time Complexity Unveiled:
The Essence of Time Complexity:
Now, let's dive into the critical realm of time complexity. Binary search boasts a time complexity of O(log n), where n is the number of elements. To put it simply, as your dataset grows, binary search's efficiency doesn't increase at the same pace as linear search, making it a go-to solution for large datasets.
Visualizing Time Complexity:
Picture a scenario where you're searching for a specific contact in your phone—a linear search would involve scrolling through each entry, while binary search mirrors the efficiency of quickly narrowing down your contacts by jumping to the middle, then deciding which half to explore.
Real-Life Applications:
Binary Search in Everyday Scenarios:
Consider managing an extensive contact list on your phone, sorted by names. Binary search becomes your ally in swiftly locating a friend's contact information without scrolling through every entry. This efficiency becomes even more pronounced in scenarios like online databases or searching for elements in a sorted array.
Optimizing Database Queries:
In the realm of databases, where time is of the essence, binary search becomes a game-changer. Whether you're searching for a specific record by ID or querying a sorted dataset for relevant information, the algorithm's efficiency enhances response times and user experience.
Conclusion:
As we conclude our exploration of the Binary Search Algorithm, it stands as a beacon of efficiency in the sea of algorithms. Its simplicity, coupled with the elegance of divide and conquer, makes it a valuable asset in the toolbox of any programmer or data scientist.
Armed with the knowledge of binary search and its time complexity advantages, you're empowered to optimize search operations and enhance the responsiveness of your applications. In the dynamic world of technology, where speed and efficiency are paramount, understanding the nuances of binary search opens doors to a realm of possibilities, making your journey through the vast data landscape smoother and more rewarding.
Know more: Click Here
0 notes
jcmarchi · 1 year ago
Text
OpenAI GPTs: Building Your Own ChatGPT-Powered Conversational AI
New Post has been published on https://thedigitalinsider.com/openai-gpts-building-your-own-chatgpt-powered-conversational-ai/
OpenAI GPTs: Building Your Own ChatGPT-Powered Conversational AI
What are GPTs?
GPTs, introduced by OpenAI in November 2023, are customizable versions of the ChatGPT model. They represent a significant shift from general-purpose AI chatbots to specialized, purpose-driven AI assistants. GPTs can be tailored for specific tasks, making them more effective and efficient in various domains, from education and gaming to business and creative arts.
OpenAI new GPT Builder (GPTs)
Key Features and Capabilities
Customization Without Coding: One of the most groundbreaking aspects of GPTs is that they require no coding skills to build. This makes it accessible to a broader audience.
Wide Range of Applications: GPTs can be designed for myriad uses, such as teaching math, assisting in game rules interpretation, or creating digital content like stickers.
Integration of Extra Knowledge: Users can feed additional information into GPTs, enhancing their ability to handle specialized tasks.
Functional Flexibility: GPTs can incorporate capabilities like web searching, image creation, and data analysis, depending on the user’s needs.
Creating a Custom GPT: Simplicity and Efficiency
Creating your personalized GPT app is a straightforward process that requires no coding knowledge, making it accessible for anyone with an idea. Here’s a simplified guide on how to bring your custom GPT to life:
Step-by-Step Guide to Creating Your Personalized GPTs App
Login and Navigate: First, log into your ChatGPT account. Look for the “Explore” section, which is usually located on the top left of your screen. This is where you’ll find all the GPT applications you have access to.
OpenAI ChatGPT
Create Your GPT: Click on ‘Create My GPT’. You’ll be taken to a new screen. Here, you’ll be prompted to describe what your GPT should do.
GPTs Interface
Set Your Prompt: Input your prompt with clarity and purpose. For our example we created a “Code Mentor” by entering a prompt: “Create an AI that provides clear explanations and guides users through algorithms and data structures, capable of facilitating real-time problem-solving sessions.”
Building a Coding Mentor with GPTs
Refinement: ChatGPT may ask follow-up questions to refine your concept. This step ensures your GPT is aligned with your vision and is capable of performing its intended functions efficiently.
Testing and Customization: Once created, your GPT appears on the right side of the screen. Here you can test its capabilities and fine-tune its functions. For the “Code Mentor” you might test it with queries like “Explain the concept of dynamic programming” or “Guide me through implementing a binary search tree.”
Save and Share: After you’re satisfied with your GPT, you can save your settings. Then, take advantage of the option to share your GPT with others. This is done through a link, making collaboration easy and promoting a community-oriented approach to AI development.
Remember, while Plus users have immediate access to use the GPTs via shared links, the creators won’t have access to the chats others have with their GPTs,.
Open AI mentioned that Privacy and safety are at the heart of GPTs. Chats with GPTs remain private, not shared with builders, and users have full control over whether data is sent to third-party APIs. Additionally, builders can decide if interactions with their GPT should contribute to model training, giving users and builders alike control over data usage and privacy.
Connecting GPTs to Real-World Applications
Beyond explanations, these GPTs can connect to external data sources or perform actions in the real-world. For instance, you could create a “Shopping Assistant” GPT that helps with e-commerce orders, or a “Travel Planner” GPT that integrates with a travel listings database.
Empowering Enterprises with Custom GPTs
Enterprises can take advantage of internal-only GPTs for specific use cases. This could range from a “Marketing Assistant” that helps draft brand-aligned materials to a “Support Helper” that aids in customer service. These GPTs can be deployed securely within a company’s workspace, with full administrative control over sharing and external GPT usage.
5 custom GPT applications that users have created
Conclusion
The evolution of AI technology with OpenAI’s GPT-4 Turbo and the introduction of customizable GPTs represent a significant leap forward in the field of artificial intelligence. GPT-4 Turbo’s enhanced context window and integration with visual and auditory capabilities mark a new era of conversational AI that is more accurate, detailed, and versatile. The GPTs, with their user-friendly customization options, open up endless possibilities for personal and professional use, democratizing AI technology and making it accessible to a wider audience.
0 notes
dat-physics-gal · 2 years ago
Text
It’s actually really sad that the police didn’t listen for a way to do their job better.
Then again, it’s the police, so i’m not that surprised.
God-tier account of a Cambridge computer scientist trying to get police to investigate his bike theft camera footage:
Tumblr media
33K notes · View notes
deletedg1rl · 2 years ago
Text
oomfies what should I learn after binary search
0 notes
idol--hands · 24 days ago
Text
“Less Perfect”
Tumblr media
12 notes · View notes
Text
Tumblr media
fascinated by the suggestions pinterest has given me. what is "they." what are you showing me pinterest.
4 notes · View notes
chaotic-fandom-hoarder · 10 months ago
Text
Tumblr media
Thinking about this AIDAN themed wallpaper I edited up about a month ago, maybe you guys would think it’s cool too?
14 notes · View notes
x-v4mp3y3lin3r-x · 2 years ago
Text
if you're deconstructing your ideas of binary gender and binary sex— you also have to deconstruct your ideas of binary sexuality and romantic attraction, too, fyi
#'are you saying homosexuals don't really exist??!?!!?!' no. please use your brain.#im saying it literally doesn't matter if a lesbian dates someone who YOU perceive as a man.#because the people in that relationship know more than you.#and human experience does not exist in a binary.#you have to accept that sometimes other people will experience life differently than you do#this also goes for gays and bis and pans and aces and aros.#the only people who get to define their experiences are them.#so no I don't really care if a gay man says his true love is a woman and he means it.#i still consider him gay. because he knows himself and his partner better than i know how to perceive them both#and how someone else identifies is none of my business.#that woman may be only part woman. or only perceived as a woman. or only sometimes a woman. or always both woman and man.#there's so many ways to be human. you have to learn to take other queers at face value and not question them#when you question if someone is 'REALLY gay' or 'REALLY trans' or 'REALLY bi'; you're thinking with the mindset of an oppressor#you do not need to gatekeep queerness. queerness is not a limited resource. queer people are not your enemies.#learn to empathize and embrace experiences unlike yours. be a better ally to the people in your own community instead of immediately -#- searching for ways to cast them out. be better. stop thinking like our oppressors. queer people do not need to rationalize ourselves for -#- anyone. they don't owe you an explanation. you cannot take their 'gay card' away.
73 notes · View notes
liquidstar · 1 year ago
Text
Tumblr media
screenshot of despair...
17 notes · View notes
knightobreath · 1 year ago
Text
fun osc fact: thw creator of the queerphobic osc comics ("pronouns? genderfluid?" leafy, "i'm not a non-binary freak" paintbrush, etc etc) is no longer queerphobic
28 notes · View notes
sidewalk-scrawls · 22 days ago
Text
Slowly increasing my Roth IRA contributions dollar by dollar until I don't owe the government any more taxes
2 notes · View notes
skulls-soul · 11 months ago
Text
In celebration of pride month I've been doing some questioning
And I feel like the best way to figure something out is asking people who are either questioning the same thing or have already found an answer to it
This is all about being demi-romantic
So to anyone and everyone who's experience this ponderment what was the outcome / turning point for you?
(who knew after 7? Maybe 8 years of identifying as non-binary and pansexual that there could be potentially more? Being queer is one hell of a roller coaster
P.s Thank you to anyone and everyone who interacts with this post)
12 notes · View notes
captivatingckcreations · 1 month ago
Text
⌕ ─ shipping search engine
⌕ Bawrence ⌕ Binary Bros ⌕ Cobra husbands ⌕ Cobra wives ⌕ Denthony ⌕ Jinny ⌕ Jommy ⌕ Jutch ⌕ Keenry ⌕ Kenthony ⌕ Kevon ⌕ Laitz ⌕ Lawrusso ⌕ Loskowitz ⌕ Maylor ⌕ Samguel ⌕ Samrobby ⌕ Samtory ⌕ Saxel ⌕ Silveence ⌕ Silverusso ⌕ Sisha ⌕ Yasmetri ⌕ Yasmoon ⌕ Uh oh, you could have made a mistake in your search, do you wish to rewrite it or look for something else? If you are looking for anything else, send us something in our inbox with the correct search to get this all figured out! *chirps*
© captivatingckcreations
4 notes · View notes