Dreams of Code
Dreams of Code
  • 53
  • 6 753 650
Binary Search Animated
Binary search is a simple yet elegant algorithm for searching for values in a data structure such as an array.
Despite this simplicity, however, Binary Search also happens to be incredibly important, due to the efficiency it provides. This efficiency enables searches to take place on millions of items in orders of magnitude less time.
This video seeks to show what Binary Search is, through animation and motion.
This video was made possible by the wonderful supporters of this channel.
Переглядів: 19 196

Відео

The best (and worst) types for storing money in PostgreSQL
Переглядів 42 тис.14 днів тому
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DreamsofCode . You’ll also get 20% off an annual premium subscription. Storing Money in a Database is not as easy as you might think. So, in this video, we look at some of the types you can use in PostgreSQL, and perhaps, why you may not want to. This video was inspired by a discussion in the Dreams of Code Di...
Testcontainers have forever changed the way I write tests
Переглядів 98 тис.21 день тому
I don't always test my code, but when I do, I test against real services. The testcontainers package enables me to easily test against real services, in a way that doesn't cause issues that normally come from integration testing, which usually leads to flaky tests. This video is kindly sponsored by Docker. Download Tescontainers Desktop for free: dockr.ly/49HLeVy AtomicJar is now part of Docker...
Function Iterators might just change the way we write loops in Go
Переглядів 44 тис.Місяць тому
The rangefunc experimental feature is now available with Go 1.22. Over the last couple of weeks I have been playing with this new feature to see how far I can push it, and I think it may just change the way we write some loops in Go. Sign up for my Golang course at: dreamsofcode.io/courses/command-line-apps-go (Website is written in Go, btw) Video links: - RangeFunc wiki: go.dev/wiki/RangefuncE...
Why I'm no longer using Copilot
Переглядів 156 тис.Місяць тому
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DreamsofCode . You’ll also get 20% off an annual premium subscription. I've been using Copilot for about a year now, and initially I was impressed. However, since it became a permanent fixture in my workflow, I've noticed my own skills getting worse. This video was sponsored by Brilliant Become a better develo...
The standard library now has all you need for advanced routing in Go.
Переглядів 81 тис.Місяць тому
Use my link sponsr.is/tld_dreamsofcode and code APPDEVFOO5 and get a .dev, .app, or .foo domain name for only $5! This video is sponsored by Porkbun. Since 1.22, the Go standard library now has everything we need to perform advanced routing without the need of a third party dependency. However, knowing how to perform tasks such as middleware, path parameters, subrouting and more can be difficul...
Adding a cache is not as simple as it may seem...
Переглядів 103 тис.2 місяці тому
Knowing what the expect and how to mitigate the issues with caching is the first step towards a successful caching implementation. Adding a cache is usually a good way to reduce load on your database, but it does come at the cost of increased complexity. This video looks at the most commong caching pattern, and the problems that can occur. This video was sponsored by Aiven. Their platform is us...
Create beautiful code screenshots in Neovim. Without damaging your wrists.
Переглядів 53 тис.2 місяці тому
No wrists were harmed in the making of this video. Sharing code is one of the best things about writing it, however, screenshots usually suck. Fortunately for us, there are a number of tools out there to create aesthetic pictures of our code, unfortunately for our wrists, however, they're all rather mouse heavy. That's where these three neovim plugins come in, which can help us turn this mouse ...
Tonic makes gRPC in Rust stupidly simple
Переглядів 39 тис.2 місяці тому
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DreamsofCode/ . The first 200 of you will get 20% off Brilliant’s annual premium subscription. gRPC is quickly becoming my goto for implementing new services. Typically, I've used Go in order to achieve this, however recently I got to playing with Tonic, and it's made gRPC stupidly simple when it comes to Rust...
Go 1.22 is bringing about a new future for the language.
Переглядів 143 тис.3 місяці тому
This is perhaps the biggest update since generics. Links Release Notes: go.dev/doc/go1.22 ServeMux Proposal: github.com/golang/go/issues/61410 Become a better developer in 4 minutes: bit.ly/45C7a29 👈 Join this channel to get access to perks: ua-cam.com/channels/WQaM7SpSECp9FELz-cHzuQ.htmljoin Join Discord: discord.com/invite/eMjRTvscyt Join Twitter: dreamsofcode_io
One of the most common mistakes in Go is about to be fixed
Переглядів 27 тис.3 місяці тому
They finally fixed it. This mistake is one of the more common mistakes you can make when writing Go code. The Go developers have realized this, and so they're going to be resolving it in the next major release of Go. We don't have to wait until then, however, as we can actually test the fix today. Become a better developer in 4 minutes: bit.ly/45C7a29 👈 Video Links: Golang FAQ on the issue: go....
8 ways JavaScript is just... different.
Переглядів 58 тис.3 місяці тому
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DreamsofCode/ . The first 200 of you will get 20% off Brilliant’s annual premium subscription. JavaScript is the most popular language out there. Despite this fact however, it does a lot of things slightly different to other languages. In this video, I take a look at 8 of those things that JavaScript has it's ...
Using docker in unusual ways
Переглядів 381 тис.4 місяці тому
Docker is one of those tools that has changed my developer workflow for the better. Most of the time I use docker for deploying application code, but there are other ways I use it as well. In this video, I take a look at some of the other ways I use docker when developing software. This video is sponsored by Docker. Check out their new features in Docker desktop! www.docker.com/products/docker-...
This is perhaps the greatest feature of modern programming languages.
Переглядів 105 тис.4 місяці тому
The last 15 years have been a fantastic time to be a software developer. One such feature that we've seen from modern languages has been null safety, which has helped to solve perhaps the greatest cause of runtime issues. In this video, I take a look at what null safety is and why it's important. Become a better developer in 4 minutes: bit.ly/45C7a29 👈 Join this channel to get access to perks: ...
The perfect Neovim setup for Next.js (it's back)
Переглядів 27 тис.4 місяці тому
The perfect Neovim setup for Next.js (it's back)
I never thought I'd use Socket.io ever again
Переглядів 84 тис.5 місяців тому
I never thought I'd use Socket.io ever again
Never write another loop again (maybe)
Переглядів 248 тис.5 місяців тому
Never write another loop again (maybe)
Should you learn Elixir in 2024?
Переглядів 71 тис.5 місяців тому
Should you learn Elixir in 2024?
When RESTful architecture isn't enough...
Переглядів 239 тис.6 місяців тому
When RESTful architecture isn't enough...
"Hello, World" in 5 CURSED languages that no one should use
Переглядів 527 тис.6 місяців тому
"Hello, World" in 5 CURSED languages that no one should use
This is apparently the most loved CRUD app of 2023
Переглядів 128 тис.7 місяців тому
This is apparently the most loved CRUD app of 2023
I've been using Redis wrong this whole time...
Переглядів 325 тис.7 місяців тому
I've been using Redis wrong this whole time...
I built my own Reddit API to beat Inflation. Web Scraping for data collection.
Переглядів 179 тис.8 місяців тому
I built my own Reddit API to beat Inflation. Web Scraping for data collection.
The (almost) perfect Neovim setup for Node.js
Переглядів 66 тис.8 місяців тому
The (almost) perfect Neovim setup for Node.js
The most unconventional internet speed test.
Переглядів 12 тис.8 місяців тому
The most unconventional internet speed test.
Solving one of PostgreSQL's biggest weaknesses.
Переглядів 169 тис.8 місяців тому
Solving one of PostgreSQL's biggest weaknesses.
Should you learn C++ in 2023?
Переглядів 51 тис.9 місяців тому
Should you learn C in 2023?
Gorilla Toolkit for Golang is revived! But is it too late?
Переглядів 27 тис.9 місяців тому
Gorilla Toolkit for Golang is revived! But is it too late?
One of the best Neovim plugins is about to be archived.
Переглядів 32 тис.10 місяців тому
One of the best Neovim plugins is about to be archived.
The perfect Neovim setup for C++
Переглядів 134 тис.10 місяців тому
The perfect Neovim setup for C

КОМЕНТАРІ

  • @kopostusverdigris6341
    @kopostusverdigris6341 Годину тому

    ides are just for bloating

  • @FelipeCampelo0
    @FelipeCampelo0 4 години тому

    I have restricted my studies to data manipulation tasks. There is a lot to take a look on data definition and control yet!

  • @rafiuddintawhid
    @rafiuddintawhid 5 годин тому

    I am rather impressed by whitespace. Maybe bro was highest level introvert😂

  • @onddu2254
    @onddu2254 8 годин тому

    What I like about pygamme is how "manual" it is. That's why I can't stand something like tkinter, it's so unintuitive having some automatic main loop. I like being able to see the main loop exactly as it is. I would hate to have just a "app.run()" to run the main loop. I want to see how it handles events, draws background, updates objects on screen, draws those objects, flips the screen and limits fps. If I can't see those, it feels way too unintuitive.

  • @sloan00
    @sloan00 13 годин тому

    The biggest downside is probably that it's a (de facto) Google product :/

  • @select_from_users5842
    @select_from_users5842 День тому

    now gRPC is cool and all... but where can we find that ZSH theme?

  • @__________________________6910

    Thanks 🙏

  • @vatsalchauhan7466
    @vatsalchauhan7466 День тому

    Which keyboard and mouse you are using? They are really cool.

  • @splatterfy
    @splatterfy День тому

    How do I get my status bar to look like yours?

  • @Dylan_thebrand_slayer_Mulveiny

    Another unusual way you can use docker: You can use it to store your "homework" folder.

  • @nandhakumar.r2690
    @nandhakumar.r2690 2 дні тому

    Is that mobile i9

  • @ismu123_aka_best_player_of_mc

    its not saying Do you want to install an example custom config? (y/N) : help me

    • @dreamsofcode
      @dreamsofcode 2 дні тому

      Make sure to select the correct branch! There's a command in the description.

    • @ismu123_aka_best_player_of_mc
      @ismu123_aka_best_player_of_mc День тому

      @@dreamsofcode i already type it and not showing pls help

  • @petrmotejlek1427
    @petrmotejlek1427 2 дні тому

    What is "unusual" about any of the use cases?

  • @petrmotejlek1427
    @petrmotejlek1427 2 дні тому

    Yeah. You can "start" an old Ubuntu or Debian. But the moment you try to run apt update, it breaks, because the repos have since moved elsewhere, and nobody comes to update the old images. Similarly the certificate authority files have since expired... I am not trying to say that you're wrong. Because you can really "start" a container using any old image, but the usability of it will vary :)

  • @mprasanth18
    @mprasanth18 2 дні тому

    The window_title option dosen't seem to pick the name of the buffer for screenshot file name. Have you found any workaround?

    • @michael-rommel
      @michael-rommel День тому

      I use this function in my config: window_title = function() return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), ":t") end,

  • @io_inc
    @io_inc 3 дні тому

    Give this man a bells!!!

  • @LopesBoa-ou2gh
    @LopesBoa-ou2gh 4 дні тому

    Just subscribed! I never knew about this pass before. Your video is very informative

  • @alessandroserra885
    @alessandroserra885 4 дні тому

    Hi, I followed all the steps but when opening a c++ file i get an error message saying that iostream module does not exist, am I doing something wrong?

  • @qqi239z123
    @qqi239z123 4 дні тому

    I am looking to switch off from the emacs and got recommended to try the neovim. OMG: the thing silently loads and executes powerful unsigned scripts from the net. Is it the biggest security hole ever? Is it allowed in corporate environment?

  • @kurshadqaya1684
    @kurshadqaya1684 4 дні тому

    Awesom!

  • @madhavsilwal2777
    @madhavsilwal2777 4 дні тому

    Why not have timescale features as a table type or view types in normal postgres db instead of having a seperate db.

    • @dreamsofcode
      @dreamsofcode 4 дні тому

      Im not sure I understand fully, but timescale is PostgreSQL

    • @madhavsilwal2777
      @madhavsilwal2777 2 дні тому

      @@dreamsofcode May be i misunderstood then. How to enable timescale featuers in existing postgres db?

    • @dreamsofcode
      @dreamsofcode 2 дні тому

      @@madhavsilwal2777 It is just a postgres extension, so you can install it like you would any other. There are instructions on Github here: github.com/timescale/timescaledb

  • @joshi1q2w3e
    @joshi1q2w3e 5 днів тому

    Please make more of these! This was amazing!

  • @LoneWolfGamer666
    @LoneWolfGamer666 5 днів тому

    HOLY CRAP! This is great!

  • @NickAbbot.
    @NickAbbot. 5 днів тому

    …or you could develop software on a platform that isn’t a load of crap with tools that aren’t loads of crap.

  • @GalWiner
    @GalWiner 6 днів тому

    how do you navigate from nvimTree to the file contents and vice-versa? you don't specify the keyboard shortcut

  • @shimonpertz
    @shimonpertz 6 днів тому

    Great video, Thanks for the Efforts! I have a question please. What if you have a Desktop app built with Rust and Tauri on some computer and you gRPC in a server. How to enable the Desktop to connect to the remote gRPC that is hosted somewhere in the cloud?

  • @lemonadeforlife
    @lemonadeforlife 6 днів тому

    Nice Animation but as a Linux User. I have one question, in fact it's just a simple question. Did you resort to windows for producing this animation?(y/n)

    • @dreamsofcode
      @dreamsofcode 6 днів тому

      I did not! I resorted to macOS 😭 My next plan is to use windows in a VM with pcie passthrough

    • @lemonadeforlife
      @lemonadeforlife 2 дні тому

      @@dreamsofcode After careful consideration and many decisions later, we came to the conclusion that since it's not a Window. And macOS is UNIX based. Congratulations🎉! Your "I use arch btw" license is not going to terminate. Have a good day🐧

    • @dreamsofcode
      @dreamsofcode 2 дні тому

      @@lemonadeforlife I'm on a provisional probation with it!

  • @AxidoDE
    @AxidoDE 6 днів тому

    Remember, folks: The secret to making Python run fast is to use as little Python as possible.

  • @_nikeee
    @_nikeee 6 днів тому

    It's also possible to CREATE TYPE and roll your own "money" type that uses numeric under the hood and stores the currency in iso format. The iso currency could also be managed by using a CREATE DOMAIN. I'm not sure how good that plays along with database drivers/application code.

  • @unitythemaker
    @unitythemaker 7 днів тому

    Thanks!

    • @dreamsofcode
      @dreamsofcode 7 днів тому

      Thank you so much for the support. It's really appreciated!!!

  • @bastiana3611
    @bastiana3611 7 днів тому

    I really enjoy it when you give examples of when stuff is used like how you compared when to use linear search vs binary search here. I'd love to see more of that! :)

  • @LinhLinhBD
    @LinhLinhBD 7 днів тому

    A good database should be fast by default. if something requires deep knowledge to make it fast, it's a nerdy database.

    • @dreamsofcode
      @dreamsofcode 7 днів тому

      Which databases would you consider "fast by default"?

    • @NysShortCut
      @NysShortCut День тому

      So everything in programming is nerdy then cuz you need to learn to make things work. wait, that indeed makes some sense...

    • @LinhLinhBD
      @LinhLinhBD День тому

      @@dreamsofcode Mysql is faster, but lack feature. So they both not good. Mongodb is pretty god, unfortunately it's not SQL which is what most people need. That's why companies should make better databases. Something that plug and play and fast.

  • @obiwanjacobi
    @obiwanjacobi 7 днів тому

    Note that CPUs with cache lines and prefetching (like x86), linear search until a couple of MB is the fastest you can get. It is easy to do the benchmarks yourself.

  • @SwiftNN
    @SwiftNN 7 днів тому

    I died for a few seconds during "ayu light"

  • @havocblast8737
    @havocblast8737 7 днів тому

    Now I just need to look at the config file so I can get the plugins that were used. I can't stand these distros

  • @changthunderwang7543
    @changthunderwang7543 7 днів тому

    It’s a cool language but some of the syntax can just fuck offff

  • @doryan08
    @doryan08 7 днів тому

    Please do more videos about other algorithms and their application on real life like Dijkstra or A*. The animation that you use is very useful to understand those.

  • @vcool
    @vcool 7 днів тому

    Pro tip: Learn it if you have a personal concurrency project to implement in it that you intend to maintain for years to come. Do not learn it to get a new job in it, as the jobs are extremely rare, and moreover they require years of experience.

  • @frd85
    @frd85 7 днів тому

    awesome video

  • @ltecheroffical
    @ltecheroffical 7 днів тому

    You can remove the browser part by using a web scraping framework that works without a browser instance.

  • @follantic
    @follantic 7 днів тому

    Also very useful when you can test if a value is too small or too large, but not the desired value. Such as an auto grow text area.

  • @pweddy1
    @pweddy1 8 днів тому

    I feel like we need Donald Knuth to reply to this. "Premature optimization is the root of all evil." Never implied that you should not ever optimize your code for any reason. And I kind of feel like that's what the "more readable" advocacy is for. I spent an entire entire semester using recursion and dynamic memory allocation. Just for the last few classes to tell you, you could do all the same things using arrays and it's way faster.

    • @dreamsofcode
      @dreamsofcode 8 днів тому

      The point of this video is more about languages that don't have iteration and how that works. Not sure where "premature optimization" fits in here. That's a whole nother kettle of fish.

  • @fahim0404150
    @fahim0404150 8 днів тому

    Great video. Could you please tell me what font you are using?

  • @momensy2136
    @momensy2136 8 днів тому

    I really feel so lucky that i found your channels Please keep up on the content, can't wait to see your channel grows well and get what it deserves ❤🔥.

    • @dreamsofcode
      @dreamsofcode 8 днів тому

      Thank you! I appreciate that a lot!

  • @angeldude101
    @angeldude101 8 днів тому

    One of the reasons to prefer linear search over binary search is the cache, since reading one value will make the CPU implicitly fetch the values around it, and if you can use those rather than discarding all of them and jumping away, then the fewer data transfers can actually trump the fewer operations of the binary search. However it is actually possible to get the best of both worlds, with fewer comparisons while still respecting the cache. It just requires an unusual form of sorting. The structure is similar to an array-backed heap, but the order of the nodes is that of a traditional binary search tree. This type of structure was first described by Michaël Eytzinger in 1590 for efficiently searching through genealogical data and a person's ancestry... on paper.

  • @HikarusVibrator
    @HikarusVibrator 8 днів тому

    anyone know what font is used in the code snippets?

  • @berndeckenfels
    @berndeckenfels 8 днів тому

    Unlike b- or binary trees a sorted array has zero (pointer) overhead, so it’s great when it can be pre-calculated and is static.

  • @luigidabro
    @luigidabro 8 днів тому

    This video is the greatest example of explanation. You even care for edge cases of the algorithm. I love that detail at 2:01. The animations are great, too! This video is truly a masterpiece.

    • @dreamsofcode
      @dreamsofcode 8 днів тому

      Thank you so much! I'm really glad people enjoy it! Was a complete labor of love :)

  • @jaddadzakaria
    @jaddadzakaria 8 днів тому

    Hey, i just want to know with what tool do you make this smooth and beautiful presentations and thanks guys

    • @dreamsofcode
      @dreamsofcode 8 днів тому

      This was done pretty much exclusively with Adobe After Effects for the animations, and Davinci Resolve for the final editing!

  • @ericlindell3777
    @ericlindell3777 8 днів тому

    Great vid!