Skip to content

Instantly share code, notes, and snippets.

View TerenceLiu98's full-sized avatar
🌍
Working

TerenceLau TerenceLiu98

🌍
Working
View GitHub Profile
@TerenceLiu98
TerenceLiu98 / license-badges.md
Created August 12, 2018 00:43 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
  • Github has a new autodetection of the LICENSE file, which shows up the license at the repo overview
wget -r -np -nH -R index.html + URL
: '
It can download all the document from the file without the index.html
`
#/bin/zsh
brew install privoxy
echo -n "<- Enter your http/https PORT ->"
read PORT
echo "PORT = $PORT"
echo "function proxy_off(){" >> ~/.bash_profile
echo " unset http_proxy" >> ~/.bash_profile
echo " unset https_proxy" >> ~/.bash_profile
echo " echo -e "已关闭代理"" ~/.bash_profile
echo "}\n" >> ~/.bash_profile
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get -y install r-base
echo " finish r-base installation"
sudo apt-get -y install gdebi-core
wget https://download2.rstudio.org/rstudio-server-1.1.463-amd64.deb
sudo gdebi rstudio-server-1.1.463-amd64.deb
echo "finish rstudio-server installation"
###################################
# Question:(solved)
# Given an array S of n integers, are there elements a, b, c in S
# such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
# Input: [-1, 0, 1, 2, -1, -4]
# Output: [[-1, 0, 1], [-1, -1, 2]]
# Answerer:Terence Liu
###################################
#!/bin/bash
basepath=$(cd `dirname $0`; pwd)
cat $basepath/name.txt | while read line
#eampty the user.txt
#echo /dev/null > echo basepath/user.txt
do
echo "The user name is : ${line}"
## Author: Terence Liu
## Date: 2020-02-05
## Follow: CC0
require(jsonlite)
require(ggplot2)
require(maptools)
require(maps)
require(mapdata)
library(devtools) # install.packages("devtools", dep = T, repos = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/")
Sub BatchCopy()
Application.ScreenUpdating = False 'turnoff screen refresh
For i = 5 To 2 Step -1
For n = 1 To 3
Rows(i & ":" & i).Select
Selection.Copy
Selection.Insert Shift:=xlDown
Next n
#include <stdio.h>
#include <math.h>
typedef struct {
const char *name;
int rank;
double expect_rate;
} girl;
const int K = 10;
void read_girl(girl g) {
printf("Girl name: %s, rank: %d, expect_rate: %.5f\n",g.name,g.rank,g.expect_rate);
## Extract categorical feature and numerical feature
def extract_factor_numeric(data:pd.DataFrame, list_a:list):
numeric = []
factor = []
for i in range(0, len(list_a)):
if len(Counter(data['{}'.format(list_a[i])])) >= 20: # or other threholds
numeric.append(list_a[i])
else:
factor.append(list_a[i])
return numeric, factor