Skip to content

Commit

Permalink
differences for PR #14
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 23, 2024
1 parent fa1c629 commit fa50b25
Show file tree
Hide file tree
Showing 14 changed files with 349 additions and 57 deletions.
349 changes: 322 additions & 27 deletions code-generation-optimization.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ contact: '[email protected]' # FIXME

# Order of episodes in your lesson
episodes:
- Introduction-AI-coding.md
- introduction-ai-coding.md
- code-generation-optimization.md
- Enhancing-coding-efficiency.md
- Ethical-and-security-considerations.md
- enhancing-coding-efficiency.md
- ethical-and-security-considerations.md

# Information for Learners
learners:
Expand Down
36 changes: 18 additions & 18 deletions Enhancing-coding-efficiency.md → enhancing-coding-efficiency.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ exercises: 15

:::::::::::::::::::::::::::::::::::::: questions

- How can the autocomplete function in Codeium help improve your coding speed?
- How can the Autocomplete function in Codeium help improve your coding speed?
- What types of repetitive coding tasks can be automated?
- What are some key components of a clear and effective prompt when using the autocomplete function?
- What are some key components of a clear and effective prompt when using the Autocomplete function?
- In what ways can Codeium assist in generating and improving code documentation?

::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::: objectives

- Use an autocomplete function of Codeium to improve coding speed
- Automate repetitive coding tasks using the autocomplete function of Codeium
- Compose clear and effective prompts that capture and facilitate the expected outcomes using the autocomplete function
- Use an Autocomplete function of Codeium to improve coding speed
- Automate repetitive coding tasks using the Autocomplete function of Codeium
- Compose clear and effective prompts that capture and facilitate the expected outcomes using the Autocomplete function
- Generate and improve documentation using Codeium

::::::::::::::::::::::::::::::::::::::::::::::::

## Autocomplete Function

A key feature of Codeium is its autocomplete function: with every keystroke, Codeium actively attempts to predict and complete what you're typing. By analyzing the current file, previous edits, and contextual snippets from your codebase, it offers relevant suggestions as "ghost text".
A key feature of Codeium is its Autocomplete function: with every keystroke, Codeium actively attempts to predict and complete what you're typing. By analyzing the current file, previous edits, and contextual snippets from your codebase, it offers relevant suggestions as "ghost text".

![](episodes/fig/acceleration.gif){alt='Autocomplete Function'}

This feature can be particularly useful when you're writing boilerplate code (which refers to repetitive code that often serves as a standard template), as it can save you time and reduce the likelihood of errors. By leveraging Codeium's autocomplete function, you can speed up your coding process and focus on the more creative and challenging aspects of your work.
This feature can be particularly useful when you're writing boilerplate code (which refers to repetitive code that often serves as a standard template), as it can save you time and reduce the likelihood of errors. By leveraging Codeium's Autocomplete function, you can speed up your coding process and focus on the more creative and challenging aspects of your work.

### Boilerplate, Formatting, and More

Expand Down Expand Up @@ -60,7 +60,7 @@ Note that the non-FIM model suggests a generic docstring based on only the prece

### Inline Comments

You can guide the autocomplete feature by using comments within your code. Codeium interprets these comments and generates code suggestions to implement what the comment describes.
You can guide the Autocomplete feature by using comments within your code. Codeium interprets these comments and generates code suggestions to implement what the comment describes.

![](episodes/fig/minimize_boilerplate.gif){alt='Inline Comments'}

Expand All @@ -84,18 +84,18 @@ The following shortcuts can be used to speed up your workflow:

### Best Practices

- Avoid manually triggering autocomplete; instead, let it naturally enhance your workflow. Writing prompts as comments is not recommended, but decorating your code with quality comments and information variable/function names yields the best results.
- To achieve the best results with autocomplete, it's important to enhance your code with clear, *declarative* (not instructive) code, descriptive function names, and good comments with examples of the desired inputs and outputs. See the table below for examples:
- Avoid manually triggering Autocomplete; instead, let it naturally enhance your workflow. Writing prompts as comments is not recommended, but decorating your code with quality comments and information variable/function names yields the best results.
- To achieve the best results with Autocomplete, it's important to enhance your code with clear, *declarative* (not instructive) code, descriptive function names, and good comments with examples of the desired inputs and outputs. See the table below for examples:

![](episodes/fig/table_autocomplete.png){alt='Best Practices for Autocomplete'}

- If needed, you can temporarily snooze autocomplete. This feature is available in VS Code version 1.8.66. Simply click the Codeium button in the bottom right to access it.
- If needed, you can temporarily snooze Autocomplete. This feature is available in VS Code version 1.8.66. Simply click the Codeium button in the bottom right to access it.

::::::::::::::::::::::::::::::::::::: challenge

## Autocomplete Exploration (10 min)

Familiarize yourself with Codeium's autocomplete feature by practicing coding tasks. Create the function `analyze_co2_trends()` that processes the CO2 data in `weekly_in_situ_co2_mlo.csv` to calculate monthly average CO2 concentrations and visualizes the trend over time. The function should:
Familiarize yourself with Codeium's Autocomplete feature by practicing coding tasks. Create the function `analyze_co2_trends()` that processes the CO2 data in `weekly_in_situ_co2_mlo.csv` to calculate monthly average CO2 concentrations and visualizes the trend over time. The function should:

- Accept the dataframe as an argument.
- Convert the `date` column to a datetime format.
Expand All @@ -104,11 +104,11 @@ Familiarize yourself with Codeium's autocomplete feature by practicing coding ta
- Visualize the trends over time in a well-formatted plot.
- Return the monthly averages.

**Note**: While this task can be solved without using autocomplete, it’s important to use Codeium in this exercise to demonstrate how autocomplete can assist with coding. Although using Python is not mandatory, the solution will be provided in Python.
**Note**: While this task can be solved without using Autocomplete, it’s important to use Codeium in this exercise to demonstrate how Autocomplete can assist with coding. Although using Python is not mandatory, the solution will be provided in Python.

1. What are the benefits of using Codeium’s autocomplete feature in this function?
2. What are the potential drawbacks of relying on autocomplete?
3. How can you improve the accuracy of suggestions using autocomplete?
1. What are the benefits of using Codeium’s Autocomplete feature in this function?
2. What are the potential drawbacks of relying on Autocomplete?
3. How can you improve the accuracy of suggestions using Autocomplete?

::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down Expand Up @@ -164,7 +164,7 @@ When you click on `Docstring`, Codeium will automatically generate a docstring a

## Autocomplete Feature for Docstrings

Note that Codeium's autocomplete feature may also suggest docstrings as you type, further assisting in creating well-documented functions without needing to manually write them. This can be particularly useful when you need to create specific wordings and have the freedom to customize documents interactively.
Note that Codeium's Autocomplete feature may also suggest docstrings as you type, further assisting in creating well-documented functions without needing to manually write them. This can be particularly useful when you need to create specific wordings and have the freedom to customize documents interactively.

::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down Expand Up @@ -242,7 +242,7 @@ def analyze_co2_trends(df):

::::::::::::::::::::::::::::::::::::: keypoints

- Codeium's autocomplete boosts coding speed by predicting and completing code based on context, past edits, and current files.
- Codeium's Autocomplete boosts coding speed by predicting and completing code based on context, past edits, and current files.
- Automating repetitive tasks like boilerplate code, repetitive functions, and formatting reduces errors and saves time.
- Fill-in-the-Middle (FIM) improves suggestions by analyzing the code above and below the insertion point.
- Docstring generation via code lenses automates the creation of accurate docstrings in the correct location.
Expand Down
File renamed without changes.
Binary file added fig/RAG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/at_mentions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/atmentions1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/best practices chat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/chat_vscode_where_to_find.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/codeium chat best practices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/codeium_command_vscode.mp4
Binary file not shown.
Binary file added fig/command.webp
Binary file not shown.
5 changes: 1 addition & 4 deletions Introduction-AI-coding.md → introduction-ai-coding.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exercises: 10
::::::::::::::::::::::::::::::::::::::::::::::::

## Introduction ##

Artificial intelligence (AI) models for coding assistants, such as Codeium and GitHub Copilot, rely on machine learning (ML) techniques, particularly deep learning and natural language processing (NLP), to assist developers. These models are trained on vast amounts of publicly available code and documentation to understand patterns, syntax, and code logic across various programming languages.
Let’s break down the *key characteristics* of how these models work:

Expand Down Expand Up @@ -72,8 +73,6 @@ Click Open Visual Studio Code, which should redirect you back to Visual Studio C

8. All Done! You will be asked to confirm the authentication in Visual Studio Code (click Open in the resulting pop-up).



### Using Codeium as your Coding Assistant ###

In this lesson, we will learn about the three ways Codeium can assist with coding: *Autocomplete*, *Chat*, and *Command*.
Expand All @@ -84,8 +83,6 @@ In this lesson, we will learn about the three ways Codeium can assist with codin

**Command:** With Command, you can tell Codeium what changes you want to make to your code in plain language. Codeium will then suggest the changes, which you can choose to accept, reject, or adjust as needed.



::::::::::::::::::::::::::::::::::::: keypoints

- AI coding assistants work by combining ML, contextual code understanding, and NLP to help developers code faster and more efficiently.
Expand Down
10 changes: 5 additions & 5 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2022-08-05"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-04-07"
"config.yaml" "345979d68ca38836f0f53b94a3c3f3d3" "site/built/config.yaml" "2024-10-23"
"config.yaml" "be983d63695a4d55717a7eb86ab3daa3" "site/built/config.yaml" "2024-10-23"
"index.md" "34399a5e151cea103c92aa7767f4c118" "site/built/index.md" "2024-09-13"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2022-04-22"
"episodes/Introduction-AI-coding.md" "6e4c56b0a0b232844bc6fb77ae7f6dc2" "site/built/Introduction-AI-coding.md" "2024-10-23"
"episodes/code-generation-optimization.md" "f3bcc1d207b37ad18f2c988093b18ed6" "site/built/code-generation-optimization.md" "2024-10-23"
"episodes/Enhancing-coding-efficiency.md" "ebee675ad95b537443940b336333c9e4" "site/built/Enhancing-coding-efficiency.md" "2024-10-17"
"episodes/Ethical-and-security-considerations.md" "5975f32200f6cc97a7ed79dd8ae4dc26" "site/built/Ethical-and-security-considerations.md" "2024-10-23"
"episodes/introduction-ai-coding.md" "b82a87c6810c1fd1cc9d10547bdf7830" "site/built/introduction-ai-coding.md" "2024-10-23"
"episodes/code-generation-optimization.md" "c9605bf06d242e7fea33cb0bfbf0333b" "site/built/code-generation-optimization.md" "2024-10-23"
"episodes/enhancing-coding-efficiency.md" "d45b5b4d9230b2bd2f5a4ac41e979ac6" "site/built/enhancing-coding-efficiency.md" "2024-10-23"
"episodes/ethical-and-security-considerations.md" "5975f32200f6cc97a7ed79dd8ae4dc26" "site/built/ethical-and-security-considerations.md" "2024-10-23"
"instructors/instructor-notes.md" "d96cb9e76302dee237d0897fb5c1b1a7" "site/built/instructor-notes.md" "2024-09-13"
"learners/reference.md" "86cca05410972bf6feb3e65095c6c89b" "site/built/reference.md" "2024-10-23"
"learners/setup.md" "5456593e4a75491955ac4a252c05fbc9" "site/built/setup.md" "2024-01-26"
Expand Down

0 comments on commit fa50b25

Please sign in to comment.