This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from openpyxl import load_workbook | |
| try: | |
| # Load the workbook | |
| workbook = load_workbook('areport.xlsx') | |
| except FileNotFoundError as e: | |
| print(f"Error: The workbook '{e.filename}' was not found. Ensure it's the same directory as this script") | |
| exit(1) # Exit the script | |
| # Select the worksheet by its name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from prefect import flow, task, get_run_logger | |
| import httpx | |
| from dotenv import load_dotenv | |
| import ollama | |
| import os | |
| load_dotenv() | |
| @task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from langchain.chat_models import ChatOpenAI, ChatOllama | |
| from langchain.chains import GraphCypherQAChain | |
| from langchain.graphs import Neo4jGraph | |
| from langchain.prompts.prompt import PromptTemplate | |
| import os | |
| os.environ["OPENAI_API_KEY"] = "" | |
| graph = Neo4jGraph( | |
| url="bolt://localhost:7687", username="neo4j", password="newpassword" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| # node js service for react app | |
| npm_frontend: | |
| image: node:18 | |
| container_name: project_frontend_${DOCKER_NAME} | |
| volumes: | |
| - ../ui:/var/www/html | |
| - ./.env:/var/www/html/.env | |
| working_dir: /var/www/html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Docker | |
| DOCKER_FRONTEND_PORT=3000 | |
| DOCKER_BACKEND_PORT=4000 | |
| DOCKER_NAME=DEV | |
| COMPOSE_PROJECT_NAME=neo4j-docker-dev | |
| # production | |
| #IS_PRODUCTION=true | |
| # UI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function primeSummation(n) { | |
| let nums = Array.from({length: n - 1}, (_, i) => i + 1) | |
| nums = nums.filter((n) => { | |
| if (n <= 3) { return n > 1; } | |
| if (n % 2 == 0 || n % 3 == 0) { return false; } | |
| for (var i = 5; i * i <= n; i += 6) { | |
| if (n % i == 0 || n % (i + 2) == 0) { return false; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function specialPythagoreanTriplet(n) { | |
| let solution = 0; | |
| for(let a = 1; a < n / 2; a++){ | |
| for(let b = a; b < n; b++){ | |
| let c = Math.sqrt(a **2 + b **2); | |
| if(Number.isInteger(c) && a + b + c === n){ | |
| solution = a * b * c; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function largestProductinaSeries(n) { | |
| let thousandDigits = [7,3,1,6,7,1,7,6,5,3,1,3,3,0,6,2,4,9,1,9,2,2,5,1,1,9,6,7,4,4,2,6,5,7,4,7,4,2,3,5,5,3,4,9,1,9,4,9,3,4,9,6,9,8,3,5,2,0,3,1,2,7,7,4,5,0,6,3,2,6,2,3,9,5,7,8,3,1,8,0,1,6,9,8,4,8,0,1,8,6,9,4,7,8,8,5,1,8,4,3,8,5,8,6,1,5,6,0,7,8,9,1,1,2,9,4,9,4,9,5,4,5,9,5,0,1,7,3,7,9,5,8,3,3,1,9,5,2,8,5,3,2,0,8,8,0,5,5,1,1,1,2,5,4,0,6,9,8,7,4,7,1,5,8,5,2,3,8,6,3,0,5,0,7,1,5,6,9,3,2,9,0,9,6,3,2,9,5,2,2,7,4,4,3,0,4,3,5,5,7,6,6,8,9,6,6,4,8,9,5,0,4,4,5,2,4,4,5,2,3,1,6,1,7,3,1,8,5,6,4,0,3,0,9,8,7,1,1,1,2,1,7,2,2,3,8,3,1,1,3,6,2,2,2,9,8,9,3,4,2,3,3,8,0,3,0,8,1,3,5,3,3,6,2,7,6,6,1,4,2,8,2,8,0,6,4,4,4,4,8,6,6,4,5,2,3,8,7,4,9,3,0,3,5,8,9,0,7,2,9,6,2,9,0,4,9,1,5,6,0,4,4,0,7,7,2,3,9,0,7,1,3,8,1,0,5,1,5,8,5,9,3,0,7,9,6,0,8,6,6,7,0,1,7,2,4,2,7,1,2,1,8,8,3,9,9,8,7,9,7,9,0,8,7,9,2,2,7,4,9,2,1,9,0,1,6,9,9,7,2,0,8,8,8,0,9,3,7,7,6,6,5,7,2,7,3,3,3,0,0,1,0,5,3,3,6,7,8,8,1,2,2,0,2,3,5,4,2,1,8,0,9,7,5,1,2,5,4,5,4,0,5,9,4,7,5,2,2,4,3,5,2,5,8,4,9,0,7,7,1,1,6,7,0,5,5,6,0,1,3,6,0,4,8,3,9,5,8,6,4,4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function nthPrime(n) { | |
| let count = 0; | |
| let current = 2; | |
| let prime = 2; | |
| while(count < n){ | |
| let isPrime = true; | |
| for(let i = 2; i < current; i++){ | |
| if(current % i === 0){ | |
| isPrime = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sumSquareDifference(n) { | |
| let sum = 0; | |
| let square = 0; | |
| for(let i = 1; i <= n; i++){ | |
| sum += i ** 2; | |
| square += i; | |
| } | |
| return (square ** 2 - sum); | |
| } |
NewerOlder