git clone xxx # 默认拉取master分支
cd xx #进入拉取的文件夹
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all #如果无人提交代码,可以不拉
git pull --all #如果无人提交代码,可以不拉
This file contains 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
#!/bin/bash | |
echo "*********************************" | |
echo "Close the progress by name!" | |
echo "usage: ./close_p.sh progressName" | |
echo "*********************************" | |
echo | |
#echo "PID of this script: $$" | |
#echo "PPID of this script: $PPID" |
This file contains 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
private val HEX_CHARS = "0123456789ABCDEF".toCharArray() | |
fun ByteArray.toHex() : String{ | |
val result = StringBuffer() | |
forEach { | |
val octet = it.toInt() | |
val firstIndex = (octet and 0xF0).ushr(4) | |
val secondIndex = octet and 0x0F | |
result.append(HEX_CHARS[firstIndex]) |
public class SendEmailUtils {
/**
* 邮件发送程序
*
* 接收邮件的address
* @param subject
* 邮件主题
* @param content
/**
* 节气计算类
*/
public final class SolarTerm {
// 提供定位的年份
private static final int baseYear = 1901;
/**
* 计算公历年当月的中气,公历月从0起始!
This file contains 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 xmaihh.pay.zxing; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.PointF; | |
import android.view.Gravity; | |
import android.view.View; | |
import android.widget.TextView; |
Android中ImageView加载Base64图片其实非常简单,并不需要引入第三方库,方法如下:
import android.util.Base64;
String base64 = "data:image/png;base64, x.xx.x.xx..."
byte[] decodedString = Base64.decode(base64, Base64.DEFAULT);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
imageView.setImageBitmap(decodedByte);
监听布局的变化来计算输入法的高度,这种方式在Activity的配置中配置为"android:windowSoftInputMode="adjustResize""时没有问题,可以正确获取输入法的高度,因为布局此时确实会动态的调整。 但是当Activity配置为"android:windowSoftInputMode="adjustNothing""时,布局不会在输入法弹出时进行调整
KeyboardHeightObserver.java
/**
* The observer that will be notified when the height of
* the keyboard has changed
*/
public interface KeyboardHeightObserver {