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 dotenv import load_dotenv | |
| import streamlit as st | |
| from PyPDF2 import PdfReader | |
| from langchain.text_splitter import CharacterTextSplitter | |
| from langchain.embeddings.openai import OpenAIEmbeddings | |
| from langchain.vectorstores import FAISS | |
| from langchain.chains.question_answering import load_qa_chain | |
| from langchain.llms import OpenAI | |
| from langchain.callbacks import get_openai_callback |
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
| import React from 'react'; | |
| import { StyleSheet, Text, ScrollView, Image, Button } from 'react-native'; | |
| const data = [ | |
| { | |
| id: '0', | |
| author: 'Alejandro Escamilla', | |
| width: 5616, | |
| height: 3744, | |
| url: 'https://unsplash.com/photos/yC-Yzbqy7PY', |
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
| export default function getInitials(fullname: string) { | |
| const match = fullname.match(/(\w)?\w*\s*(\w)?/); | |
| return match ? match.slice(1).join('') : ''; | |
| } | |
| export default function getAvatarColor(name: string) { | |
| const hexCode = name | |
| .split('') | |
| .reduce((acc, char) => (acc * char.charCodeAt(0)) % 0xffffff, 1) |
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
| var isAndroid = Ti.Platform.osname == "android"; | |
| function DueDateWindow(/*function */ setSelectedDate) { | |
| var win = Ti.UI.createWindow({ | |
| backgroundColor: isAndroid ? "black": "white", | |
| layout: "vertical" | |
| }); |
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
| // this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
| Titanium.UI.setBackgroundColor('#000'); | |
| var win = Ti.UI.createWindow({ | |
| backgroundColor: "white" | |
| }); | |
| var navWin = Ti.UI.iOS.createNavigationWindow({ | |
| window: win | |
| }); |
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
| 0. definire il modello (tramite titanium studio) | |
| -- opzionale (implementare validate, almeno il titolo) | |
| 1. Creare una collection per la todolist (nella ListToDoWindow.XML) - da "bindare" alla tableview | |
| 2. Create un Modello (singleton) per la NewToDoWindow - da associare alla Form | |
| 3. function addToDo nel controller di NewToDoWindow.js |
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
| var myArgs = process.argv.slice(2); | |
| if (myArgs.length < 1) { | |
| console.log("we need the XML filename to parse"); | |
| return; | |
| } | |
| var parser = require('xml2json'); | |
| var fs = require('fs'); |