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 com.jsoniter.JsonIterator; | |
import com.jsoniter.any.Any; | |
import com.oc.projectone.dataminer.model.Person; | |
import org.springframework.stereotype.Service; | |
import javax.annotation.PostConstruct; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; |
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
from bs4 import BeautifulSoup | |
import requests | |
import pandas as pd | |
def process_single_book(website): | |
# Get Request and Status Code | |
response = requests.get(website, verify=False) | |
# print(response.status_code) |
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
// should return all of the books taken out by an account with the author embedded | |
function getBooksPossessedByAccount(account, books, authors) { | |
let books_taken = []; | |
books.forEach(book=>{ | |
if (book.borrows.find(item=>item.id === account.id && !item.returned)) { | |
books_taken.push(book); | |
} | |
}) | |
console.log(books_taken); | |
books_taken.forEach(book=>{ |
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 bulkDelete(ids) { | |
const promises = ids.map((id) => { | |
const url = `${BASE_URL}/constellations/${id}`; | |
return axios.delete(url).then((data)=>{ | |
console.log(data); | |
return {id}; | |
}) | |
}); | |
return Promise.all(promises); | |
} |
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 addProductToCart({ name, priceInCents }, cart = {}) { | |
const selected = cart[name]; | |
if (selected) { | |
selected.quantity++; | |
} else { | |
cart[name] = { priceInCents, quantity: 1 }; | |
} | |
return cart; | |
} |
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 printNames (names) { | |
names.forEach(name => console.log(name)); | |
} | |
function logTreeType (trees) { | |
trees.forEach(type => console.log(type.type)); | |
} | |
function totalPoints(points) { | |
// your solution here |
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 Display(props) { | |
const list = hobbies.map((hobby) => <li>{hobby}</li>); | |
return (<div> | |
<h3>Hobbies</h3> | |
<ul>{list}</ul> | |
</div>) | |
const rows = dailyActivities.map(({time, description}, index) =>( | |
<tr key={index}> | |
<td>{time}</td> | |
<td>{description}</td> |
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 React from "react"; | |
function App() { | |
const name = "Kitty Kat"; | |
const birthday = "January 1"; | |
const imageSrc = | |
"https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg"; | |
const hobbies = ["watching birds", "hiding in a box", "napping"]; | |
const dailyActivities = [ | |
{ time: "8:00 am", description: "wake up" }, |
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 showHelpOptions(message){ | |
let str = "" | |
for(let i=0; message.length>i; i++){ | |
if (i!== message.length -1) { | |
str += message[i] + ", "; | |
} else { | |
str += message[i] + "."; | |
} | |
} | |
return "Enter a keyword for help with a topic: " + str; |
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
// v1 | |
// write a function that says hello from the bot, to be called when the chat starts | |
function botGreeting() { | |
return "Hello, I'm the Getaway Bot! I want to help you find your dream destination. You can ask me about our current offers, payment, or contact info. Or type 'help'."; | |
} | |
// v2 | |
// When the bot doesn't understand, we still want the bot to give a response to the user. Write a function `botResponse` that explains that the bot didn't understand. It should say "I'm not sure I understood your message: '[message]'. Type 'help' to see more options." | |
function botResponse(message) { | |
return ( |
NewerOlder