`
wang_peng1
  • 浏览: 3912634 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
全局变量 private let _SingletonSharedInstance = Singleton() class Singleton { class var sharedInstance : Singleton { return _SingletonSharedInstance } } 嵌套 class Singleton { class var sharedInstance : Singleton { struct Static { static let instance ...
参看文档 http://practicalswift.com/2014/06/14/the-swift-standard-library-list-of-built-in-functions/

swift 简单总结

http://kpbp.github.io/swiftcheatsheet/#constants   Swift is a new programming language for developing iOS and OS X apps that was introduced by Apple in June 2014. Variables var myInt = 1 var myExplicitInt: Int = 1 // explicit type var x = 1, y = 2, z = 3 // declare multiple integers myEx ...

ping 网络

如果ping一个网络是不是通,这里不是wifi,可以参看 http://www.splinter.com.au/how-to-ping-a-server-in-objective-c-iphone/

获取点击区域

@Override public void getHitRect(Rect outRect) { super.getHitRect(outRect); outRect.top+=getPaddingBottom()/2; outRect.bottom-=getPaddingBottom()/2; }  
下载: http://www.speex.org/downloads/ http://xiph.org/downloads/ 建立 jni 文件夹,然后从下载的文件夹中提取相关文件 放到jni下 /libspeex/* ? /jni/libspeex/ /include/speex/* ? /jni/include/speex/ /src/wav_io.h ? /jni/include/speex /src/* ? /jni/libogg/ /include/ogg/* ? /jni/include/ogg 编辑jni/include/speex/ ...

rsync 同步

两台android 设备 进行rsync 同步 1。编译 rsync 源码 sudo apt-get install gcc-arm-linux-gnueabi wget http://rsync.samba.org/ftp/rsync/rsync-3.1.0.tar.gz tar -zxv -f rsync-3.1.0.tar.gz cd rsync-3.1.0 ./configure --host=arm-linux-gnueabi CFLAGS="-static" make 2. ...
1.下载 http://maven.apache.org/download.cgi 2. 配置好 jdk 和marven路径 3. sudo gedit /etc/profile 最后添加 # set jdk environment export JAVA_HOME=/home/wangpeng/work/jdk1.7.0_45 export JRE_HOME=/home/wangpeng/work/jdk1.7.0_45 export NDK_PATH=/home/wangpeng/work/android-ndk-r8b export CLASS ...

流转字符串

public static String convertStreamToString(InputStream is) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line ...
<?xml version="1.0" encoding="UTF-8"?> <data> <head> <ver>协议版本</ver> <dev_type>设备类型</dev_type> <dev_sub_type>设备子类型</dev_sub_type> <dev_sn>设备编号</dev_sn> <cmd >命令字</cmd > <id>消息i ...
try { PackageManager manager = getPackageManager(); Resources resources = manager.getResourcesForApplication("com.example.packagename"); int resId = resources.getIdentifier("drawable_id", "drawable", "com.example.packagename"); Drawable ...
@interface MONImage : UIImage + (instancetype)imageNamed:(NSString *)pName; @end @implementation MONImage + (instancetype)imageNamed:(NSString *)pName { UIImage * source = [UIImage imageNamed:pName]; CGImageRef cgImage = source.CGImage; if (cgImage) return [[self ...
public class IncomingCallInterceptor extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String callingSIM = ""; Bundle bundle = intent.getExtras(); callingSIM =String.valueOf(bundle.getInt("simId", -1)); if(call ...
UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithCustomView:segmentView]; UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:ni ...
1. 环境 ubuntu 我的是13.10  ndk r9 64位 2. 下载ffmpeg http://www.ffmpeg.org/download.html  找到  FFmpeg 2.1.3 "Fourier" 2.1.3 was released on 2014-01-15. It is the latest stable FFmpeg release from the 2.1 release branch, which was cut from master on 2013-10-28. Amongst lots of other changes, it ...
Global site tag (gtag.js) - Google Analytics