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 mongoose = require('mongoose') | |
const {model,Schema} = require('mongoose') | |
mongoose.connect('mongodb://localhost:27017/myapp',{useNewUrlParser:true}); | |
const app = require('express')() | |
const DepartmentSchema = new Schema({ | |
name: String, | |
location: String | |
} | |
) |
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 express = require("express"); | |
const app = express(); | |
const mongoose = require("mongoose"); | |
const bodyParser = require("body-parser"); | |
const session = require("express-session"); | |
const flash = require("connect-flash"); | |
const moment = require("moment"); | |
const seedDB = require("./seed"); | |
const removeUsers = require("./remove"); |
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
# -*- coding: utf-8 -*- | |
#from pytube import YouTube | |
#url = 'https://youtu.be/Ej83dvkU-Z4' | |
#YouTube(url).streams.first().download() | |
# -*- coding: utf-8 -*- | |
from moviepy.editor import * |
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
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
for(int i=1;i<=7;i++) | |
{ | |
for(int j=1;j<=7;j++) | |
{ | |
if(!(i>=3&&i<=5)&&!(j>=3&&j<=5)&&!((i==1||i==7)&&(j==1||j==7))) | |
{ |
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
List<String> strings = list.stream().map(object -> Objects.toString(object,null)).collect(Collectors.toList()); | |
// table 1 | |
// 有 A 才有 B |
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
#include<iostream> | |
using namespace std; | |
/* | |
Out: num' | |
In: num | |
*/ | |
int main() | |
{ | |
int num; |
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
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
int n,m; | |
cin >> n >> m; // [100,400] | |
int i = n; | |
int total = 0; | |
while(i<=m) | |
{ |
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
// Copyright 2018-present the Flutter authors. All Rights Reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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
class Solution: | |
def reachableNodes(self, edges: List[List[int]], maxMoves: int, n: int) -> int: | |
''' | |
status: 7/47 | |
Step 1: Create graph | |
Step 2: HP[node] = remain power | |
Step 3: sum of main-nodes + sub-nodes | |
''' | |
# Step 1 |
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
#!/usr/bin/py | |
from collections import defaultdict | |
def hermionesWand(arr, K, max_x, max_y): | |
# find both entry and exit points | |
for idx, line in enumerate(arr): | |
for inner_idx in range(len(line)): | |
if line[inner_idx] == 'M': | |
start = (idx, inner_idx) | |
if line[inner_idx] == '*': |