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
/* Source `cracking the coding interview` */ | |
/* Flexible Divisions */ | |
public class MultiStack{ | |
/* StackInfo is a simple class that holds a set of data about each stack. */ | |
private class StackInfo{ | |
public int start, size, capacity; | |
public StackInfo(int start, int capacity){ | |
this.start = start; | |
this.capacity = capacity; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<div class="container"> |
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
<!-- table tennis king --> | |
import './App.css'; | |
import { Table,Button,Layout,Input} from 'antd'; | |
import React, { useState,useRef } from 'react'; | |
import ReactToPrint from "react-to-print"; | |
import { PrinterOutlined } from '@ant-design/icons'; | |
const { Header, Content, Footer } = Layout; | |
function App() { |
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
REF: https://kentcdodds.com/blog/stop-being-a-junior |
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
class TrieNode: | |
def __init__(self): | |
self.childen = {} | |
self.isEnd = False | |
self.refs = 0 | |
def addWord(self,word): | |
cur = self | |
# cur.ref += 1 | |
for w in word: |
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
// npm install react-csv --save; | |
// npm install papaparse | |
import React, { useState } from "react"; | |
import { CSVLink } from "react-csv"; | |
import Papa from "papaparse"; | |
const App = () => { | |
const [tableRows, setTableRows] = useState([]); |
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
# V Read every line in application.config | |
# V split each line using equal operator | |
# --- | |
# write to excel: | |
# Put key value to excel specified field | |
# & default value already wriien in excel | |
# --- | |
# [Note] | |
# Check it ... |
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 sys | |
import os | |
import time | |
import platform | |
try: | |
name = sys.argv[1] | |
except: | |
print('Type python3 dancing_bob.py [Name]') | |
exit(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
package mycat; | |
public class Cat { | |
private String name; | |
private String weight; | |
// Getter | |
public String getName() { | |
return name; | |
} |
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
exports.addNewClass = async (req, reply) => { | |
try { | |
let classname = new class_name(req.body) | |
const className = req.body | |
console.log(className.class_name) | |
const duplicateData = await class_name.findOne({"class_name":className.class_name}) | |
console.log("duplicateData:"+duplicateData) | |
if(!duplicateData){ | |
let newclass = await classname.save() | |
return newclass |
NewerOlder