diff --git a/week1/community-contributions/day1-webscraping-selenium-for-javascript.ipynb b/week1/community-contributions/day1-webscraping-selenium-for-javascript.ipynb index 6b7a266..a9fc4cc 100644 --- a/week1/community-contributions/day1-webscraping-selenium-for-javascript.ipynb +++ b/week1/community-contributions/day1-webscraping-selenium-for-javascript.ipynb @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd", "metadata": {}, "outputs": [], @@ -91,7 +91,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "019974d9-f3ad-4a8a-b5f9-0a3719aea2d3", "metadata": {}, "outputs": [], @@ -135,7 +135,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "c5e793b2-6775-426a-a139-4848291d0463", "metadata": {}, "outputs": [], @@ -197,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "abdb8417-c5dc-44bc-9bee-2e059d162699", "metadata": {}, "outputs": [], @@ -211,7 +211,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "f0275b1b-7cfe-4f9d-abfa-7650d378da0c", "metadata": {}, "outputs": [], @@ -258,7 +258,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "f25dcd35-0cd0-4235-9f64-ac37ed9eaaa5", "metadata": {}, "outputs": [], @@ -292,7 +292,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "0134dfa4-8299-48b5-b444-f2a8c3403c88", "metadata": {}, "outputs": [], @@ -328,7 +328,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "905b9919-aba7-45b5-ae65-81b3d1d78e34", "metadata": {}, "outputs": [], @@ -356,7 +356,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "3d926d59-450e-4609-92ba-2d6f244f1342", "metadata": {}, "outputs": [], @@ -459,7 +459,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "682eff74-55c4-4d4b-b267-703edbc293c7", "metadata": {}, "outputs": [], @@ -474,7 +474,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "90ca6dd0", "metadata": {}, "outputs": [], @@ -532,7 +532,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "947eac30", "metadata": {}, "outputs": [], @@ -543,7 +543,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "id": "2cba8c91", "metadata": {}, "outputs": [], @@ -572,7 +572,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "7880ce6a", "metadata": {}, "outputs": [], @@ -601,7 +601,7 @@ ], "metadata": { "kernelspec": { - "display_name": "llm_env", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -615,7 +615,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.11.11" } }, "nbformat": 4, diff --git a/week2/day4.ipynb b/week2/day4.ipynb index 0151e7d..bc3f0df 100644 --- a/week2/day4.ipynb +++ b/week2/day4.ipynb @@ -228,14 +228,6 @@ "source": [ "gr.ChatInterface(fn=chat, type=\"messages\").launch()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "11c9da69-d0cf-4cf2-a49e-e5669deec47b", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/week4/day3.ipynb b/week4/day3.ipynb index 74cbc7c..bfa8765 100644 --- a/week4/day3.ipynb +++ b/week4/day3.ipynb @@ -275,9 +275,12 @@ "It compiles the file `optimized.cpp` into an executable called `optimized` \n", "Then it runs the program called `optimized`\n", "\n", - "You can google (or ask ChatGPT!) for how to do this on your platform, then replace the lines below.\n", + "In the next lab (day4), a student has contributed a full solution that compiles to efficient code on Mac, PC and Linux!\n", + "\n", + "You can wait for this, or you can google (or ask ChatGPT!) for how to do this on your platform, then replace the lines below.\n", "If you're not comfortable with this step, you can skip it for sure - I'll show you exactly how it performs on my Mac.\n", "\n", + "\n", "OR alternatively: student Sandeep K.G. points out that you can run Python and C++ code online to test it out that way. Thank you Sandeep! \n", "> Not an exact comparison but you can still get the idea of performance difference.\n", "> For example here: https://www.programiz.com/cpp-programming/online-compiler/" @@ -326,7 +329,8 @@ "metadata": {}, "outputs": [], "source": [ - "python_hard = \"\"\"\n", + "python_hard = \"\"\"# Be careful to support large number sizes\n", + "\n", "def lcg(seed, a=1664525, c=1013904223, m=2**32):\n", " value = seed\n", " while True:\n", diff --git a/week4/day4.ipynb b/week4/day4.ipynb index 97730f1..fe1e925 100644 --- a/week4/day4.ipynb +++ b/week4/day4.ipynb @@ -282,7 +282,8 @@ "metadata": {}, "outputs": [], "source": [ - "python_hard = \"\"\"\n", + "python_hard = \"\"\"# Be careful to support large number sizes\n", + "\n", "def lcg(seed, a=1664525, c=1013904223, m=2**32):\n", " value = seed\n", " while True:\n", @@ -461,31 +462,31 @@ "outputs": [], "source": [ "def execute_python(code):\n", - " try:\n", - " output = io.StringIO()\n", - " sys.stdout = output\n", - " exec(code)\n", - " finally:\n", - " sys.stdout = sys.__stdout__\n", - " return output.getvalue()" + " try:\n", + " output = io.StringIO()\n", + " sys.stdout = output\n", + " exec(code)\n", + " finally:\n", + " sys.stdout = sys.__stdout__\n", + " return output.getvalue()" ] }, { "cell_type": "code", - "execution_count": 107, + "execution_count": null, "id": "77f3ab5d-fcfb-4d3f-8728-9cacbf833ea6", "metadata": {}, "outputs": [], "source": [ "def execute_cpp(code):\n", - " write_output(code)\n", - " try:\n", - " compile_result = subprocess.run(compiler_cmd[2], check=True, text=True, capture_output=True)\n", - " run_cmd = [\"./optimized\"]\n", - " run_result = subprocess.run(run_cmd, check=True, text=True, capture_output=True)\n", - " return run_result.stdout\n", - " except subprocess.CalledProcessError as e:\n", - " return f\"An error occurred:\\n{e.stderr}\"" + " write_output(code)\n", + " try:\n", + " compile_result = subprocess.run(compiler_cmd[2], check=True, text=True, capture_output=True)\n", + " run_cmd = [\"./optimized\"]\n", + " run_result = subprocess.run(run_cmd, check=True, text=True, capture_output=True)\n", + " return run_result.stdout\n", + " except subprocess.CalledProcessError as e:\n", + " return f\"An error occurred:\\n{e.stderr}\"" ] }, { @@ -640,6 +641,27 @@ " yield stream_so_far " ] }, + { + "cell_type": "markdown", + "id": "4b0a6a97-5b8a-4a9b-8ee0-7561e0ced673", + "metadata": {}, + "source": [ + "
\n",
+ " ![]() | \n",
+ " \n",
+ " Thank you to @CloudLlama for an amazing contribution\n", + " \n", + " A student has contributed a chunk of code to improve this, in the next 2 cells. You can now select which Python porgram to run,\n", + " and a compiler is automatically selected that will work on PC, Windows and Mac. Massive thank you @CloudLlama!\n", + " \n", + " | \n",
+ "