- 博客(109)
- 收藏
- 关注
原创 pthread 线程同步
/* * m.cpp * * Created on: 2015年1月23日 * Author: maygolf */#include <pthread.h>#include <iostream>#include <time.h>#include <sys/time.h>#include <...
2015-01-23 18:09:59
198
原创 nodej读取客户端ip
代码比较简单了#!/usr/bin/env nodejsvar http = require('http');var fs = require("fs");http.createServer(function (req, res) { var ip = req.headers['x-forwarded-for'] || req.connecti...
2014-06-27 10:07:48
279
原创 sublime-text2比较工具
http://www.sublimerge.com/#installation overview features changelog documentation support buySublimergeThe professional diff and merge tool for Sublime Text 2 an...
2014-04-01 09:10:54
401
原创 关于android contentprovider 多线程读取问题
/** * @(#) TestActivity.java Created on 2014-3-7 * * */package com..android.app.ui;import java.util.Random;import java.util.UUID;import com..gx.oatos.R;import com..android.busi...
2014-03-07 10:21:22
1085
原创 make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4217b3)
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4217b3) 这个错误的原因是:你的机器上是否有两套cygwin环境 ,请检查你PATH 变量如git 等软件会自动安装上 本人机器win7X64...
2014-03-05 16:55:00
3766
1
原创 上了大当 ,调试了一上午
final StringBuffer buffer = new StringBuffer(); buffer.append("GET").append(" ").append(uri.getPath()).append(" ").append("HTTP/1.1") .append(eof); buffer.append("Host: ").append(uri.getAu...
2013-07-23 15:36:30
126
原创 android 调用相机拍摄照片视频
// 拍照片 case R.id.taking_pictures_layout: final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a ...
2013-06-04 10:08:55
199
原创 java 垃圾回收问题
student /** * @(#) Student.java Created on 2013-5-30 * * Copyright © 2013 */package com.braver.test;/** * The class <code>Student</code> * * @author Feng OuYang ...
2013-05-30 10:29:37
137
原创 android 操作剪切板
/** * @(#) CutActivity.java Created on 2013-5-14 * * Copyright © 2013 深圳企业云科技有限公司 版权所有 */package com.demo;import java.util.Random;import android.app.Activity;import android.conte...
2013-05-14 17:22:19
161
原创 QQ push 进程守护
package com.tencent.mm.booter; import android.app.AlarmManager;import android.app.PendingIntent;import android.content.BroadcastReceiver;import android.content.Context;import android.cont...
2013-05-14 11:15:04
218
原创 android couldn't save which view has focus because the focused view
couldn't save which view has focus because the focused view <activity android:name="com.oatos.m.android.ui.UserInfoActivity" android:configChanges="orientation|key...
2013-05-13 15:52:49
166
原创 android ios浏览器请求头
开始监听...........192.168.1.198已连接........GET / HTTP/1.1Host: 192.168.1.107Accept-Encoding: gzip, deflateAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Languag...
2013-03-21 11:41:36
658
原创 Java ip 转成数字
final String ip = "119.122.78.13"; final String[] ipSplitArray = ip.split("\\."); int num = 0; for (int i = 0; i < ipSplitArray.length; i++) { num |= Integer.parseInt(ipSplitArray[i])...
2013-03-04 13:24:26
291
原创 ubuntu10.4上安装OpenCV
1.下载到http://opencv.org/下载最近的linux源码包OpenCV-2.4.3.tar.bz22.解压源码包tar -xzf OpenCV-2.4.3.tar.bz23.安装依赖的包sudo apt-get install build-essentialsudo apt-get install cmakesudo apt-get install libgtk2.0-devsud...
2013-01-17 15:25:42
259
原创 Java 执行javascript
/** * @(#) Main.java Created on 2012-11-22 * * Copyright (c) 2012 Aspire. All Rights Reserved */package com.braver.javascript;import javax.script.ScriptEngine;import javax.script.Sc...
2013-01-08 21:00:42
113
原创 aapt解析apk包
/** * @(#) CmdExecute.java Created on 2012-10-30 * * Copyright (c) 2012 Aspire. All Rights Reserved */package com.aspire.mbre.pc.client.common.utils;import java.io.BufferedReader;im...
2013-01-08 10:09:54
369
原创 java 对象排序
Java API针对集合类型排序提供了两种支持:java.util.Collections.sort(java.util.List)java.util.Collections.sort(java.util.List, java.util.Comparator) 第一个方法要求所排序的元素类必须实现java.lang.Comparable接口。第二个方法要求实现一个java.util.Compara...
2013-01-07 10:19:59
91
原创 java SWT Browser 交互
最近在做swt ,写一个桌面应用,要与web界面交互,也就java与javascript通信 用到的控件是org.eclipse.swt.browser.Browser 首先说下,java 怎么调用 javascript browser.execute(arg0)arg0 里面写javascript脚本 browser.execute("alert('123...
2012-12-27 18:04:13
718
原创 tesseract-ocr安装
本文档是关于linux下的tesseract-ocr安装,本教程执行环境为ubuntu 10.4 下载地址:https://code.google.com/p/tesseract-ocr/downloads/list 1.下载tesseract-ocr-3.02.02.tar.gz,并解压到目录 2.安装依赖的包sudo apt-get install auto...
2012-11-30 16:41:47
199
原创 android native c++ thread
下面的代码示例在android平台下使用线程类threads.h MyThread.h #ifndef _MYTHREAD_H#define _MYTHREAD_H#include <utils/threads.h>namespace android {class MyThread: public Thread {public:...
2012-11-14 17:34:11
603
原创 Windows 下调用shell不阻塞方法
CmdExecute.java/** * @(#) CmdExecute.java Created on 2012-7-19 * * Copyright (c) 2012 Aspire. All Rights Reserved */package com.aspire.sqmp.mobilemanager.service.adb;import java.io....
2012-10-29 14:22:56
1030
原创 Android输入系统与Qwerty物理键盘的支持
以下内容,针对Android2.3.3~Android的用户输入系统,自下而上,分成如下部分:1.驱动程序:/dev/input目录下,通常时Event类型的驱动;2.EventHub:libui的一部分,实现了对驱动程序的控制,从中获得信息;3.KeyLayout(按键布局)和KeyCharacterMap(按键字符映射):后缀名称分别为kl和kcm;Android系统文件中存...
2012-10-26 11:15:13
745
原创 JNI 动态注册
由于静态注册要用javah生成头谁的,所以一般采用动态注册 代码如下 #include <jni.h>#ifndef HELL_JNI#define HELL_JNIstatic const char *className = "com/braver/jni/dy/HelloJni";#ifdef __cplusplusexte...
2012-10-11 00:20:08
87
原创 不用第三变量交换两个变量的值
/** * @param args * @throws FileNotFoundException */ public static void main(String[] args) throws Exception { int i = 60; int j = 70; i = i ^ j;...
2012-09-13 14:29:15
91
原创 汇编英文大小写转换
assume cs:code,ds:datadata segment db 'iloveyou'data endscode segment start: mov ax,data mov ds,ax mov bx,0 mov cx,8 s: mov al,[bx] and al,11011111b mo...
2012-08-30 16:51:21
529
原创 window 管理右键菜单
一: 开始,运行里面输入: regsvr32 /u igfxpph.dll 确定 ok了 注意/u两边各有一个空格的,或者直接复制进去运行吧 二:清除鼠标右键菜单中多余项的操作步骤如下: (1)在系统桌面上单击“开始→运行”项。 (2)在随后出现的窗口中的“打开”栏中键入regedit并单击“确定”按钮运行注册表编辑器。 (3)在注册表的HKEY_CURRENT_...
2012-08-20 09:25:52
216
原创 java 运行时设置环境
我们知道通过System.getProperty可以得到系统中的环境变量的值,如果在运行程序时我们自己要定义一个呢,怎么办,如:System.out.println(System.getProperty("workdir")); 通过java 命令可以看到有以下说明:Usage: java [-options] class [args...] (t...
2012-08-17 12:11:38
727
原创 android 运行java main
平常都是用java写activity之类的东西,都看不到程序的入口main,android 系统是dalvik虚拟机,只是把java class 合成了一个文件,把字节码转成了dalvik运行的东西,所以dalvik可以运行没有四个组件的代码吧,今天 试了一个 可以下面来说下:1.先来个java mainpackage com.aspire.test.dex;impor...
2012-07-06 17:01:58
157
原创 android am命令
usage: am [subcommand] [options] start an Activity: am start [-D] <INTENT> -D: enable debugging send a broadcast Intent: am broadcast <INTENT> start an Instrumentat...
2012-07-03 15:42:26
101
原创 java 生成双色球彩票
什么都不说了 ,直接上代码package com.java.color.ticket;import java.util.Arrays;import java.util.Random;public class ColorTicket { /** * 蓝球的可选范围 */ private static final int[] BLUEBALL = { 1...
2012-06-22 00:35:51
334
原创 java 判断ip网段代码
package com.test;public class IpTest { /** * 判断IP是否在指定范围; */ boolean i; public static boolean ipIsValid(String ipSection, String ip) { if (ipSection == null) throw new Nu...
2012-06-15 17:14:25
540
原创 C#soapheader ip 过滤
using System;using System.Data;using System.Configuration;using System.Web;using System.Collections;using System.Text.RegularExpressions;using System.Xml;using Core;namespace Gree...
2012-06-15 17:14:12
133
原创 送去java File类renameTo
刚才帮同看问题,同说调用renameTo 文件没有被重命名,看了一下原来问题出在这里/** * @(#) Test.java Created on 2012-6-4 * * Copyright (c) 2012 Aspire. All Rights Reserved */package com.and.test;import java.io.File;impor...
2012-06-15 17:13:49
112
原创 android spinner 省市级联
项目源码地址:https://fengsourcecode.googlecode.com/svn/trunk/ProvinceAndCity 1.首先是bean 省的/** * @(#) Province.java Created on 2012-6-13 * * Copyright (c) 2012 Aspire. All Rights Reserved */...
2012-06-13 16:10:53
120
原创 androi 静默安装APK
静默安装前 手机 必须 root 以下是代码 、package com.test.root.install;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import org.xml.sax.InputSource;impor...
2012-05-28 16:47:42
192
原创 adb shell top命令
执行Linux下的top、ps等命令,这些命令你也通过adb可以执行查看效果。 1)top命令如下:adb shell $ top -h top -h Usage: top [-m max_procs] [-n iterations] [-d delay] [-s sort_column] [-t] [-...
2012-05-24 11:29:57
741
原创 关于java线程的
import java.util.Scanner;public class Test { private T t = new T(); /** * @param args */ public static void main(String[] args) { final Test test = new Test(); final Scanner ...
2012-04-19 17:28:31
62
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人