Skip to content

Instantly share code, notes, and snippets.

@polbins
polbins / README.md
Last active February 29, 2024 09:58
Simple RecyclerView Divider

Simple RecyclerView Divider

Simple Horizontal Divider Item Decoration for RecyclerView

    mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
            getApplicationContext()
    	));

NOTE: Add item decoration prior to setting the adapter

@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@prayagupa
prayagupa / 1.1 -hadoop_namenode_jobtracker_tasktracker.md
Last active April 11, 2019 15:25
hadoop, storm, spark, mesos, zookeeper

PART 1

[STEP 2] Adding a dedicated hadoop system user

check groups

$ compgen -g
@jackey
jackey / controller.php
Created July 3, 2013 14:55
laravel 验证码
public function action_authcode() {
//随机生成一个4位数的数字验证码
$num="";
for($i=0;$i<4;$i++){
$num .= rand(0,9);
}
//4位验证码也可以用rand(1000,9999)直接生成
//将生成的验证码写入session,备验证页面使用
SESSION::put("authcode", $num);
//创建图片,定义颜色值
@liamzh
liamzh / gist:5449825
Created April 24, 2013 05:25
「按键问题」解题报告

「按键问题」解题报告

作者:TheLover_Z

问题描述:

假设你的键盘只有以下键:A,Ctrl + A,Ctrl + C,Ctrl + V。

这里 Ctrl+A,Ctrl+C,Ctrl+V 分别代表「全选」,「复制」,「粘贴」,组合键算一次按键。

anonymous
anonymous / what-a-nb-sql.txt
Created June 15, 2012 10:57
杭州正方教务管理系统,超级NB的SQL,你没看错这是一条查询。
select * from (select case when a.kcxzdm is null then '98' else a.kcxzdm end kcxzdm,a.kcxzmc,case when a.xfyq is null then 0 else to_number(a.xfyq) end xfyq ,b.xfh1,b.xfh2,to_number(to_number((case when a.xfyq is null then 0 else to_number(a.xfyq) end))-to_number(b.xfh1)) xfc from (select * from jxjhxfyqview where jxjhh=(select dqszj||zydm from xsjbxxb where xh='0407100522')) a left join (select kcxz,case when sum(xf1) is null then 0 else sum(xf1) end xfh1,case when sum(xf2) is null then 0 else sum(xf2) end xfh2 from (select kcdm,kcmc,kcxz,cj,xf,decode(floor(McjN/60),1,xf) xf1,decode(floor(McjN/60),0,xf) xf2 from (select a.*,b.xymc from (select a.*,b.kkbmdm from (select xn,xq,xkkh,xh,xm,kcmc,qzxs,xf,cj,zscj,bz,xgsj,xgs,cxbj,tzf,tzfjd,kcdm,pscj,qmcj,sycj,bkcj,cxcj,kcxz,tj,tjbz,cxxnxq,qzcj,kcgs,fxbj,jf,xsqr,sfkc,ysbkcj,McjN,McxcjN,zpZ,bkcjZ,cxcjZ,cxcj1Z,cxcj2Z,cxcj3Z,cxcj4Z,cxcj5Z,cxcj1,cxcj2,cxcj3,cxcj4,cxcj5,McjX,McxcjX,McjzPN,jycj,MjyN,MjycjN,MjybkcjN,MjycxcjN,MjycxbkcjN ,(case when (select x.kcdm from wjdsz
@neuro-sys
neuro-sys / BCD.java
Last active January 13, 2022 03:34
BCD Conversion in java
/*
* Copyright 2010 Firat Salgur
* Improved by Abdallah Abdelazim
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>