Git Product home page Git Product logo

examples's Introduction

About

This repository contains all the code examples that I use in my YouTube videos. You'll find the link to the code in the description of each of the videos on YouTube. If you're a regular watcher, you can simply clone the repository and check out the code for the latest video. The main branch will always contain the latest code.

If you have any suggestion to improve this repository, feel free to open an issue or a pull request.

Links

examples's People

Contributors

abdreos avatar alyceosbourne avatar bruceli2017 avatar caspii avatar egges avatar henriqueajnb avatar iljamanakov avatar kiwidamien avatar marktodisco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

Unexpected Error in py_wanderer.plotter

After a simple c&p from GH repo when streamlit run simple_plot.py

File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\py_wanderer\plotter.py", line 21, in plot_maze_with_paths
cmap = cm.get_cmap("tab20")
^^^^^^^^^^^
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'

examples/2024/golroast/after /game.py wont work with python 3.11


and

say that this code should work with python 3.11^ but the syntax here
type Rule = Callable[[int, int], int | None]

requires 3.12.
Tripped me up for a couple mins when i went to play around with the code.

I dont normally use poetry so could be wrong here.

Add an topic about creating multiple instances of classes in Notion

Suggestion

I like the idea of using two examples, each to showcase the advantages of either using functions or classes. I think an important "feature" of classes is that you can create multiple instances of something. Can you add a line about that? I think the bank accounts example actually shows that quite clearly, since you can have multiple bank accounts, so classes work great there.

improvement suggestion for the Streamlit/openai app

hi Arjan,

In you Streamlit/openai app you may benefit from using more params the openAI API offers.
For example, because the first question ("which programming language?") expects a single word, you can use max_tokens to enforce a single-word answer. Likewise, logit_bias might help. Also, for a nicer UX you can stream the model's completion.

Happy to share an example,
Best,

Clem

Create a `pyproject.toml` file

Can you make sure your code examples don't have type errors if you switch on strict type checking in vs code?

This is always recommended, even if there are no external dependencies, mostly because it points to the correct Python version used. It also points to the idea that every code should have an isolated environment to run, and poetry is the default package to manage it.

fail_fast tests fail: "sqlite3.OperationalError: no such table: employees"

In 2024/tuesday_tips/fail_fast, I tried running the tests, and two of the three tests fail.

===================================================== short test summary info =====================================================
FAILED tests/test_main.py::test_successful_employee_update - sqlite3.OperationalError: no such table: employees
FAILED tests/test_main.py::test_update_non_existing_employee - sqlite3.OperationalError: no such table: employees
=================================================== 2 failed, 1 passed in 1.26s ===================================================

How to reproduce:

cd 2024/tuesday_tips/fail_fast
poetry install
poetry run pytest

Is that the correct procedure to run the tests? Is some other command needed to initialize the database? README.md was empty, so the above commands were my guess at how to do it.

Thanks!

Get a small sample of dataset in order to run code without unzip the csv file

The dataset is indeed quite large. Can we use a subset of the data so that no special unzipping action is needed? I prefer to have an example that runs out of the box.

To run the code, there is a step to do: unzip the file, because GitHub has a limitation on uploading files greater than 100Mb. Grabbing a small sample of the dataset, and being able to upload it directly, would resolve this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.