Skip to content

Instantly share code, notes, and snippets.

View zstartw's full-sized avatar
🌴
On vacation

Just do it zstartw

🌴
On vacation
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#define BOOL int
#define TRUE 1
#define FALSE 0
void bubbleSort(int arr[], int a);
void selectSort(int arr[], int len);
void quickSort(int arr[], int left, int right);
colorscheme ir_black
" 解决打开之后主题显示会是红色的问题
set nospell
nnoremap <F4> :make!<CR>
" Move to the start of line
nnoremap H ^
" Move to the end of line
nnoremap L $
@zstartw
zstartw / Docker CE on Linux Mint 18.1
Created September 24, 2019 09:49 — forked from holazt/Docker CE on Linux Mint 18.1
Docker CE on Linux Mint 18.1
Here are the instructions to installing Docker CE on Linux Mint 18.1 Serena.
Step1. `sudo apt-get install apt-transport-https ca-certificates curl software-properties-common`
Step2. `curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -`
The following line in the SOURCE automatically determines the distribution, which is Serena,
but there are no Linux Mint packages for Docker. You have to change it to the matching Ubuntu distribution.
FYI Linux Mint Serena is based on Ubuntu 16.04 Xenial.
@zstartw
zstartw / network.java
Last active July 8, 2019 10:12
判断网络
public void checkOnlineState() {
ConnectivityManager CManager =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo NInfo = CManager.getActiveNetworkInfo();
if (NInfo != null && NInfo.isConnectedOrConnecting()) {
if (InetAddress.getByName("www.xy.com").isReachable(timeout))
{
// host reachable
}
else
@zstartw
zstartw / MainActivity.java
Created May 9, 2018 03:24 — forked from hello2pal/MainActivity.java
Play YouTube Video in Your Application
import android.os.Bundle;
import com.google.android.youtube.player.YouTubeBaseActivity;
import com.google.android.youtube.player.YouTubeInitializationResult;
import com.google.android.youtube.player.YouTubePlayer;
import com.google.android.youtube.player.YouTubePlayer.OnInitializedListener;
import com.google.android.youtube.player.YouTubePlayer.Provider;
import com.google.android.youtube.player.YouTubePlayerView;
public class MainActivity extends YouTubeBaseActivity implements
OnInitializedListener {
@zstartw
zstartw / Installation.java
Last active March 12, 2018 07:32
识别设备
public class Installation {
private static String sID = null;
private static final String INSTALLATION = "INSTALLATION";
public synchronized static String id(Context context) {
if (sID == null) {
File installation = new File(context.getFilesDir(), INSTALLATION);
try {
if (!installation.exists())
writeInstallationFile(installation);
@zstartw
zstartw / .vimrc
Last active March 17, 2018 07:42
vim配制
set nocompatible " be iMproved, required
" filetype off " required
"定义快捷键
let mapleader=","
let g:mapleader=","
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
<style name="DefaultLightTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
<style name="PopupWindowTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:">true</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
public class ArithUtils {
/**
* 提供精确的加法运算。
*
* @param v1 被加数
* @param v2 加数
* @return 两个参数的和
*/
public static double add(double v1, double v2) {
<android.support.design.widget.TabLayout
android:id="@+id/home_tab_tab"
style="@style/customTabLayout"
app:tabMode="scrollable" />
<style name="customTabLayout" parent="Widget.Design.TabLayout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">45dip</item>