小丰程序人生
ouyangfeng521 · 共 108 篇文章
pthread 线程同步
/* * m.cpp * * Created on: 2015年1月23日 * Author: maygolf */ #include <pthread.h> #include <iostream> #include <time.h> #include <sys/time.h> #include <unistd.h> using namespace std; int i = 0; pthread_mutex_t mutex ;//= PTHREAD_MUTEX_INITIALIZER; long long current_time() { struct timeval t_start; //…
2015-01-23 18:09 · 评论(0)
nodej读取客户端ip
代码比较简单了 #!/usr/bin/env nodejs var http = require('http'); var fs = require("fs"); http.createServer(function (req, res) { var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.socket.remoteAddress || req.connection.socket.remoteAddress; res.writeHead(200, {'Content-Type': '…
2014-06-27 10:07 · 评论(0)
sublime-text2比较工具
http://www.sublimerge.com/#installation overview features changelog documentation support buy SublimergeThe professional diff and merge tool for Sublime Text 2 and 3 @sublimerge Buy for $19 Per user on any number of computers. Evaluate a Free Trial No time and functionality limitations. Available f…
2014-04-01 09:10 · 评论(0)
关于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.business.provider.PreferenceProvider; import com..android.preferences.SysPreferences; import android.app.Activity; import …
2014-03-07 10:21 · android 源码 · 评论(0)
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 · winavr · 评论(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.getAuthority()).append(eof); buffer.append("Upgrade: ").append("websocket").append(eof); buffer.append("Connection: …
2013-07-23 15:36 · 评论(0)
android 调用相机拍摄照片视频
// 拍照片 case R.id.taking_pictures_layout: final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a // file intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the // image startActivityForResult(intent, CAPTURE_IMAGE_ACTI…
2013-06-04 10:08 · 评论(0)
java 垃圾回收问题
student /** * @(#) Student.java Created on 2013-5-30 * * Copyright © 2013 */ package com.braver.test; /** * The class <code>Student</code> * * @author Feng OuYang * @version 1.0 */ public class Student { String name; int age; static Student student; /** * @param name * @param age */ public Student(…
2013-05-30 10:29 · 评论(0)
android 操作剪切板
/** * @(#) CutActivity.java Created on 2013-5-14 * * Copyright © 2013 深圳企业云科技有限公司 版权所有 */ package com.demo; import java.util.Random; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.text.ClipboardManager; import android.view.View; import android.…
2013-05-14 17:22 · 评论(0)
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.content.Intent; import com.tencent.mm.sdk.platformtools.o; import com.tencent.mm.sdk.platformtools.r; public cla…
2013-05-14 11:15 · 评论(0)
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|keyboardHidden|keyboard|screenLayout" android:screenOrientation="portrait" android:windowSoftInputMode="stateHidden" > <intent-filter> <act…
2013-05-13 15:52 · 评论(0)
android ios浏览器请求头
开始监听........... 192.168.1.198已连接........ GET / HTTP/1.1 Host: 192.168.1.107 Accept-Encoding: gzip, deflate Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us Connection: keep-alive Cache-Control: max-age=0 User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 6_…
2013-03-21 11:41 · 评论(0)
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]); if(i < ipSplitArray.length - 1) num <<= 8; } System.out.println(num);
2013-03-04 13:24 · 评论(0)
ubuntu10.4上安装OpenCV
1.下载 到http://opencv.org/下载最近的linux源码包OpenCV-2.4.3.tar.bz2 2.解压源码包 tar -xzf OpenCV-2.4.3.tar.bz2 3.安装依赖的包 sudo apt-get install build-essential sudo apt-get install cmake sudo apt-get install libgtk2.0-dev sudo apt-get install pkgconfig sudo apt-get install python-dev python-numpy sudo apt-get instal…
2013-01-17 15:25 · 评论(0)