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
patch:
# 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
staticor / azkaban-statu.sql
Last active Jun 24, 2019
Azkaban-Status统计
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
staticor / squirrel.custom.yaml
Created Jun 5, 2019 — forked from singlepig/squirrel.custom.yaml
Rime主题配色,模仿官网rime.im配图
View squirrel.custom.yaml
# modified from https://gist.github.com/deamwork/7cfb49777c2f163a475c71521cf7dd6e
# preview https://i.loli.net/2017/12/11/5a2d782e2f695.png
rimeblue:
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
staticor / tmux.md
Created May 22, 2019 — forked from andreyvit/tmux.md
tmux cheatsheet
View tmux.md

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
as
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
staticor / HotItems.java
Created Feb 26, 2019
Flink- example 2 计算热门商品, wuchong blog - code
View HotItems.java
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
@staticor
staticor / SocketWindowWordCount.java
Last active Feb 25, 2019
first Flink application , used to wordcount
View SocketWindowWordCount.java
package myflink;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple2;
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
staticor / 404.html
Created Feb 23, 2019
hexo 404.html
View 404.html
<html>
<head>
<!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="utf-8">
<title>404页面</title>
<style>
*{margin:0;padding:0;outline:none;font-family:\5FAE\8F6F\96C5\9ED1,宋体;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;user-select:none;cursor:default;font-weight:lighter;}
.center{margin:0 auto;}
.whole{width:100%;height:100%;line-height:100%;position:fixed;bottom:0;left:0;z-index:-1000;overflow:hidden;}
.whole img{width:100%;height:100%;}
.mask{width:100%;height:100%;position:absolute;top:0;left:0;background:#000;opacity:0.6;filter:alpha(opacity=60);}
@staticor
staticor / HiveInputSplit.java
Created Jan 22, 2019
Hive Input Split 相关的代码
View HiveInputSplit.java
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.