This file contains hidden or 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
use std::env; | |
use std::process; | |
use std::fs; | |
use std::error::Error; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); | |
let config = Config::new(&args).unwrap_or_else(|err|{ | |
println!("Problem parsing arguements: {}", err); |
This file contains hidden or 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
import android.app.Activity | |
import android.content.* | |
import android.database.Cursor | |
import android.provider.ContactsContract | |
import android.util.Log | |
object ContactUtil { | |
private const val TAG = "ContactUtil" | |
fun getContacts(context: Context): StringBuilder { |
This file contains hidden or 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
import android.media.AudioFormat | |
import android.media.AudioRecord | |
import android.media.MediaRecorder | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.os.Handler | |
import android.util.Log | |
import android.view.View | |
import android.widget.Button | |
import java.io.* |
This file contains hidden or 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
1 #!/bin/bash | |
2 | |
3 sudo update-alternatives --install /usr/bin/java java /home/sunting/tools/jdk1.8.0/bin/java 1070 | |
4 sudo update-alternatives --install /usr/bin/javac javac /home/sunting/tools/jdk1.8.0/bin/javac 1070 | |
5 sudo update-alternatives --install /usr/bin/jar jar /home/sunting/tools/jdk1.8.0/bin/jar 1070 | |
6 sudo update-alternatives --install /usr/bin/javah javah /home/sunting/tools/jdk1.8.0/bin/javah 1070 | |
7 sudo update-alternatives --install /usr/bin/javap javap /home/sunting/tools/jdk1.8.0/bin/javap 1070 |
This file contains hidden or 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
N = 8 | |
def isVaild(path, dcolumn): | |
drow = len(path) | |
for row, column in enumerate(path): | |
if column + drow - row == dcolumn: | |
return False | |
if column - (drow - row) == dcolumn: | |
return False | |
return True |
This file contains hidden or 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 static final String HTTP_END = "\r\n"; | |
private static final String HTTP_START = "--"; | |
private static final String HTTP_BOUNDARY = "*******"; | |
private boolean uploadFileToServer(File file) { | |
if (file == null || !file.exists()) { | |
LogUtil.d(TAG, "file not exists, ignore upload."); | |
return true; | |
} |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# Copyright (C) 2013-15 The CyanogenMod Project | |
# (C) 2017 The LineageOS 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 |
This file contains hidden or 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 com.leaf.library; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.os.Build; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.IntRange; | |
import android.support.annotation.NonNull; |
This file contains hidden or 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
imap fd <Esc> |
This file contains hidden or 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
let mapleader = "," " leader is comma | |
let localleader = "," " leader is comma | |
set tabstop=4 " number of visual spaces per TAB | |
set softtabstop=4 " number of spaces in tab when editing | |
set shiftwidth=4 " spaces in newline start | |
set expandtab " tabs are spaces | |
set number " show line numbers | |
set rnu " show relative line numbers | |
set showcmd " show command in bottom bar |