Skip to content

Instantly share code, notes, and snippets.

View zhaochunqi's full-sized avatar
:octocat:
Working from home

Alex Zhao zhaochunqi

:octocat:
Working from home
View GitHub Profile
@zhaochunqi
zhaochunqi / ArrayCombine.java
Last active December 22, 2015 04:09
数组:合并两个Int数组
private static int[] ArrayCombine (int[] a,int[] b) {
int[] al = new int[a.length+b.length];
al = Arrays.copyOf(a, a.length+b.length);
for(int i = 0;i < b.length; i++) {
al[a.length+i] = b[i];
}
return al;
}
import java.util.*;
public class TestShellSort {
public static void main(String[] args) {
Integer[] intarray = {10,2,4,243,42,34,2,42,4,24,4,5,56,657,68,7,988,9,80,5};
System.out.println("Origin :"+Arrays.toString(intarray));
shellsort(intarray);
System.out.println("After :"+Arrays.toString(intarray));
}
@zhaochunqi
zhaochunqi / share_to.java
Last active August 29, 2015 14:01
利用Intent分享。
public void shareTo(View view) {
Intent intent = new Intent(Intent.ACTION_SEND);
File file = new File("/storage/sdcard0/DCIM/100_CFV5/DSC_0005.JPG");//写死了一个地址。
// intent.setType("text/plain;image/*");
// intent.putExtra(Intent.EXTRA_SUBJECT,"分享");
// intent.putExtra(Intent.EXTRA_TEXT, "I would like to share this with you...");
// intent.putExtra(Intent.);
// Intent sendIntent = new Intent();
// sendIntent.setAction(Intent.ACTION_SEND);
// sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@zhaochunqi
zhaochunqi / git_clean.sh
Last active August 29, 2015 14:02
git_recover.sh
#!/bin/zsh
# 用来恢复本地的git文档
git checkout . && git clean -xdf
@zhaochunqi
zhaochunqi / deleteIntellijProject.sh
Created June 22, 2014 07:06
删除IntellijIdea中的项目
#!/bin/zsh
cd ~
cd Library/Preferences/IntelliJIdea13/options
vi other.xml
#本脚本用来删除IntelljIdea中的项目,因为只删除文件的话,实际上在配置文件中它还是写着的,所以要进入others.xml找到对应的项目名称删除即可。
@zhaochunqi
zhaochunqi / Android_Photos.java
Created June 22, 2014 07:09
Android调用系统的Photos进行拍照
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
@zhaochunqi
zhaochunqi / AndroidManifest.xml
Last active August 29, 2015 14:02
Android 录音与播放
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.zhaochunqi.testrecord007.app" >
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
@zhaochunqi
zhaochunqi / TestBaseAdapter.java
Last active August 29, 2015 14:03
Adapter--BaseAdapter
package cn.zhaochunqi.testadapter.app;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
@zhaochunqi
zhaochunqi / TestSimpleAdapter.java
Created June 26, 2014 07:09
Adapter--SimpleAdapter
package cn.zhaochunqi.testadapter.app;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;