Skip to content

Instantly share code, notes, and snippets.

Math is Beautiful

Steve-金勇 staticor

Math is Beautiful
Block or report user

Report or block staticor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View squirrel.custom.yaml
# squirrel.custom.yaml
# us_keyboard_layout: true # 键盘选项:应用美式键盘布局# show_notifications_when: growl_is_running # 狀態通知,默認裝有Growl時顯示,也可設爲全開(always)全關(never)
style/color_scheme: demo # 选择配色方案
style/horizontal: true# 候选窗横向显示# style/inline_preedit: false # 关闭内嵌编码,这样就可以显示首行的拼音(MAC下不建议开启)
style/corner_radius: 3# 窗口圆角半径
style/border_height: 4# 窗口边界高度,大于圆角半径才有效果
tyle/border_width: 4# 窗口边界宽度,大于圆角半径才有效果# style/line_spacing: 1 # 候选词的行间距# style/spacing: 5 # 在非内嵌编码模式下,预编辑和候选词之间的间距
style/font_face: "Lantinghei TC Extralight"# 预选栏文字字体,使用中文字体:兰亭黑-纤黑
style/font_point: 17#预选栏文字字号
staticor / azkaban-statu.sql
Last active Jun 24, 2019
View azkaban-statu.sql
select ifnull( status , 'TOTAL') status, count( flow_id ) exec_num
from (
select exec_id, project_id, flow_id
, case
when status = 50 then 'success'
when status = 60 then 'killed'
when status = 70 then 'failed'
staticor / squirrel.custom.yaml
Created Jun 5, 2019 — forked from singlepig/squirrel.custom.yaml
View squirrel.custom.yaml
# modified from
# preview
name: "RimeBlue"
horizontal: false # 候选条横向显示
inline_preedit: true # 启用内嵌编码模式,候选条首行不显示拼音
candidate_format: "%c.\u2005%@\u2005" # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间。
corner_radius: 10 # 候选条圆角半径
border_height: 0 # 窗口边界高度,大于圆角半径才生效
staticor /
Created May 22, 2019 — forked from andreyvit/
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
View max-stays-sequence-in-hive.hql
create table temp.result
select uid, dtnum
from (
select uid, rndiff, dtnum
, row_number() over ( partition by uid order by dtnum desc ) rk
from (
select uid, rndiff, count(dt) dtnum
from (
staticor /
Created Feb 26, 2019
Flink- example 2 计算热门商品, wuchong blog - code
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
staticor /
Last active Feb 25, 2019
first Flink application , used to wordcount
package myflink;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.windowing.time.Time;
import org.apache.flink.util.Collector;
public class SocketWindowWordCount {
staticor / 404.html
Created Feb 23, 2019
hexo 404.html
View 404.html
<!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="utf-8">
.center{margin:0 auto;}
.whole img{width:100%;height:100%;}
staticor /
Created Jan 22, 2019
Hive Input Split 相关的代码
public InputSplit[] getSplits(JobConf job, int numSplits) throws IOException {
for (Path dir : dirs) {
PartitionDesc part = getPartitionDescFromPath(pathToPartitionInfo, dir);
Class inputFormatClass = part.getInputFileFormatClass();
InputFormat inputFormat = getInputFormatFromCache(inputFormatClass, job);
//注意:这里的Inputformat只是old version API:org.apache.hadoop.mapred而不是org.apache.hadoop.mapreduce,因此不能采用新的API,否则在查询时会报异常:Input format must implement InputFormat.区别就是新的API的计算inputsplit size(Math.max(minSize, Math.min(maxSize, blockSize))和老的(Math.max(minSize, Math.min(goalSize, blockSize)))不一样;
InputSplit[] iss = inputFormat.getSplits(newjob, numSplits / dirs.length);
View hive-ddl-example.hql
-- Hive db.
use rds;
alter table customer add columns
( shipping_address varchar(50) comment 'shipping_address'
, shipping_zip_code int comment 'shipping_zip_code'
, shipping_city varchar(30) comment 'shipping_city'
, shipping_state varchar(2) comment 'shipping_state'
alter table sales_order add columns(order_quantity int comment 'order_quantity');
You can’t perform that action at this time.