text:
# tito-zapier
ti.to webhook to zapier connector using AWS Lambda

## Instructions

Modify `hook.py` to add your zapier incoming webhook, and upload this code to AWS Lambda (POST, open authentication).

## Google Sheets

If you want to use Google Sheets, you can use the following header row:

```
title	url	name	email	payment email	currency	total cost	ticket discount code	ticket type ticket quantity	ticket cost
```

## License

MIT License.

repository: swenson/tito-zapier

repo_name: swenson/tito-zapier


text:
InductiveAutomation is a Minecraft mod that adds various technical content to Minecraft.
It's mainly focused on providing automation systems for large otherwise extremely time consuming or annoying tasks.
Another goal is to rather provide a few multifunctional machines instead of many specialized machines for only very specific tasks.

Links:
- [InductiveAutomation on Curse](http://minecraft.curseforge.com/projects/inductive-automation)

##Wiki / Documentation
- [InductiveAutomation Manual](https://github.com/CD4017BE/InductiveAutomation/blob/master/doc/manual/InductiveAutomationManual.pdf)

#Download & Installation

Choose a [release version](https://github.com/CD4017BE/InductiveAutomation/releases)
- For normal playing with Forge-Modloader download the file that just ends with `.jar`
- For use in deobfuscated ForgeGradle environment download the `-deobf.jar` file.

**Important:** Also download the required version of CD4017BE_lib that is linked in the release description.
These files then just go into the `mods` folder of your Minecraft-installation, Modpack or Gradle-project.

## Project setup from source

If you want to program with the mod itself you need an empty ForgeGradle project first. Then either use Git or download the zipped source-code to import it into your project.
As this project depends on my CD4017BE_lib you also need to download the `-deobf.jar` for it and add it to your build path and gradle dependency. Or alternatively setup another ForgeGradle project for it and add that as dependency.
In order to compile the NEI-plugin of this mod you also need to add the deobfuscated versions of NEI, CodeChickenCore and CodeChickenLib to your dependency.

#Modpack permissions

You are allowed to use this mod in any public Modpack you like as long as you provide source credits.

license: MIT

repository: Zandorum/InductiveAutomation

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: Zandorum/InductiveAutomation


text:
# Project 1 - *InstagamViewer*

**InstagamViewer** is an android app that allows a user to check out popular photos from Instagram. The app utilizes Instagram API to display images and basic image information to the user.

Time spent: **15** hours spent in total

## User Stories

The following **required** functionality is completed:

* [X] User can sign in to Twitter using OAuth login (2 points)
* [X] User can view the tweets from their home timeline
  * [X] User should be displayed the username, name, and body for each tweet (2 points)
  * [X] should be displayed the relative timestamp for each tweet "8m", "7h" (1 point)
  * [X] can view more tweets as they scroll with infinite pagination (1 point)
* [X] User can compose a new tweet
  * [X] User can click a “Compose” icon in the Action Bar on the top right (1 point)
  * [X] User can then enter a new tweet and post this to twitter (2 points)
  * [X] User is taken back to home timeline with new tweet visible in timeline (1 point)

* [X] User can switch between Timeline and Mention views using tabs. (4 points)
  * [X] User can view their home timeline tweets.
  * [X] User can view the recent mentions of their username.
* [X] User can navigate to view their own profile (3 points)
  * [X] User can see picture, tagline, # of followers, # of following, and tweets on their profile.
* [X] User can click on the profile image in any tweet to see another user's profile. (4 points total)
  * [X] User can see picture, tagline, # of followers, # of following, and tweets of clicked user. (1 point)
  * [X] Profile view should include that user's timeline (1 point)
  * [X] Optional: User can view following / followers list through the profile (2 points)
* [X] User can infinitely paginate any of these timelines (home, mentions, user) by scrolling to the bottom (1 point)

The following advanced user stories are optional:

* [X] Advanced: While composing a tweet, user can see a character counter with characters remaining for tweet out of 140 (1 point)
* [X] Advanced: Links in tweets are clickable and will launch the web browser (see autolink) (1 point)
* [X] Advanced: User can refresh tweets timeline by pulling down to refresh (i.e pull-to-refresh) (1 point)
* [X] Advanced: User can open the twitter app offline and see last loaded tweets
  * [X] Tweets are persisted into sqlite and can be displayed from the local DB (2 points)
* [] Advanced: User can tap a tweet to display a "detailed" view of that tweet (2 points)
* [X] Advanced: User can select "reply" from detail view to respond to a tweet (1 point)
* [X] Advanced: Improve the user interface and theme the app to feel "twitter branded" (1 to 5 points)
* [X] Bonus: User can see embedded image media within the tweet detail view (1 point)
* [X] Bonus: User can watch embedded video within the tweet (1 point)
* [X] Bonus: Compose activity is replaced with a modal overlay (2 points)
* [X] Bonus: Use Parcelable instead of Serializable using the popular Parceler library. (1 point)
* [X] Bonus: Apply the popular Butterknife annotation library to reduce view boilerplate. (1 point)
* [] Bonus: Leverage the popular GSON library to streamline the parsing of JSON data. (1 point)
* [] Bonus: Leverage RecyclerView as a replacement for the ListView and ArrayAdapter for all lists of tweets. (2 points)
* [] Bonus: Move the "Compose" action to a FloatingActionButton instead of on the AppBar. (1 point)
* [] Bonus: Replace Picasso with Glide for more efficient image rendering. (1 point)

* [X] Advanced: User can search for tweets matching a particular query and see results (2 points)

## Video Walkthrough

Here's a walkthrough of implemented user stories:

![Video Walkthrough](Demo.gif)

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Notes

Describe any challenges encountered while building the app.

## Open-source libraries used

- [Android Async HTTP](https://github.com/loopj/android-async-http) - Simple asynchronous HTTP requests with JSON parsing
- [Picasso](http://square.github.io/picasso/) - Image loading and caching library for Android
- [Butterknife] (http://jakewharton.github.io/butterknife/) A annotation library to reduce view boilerplate

## License

    Copyright [2016] [name of copyright owner]

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

repository: uttamavillain/TwitterClient

repo_name: uttamavillain/TwitterClient


text:
en-cartelera-android
====================

Lista de películas que están en cartelera en los cines de Nicaragua

[![Google Play](https://ssl.gstatic.com/android/market_images/web/play_logo.png)](https://play.google.com/store/apps/details?id=com.mc.encartelera)

La aplicación obtiene la información de [https://github.com/apinic/movies](https://github.com/apinic/movies).

## Librerías utilizadas

* [com.android.support:appcompat-v7:20.0.0](https://developer.android.com/intl/es/tools/support-library/features.html#v7)
* [com.loopj.android:android-async-http:1.4.5](http://loopj.com/android-async-http/)
* [com.nhaarman.listviewanimations:library:2.6.0](https://github.com/nhaarman/ListViewAnimations)
* [com.googlecode.android-query:android-query:0.25.9](https://code.google.com/p/android-query/)

License
=======

    Copyright 2014 Paulo McNally<EMAIL_ADDRESS>
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

repository: paulomcnally/en-cartelera-android

repo_name: paulomcnally/en-cartelera-android


text:
---
layout: post
title: ChatGPT prompts for developers
date: 2023-06-27 20:14
summary: Prompts and explanation to work with openai chatgpt completion api. These use cases demonstrate the versatility of ChatGPT and the potential it holds for streamlining and automating various tasks in software development.
categories: General
---

<img src="https://i.ibb.co/5nLYsQc/gpt.jpg" alt="chatgpt-prompts" border="0">

[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fcodeslord.github.io&count_bg=%232CD91B&title_bg=%23000000&icon=probot.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)

# Using ChatGPT as a Developer
{: .no_toc }

When creating chatgpt prompts for software development and related work, it is important to follow some best practices to ensure that the output is accurate and relevant. Some best practices to follow include:

1.  Be specific: Provide clear and specific prompts that detail the task or problem you are trying to solve. This will help ChatGPT understand what you are looking for and provide more accurate results.

2.  Provide context: Provide ChatGPT with relevant information such as the programming language being used, the development framework, and any other relevant details.

3.  Use examples: Provide examples of the type of output you are looking for, such as code snippets or documentation. This will help ChatGPT understand the format and style you are looking for.

4.  Be mindful of the model's capabilities: ChatGPT is a powerful tool, but it has limitations. Be mindful of its capabilities and limitations, and adjust your prompts accordingly.

5.  Test the output: Before using the output generated by ChatGPT, it is important to test it to ensure that it is accurate and meets your requirements. If necessary, make adjustments to the prompt and retrain the model.

6.  Use the right training data: Make sure you are using the right training data that is relevant to the task you are trying to accomplish.

# Prompts for Developers
{: .no_toc }

ChatGPT is a powerful language model that can be used in a variety of ways to assist developers and software engineers in their work. This list presents ways that ChatGPT can be used, from auto-generating code documentation to AI-assisted coding and debugging.

These use cases demonstrate the versatility of ChatGPT and the potential it holds for streamlining and automating various tasks in software development.

#### Use Cases
{: .no_toc .text-delta }

1. TOC
{:toc}

---

## Auto-generating code documentation

*Auto-generating code documentation with GPT refers to the process of using the GPT language model to automatically generate documentation for code.* This can save time and resources for developers, as they don't have to manually write documentation, and can focus on more complex tasks.

Here's a simple example of how a developer might use GPT to generate documentation for a Python function:

```
def add_numbers(a: int, b: int) -> int:
    """
    This function takes in two numbers and returns their sum.
    """
    return a + b
```

**A developer then would enter the prompt:**

```
Please provide a summary of the function add_numbers(a: int, b: int) -> int:
```

GPT would then generate a summary of the function like this:

```
The add_numbers function takes in two integers, a and b, and returns their sum. The function is defined with type hints for the input and output parameters.
```

In this example, the developer has provided GPT with the function code and a prompt asking for a summary of the function. GPT uses this information to generate a clear and concise summary of the function. This summary can be used as part of the code documentation and can be added as a comment in the code.

This is just a simple example of how a developer could use GPT to generate code documentation, but GPT can also be used to generate more comprehensive documentation for larger codebases and even entire projects.

---
## Generating Code Documentation In Markdown

Generating Markdown Code Documentation with ChatGPT refers to the process of using the GPT language model to automatically generate documentation for code in Markdown format. This can be used to create user guides, API documentation, and other types of documentation.

Here's a simple example of how a developer might use GPT to generate Markdown documentation for a Python function:

Code:

```
def add_numbers(a: int, b: int) -> int:
    """
    This function takes in two numbers and returns their sum.
    """
    return a + b
```

Prompt:

```
Please generate Markdown documentation for the function add_numbers(a: int, b: int) -> int:
```

GPT would then generate Markdown documentation for the function like this:

```
# `add_numbers` function

The `add_numbers` function takes in two numbers and returns their sum.

### Inputs
- `a`: an integer
- `b`: an integer

### Output
- The sum of `a` and `b`

### Example
```python
>>> add_numbers(1,2)
3
```

In this example, the developer has provided GPT with the function code and a prompt asking for Markdown documentation of the function. GPT uses this information to generate clear and concise documentation of the function, which can be used as part of the code documentation and can be added as a comment in the code or even in an external documentation file.

This is just a simple example of how a developer could use GPT to generate code documentation in Markdown format, but GPT can also be used to generate more comprehensive documentation for larger codebases and even entire projects.

---

## Code Summarization

Code summarization with ChatGPT refers to the process of using the GPT language model to automatically generate a summary of the code. This can help developers and software engineers to understand and navigate large codebases, by providing a brief overview of the code structure and functionality.

Here's a simple example of how a developer might use GPT to generate a summary of a Python script:

```
import pandas as pd

def load_data(file_path: str) -> pd.DataFrame:
    """
    This function loads a csv file and returns a Pandas DataFrame.
    """
    return pd.read_csv(file_path)

def clean_data(data: pd.DataFrame) -> pd.DataFrame:
    """
    This function performs data cleaning and returns a cleaned DataFrame.
    """
    data = data.dropna()
    data = data.drop_duplicates()
    return data

def analyze_data(data: pd.DataFrame):
    """
    This function performs basic data analysis and prints the results.
    """
    print(data.describe())

if __name__ == "__main__":
    file_path = "data.csv"
    data = load_data(file_path)
    data = clean_data(data)
    analyze_data(data)
```

**A developer then would enter the prompt:**

```
Please provide a summary of the script above.
```

GPT would then generate a summary of the script like this:

```
The above script is a simple data analysis pipeline that loads a csv file, performs data cleaning, and performs basic data analysis. It uses the Pandas library for data manipulation and uses functions with clear and descriptive names for each step of the pipeline.
```

In this example, the developer has provided GPT with the script code and a prompt asking for a summary of the script. GPT uses this information to generate a brief overview of the script's functionality and structure, which can be useful for understanding the script's purpose and how it works, especially when working with large codebase.

---

## Code Generation

Code generation with ChatGPT refers to the process of using the GPT language model to automatically generate code snippets or even entire programs, based on a set of prompts and inputs provided by the developer. This can save time and resources for developers, as they don't have to manually write code, and can focus on more complex tasks.

Here's a simple example of how a developer might use GPT to generate code for a Python function that performs data preprocessing:

Prompt:

```
Please generate a Python function that takes in a Pandas DataFrame and performs the following preprocessing steps:
- Removes rows with missing values
- Removes duplicate rows
- Converts all column values to lowercase
- Replaces all occurrences of the string "unknown" with None
```

GPT would then generate a code snippet for the Python function like this:

```
def preprocess_data(data: pd.DataFrame) -> pd.DataFrame:
    """
    This function performs data preprocessing on a Pandas DataFrame.
    """
    # Remove rows with missing values
    data = data.dropna()
    # Remove duplicate rows
    data = data.drop_duplicates()
    # Convert all column values to lowercase
    data = data.apply(lambda x: x.str.lower() if x.dtype == "object" else x)
    # Replace all occurrences of the string "unknown" with None
    data = data.replace("unknown", None)
    return data
```

In this example, the developer has provided GPT with a prompt that describes the specific steps and requirements for a data preprocessing function, and GPT has generated a complete Python function that performs these steps. This can save time and effort for the developer, as they don't have to manually write the code for this function, and can focus on more complex tasks.

This is just a simple example of how a developer could use GPT to generate code, but GPT can also be used to generate more complex code for larger projects or entire programs, depending on the complexity of the task and the inputs provided.

----

## Code Feedback

Code feedback with ChatGPT refers to the process of using the GPT language model to provide feedback on code snippets or entire programs. This can help developers improve their code, by providing suggestions for code optimization, bug fixes, and best practices.

Here's a simple example of how a developer might use GPT to receive feedback on a Python function:

Code:

```
def square_numbers(numbers: List[int]) -> List[int]:
    """
    This function squares a list of numbers.
    """
    return [number ** 2 for number in numbers]
```

Prompt:

```
Please provide feedback on the function square_numbers(numbers: List[int]) -> List[int]:
```

ChatGPT would then generate feedback on the function similar to:

```
The function square_numbers is well-named and is easy to understand. The code is clear, and the use of list comprehension makes it efficient. However, it's missing input validation, it would be good to add checks to ensure that the input is a list of integers and not empty.
```

In this example, the developer has provided GPT with the function code and a prompt asking for feedback on the function. GPT uses this information to generate feedback on the function, including suggestions for improvements and best practices. This can help developers improve their code and write more robust and maintainable code.

Note that code feedback can be used for several purposes, such as improving the quality of the code, identifying bugs, and making suggestions for performance optimization, security, and maintainability.

----

## AI-Assisted Coding

AI-assisted coding with ChatGPT refers to the process of using the GPT language model to assist developers in writing code. This can be done by providing code suggestions, auto-completing code snippets, generating code snippets, and more. By using GPT, developers can save time and effort while writing code and increase their productivity.

Here's a simple example of how a developer might use GPT to assist them in writing a Python function:

Prompt:

```
Please generate a Python function that takes in a list of numbers and returns a new list with only the even numbers.
```

GPT would then generate a code snippet for the Python function like this:

```
def get_even_numbers(numbers: List[int]) -> List[int]:
    """
    This function takes in a list of numbers and returns a new list with only the even numbers.
    """
    return [number for number in numbers if number % 2 == 0]
```

In this example, the developer has provided GPT with a prompt describing the requirement for a function that takes in a list of numbers and returns a new list with only the even numbers, and GPT has generated a complete Python function that performs this task. This can save time and effort for the developer, as they don't have to manually write the code for this function and can focus on more complex tasks.

This is just a simple example of how a developer could use GPT to assist in writing code, but GPT can also be used for more complex tasks, such as generating entire programs, providing suggestions for code optimization, and more.

---

## Auto-completing code snippets

Auto-completing code snippets with ChatGPT refers to the process of using the GPT language model to automatically complete code snippets based on a set of prompts and inputs provided by the developer. This can save time and resources for developers, as they don't have to manually write the entire code, and can focus on more complex tasks.

Here's a simple example of how a developer might use GPT to auto-complete a Python function:

Prompt:

```
Please complete the following code snippet for a Python function that takes in a string and returns the first letter of each word in the string in uppercase:
```

Code:

```
def first_letter_of_each_word(string: str):
    """
    This function takes in a string and returns the first letter of each word in the string in uppercase
    """
    return
```

GPT would then complete the code snippet for the Python function like this:

```
def first_letter_of_each_word(string: str):
    """
    This function takes in a string and returns the first letter of each word in the string in uppercase
    """
    words = string.split()
    first_letters = [word[0].upper() for word in words]
    return "".join(first_letters)
```

In this example, the developer has provided GPT with a prompt describing the requirement for a function that takes in a string and returns the first letter of each word in the string in uppercase and a code snippet that has the function signature and docstring. GPT has completed the function by providing the logic and implementation of the function.

This is just a simple example of how a developer could use GPT to auto-complete a code snippet, but GPT can also be used to auto-complete more complex code snippets and even entire programs, depending on the complexity of the task and the inputs provided.

---

## Generating software testing scenarios

Generating software testing scenarios with ChatGPT refers to the process of using the GPT language model to automatically generate test cases, test scenarios, and test inputs for software applications. This can help developers ensure that their software is thoroughly tested and free of bugs, by providing a wide range of test scenarios that cover different inputs, edge cases and other test conditions.

Here's a simple example of how a developer might use GPT to generate test scenarios for a Python function:

Code:

```
def add_numbers(a: int, b: int) -> int:
    """
    This function takes in two numbers and returns their sum.
    """
    return a + b
```

Prompt:

```
Please generate test scenarios for the function add_numbers(a: int, b: int) -> int:
```

GPT would then generate test scenarios for the function like this:

```
- Test scenario 1: Verify that the function returns the correct sum for positive integers
- Test scenario 2: Verify that the function returns the correct sum for negative integers
- Test scenario 3: Verify that the function returns the correct sum for zero values
- Test scenario 4: Verify that the function returns an error for non-numeric inputs
```

In this example, the developer has provided GPT with the function code and a prompt asking for test scenarios for the function. GPT uses this information to generate test scenarios that cover different inputs, such as positive and negative integers, zero values, and non-numeric inputs. This can help the developer ensure that the function is thoroughly tested and performs as expected for a wide range of inputs.

This is just a simple example of how a developer could use GPT to generate software testing scenarios, but GPT can also be used to generate more complex test scenarios, test cases, and test inputs depending on the complexity of the software and the inputs provided.

---

## Generating data visualization code

Generating data visualization code with ChatGPT refers to the process of using the GPT language model to automatically generate code for creating visual representations of data. This can be used to create charts, plots, graphs, and other types of visualizations to help developers and data scientists better understand their data and make data-driven decisions.

Here's a simple example of how a developer might use GPT to generate code for creating a bar chart in Python:

Prompt:

```
Please generate code for creating a bar chart in Python that visualizes the following data:

data = {'apples': 10, 'bananas': 5, 'oranges': 8}
```

GPT would then generate code for creating a bar chart like this:

```
import matplotlib.pyplot as plt

data = {'apples': 10, 'bananas': 5, 'oranges': 8}

plt.bar(data.keys(), data.values())
plt.xlabel('Fruit')
plt.ylabel('Quantity')
plt.title('Fruit Quantity')
plt.show()
```

In this example, the developer has provided GPT with a prompt describing the requirement for a bar chart in Python that visualizes a specific data set, and GPT has generated a complete Python code that creates a bar chart based on the data provided. This can save time and effort for the developer, as they don't have to manually write the code for creating the chart and can focus on more complex tasks.

This is just a simple example of how a developer could use GPT to generate code for data visualization, but GPT can also be used to generate more complex visualizations, such as line charts, scatter plots, and heat maps, depending on the complexity of the data and the requirements of the visualization.

---

## Generating code for data preprocessing

Generating code for data preprocessing with ChatGPT refers to the process of using the GPT language model to automatically generate code for cleaning, transforming, and preparing data for analysis or modeling. This can include tasks such as removing missing values, converting data types, feature scaling, and more.

Here's a simple example of how a developer might use GPT to generate code for data preprocessing in Python:

Prompt:

```
Please generate code for loading and preprocessing a CSV file in Python that includes the following steps:
- Loading the CSV file
- Removing the rows with missing values
- Replacing the missing values with the mean
- Converting the data types
- Splitting the data into a training and testing set
```

GPT would then generate code for loading and preprocessing a CSV file like this:

```
import pandas as pd
from sklearn.model_selection import train_test_split

# Load the CSV file
data = pd.read_csv('data.csv')

# Remove the rows with missing values
data.dropna(inplace=True)

# Replace the missing values with the mean
mean = data.mean()
data.fillna(mean, inplace=True)

#Converting the data types
data = data.astype(float)

#Splitting the data into a training and testing set
train_data, test_data = train_test_split(data, test_size=0.2)
```

In this example, the developer has provided GPT with a prompt describing the requirement for a code that loads and preprocesses a CSV file in Python and GPT has generated a complete Python code that loads and preprocesses a CSV file based on the steps provided in the prompt. This can save time and effort for the developer, as they don't have to manually write the code for preprocessing the data and can focus on more complex tasks.

This is just a simple example of how a developer could use GPT to generate code for data preprocessing, but GPT can also be used to generate more complex data preprocessing pipelines, depending on the complexity of the data and the requirements of the analysis or modeling.

---

## Creating code snippets for specific programming languages

Creating code snippets for specific programming languages with ChatGPT refers to the process of using the GPT language model to automatically generate code snippets that are specific to a certain programming language. This can be used to quickly generate code for common tasks, such as connecting to a database, creating a loop, or defining a function, in a specific programming language.

Here's a simple example of how a developer might use GPT to generate a code snippet for connecting to a MySQL database in Python:

Prompt:

```
Please generate a code snippet for connecting to a MySQL database in Python.
```

GPT would then generate a code snippet for connecting to a MySQL database like this:

```
import mysql.connector

def connect_to_db(user, password, host, database):
    connection = mysql.connector.connect(user=user, password=password, host=host, database=database)
    return connection
```

In this example, the developer has provided GPT with a prompt asking for a code snippet for connecting to a MySQL database in Python and GPT has generated a complete Python code that connects to a MySQL database and returns the connection object. This can save time and effort for the developer, as they don't have to manually write the code for connecting to the database and can focus on more complex tasks.

This is just a simple example of how a developer could use GPT to generate code snippets for specific programming languages, but GPT can also be used to generate more complex code snippets for different tasks, depending on the requirements.

---

## AI-assisted debugging and error resolution

AI-assisted debugging and error resolution with ChatGPT refers to the process of using the GPT language model to assist in identifying and resolving errors in code. This can include tasks such as identifying the root cause of an error, suggesting potential solutions, and even generating code to fix the error.

Here's a simple example of how a developer might use GPT to assist in debugging and resolving an error in Python:

Prompt:

```
I am getting an "unexpected EOF while parsing" error in my Python code. Please help me understand what is causing this error and suggest a potential solution.
GPT would then generate a response that explains that the error is likely caused by a missing parenthesis or bracket somewhere in the code, and suggests adding print statements to the code to help identify the exact location of the missing parenthesis or bracket. It would also generate a code snippet that would fix the problem like this:
```

```
# Add print statements to help identify the location of the missing parenthesis or bracket
print("Start of code")
# your code here
print("End of code")
```

In this example, the developer has provided GPT with a prompt describing an error they are encountering in their Python code, and GPT has responded with an explanation of the likely cause of the error and a suggested solution, as well as a code snippet that would fix the problem. This can save time and effort for the developer, as they don't have to manually debug the code and can focus on more complex tasks.

This is just a simple example of how a developer could use GPT to assist in debugging and resolving errors in code, but GPT can also be used to assist in debugging more complex errors and resolving them in different programming languages.

It's worth noting that AI-assisted debugging and error resolution is still a relatively new field, and there are limitations to what GPT can do in this area. While GPT can provide suggestions and code snippets to help with debugging, it may not always be able to provide a definitive solution to every error. It's important for developers to use their own expertise and knowledge of the codebase when working with GPT to debug and resolve errors.

---

## Generating code for data analysis

Generating code for data analysis with ChatGPT refers to the process of using the GPT language model to automatically generate code for analyzing and interpreting data. This can include tasks such as calculating summary statistics, creating visualizations, and running statistical tests.

Here's a simple example of how a developer might use GPT to generate code for analyzing and interpreting a dataset in Python:

Prompt:

```
Please generate code for analyzing a dataset in Python that includes the following steps:
- Loading the dataset
- Calculating summary statistics
- Creating a bar chart to visualize the distribution of a categorical variable
- Running a t-test to compare the means of two numerical variables
```

GPT would then generate code for analyzing and interpreting a dataset in Python like this:

```
Copy code
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats

# Load the dataset
data = pd.read_csv('data.csv')

# Calculate summary statistics
print(data.describe())

# Create a bar chart to visualize the distribution of a categorical variable
data.groupby('categorical_variable').size().plot(kind='bar')
plt.show()

# Running a t-test to compare the means of two numerical variables
t_test = stats.ttest_ind(data['numerical_variable1'], data['numerical_variable2'])
print(t_test)
```

In this example, the developer has provided GPT with a prompt describing the requirements for analyzing a dataset in Python and GPT has generated a complete Python code that performs the steps provided in the prompt. This code loads the dataset, calculates summary statistics, creates a bar chart to visualize the distribution of a categorical variable, and runs a t-test to compare the means of two numerical variables. This can save time and effort for the developer, as they don't have to manually write the code for data analysis and can focus on more complex tasks.

This is just a simple example of how a developer could use GPT to generate code for data analysis, but GPT can also be used to generate more complex data analysis pipelines, depending on the complexity of the data and the requirements of the analysis.

---

## Auto-generating code for Machine Learning models

Auto-generating code for Machine Learning models with ChatGPT refers to the process of using the GPT language model to automatically generate code for training, evaluating and deploying machine learning models. This can include tasks such as data preprocessing, model selection, hyperparameter tuning, and model deployment.

Here's a simple example of how a developer might use GPT to generate code for a machine learning model in Python:

Prompt:

```
Copy code
Please generate code for training and evaluating a simple linear regression model on a dataset in Python. The dataset is called data.csv and contains two columns, 'x' and 'y'.
```

GPT would then generate code for training and evaluating a simple linear regression model like this:

```
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split

# Load the dataset
data = pd.read_csv('data.csv')

# Split the data into train and test sets
X_train, X_test, y_train, y_test = train_test_split(data[['x']], data['y'], test_size=0.2)

# Create the linear regression object
model = LinearRegression()

# Train the model using the training data
model.fit(X_train, y_train)

# Make predictions on the test data
y_pred = model.predict(X_test)

# Calculate the mean squared error of the predictions
mse = mean_squared_error(y_test, y_pred)

# Print the mean squared error
print(mse)
```

In this example, the developer has provided GPT with a prompt describing the requirements for training a simple linear regression model on a dataset in Python, GPT has generated a complete Python code that performs the steps provided in the prompt. This code loads the dataset, split the data into train and test sets, train the model using the training data, make predictions on the test data, calculate the mean squared error of the predictions, and print the mean squared error.

---

## Generating code for web scraping

Generating code for web scraping with ChatGPT refers to the process of using the GPT language model to automatically generate code for extracting data from websites. This can include tasks such as navigating through website pages, parsing HTML and XML, and storing data in a structured format.

Here's a simple example of how a developer might use GPT to generate code for web scraping in Python:

Prompt:

```
Please generate code for scraping the product names and prices from the website "https://www.example.com" and storing them in a CSV file called "products.csv"
```

GPT would then generate code for web scraping like this:

```
import requests
from bs4 import BeautifulSoup
import csv

# Send a request to the website
response = requests.get('https://www.example.com')

# Parse the HTML content
soup = BeautifulSoup(response.content, 'html.parser')

# Find all product names and prices
products = soup.find_all('div', class_='product')

# Open a CSV file to store the data
with open('products.csv', 'w') as f:
    writer = csv.writer(f)
    writer.writerow(['Product Name', 'Price'])

    # Write the data to the CSV file
    for product in products:
        name = product.find('h3').text
        price = product.find('span', class_='price').text
        writer.writerow([name, price])
```

In this example, the developer has provided GPT with a prompt describing the requirements for scraping product names and prices from a website and storing them in a CSV file. GPT has generated a complete Python code that performs the steps provided in the prompt. This code sends a request to the website, parse the HTML content, finds all the product names and prices, opens a CSV file, writes the header, and writes the data to the CSV file.

---

## Generating code for NLP tasks

Generating code for NLP tasks with ChatGPT refers to the process of using the GPT language model to automatically generate code for performing various Natural Language Processing tasks such as text classification, language translation, text summarization, sentiment analysis, and more.

Here's a simple example of how a developer might use GPT to generate code for performing text classification in Python:

Prompt:

```
Please generate code for classifying a given piece of text as positive or negative sentiment using a pre-trained BERT model in Python. The text is stored in a variable called 'text'
```

GPT would then generate code for text classification like this:

```
import transformers
from transformers import BertTokenizer, BertForSequenceClassification
import torch

# Load the BERT tokenizer
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')

# Encode the text
input_ids = torch.tensor([tokenizer.encode(text, add_special_tokens=True)])

# Load the BERT model
model = BertForSequenceClassification.from_pretrained('bert-base-uncased')

# Perform the classification
outputs = model(input_ids)

# Extract the classification results
_, logits = outputs[:2]

# Convert the logits to probabilities
probs = torch.softmax(logits, dim=1)

# Print the results
print("Positive sentiment probability:", probs[0][1].item())
print("Negative sentiment probability:", probs[0][0].item())
```

In this example, the developer has provided GPT with a prompt describing the requirements for classifying a given piece of text as positive or negative sentiment using a pre-trained BERT model in Python.

GPT has generated a complete Python code that performs the steps provided in the prompt. This code loads the BERT tokenizer, encode the text, loads the BERT model, performs the classification, extract the classification results, converts the logits to probabilities, and print the results.

---

## Generating code for deployment scripts and automation

Generating code for deployment scripts and automation with ChatGPT refers to the process of using the GPT language model to automatically generate code for automating the deployment of software applications to various environments such as servers, cloud environments, or even IoT devices. This can include tasks such as configuring servers, creating and managing containers, automating scaling and load balancing, and more.

Here's a simple example of how a developer might use GPT to generate code for deploying a Python web application to a Kubernetes cluster:

Prompt:

```
Please generate code for deploying a Python web application to a Kubernetes cluster. The application should be deployed as a container, and should be accessible via a LoadBalancer service. The application code is located in a directory called 'app' and the dependencies are listed in a file called 'requirements.txt'
```

GPT would then generate code for deploying the application like this:

```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: web-app
  template:
    metadata:
      labels:
        app: web-app
    spec:
      containers:
      - name: web-app
        image: python:3.8
        command: ['sh', '-c', 'pip install -r /app/requirements.txt && python /app/main.py']
        ports:
        - containerPort: 5000
        volumeMounts:
        - name: app-code
          mountPath: /app
      volumes:
      - name: app-code
        configMap:
          name: app-code
---
apiVersion: v1
kind: Service
metadata:
  name: web-app
spec:
  selector:
    app: web-app
  ports:
  - name: http
    port: 80
    targetPort: 5000
  type: LoadBalancer
```

In this example, the developer has provided GPT with a prompt describing the requirements for deploying a Python web application to a Kubernetes cluster as a container and making it accessible via a LoadBalancer service. GPT has generated a complete Kubernetes deployment file in YAML format that performs the steps provided in the prompt.

This code defines a deployment that creates 3 replicas of the container, specifies the container image, command to run inside the container, the ports exposed by the container, the volume mounts, and the volumes. Also, it defines a service of type LoadBalancer to expose the application.


text:
# 2. Configure Wagtail Localize

In this section, you will enable Wagtail's internationalisation and install Wagtail Localize into the site that you
created earlier.

## Settings

Open `tutorial/settings/base.py` in your favourite text editor.

### Add Wagtail Localize to `INSTALLED_APPS`

Find the `INSTALLED_APPS` setting, and insert `'wagtail_localize'` and `'wagtail_localize.locales'` in between
`'search` and `'wagtail.contrib.forms'`:

```python
INSTALLED_APPS = [
    "home",
    "search",
    # Insert these here
    "wagtail_localize",
    "wagtail_localize.locales",
    "wagtail.contrib.forms",
    "wagtail.contrib.redirects",
    # ...
]
```

Note that the `wagtail_localize.locales` module is a temporary replacement for Wagtail's builtin `wagtail.locales`
module and it will be removed in a later release.

### Enable Wagtail's internationalisation

Find the "Internationalisation" section, and add the `WAGTAIL_I18N_ENABLED` setting:

```python
USE_I18N = True

USE_L10N = True

# Add this
WAGTAIL_I18N_ENABLED = True

USE_TZ = True
```

### Configure content languages

In the "Internationalisation" section, add the following to set the `LANGUAGES` and `WAGTAIL_CONTENT_LANGUAGES`
settings to English and French:

```python
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [
    ("en", "English"),
    ("fr", "French"),
]
```

### Enable `LocaleMiddleware`

Django's `LocaleMiddleware` detects a user's browser language and forwards them to the most appropriate language
version of the website.

To enable it, insert `'django.middleware.locale.LocaleMiddleware'` into the middleware setting
above `RedirectMiddleware`:

```python
MIDDLEWARE = [
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
    "django.middleware.security.SecurityMiddleware",
    # Insert this here
    "django.middleware.locale.LocaleMiddleware",
    "wagtail.contrib.redirects.middleware.RedirectMiddleware",
]
```

## URLs

Next, you need configure which URL paths are translatable so that Django will prefix them with the language code.

Open `tutorial/urls.py` in your text editor. You'll see that there are two groups of URL patterns with an
`if settings.DEBUG:` block in between them.

The patterns that need to be made translatable are:

- `path('search/', search_views.search, name='search'),`
- `path("", include(wagtail_urls)),`

To make these translatable, move the 'search/' pattern into the second block, above the `wagtail_urls` pattern. Then,
replace the square brakets around that block with
[`i18n_patterns`](https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#django.conf.urls.i18n.i18n_patterns):

```python
from django.conf.urls.i18n import i18n_patterns

# These paths are translatable so will be given a language prefix (eg, '/en', '/fr')
urlpatterns = urlpatterns + i18n_patterns(
    path("search/", search_views.search, name="search"),
    # For anything not caught by a more specific rule above, hand over to
    # Wagtail's page serving mechanism. This should be the last pattern in
    # the list:
    path("", include(wagtail_urls)),
    # Alternatively, if you want Wagtail pages to be served from a subpath
    # of your site, rather than the site root:
    #    path("pages/", include(wagtail_urls)),
)
```

With the search pattern removed, the first group should now look like:

```python
# These paths are non-translatable so will not be given a language prefix
urlpatterns = [
    path("django-admin/", admin.site.urls),
    path("admin/", include(wagtailadmin_urls)),
    path("documents/", include(wagtaildocs_urls)),
]
```

## Migrate the database

Run the migrate command again to set up the tables for Wagtail Localize in the database you created earlier:

```shell
python manage.py migrate
```

## Check the site

Go back to `http://localhost:8000`. If your browser is configured for English or any other language except French,
you should be redirected to `http://localhost:8000/en/`.
If your browser is configured in French, you should be redirected to `http://localhost:8000/fr/`.

In either case, you can view the site in `/en/` or `/fr/` (no differences yet).

If this is all working as described, that means `i18n_patterns` and `LocaleMiddleware` are working!

## Check the admin

Now go back into the Wagtail admin interface. When you open the "Pages" menu, you shoud see that that the "Home" page
has been labelled as "English". If you see that, then Wagtail's internationalisation is working!

![Wagtail explorer menu with internationalisation enabled](/_static/tutorial/wagtail-explorer-with-i18n.png)

## Create the "French" locale

Wagtail Localize creates only one locale to begin with, which is the one the corresponds to what you have in the
`LANGUAGE_CODE` setting. If you left `LANGUAGE_CODE` set to `en-gb` the initial locale would've been created for
"English", so you need to create a new locale for "French".

To create a new locale, go to "Settings" => "Locales" in the admin interface, and click "Add a new locale". "French"
should be automatically selected as it is the only available option (this list comes from the
`WAGTAIL_CONTENT_LANGUAGES` setting you configured earlier).

Set the "Sync from" field to "English". This keeps the "French" language tree in sync with any existing and new English
content as it's authored.

![Setting up the French locale](/_static/tutorial/wagtail-add-french-locale.png)

After you press "Save", there should be two "Home" pages in the page explorer:

![Wagtail explorer menu with English and French homepages](/_static/tutorial/wagtail-explorer-with-english-and-french.png)

repository: wagtail/wagtail-localize

branch_name: refs/heads/main

gha_language: Python

gha_license_id: NOASSERTION

repo_name: wagtail/wagtail-localize


text:
---
layout: post
title: LeetCode - Surrounded Regions
mathjax: false
related: false
comments: true
---

_Click [here](./index.html) to go back to LeetCode summary page._

Problem description is [here](https://oj.leetcode.com/problems/surrounded-regions/), or as follows:

<pre>
 Given a 2D board containing 'X' and 'O',
capture all regions surrounded by 'X'.

A region is captured by flipping all 'O's
into 'X's in that surrounded region.

repository: yinyingt/yysite

repo_name: yinyingt/yysite


text:
# Developer install

## Installing

This explains how to run a local instance of `icubam` on a developer's machine. We use conda, but you might choose virtualenv.

Steps:

- create a conda environment (e.g. `conda create -n icubam python=3.8`)
- activate the environment (`conda activate icubam`)
- install deps with `pip install -r requirements.txt`
- install the package in edit mode by running `pip install -e .`

**Note:** in addition to the python dependencies described in `requirements.txt`, `icubam` requires SQLite >= 3.24.0 as it uses upsert statements.

### Configuration

Create a `.env` file at root of the project containing the following keys:
```
SHEET_ID=
TOKEN_LOC=
SMS_KEY=
SECRET_COOKIE=
JWT_SECRET=
GOOGLE_API_KEY=
MB_KEY=
NX_KEY=
NX_API=
TW_KEY=
TW_API=
```

### Pre-populate DB with test data

Create a fake database in order to be able to play with it:
`python scripts/populate_db_fake.py`

The databse will be named `test.db`.

## Running locally

Start the server locally:
`python scripts/run_server.py`

Will produce the following logs:
```
I0324 19:02:15.784908<PHONE_NUMBER>58048 server.py:32] UpdateHandler serving on /update
I0324 19:02:15.785018<PHONE_NUMBER>58048 server.py:32] HomeHandler serving on /
I0324 19:02:15.785090<PHONE_NUMBER>58048 server.py:49] Running WWWServer on port 8888
I0324 19:02:15.788751<PHONE_NUMBER>58048 server.py:51] http://localhost:8888/update?id=<A_VERY_LONG_ID>
```

Follow the proposed link `http://localhost:8888/update?id=<A_VERY_LONG_ID>`

## Running unit tests

The unit tests require `TOKEN_LOC` to be set with a valid `token.pickle` file in the `.env` file.

To start the tests, install `pytest` and run `pytest`


text:
# Tutorials
We provide several tutorials to help users get familiar with Bootleg.

## Introduction
### End to End
In this [tutorial](end2end_ned_tutorial.ipynb), learn how to use Bootleg for end-to-end inference. We start from text data and show how to detect mentions and then link them to entities. We also show how to use Bootleg for "on-the-fly" disambiguation of individual sentences.

### On the Fly
In this [tutorial](annotation-on-the-fly.ipynb), we show how to use Bootleg for "on-the-fly" disambiguation of individual sentences.

### Entity Profiles
In this [tutorial](entity_profile_tutorial.ipynb), learn how to modify and change the entity database associated with a Bootleg model. We start from the downloaded entity profile data and show how to add/remove entities and change type and relation mappings. We then show how to fit an existing model to this profile and load it into a new annotator (or use it on your own data!).

## Using Bootleg Representations
### Embeddings Extraction
In this [tutorial](entity_embedding_tutorial.ipynb), we will introduce you to how to take a pretrained Bootleg model and generate entity representations. The next tutorial shows you how to use them in a downstream model.

### Bootleg-Enhanced TACRED
In this [tutorial](downstream_tutorial/), we show you how to integrate Bootleg embeddings into a downstream LSTM model and SPAN-BERT model.

## Training
### Basic Training
In this [tutorial](https://bootleg.readthedocs.io/en/latest/gettingstarted/training.html), learn how to train a Bootleg model on a small dataset. This will cover input data formatting, data preprocessing, and training.

### Advanced Training
In this [tutorial](https://bootleg.readthedocs.io/en/latest/advanced/distributed_training.html), learn how to use distributed training to train a Bootleg model on the full English Wikipedia save (over 50 million sentences!). You will need access to GPUs to train this model.

repository: SuveshBaskar/bootleg

repo_name: SuveshBaskar/bootleg


text:
## Features

- csv-to-mysql enables you to export csv files to your mysql database.
- creates table with columns of appropriate datatypes that matches the values in the csv file.
- Inserts all the values in the file automatically.
## CSV file format
- Names of columns should be in the first row
- Column values must be in suqsequent rows
- Null values cannot be added

## Installation

```bash
npm install csv-to-mysql
```
## Syntax
```
var exporter = require('csv-to-mysql');
exporter(host,db_name,db_user_name,db_user_pwd,csv_file_path);
```
## example
  ```
 var exporter = require('csv-to-mysql');
 exporter('localhost','sample','root','listenurheart','C:\\prep app\\employee.csv');

 ```
## Credits

- Kaushik Kumaran (https://www.facebook.com/kaushik.kumaran1)

## License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: Gopikapayoor/GrootanServer

repo_name: Gopikapayoor/GrootanServer


text:
---
layout: default
title: Lightning
nav_order: 40
---
<!-- markdownlint-disable MD014 MD022 MD025 MD033 MD040 -->
# Lightning: LND
{: .no_toc }

We set up LND, the Lightning Network Daemon by [Lightning Labs](https://lightning.engineering/){:target="_blank"}.

---

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}

---

## Installation

The installation of LND is straight-forward, but the application is quite powerful and capable of things not explained here. Check out their [Github repository](https://github.com/lightningnetwork/lnd/blob/master/README.md){:target="_blank"} for a wealth of information about their open-source project and Lightning in general.

### Download

Download and install LND

```sh
$ cd /tmp
$ wget https://github.com/lightningnetwork/lnd/releases/download/v0.10.4-beta/lnd-linux-armv7-v0.10.4-beta.tar.gz
$ wget https://github.com/lightningnetwork/lnd/releases/download/v0.10.4-beta/manifest-v0.10.4-beta.txt
$ wget https://github.com/lightningnetwork/lnd/releases/download/v0.10.4-beta/manifest-v0.10.4-beta.txt.sig
$ wget https://keybase.io/roasbeef/pgp_keys.asc

$ sha256sum --check manifest-v0.10.4-beta.txt --ignore-missing
> lnd-linux-armv7-v0.10.4-beta.tar.gz: OK

$ gpg ./pgp_keys.asc
> 9769140D255C759B1EB77B46A96387A57CAAE94D

$ gpg --import ./pgp_keys.asc
$ gpg --verify manifest-v0.10.4-beta.txt.sig
> gpg: Good signature from "Olaoluwa Osuntokun<EMAIL_ADDRESS>[unknown]
> Primary key fingerprint: 9769 140D 255C 759B 1EB7  7B46 A963 87A5 7CAA E94D
>      Subkey fingerprint: 4AB7 F8DA 6FAE BB3B 70B1  F903 BC13 F65E 2DC8 4465

$ tar -xzf lnd-linux-armv7-v0.10.4-beta.tar.gz
$ sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-armv7-v0.10.4-beta/*
$ lnd --version
> lnd version 0.10.4-beta commit=v0.10.4-beta
```

<script id="asciicast-DvuCHl1ibT4eursipO0Z53xf5" src="https://asciinema.org/a/DvuCHl1ibT4eursipO0Z53xf5.js" async></script>

### Configuration

Now that LND is installed, we need to configure it to work with Bitcoin Core and run automatically on startup.

* Open a "bitcoin" user session

  ```sh
  $ sudo su - bitcoin
  ```

* Create the LND working directory and the corresponding symbolic link

  ```sh
  $ mkdir /mnt/ext/lnd
  $ ln -s /mnt/ext/lnd /home/bitcoin/.lnd
  $ ls -la
  ```

* Create the LND configuration file and paste the following content (adjust to your alias). Save and exit.

  ```sh
  $ nano /mnt/ext/lnd/lnd.conf
  ```

  ```ini
  # RaspiBolt: lnd configuration
  # /mnt/ext/lnd/lnd.conf

  [Application Options]
  alias=YOUR_FANCY_ALIAS
  debuglevel=info
  maxpendingchannels=5
  listen=localhost

  [Bitcoin]
  bitcoin.active=1
  bitcoin.mainnet=1
  bitcoin.node=bitcoind

  [tor]
  tor.active=true
  tor.v3=true
  tor.streamisolation=true
  ```

🔍 *more: [sample-lnd.conf](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf){:target="_blank"} with all possible options in the LND project repository*

<script id="asciicast-BIhZQuGGoUKtKDsawTpysYa3o" src="https://asciinema.org/a/BIhZQuGGoUKtKDsawTpysYa3o.js" async></script>

---

## Run LND

Again, we switch to the user "bitcoin" and first start LND manually to check if everything works fine.

```sh
$ sudo su - bitcoin
$ lnd
```

The daemon prints the status information directly to the command line.
This means that we cannot use that session without stopping the server. We need to open a second SSH session.

### Wallet setup

Start your SSH program (eg. PuTTY) a second time, connect to the Pi and log in as "admin".
Commands for the **second session** start with the prompt `$2` (which must not be entered).

Once LND is started, the process waits for us to create the integrated Bitcoin wallet (it does not use the "bitcoind" wallet).

* Start a "bitcoin" user session

  ```sh
  $2 sudo su - bitcoin
  ```

* Create the LND wallet

  ```sh
  $2 lncli create
  ```

* If you want to create a new wallet, enter your `password [C]` as wallet password, select `n` regarding an existing seed and enter the optional `password [D]` as seed passphrase. A new cipher seed consisting of 24 words is created.

These 24 words, combined with your passphrase (optional `password [D]`)  is all that you need to restore your Bitcoin wallet and all Lighting channels. The current state of your channels, however, cannot be recreated from this seed, this requires a continuous backup and is still under development for LND.

🚨 This information must be kept secret at all times. **Write these 24 words down manually on a piece of paper and store it in a safe place.** This piece of paper is all an attacker needs to completely empty your wallet! Do not store it on a computer. Do not take a picture with your mobile phone. **This information should never be stored anywhere in digital form.**

* exit "bitcoin" user session

  ```sh
  $2 exit
  ```

<script id="asciicast-xv9Gq3G5Pu5A1Jtxu2bACRvjQ" src="https://asciinema.org/a/xv9Gq3G5Pu5A1Jtxu2bACRvjQ.js" async></script>

💡 _In this screencast I use the awesome [`tmux`](https://www.ocf.berkeley.edu/~ckuehl/tmux/){:target="_blank"} to run multiple Terminal sessions in parallel.
But you can just connect to your RaspiBolt with two separate SSH sessions._

### Authorization for "admin"

Let's authorize the "admin" user to work with LND using the command line interface `lncli`. For that to work, we need to copy the Transport Layer Security (TLS) certificate and the permission files (macaroons) to the admin home folder.

* Check if the TLS certificates and `admin.macaroon` have been created.

  ```sh
  $2 sudo ls -la /mnt/ext/lnd/
  ```

* Check if the permission files `admin.macaroon` has been created.

  ```sh
  $2 sudo ls -la /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/
  ```

* Link the LND data directory in the user "admin" home.
  As a member or the group "bitcoin", admin has read-only access to certain files.
  We also need to make all directories browsable for the group (with `g+X`) and allow it to read the `admin.macaroon`.

  ```sh
  $2 ln -s /mnt/ext/lnd /home/admin/.lnd
  $2 sudo chmod -R g+X /home/admin/.lnd/data/
  $2 sudo chmod g+r /home/admin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
  ```

* Make sure that `lncli` works by unlocking your wallet (enter `password [C]` ) and getting some node infos.

  ```sh
  $2 lncli unlock
  ```

* Check the current state of LND

  ```sh
  $2 lncli getinfo
  ```

You can also see the progress of the initial sync of LND with Bitcoin in the first SSH session.

Let's stop the server for the moment and focus on our primary SSH session again.

```sh
$2 lncli stop
$2 exit
```

This should terminate LND "gracefully" in SSH session 1 that can now be used interactively again.

<script id="asciicast-o7YMV8E3KAWyVXq3VdzATImYX" src="https://asciinema.org/a/o7YMV8E3KAWyVXq3VdzATImYX.js" async></script>

### Autostart on boot

Now, let's set up LND to start automatically on system startup.

* Exit the "bitcoin" user session back to "admin"

  ```sh
  $ exit
  ```

* Create LND systemd unit with the following content. Save and exit.

  ```sh
  $ sudo nano /etc/systemd/system/lnd.service
  ```

  ```ini
  # RaspiBolt: systemd unit for lnd
  # /etc/systemd/system/lnd.service

  [Unit]
  Description=LND Lightning Network Daemon
  Wants=bitcoind.service
  After=bitcoind.service

  [Service]

  # Service execution
  ###################

  ExecStart=/usr/local/bin/lnd

  # Process management
  ####################

  Type=simple
  Restart=always
  RestartSec=30
  TimeoutSec=240
  LimitNOFILE=128000

  # Directory creation and permissions
  ####################################

  # Run as bitcoin:bitcoin
  User=bitcoin
  Group=bitcoin

  # /run/lightningd
  RuntimeDirectory=lightningd
  RuntimeDirectoryMode=0710

  # Hardening measures
  ####################

  # Provide a private /tmp and /var/tmp.
  PrivateTmp=true

  # Mount /usr, /boot/ and /etc read-only for the process.
  ProtectSystem=full

  # Disallow the process and all of its children to gain
  # new privileges through execve().
  NoNewPrivileges=true

  # Use a new /dev namespace only populated with API pseudo devices
  # such as /dev/null, /dev/zero and /dev/random.
  PrivateDevices=true

  # Deny the creation of writable and executable memory mappings.
  MemoryDenyWriteExecute=true

  [Install]
  WantedBy=multi-user.target
  ```

* Enable, start and unlock LND

  ```sh
  $ sudo systemctl enable lnd
  $ sudo systemctl start lnd
  $ systemctl status lnd
  $ lncli unlock
  ```

* Now, the daemon information is no longer displayed on the command line but written into the system journal. You can monitor the LND startup progress until it caught up with the testnet blockchain (about 1.3m blocks at the moment). This can take up to 2 hours, after that you see a lot of very fast chatter (exit with `Ctrl-C`).

  ```sh
  $ sudo journalctl -f -u lnd
  ```

<script id="asciicast-7Kx4HpX5EfwzYmDXBeqVCszk6" src="https://asciinema.org/a/7Kx4HpX5EfwzYmDXBeqVCszk6.js" async></script>

---

## LND in action

Now your Lightning node is ready.
This is also the point of no return.
Up until now, you can just start over.
Once you send real bitcoin to your RaspiBolt, you have "skin in the game".

* Make sure your RaspiBolt is working as expected.
* Get a little practice with `bitcoin-cli` and its options (see [Bitcoin Core RPC documentation](https://bitcoin-rpc.github.io/){:target="_blank"})
* Try a few restarts (`sudo reboot`), is everything starting fine?

### Funding your Lightning node

* Generate a new Bitcoin address to receive funds on-chain and send a small amount of Bitcoin to it from any wallet of your choice.
  [🕮 `newaddress`](https://api.lightning.community/#newaddress){:target="_blank"}

  ```sh
  $ lncli newaddress np2wkh
  > "address": "3JqmUWMD9mqmdPhMr4sQ9XV7p4o9Cn62CG"
  ```

* Check your LND wallet balance
  [🕮 `walletbalance`](https://api.lightning.community/#walletbalance){:target="_blank"}

  ```sh
  $ lncli walletbalance
  {
      "total_balance": "712345",
      "confirmed_balance": "0",
      "unconfirmed_balance": "712345"
  }
  ```

As soon as your funding transaction is mined, LND will show its amount as "confirmed_balance".

💡 If you want to open a few channels, you might want to send a few transactions.
If you have only one [UTXO](https://bitcoin.org/en/glossary/unspent-transaction-output), you need to wait for the change to return to your wallet after every new channel opening.

<script id="asciicast-8tL55NcHD5zdaHlBJkFbFXaxV" src="https://asciinema.org/a/8tL55NcHD5zdaHlBJkFbFXaxV.js" async></script>

### Opening channels

Although LND features an "autopilot", we manually open some channels.
I recommend to go on [1ML.com](https://1ml.com){:target="_blank"} and look for a mix of big and small nodes with decent Node Ranks.

To connect to a remote node, you need its URI that looks like `<pubkey>@host`:

* the `<pubkey>` is just a long hexadecimal number, like `03abc8abc44453abc7b5b64b4f7b1abcdefb18e102db0abcde4b9cfe93763abcde`
* the `host` can be a domain name, an ip address or a Tor onion address, followed by the port number (usually `:9735`)

Just grab the whole URI above the big QR code and use it as follows:

* **Connect** to the remote node, with the full URI.
  [🕮 `connect`](https://api.lightning.community/#connectpeer){:target="_blank"}

  ```sh
  $ lncli connect 03abc8abc44453abc7b5b64b4f7b1abcdefb18e102db0abcde4b9cfe93763abcde@<IP_ADDRESS>:9735
  ```

* **Open a channel** using the `<pubkey>` and the channel capacity in satoshis.
  [🕮 `openchannel`](https://api.lightning.community/#openchannel){:target="_blank"}

  One Bitcoin equals 100 million satoshis, so at $10'000/BTC, $10 amount to 0.001 BTC or 100'000 satoshis.
  To avoid mistakes, you can just use an [online converter](https://www.buybitcoinworldwide.com/satoshi/btc-to-satoshi).

  This will open a channel with fees using the built in estimator
  ```sh
  $ lncli openchannel 03abc8abc44453abc7b5b64b4f7b1abcdefb18e102db0abcde4b9cfe93763abcde 100000 0
  ```

  You can manually control the fees for the funding transaction by using the `sat_per_byte` argument as follows
  ```sh
  $ lncli openchannel --sat_per_byte 8 03abc8abc44453abc7b5b64b4f7b1abcdefb18e102db0abcde4b9cfe93763abcde 100000 0
  ```

* **Check your funds**, both in the on-chain wallet and the channel balances.
  [🕮 `walletbalance`](https://api.lightning.community/#walletbalance){:target="_blank"}
  [🕮 `channelbalance`](https://api.lightning.community/#channelbalance){:target="_blank"}

  ```sh
  $ lncli walletbalance
  $ lncli channelbalance
  ```

* **List active channels**. Once the channel funding transaction has been mined and gained enough confirmations, your channel is fully operational.
  That can take an hour or more.
  [🕮 `listchannels`](https://api.lightning.community/#listchannels){:target="_blank"}

  ```sh
  $ lncli listchannels
  ```

* **Make a Lightning payment**. These work with invoices, so everytime you buy something or want to send money, you need to get an invoice first.
  To try, why not send me a single satoshi to view my Twitter profile?

  * Click on this paywall link: <https://paywall.link/to/468ad>
  * Click on "Manual Payment Information" and copy the Invoice.
  * Pay me 1 satoshi (~ $0.0001) 🤑

    ```sh
    * lncli payinvoice lnbc10n1pw......................gsj59
    ```

<script id="asciicast-ATudEzl9xUe7wlodVQuVuuUL6" src="https://asciinema.org/a/ATudEzl9xUe7wlodVQuVuuUL6.js" async></script>

### More commands

A quick reference with common commands to play around with:

* list all arguments for the CLI (command line interface)

  ```sh
  $ lncli
  ```

* get help for a specific command

  ```sh
  $ lncli help [COMMAND]
  ```

* Find out some general stats about your node:
  [🕮 `getinfo`](https://api.lightning.community/#getinfo){:target="_blank"}

  ```sh
  $ lncli getinfo
  ```

* Check the peers you are currently connected to:
  [🕮 `listpeers`](https://api.lightning.community/#listpeers){:target="_blank"}

  ```sh
  $ lncli listpeers
  ```

* Check the status of your pending channels:
  [🕮 `pendingchannels`](https://api.lightning.community/#pendingchannels){:target="_blank"}

  ```sh
  $ lncli pendingchannels
  ```

* Check the status of your active channels:
  [🕮 `listchannels`](https://api.lightning.community/#listchannels){:target="_blank"}

  ```sh
  $ lncli listchannels
  ```

* Before paying an invoice, you should decode it to check if the amount and other infos are correct:
  [🕮 `decodepayreq`](https://api.lightning.community/#decodepayreq){:target="_blank"}

  ```sh
  $ lncli decodepayreq [INVOICE]
  ```

* Pay an invoice:

  ```sh
  $ lncli payinvoice [INVOICE]
  ```

* Check the payments that you sent:
  [🕮 `listpayments`](https://api.lightning.community/#listpayments){:target="_blank"}

  ```sh
  $ lncli listpayments
  ```

* Create an invoice:
  [🕮 `addinvoice`](https://api.lightning.community/#addinvoice){:target="_blank"}

  ```sh
  $ lncli addinvoice [AMOUNT_IN_SATOSHIS]
  ```

* List all invoices:
  [🕮 `listinvoices`](https://api.lightning.community/#listinvoices){:target="_blank"}

  ```sh
  $ lncli listinvoices
  ```

* to close a channel, you need the following two arguments that can be determined with `listchannels` and are listed as "channelpoint": `FUNDING_TXID`:`OUTPUT_INDEX`
  [🕮 `closechannel`](https://api.lightning.community/#closechannel){:target="_blank"}

  ```sh
  $ lncli listchannels
  $ lncli closechannel [FUNDING_TXID] [OUTPUT_INDEX]
  ```

* to force close a channel (if your peer is offline or not cooperative), use `--force`

  ```sh
  $ lncli closechannel --force [FUNDING_TXID] [OUTPUT_INDEX]
  ```

🔍 _more: full [LND API reference](https://api.lightning.community/)_

---

## LND upgrade

If you want to upgrade to a new release of LND in the future, check out the FAQ section:
[How to upgrade LND](raspibolt_faq.md#how-to-upgrade-lnd)

---

Next: [Electrum >>](raspibolt_50_electrs.md)

repository: Pantamis/RaspiBolt

gha_license_id: MIT

repo_name: Pantamis/RaspiBolt


text:
---

This repository is intended to list all the keyboard layouts I have made. All these layouts are compatible with wasd's custom keyboards.

## List of layouts

- International ISO ([`intl_iso`](https://github.com/smarlhens/wasd/tree/master/intl_iso) folder)
  - [nf-z71-300-wasd-inkscape-105-8.16.2019.svg](https://github.com/smarlhens/wasd/blob/master/intl_iso/nf-z71-300-wasd-inkscape-105-8.16.2019.svg) : New AZERTY (*[NF-Z71-300](https://norme-azerty.fr/#explore)*), edited with [Inkscape](https://inkscape.org)
  Compatible with :
    - [105-Key Full Size](http://www.wasdkeyboards.com/index.php/products/mechanical-keyboard/wasd-v3-105-key-iso-custom-mechanical-keyboard.html)
    - [88-Key Tenkeyless](http://www.wasdkeyboards.com/index.php/products/mechanical-keyboard/wasd-v3-88-key-iso-custom-mechanical-keyboard.html)

---

### Want to try to customize your keyboard?
Follow the instructions on this [tutorial](https://support.wasdkeyboards.com/hc/en-us/articles/115009403848-Intro-to-Custom-Layouts).

---

### An example of a custom keyboard with NF-Z71-300 layout

repository: smarlhens/wasd

repo_name: smarlhens/wasd


text:
#Description

The easy configurable php data fetcher that can get all the info for your monitored servers directly from NewRelic API

##When to use

[![Pingdom home](Screenshots/PingdomHome.png)](Screenshots/PingdomHome.png)

The main reason I created that plugin was because I lost a few days while searching through the web about how to get the info directly from their API, since I really dislike their public status page. I ended up having to read a bunch of poorly written documentation. I do not want the same thing for you... you can just use the plugin.  It is quite easy to be used. Set the cron how often you want to pick the data and just use it in your custom made status page.

* Supports almost all of the servers (uses php curl that is basically pre-set on every Unix machine)
* Support is easy to be handled (just set the cron job which I cover later, auto fetch the data and then save it)
* Can be used on every Web page
* Customisable style (it is explained in a way which does not require any knowledge of programming to grasp)

### Installation

1. Go to the Terminal.

2. Type "crontab -e" and choose nano.

3. You will see this field

[![Cron home](Screenshots/cron-large.png)](Screenshots/PingdomHome.png)

4. You will see that row

[![Cron home](Screenshots/cron-target.png)](Screenshots/PingdomHome.png)

Where each value stands for:

1. Minute (0-59)
2. Hours (0-23)
3. Day (0-31)
4. Month (0-12 [12 == December])
5. Day of the week(0-7 [7 or 0 == sunday])
6. /path/to/command - Script or command name to schedule

5. Set the main php script contained in Plugin/get_newrelic_data.php to be run at least 1 time on a daily basis.

6. You can actually manually set eveything the script needs to run. Now you just need to put your info into the settings.json that looks like this:

[![Settings json](Screenshots/settings.png)](Screenshots/settings.png)

7. There is inline documentation but ill still explain what to do.

1.1. The row under comment 2 is app-key. You must get it from your Newrelic acc and put it here.

1.2. The row under comment 3 is for the ids. You must fill them with the id words they use for your things(database and etc.).

1.3.  In the servers tab you only type the last numbers here and leave just the amount of servers you need (add or remove rows in the json)

[![Cron home](Screenshots/servers.png)](Screenshots/Servers.png)

1.4. If you want to change something first be sure you know what is JSON and if you dont know read here http://en.wikipedia.org/wiki/JSON

#### Example Usage

The result will be into the Plugin/storageNewRelic.json that looks like this.

[![Cron home](Screenshots/result.png)](Screenshots/result.png)

There is a summary for each server. "days" holds the 10 days that pingdom returns as output. "Uptime" is the total uptime for the day displayed in seconds (unix time). "avgresponse" relates to the average required calltime and startime which displays when the day gets started.

##### The new relic error script is just the errors call on different file for the people who just want to see when there are errors and how often!

## Requirements

* PHP
* CURL
* CRON

## Contact

[Dimitar Jilanov](http://jilanov.com)
[@DimitarJilanov](https://twitter.com/DimiturJilanov)

## License

Pingdom Data Fetcher is available under the MIT license. See the LICENSE file for more info.

## Special thanks

Special thanks to Emil Katzarski for the code assistance while creating it!

Special thanks to Stefo Danchovski for the documentation assistance while creating it!


text:
---
layout: post
title: First Post
subtitle: An explanation of what this website is.
cover-img: /assets/img/SleepyDog.jpg
thumbnail-img: /assets/img/SunJericho.jpg
share-img: /assets/img/SunJericho.jpg
tags: [test]
---

This website is for a class project in BIOS 823: Statistical Programming for Big Data at Duke University. For our first assignment we had to make our own personal website using GitHub pages; I already had a [personal website](https://joekrinke15.github.io/), so I decided to make a new one that features my dogs Lily and Jericho.


text:
# craftroom
A good craftroom is strewn with pipe cleaners, bits of yarn, scraps of fabric, colorful paper, and at least one hot glue gun. When it comes time to make a puppet or a toy or a Halloween costume, the ingredients you need are probably sitting on a shelf somewhere. This is a collection of useful code snippets and tools that hopes to serve the same messy purpose for various astronomy projects.

You should be able to install it either by cloning the repository and running `python setup.py install` from its main directory, or directly by running `pip install git+https://github.com/zkbt/craftroom.git`.

If you want to be able to modify the code yourself, please also feel free to fork/clone this repository onto your own computer and install directly from that editable package. For example, this might look like:
```
git clone https://github.com/zkbt/craftroom.git
cd craftroom/
pip install -e .
```
This will link the installed version of the `craftroom` package to your local repository. Changes you make to the code in the repository should be reflected in the version Python sees when it tries to `import craftroom`.

repository: zkbt/craftroom

gha_language: Jupyter Notebook

repo_name: zkbt/craftroom


text:
---
title: fipo
description: OpenBB SDK Function
---

# fipo

Future IPOs dates. [Source: Finnhub]

Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/stocks/discovery/finnhub_model.py#L115)]

```python
openbb.stocks.disc.fipo(num_days_ahead: int = 5, end_date: Optional[str] = None)
```

---

## Parameters

| Name | Type | Description | Default | Optional |
| ---- | ---- | ----------- | ------- | -------- |
| num_days_ahead | int | Number of days to look ahead for IPOs dates | 5 | True |
| end_date | datetime | The end date (format YYYY-MM-DD) to look for IPOs from today onwards | None | True |

---

## Returns

| Type | Description |
| ---- | ----------- |
| pd.DataFrame | Get dataframe with future IPOs |
---

repository: conrad-strughold/GamestonkTerminal

repo_name: conrad-strughold/GamestonkTerminal


text:
---
layout: page
title: What is this site?
permalink: /what/
---

This is a pseudo-anonymous blog, to act as a replacement for my social media.

Instead of shouting into the void on a platform that spies on me, I am choosing to shout into the void of the internet via this site.

This is a site for me to dump my thoughts. This is a place for me to share posts that I find interesting.

And if I ever write anything interesting - to share that as well.

It's a mix of a public notebook, a journal and a blog.

I'm not really writing on this site with anything in mind. Just anything that I don't necessarily want on my IRL identity - nothing malicious, but I like to maintain a gap between the two identities. See [Context Collapse](https://www.zephoria.org/thoughts/archives/2013/12/08/coining-context-collapse.html).

I'm never really sure about the political alignment of people around me - I'm not very good at judging that. hence I avoid talking about that IRL - but this identity, I've tried to separate as much as possible from my real life.


text:
# About
This repository contains the codes to find τ-axioms described in the paper "Automatic Extraction of Axioms in Planning".

# Dependencies
- psutil

## Lemon Graph Library 1.3.1

The program requires the lemon graph library to be installed globally.

- official site (http://lemon.cs.elte.hu/trac/lemon)

# Installation

```
git clone --recursive git@github.com:dosydon/tau_axiom_extractor.git
cd tau_axiom_extractor
cmake .
make
```

# Test
```
./test_all.sh
```

# How to Use

--candidate\_gen=opgraph runs the graph based algorithm described in the paper.
--candidate\_gen=top runs the variable based algorithm described in the paper.

```
usage: encode.py [-h] [--output OUTPUT] [--candidate_gen CANDIDATE_GEN]
                 sas_file

positional arguments:
  sas_file

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT
  --candidate_gen CANDIDATE_GEN
```


text:
Shoot'nShare
==============
You want to shoot cool photos and share them with friends using Google Drive or Facebook account?
With Shoot'nShare you can take picture, browse your camera roll, pick a picture and share it!
Picture get uploaded to your GoogleDrive or Facebook wall.
You can also run this demo with its associated [Keycloak backend](https://github.com/aerogear/aerogear-backend-cookbook/tree/master/Shoot) and upload photo to your own social network.

Supported platforms: iOS7, iOS8, iOS9.

**NOTES:** On iOS8, this demo securely stores OAuth2 tokens in your iOS keychain, we chosen to use ```WhenPasscodeSet``` policy as a result to run this app you need to have **your passcode set**.
For iOS7, the ```WhenUnlockedThisDeviceOnly``` is choosen, no need of passcode to be set.
For more details see [WhenPasscodeSet blog post](http://corinnekrych.blogspot.fr/2014/09/new-kids-on-block-whenpasswordset.html) and [Keychain and WhenPasscodeSet blog post](http://corinnekrych.blogspot.fr/2014/09/touchid-and-keychain-ios8-best-friends.html)

### Run it in Xcode

The project uses [cocoapods](http://cocoapods.org) or handling its dependencies. As a pre-requisite, install [cocoapods](http://cocoapods.org) and then install the pod. On the root directory of the project run:

```bash
pod install
```
and then double click on the generated .xcworkspace to open in Xcode.

For the complete instructions about how to setup Google, Facebook or Keycloak credentials, visit our [OAuth2 documentation guide](https://aerogear.org/docs/guides/security/oauth2-guide/#_before_you_get_started)

## UI Flow
When you start the application you can take picture or select one from your camera roll.

Once an image is selected, you can share it. Doing so, you trigger the OAuth2 authorization process. Once successfully authorized, your image will be uploaded.

NOTES: Because this app uses your camera, you should run it on actual device. Running on simulator won't allow camera shoot.

## AeroGear OAuth2

```
    func shareWithGoogleDrive() {
        println("Perform photo upload with Google")

        let googleConfig = GoogleConfig(                              // [1]
            clientId: "873670803862-g6pjsgt64gvp7r25edgf4154e8sld5nq.apps.googleusercontent.com",
            scopes:["https://www.googleapis.com/auth/drive"])
        //googleConfig.isWebView = true                               // [2]
        let gdModule = AccountManager.addGoogleAccount(googleConfig)  // [3]
        let http = Http(url: "https://www.googleapis.com/upload/drive/v2/files")
        http.authzModule = gdModule                                   // [4]
        self.performUpload(http, parameters: self.extractImageAsMultipartParams())
    }
```
In [1] initialize config. The default config uses an external browser approach when lauching the authorization request (ie: Safari opens to prompt you for your credentials). If you prefer to use an embedded webview, uncomment line [2].

You can use AccountManager to create an OAuth2Module in [3]

Simply create an http object and inject the oauth2 module [4], then all headers will be added for you when you do http.POST/GET etc...

repository: gauravmb/aerogear

repo_name: gauravmb/aerogear


text:
Dotfiles
========

This repo contains all of the current dotfiles used to configure my Archlinux, which includes:
- [i3](https://github.com/shizhz/dotfiles/tree/master/i3), also with [conky](https://github.com/shizhz/dotfiles/tree/master/conky) for i3bar's input
- [Terminator](https://github.com/shizhz/dotfiles/tree/master/terminator), terminal emulator I like
- [Vim](https://github.com/shizhz/dotfiles/tree/master/vim), IDE-like vim environment configuration for python and golang
- [Rofi](https://github.com/shizhz/dotfiles/tree/master/rofi), application launcher and window switcher

Please check each subdirectory for more detailed installation info.

repository: shizhz/dotfiles

repo_name: shizhz/dotfiles


text:
# A0116603R
###### /DeveloperGuide.md
``` md
#### User Interface (UI)

<img src="images/UiClassDiagram.png" width="800"><br>

**API** : [`Ui.java`](../src/main/java/seedu/priorityq/ui/Ui.java)

The `view` component is the part of the application that directly interacts with the user. The `view` is created using information supplied from the controller. Thus, a major purpose of view objects is to display data from the application’s model objects and to enable the editing of that data.

To accomplish this, the `view` component communicates all user interactions through the `controller` component to the application’s `model` objects. In turn, any changes in `model` data are propagated through the application’s `controller` objects.

The diagram above gives an overview of the architecture of the `UI` component of PriorityQ. The `UI` consists of a `MainController` which encapsulates the root layout of the GUI. The `MainController` inherits from the abstract `UiPart` class and it can be loaded using the `UiPartLoader`. On start-up, the `MainController` initialises an `AppViewController`.

Subsequently, the `AppViewController` initialises the `TaskViewController` and the `HelpViewController`. The former is made up of a `TaskList` which displays `TaskCard`s, while the latter is made up of a `HelpList` which displays `HelpCard`s. Both of them implement the abstract `Controller` class which enforces the implementation of certain methods for initialisation and also provides common and useful controller methods needed by all such view controllers.

To display custom layouts to the user, the `UI` component uses JavaFx `UI` framework. The root layout is a `StackPane` from JavaFX.

`UI` parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the root layout is specified in [`RootLayout.fxml`](../src/main/resources/view/RootLayout.fxml), and the `TaskList` is specified in [`TaskList.fxml`](../src/main/resources/view/TaskList.fxml).

PriorityQ has its own custom stylesheet which makes the GUI clean and simple. You can find the [css stylesheet](../src/main/resources/view/PriorityQTheme.css) in the same folder as the `.fxml` files.

In summary, the UI component:

- Executes user commands using the Logic component.
- Binds itself to data in the Model so that the UI can auto-update when data in the Model changes.
- Responds to events raised from various parts of the App and updates the UI accordingly.
- Raises events for certain user-initiated interactions so that other UI components can respond accordingly.

```
###### /DeveloperGuide.md
``` md
Certain GUI interactions are propagated to the logic component using the `EventsCenter`:

<img src="images/SDMarkTask.png" width="800"><br>

```
###### /DeveloperGuide.md
``` md
### Continuous Integration

We use [Travis CI](https://travis-ci.org/) to perform _Continuous Integration_ on our projects.
See [UsingTravis.md](UsingTravis.md) for more details.

### Making a Release

Here are the steps to create a new release.

 1. Generate a JAR file [using Gradle](UsingGradle.md#creating-the-jar-file).
 2. Tag the repo with the version number. e.g. `v0.1`
 2. [Crete a new release using GitHub](https://help.github.com/articles/creating-releases/)
    and upload the JAR file your created.

### Managing Dependencies

A project often depends on third-party libraries. For example, Address Book depends on the
[Jackson library](http://wiki.fasterxml.com/JacksonHome) for XML parsing. Managing these _dependencies_
can be automated using Gradle. For example, Gradle can download the dependencies automatically, which
is better than these alternatives.<br>
a. Include those libraries in the repo (this bloats the repo size)<br>
b. Require developers to download those libraries manually (this creates extra work for developers)<br>

## Known Issues

### Natural language processing for recurring events
The natural language processing for recurring events has a few bugs. Currently, the recurrence feature can only handle user input with the format: “every X <unit of time>”, i.e: “every 1 day”. This restricts the user’s freedom in typing in a command to create a recurring event.

### Performance

The program will take longer to respond if a large number (e.g. a few thousand) of tasks are present in PriorityQ. A workaround is to regularly clear your completed tasks by using either the delete  or  clear  command.

## Future work

### Google Calendar integration

Google Calendar offers a comprehensive user experience when it comes to organizing tasks on a calendar. Other features like email reminders, invitations and especially cross-platform synchronization can greatly benefit our users.

### Personalization

We want users to have their own personal touch in the app. Hence we’re looking forward to implement some features that users can customise such as changing theme color to suit user’s style. We will provide 10+ themes for use to select and modify to help make PriorityQ their own.

### Email notification
Although this is not a main feature since we designed PriorityQ to be able to work 100% offline, it would be a nice-to-have.

## Appendix A : User Stories

| User Stories | Likely/Not Likely |
| ------ | ----------- |
|As a user I can add an entry by specifying a entry title only, so that I can record entrys that need to be done ‘some day’.|Likely
|As a user I can add entries that have a specific start and end time, so that I can record events with a specific duration.|Likely|
|As a user I can add descriptions to my entries, so that I can add detail to my tasks.|Likely|
|As a user I can edit an entry, so that I can make changes to entries as needed.|Likely|
|As a user I can delete an entry, so that I can get rid of entries that I no longer care to track.|Likely|
|As a user I can list all entries that are due, so that I can get an overview of all my entries.|Likely|
|As a user I can find upcoming entries, so that I can decide what needs to be done soon.|Likely|
|As a user, I can set a entry as completed, so that I can keep track of completed/uncompleted entries.|Likely|
|As a user, I can add tags to the entries so that I can categorize entries together|Likely|
|As a user I can search for an entry by different entry attributes, so that I can find specific entries.|Likely|
|As a user I can undo a certain number of actions so that I can correct any mistaken actions.|Likely|
|As a new user I can view more information about a particular command, so that I can learn how to use various commands.|Likely|
|As an advanced user I can use shorter versions of a command, so that type a command faster.|Likely|
|As a user, I can schedule a entry to be automatically added with a given frequency so that I don’t have to manually add entries every time.|Likely|
|As an advanced user, I can specify a specific folder as the data storage location, so that I can choose to store the data file in a local folder controlled by a cloud syncing service, allowing me to access entry data from multiple computers.|Likely|
|As a user, I can choose different views of all my tasks, e.g. “Due Today”, “Due This Week”, so that I can focus on what is important to me at that moment.|Likely|
|As a user, I can use autocompletion of entry description so that I can quickly add entries that are similar to what I have added before|Not Likely|
|As a user, I can personalize my app by changing the color scheme so that it fits my aesthetic requirements.|Not Likely|
|As an advanced user, I can rebind default commands into my own keyboard shortcuts, so that I can use shortcuts that I am comfortable with.|Not Likely|
|As a user, I can type in commands in a more ‘natural’ manner, so that I do not need to learn the command format.|Not Likely|

## Appendix B : Use Cases

(For all use cases below, the **System** is the `TaskManager` and the **Actor** is the `user`, unless specified otherwise)

#### Use case: Delete entry

**Use case: Create a floating task**

Actors: User

MSS

1. User request to create a new entry without specifying the start and/or end date and deadline
2. TodoList add that particular floating task into Storage and save it

  Use Case Ends

*Extensions*

1a. Entry is entered with invalid properties e.g. title
> 1a1. TodoList warns user that the entry is invalid and does not add it into Storage
>
> Use Case Ends

1b. Entry already exists
> 1b1. TodoList warns user that the entry already exists and does not add it into Storage
>
> Use Case Ends

**Use case: Create an event**

Actors: User

MSS

1. User request to create a new entry while specifying the start and/or end date but not deadline
2. TodoList add that particular event into Storage and save it

  Use Case Ends

**Use Case: Create a deadline**

Actors: User

MSS

1. User request to create a new entry while specifying the deadline but no start and/or end date
2. TodoList add that particular deadline into Storage and save it

  Use Case Ends

**Use Case: Delete an entry**

Actors: User

MSS

1. User requests to delete an entry with a specified id
2.  Entry with the specified id does not exist
> 1a1. TodoList warns the user that the entry with the specified id does not exist
>
> Use Case Ends

```
###### /UserGuide.md
``` md
## Introduction
PriorityQ is a task manager for the modern power user who enjoys working primarily without a mouse. You care about productivity and your workflow might be primarily keyboard-based.

In fact, you could subscribe to the ‘Inbox Zero’ philosophy. Consequently, it is important that you can quickly keep track of tasks that come in. Because of the variety of such tasks and events, you want a manager that is flexible. From creating tasks without a specific deadline to blocking out specific times on your calendar, PriorityQ does it all, in a clean and easy-to-use interface. Use PriorityQ to capture your ideas, goals, wish lists, trip plans and daily tasks.

This user guide aims to provide you with a brief overview of PriorityQ and how to maximize your productivity with it.

## Getting Started

You need Java 8(Version 1.8) JVM(Java Virtual Machine) in order to be able to run the program. To start, simply download the .jar file from our release page and run it by double clicking on the icon.

At the launch of PriorityQ, you should see the following screen:

<img src="images/pq_start.png" width="600"><br>

All tasks and events are sorted in the conventional calendar manner such that your most important tasks and events are displayed at the top. At the bottom of the screen, you will find a command line which enables you to interact with PriorityQ.

## Quick Start

To start, try adding a new task:

```
add Buy groceries
>>> [1] New entry added: Buy groceries
```
<img src="images/add.png" width="600">

The task can be edited with the following command:

```
edit 1 end/tomorrow 5pm
>>> Edited entry Buy groceries Due: 21 hours from now
```
Yep, natural language is parsed as well!

<img src="images/edit.png" width="600">

Undo is quite easily done:

```
$ undo
>>> Undo edits to entry: Buy groceries
```

Finally, try deleting the task:

```
delete 1
>>> Deleted Entry: Buy groceries
```

<img src="images/delete.png" width="600">

```
###### /UserGuide.md
``` md
To quickly jump to the command line, simply press the ENTER key and you can start typing your command.

When the app is maximised beyond a particular width, the text automatically becomes larger.

```

gha_language: Java


text:
---
layout: post
title:  "I started a blog!"
date:   2019-08-01
banner_image: /assets/images/posts/2019/road.jpg
tags: [random]
---

I don't know what came over me, but I decided to start a blog!

Were people beating my door down for my opinion on everything?

*No.*

Were people clamoring for a peak inside my life and mind?

*Not a chance.*

Am I having narcissistic tendencies with the need to share every thought I've ever had.

*Gosh I hope not, but we're probably getting closer!*

<!--more-->

In all honesty, I don't know where this will go.  I've never been much
of a writer or journaler.  However with the recent involvement getting the [US-RSE
Association](https://us-rse.org) going, I find myself
thinking, reflecting, and wanted to share my thoughts.  So this is
most likely going to be a professional blog.  Not that I don't have opinions on
things outside of work. Here are a couple that always get me going:

- **Why do weather forecasters
insist on reporting relative humidity?** If only there was a logical,
useful measure of humidity we could all understand!  Oh wait, there is,
it's the dew point!  None of this "feels like" garbage.  Someone
picked a completely arbitrary dew point as the norm and based
everything off of that.  In the northeast it's never that dry, so it's
never an accurate "feels like."

- **Why do people always insist on
putting the utensils and napkins at the front of a buffet line?**  I
don't know what I'm getting so I don't know what I'll need. Invariably
I'll end up needing a knife, not have one, and have to apologize as I
try to reach in and grab one.  Not to mention, now I have to carry the
utensils the whole way through the buffet line or put them in my
pocket?

See what I mean? No one wants to hear my random rantings and
ravings.  I could literally write a book on first-world problems and
complaints.  Hey, maybe you want to hear this things...if you do let
me know.  Poke me on [twitter](https://twitter.com/iancosden) and
maybe from time to time I'll put something in.  More likely, if I
venture off reservation it'll be to drop a review about a good book I
recently listened to on audible (I'm an avid audiobook listener).

The smart money is on my sticking with this for a few weeks
(months?) and then it sitting stale, never getting updated until
eventually I pull the plug, embarrassed and pretending it never
happened.

gha_language: SCSS