上一页 1 ··· 3 4 5 6 7

2012年8月2日

Android2.1--UI基本控件<1>--ListView

摘要: 1 package com.yarin.android.Examples_04_04; 2 3 import android.app.Activity; 4 import android.database.Cursor; 5 import android.graphics.Color; 6 import android.os.Bundle; 7 import android.provider.ContactsContract; 8 import android.provider.ContactsContract.PhoneLookup; 9 import android.... 阅读全文

posted @ 2012-08-02 10:20 龙沙宝石 阅读(376) 评论(0) 推荐(0) 编辑

2012年7月26日

Andoid2.1--robotium<1>--NotePadTest

摘要: /* * This is an example test project created in Eclipse to test NotePad which is a sample * project located in AndroidSDK/samples/android-11/NotePad * Just click on File --> New --> Project --> Android Project --> Create Project from existing source and * select NotePad. * * Then you can 阅读全文

posted @ 2012-07-26 16:37 龙沙宝石 阅读(1168) 评论(0) 推荐(0) 编辑

2012年7月16日

uinx 学习(3)exec函数族 转载

摘要: 进程控制函数之exec()函数的学习当我们看恐怖片时,经常会有这样的场景:当一个人被鬼上身后,这个人的身体表面上还和以前一样,但是他的灵魂和思想已经被这个鬼占有了,因此它会控制这个人做他自己想做的事情--那么在进程中也有这样的情景。那么是如何实现的呢?现在我们来学习exec()函数族一.exec()函数 族1. 首先我们在终端输入命令:man exec 可以看到函数的原型:#include <unistd.h>int execl(const char *path, const char *arg, ...);int execv(const char *path, char *con 阅读全文

posted @ 2012-07-16 19:54 龙沙宝石 阅读(928) 评论(0) 推荐(0) 编辑

2012年7月12日

unix学习笔记<2> 多线程 udp聊天程序 简单实例

摘要: 1 /* client_udp.c: */ 2 #include <stdio.h> 3 #include <errno.h> 4 #include <sys/types.h> 5 #include <sys/socket.h> 6 #include <netinet/in.h> 7 #include <unistd.h> 8 #include <string.h> 9 10 #define MAX_BUF_SIZE 102411 struct sockaddr_in srvaddr,clientaddr;12 阅读全文

posted @ 2012-07-12 15:07 龙沙宝石 阅读(755) 评论(0) 推荐(0) 编辑

2012年7月9日

unix学习笔记<1> read () write()

摘要: 摘自《unix环境高级编程》文件I/OSTDIN_FILENO--标准输入,一般指从键盘输入STDOUT_FILENO--标准输出,一般指输出到显示器STDERR_FILENO--标准出错输出定义函数:ssizet_t write (int fd, const *buf, size_t count)函数说明:write()会把参数buf所指的内存中的count个字节写到参数filedes所指的文件内中。返回值:成功write()会返回实际写入的字节数。当有错误发生时则返回-1,错误代码存入errno中。参数fd 可以是 STDIN_FILENO/文件,表头文件 #include<unis 阅读全文

posted @ 2012-07-09 11:23 龙沙宝石 阅读(3329) 评论(0) 推荐(1) 编辑

2012年7月6日

linux 学习之管道

摘要: #include "apue.h"#include <sys/wait.h>#define DEF_PAGER "/bin/more"int main (int argc, char *argv[]){int n;int fd[2];pid_t pid;char *pager, *argv0;char line[MAXLINE];FILE *fp;if (argc !=2)//命令行参数不为2时执行printf{printf("usage:a.out<pathmane>\n");}if ((fp = fopen 阅读全文

posted @ 2012-07-06 15:11 龙沙宝石 阅读(309) 评论(0) 推荐(0) 编辑

2012年6月26日

linux 多线程(一)条件变量

摘要: #include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <errno.h> int gnum = 0; int gsub = 100;pthread_mutex_t mutex; pthread_cond_t cond; //条件变量 void pthread_func_1 (void); void pthread_func_2 (void); int main (void) { pthread_t pt_1 = 0; pthread_t pt_2 = 0; int 阅读全文

posted @ 2012-06-26 18:21 龙沙宝石 阅读(224) 评论(0) 推荐(0) 编辑

2012年6月12日

c++线程(一)CreateEvent;CreateMutex()

摘要: #include <stdio.h>#include <string> // for STL string class#include <windows.h> // for HANDLE#include <process.h> // for _beginthread()#include <iostream>using namespace std;HANDLE g_event; HANDLE ghMutex; DWORD dwWaitResult01;class ThreadX{private: int loopStart; int l 阅读全文

posted @ 2012-06-12 20:55 龙沙宝石 阅读(2148) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7

导航