This file contains 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
import "cheerio"; | |
import { CheerioWebBaseLoader } from "@langchain/community/document_loaders/web/cheerio"; | |
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; | |
import { MemoryVectorStore } from "langchain/vectorstores/memory"; | |
import { OpenAIEmbeddings, ChatOpenAI } from "@langchain/openai"; | |
import { pull } from "langchain/hub"; | |
import { ChatPromptTemplate } from "@langchain/core/prompts"; | |
import { StringOutputParser } from "@langchain/core/output_parsers"; | |
import { Ollama, ChatOllama } from "@langchain/ollama" ; |
This file contains 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
const dotEnv = require("dotenv"); | |
dotEnv.config(); | |
const { | |
S3Client, | |
PutObjectCommand, | |
CreateBucketCommand, | |
DeleteObjectCommand, | |
DeleteBucketCommand, | |
paginateListObjectsV2, | |
GetObjectCommand, |
This file contains 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
const dotEnv = require("dotenv"); | |
dotEnv.config(); | |
const { | |
S3Client, | |
PutObjectCommand, | |
CreateBucketCommand, | |
DeleteObjectCommand, | |
DeleteBucketCommand, | |
paginateListObjectsV2, | |
GetObjectCommand, |
This file contains 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
{"name":"node.js","settings":"{\"settings\":\"{\\n \\\"editor.formatOnPaste\\\": true,\\n \\\"git.autofetch\\\": true,\\n \\\"[markdown]\\\": {\\n \\\"editor.wordWrap\\\": \\\"on\\\"\\n },\\n \\\"[json]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[jsonc]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"vscode.json-language-features\\\"\\n },\\n \\\"[html]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[javascript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[typescript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"window.zoomLevel\\\": 2,\\n \\\"editor.fontSize\\\": 16,\\n \\\"workbench.colorTheme\\\": \\\"Atom Material Theme\\\",\\n \\\"editor.mouseWheelScrollSensitivity\\\": 0.5,\\n \\\"editor.formatOnSave\\\": true,\\n \\\"workbench.editor.ena |
This file contains 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
{"name":"Node.js","settings":"{\"settings\":\"{\\n \\\"editor.formatOnPaste\\\": true,\\n \\\"git.autofetch\\\": true,\\n \\\"[markdown]\\\": {\\n \\\"editor.wordWrap\\\": \\\"on\\\"\\n },\\n \\\"[json]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[jsonc]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"vscode.json-language-features\\\"\\n },\\n \\\"[html]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[javascript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[typescript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"editor.fontSize\\\": 16.8,\\n \\\"workbench.colorTheme\\\": \\\"Atom Material Theme\\\",\\n \\\"workbench.editor.enablePreview\\\": false,\\n \\\"window.zoomLevel\\\": 2,\\n \\\"editor.fastScrollSensitivity\\\": 1,\\n \\\"workbench.list |
This file contains 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 find(input) { | |
let prefix = input[0]; | |
for (var i = 1; i < input.length; i++) { | |
let current = input[i]; | |
if (current.length < prefix.length && prefix.startsWith(current)) { | |
prefix = current; | |
} else { | |
for (var j = 0; j < prefix.length; j++) { | |
if (current.charAt(j) === prefix.charAt(j)) { |
This file contains 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 find(inputStr) { | |
var deleteCount = 0; | |
let prefix = ''; | |
var visited = {}; | |
var lastIdx = -1; | |
var previous; | |
for (var i = 0; i < inputStr.length; i++) { | |
var current = inputStr.charAt(i); | |
if (previous === current) { | |
if (prefix.length > 0) { |
This file contains 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
Step 1: Enable capabilities "background fetch" | |
Step2 : Setup AppDelegate.swift | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Alert, categories: nil) | |
UIApplication.sharedApplication().registerUserNotificationSettings(settings) | |
UIApplication.sharedApplication().setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum) | |
return true; |
This file contains 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
'use strict'; | |
var input = 'this is a test string'; | |
input = 'aaaabbbcccdddcdbaaa'; | |
var match = 'tist'; //accb | |
match = 'abc'; | |
input = 'abcdefadfafaefd'; | |
match = 'ef'; | |
var matches = []; |
NewerOlder