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
    
  
  
    
  | ''' A Python implementation of the algorithm proposed here: | |
| https://arxiv.org/abs/2104.07663 by Cristina Maria Pacurar, | |
| Ruxandra-Gabriela Albu, Victor-Dan Pacurar [April 15, 2021] | |
| Implementation by Caleb Morales | |
| ''' | |
| from typing import Tuple, List | |
| from operator import itemgetter | |
  
    
      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 functools import lru_cache | |
| from typing import List, Tuple | |
| def flatten_list(fat_list: List[List[int]]): | |
| if len(fat_list) == 0: | |
| return fat_list | |
| if isinstance(fat_list[0], list): | |
| return flatten_list(fat_list[0] + flatten_list(fat_list[1:])) | |
| return fat_list[:1] + flatten_list(fat_list[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
    
  
  
    
  | #include <iostream> | |
| #include <fstream> | |
| #include <Windows.h> | |
| LONG WINAPI CrashHandler(EXCEPTION_POINTERS* e) | |
| { | |
| std::string file = "./output.txt"; | |
| std::ofstream out(file.c_str()); | |
| out << "### CRASH OCCURRED ###"; | |
| out.close(); | 
  
    
      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
    
  
  
    
  | ''' | |
| You are driving a bus along a highway, full of rowdy, hyper, thirsty students | |
| and a soda fountain machine. Each minute that a student is on your bus, | |
| that student drinks one ounce of soda. Your goal is to drop the students | |
| off quickly, so that the total amount of soda consumed by all students is as | |
| small as possible. | |
| You know how many students will get off of the bus at each exit. Your | |
| bus begins somewhere along the highway (probably not at either end) | |
| and moves at a constant speed of 37.4 miles per hour. You must drive theb | 
  
    
      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 fastapi import FastAPI, Query | |
| import random | |
| app = FastAPI() | |
| scrambled_words = [] | |
| words = [] | |
| @app.get("/getscrambles") | |
| async def get_scrambled_words(): | 
  
    
      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 { Injectable } from '@angular/core'; | |
| import { HttpClient, HttpErrorResponse } from '@angular/common/http'; | |
| import { Observable, throwError } from 'rxjs'; | |
| import { catchError, tap, map } from 'rxjs/operators'; | |
| import { ISession } from './session'; | |
| @Injectable({ | |
| providedIn: 'root' | |
| }) | 
  
    
      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
    
  
  
    
  | @RestController | |
| @RequestMapping("/api/v1/sessions") | |
| public class SessionsController { | |
| @Autowired | |
| private SessionRepository sessionRepository; | |
| @GetMapping | |
| public List<Session> list() { | |
| return sessionRepository.findAll(); | |
| } | 
  
    
      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 com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| import javax.persistence.*; | |
| import java.util.List; | |
| @Entity(name = "sessions") | |
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |
| public class Session { | |
| @Id | |
| @GeneratedValue(strategy = GenerationType.IDENTITY) | 
  
    
      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
    
  
  
    
  | spring.datasource.url=jdbc:postgresql://localhost:5432/database | |
| spring.datasource.username=username | |
| spring.datasource.password=password | |
| spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect | |
| spring.jpa.hibernate.ddl-auto = none | |
| spring.jpa.hibernate.show-sql=true | |
| spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true | 
  
    
      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
    
  
  
    
  | def day2Part2(lines): | |
| validPasswords = 0 | |
| for line in lines: | |
| x = line.split() | |
| locations = x[0].split('-') | |
| first = int(locations[0]) | |
| second = int(locations[1]) | |
| character = x[1] | 
NewerOlder