在进程一开始运行,就自动打开了三个对应设备的文件,它们是标准输入、输出、错误流,分别用全局文件指针stdin、stdout、stderr表示,对应的文件描述符为0,1,2;stdin具有可读属性,缺省情况下是指从键盘的读取输入,stdout和stderr具有可写属性,缺省情况下是指向屏幕输出数据。
将文件路径转化为文件指针:
#include //头文件包含
FILE *fopen(...
分类:
编程语言 时间:
2014-06-30 10:44:03
阅读次数:
176
Linux下Memcached的安装步骤,如果出现/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory异常在/etc/ld.so.conf中加入/usr/local/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可。...
分类:
系统相关 时间:
2014-06-30 09:20:50
阅读次数:
320
最近公司产品需要增加一个功能,就是版本自动更新,使用apt-get 实现。apt-get 软件源配置的方法,参见本人资源里的共享。下面是代码中作为升级的一部分。 FILE *fp;
char buffer[256];
char source_ok[] = "Reading package lists...";
if(0 > system("mv -f /etc/apt/sources....
分类:
其他好文 时间:
2014-06-30 08:37:47
阅读次数:
228
这篇打算直接告诉大家怎么用吧,其实这个也不是很难的框架,大致使用过程如下:
// 获取缓存图片目录
File cacheDir = StorageUtils.getOwnCacheDirectory(activity,
"imageloader/Cache");
ImageLoaderConfiguration config = new ImageLoaderConfigur...
分类:
移动开发 时间:
2014-06-30 08:13:12
阅读次数:
289
HDU 1557 权利指数 状态压缩 暴力
ACM
题目地址:HDU 1557 权利指数
题意:
中文题,不解释。
分析:
枚举所有集合,计算集合中的和,判断集合里面的团体是否为关键团队。
代码:
/*
* Author: illuz
* File: 1557.cpp
* Create Date: 2014-06-28 14:...
分类:
其他好文 时间:
2014-06-30 08:02:51
阅读次数:
175
一、文件:
在IO包中唯一与文件相关的类就是 File类。
File类中常用的常量和方法
1、创建文件:
指定路径和将要创建的文件名字以及类型;
然后调用 createNewFile()方法
File file = new File("D:"+File.separator+"MyJavaProgram"+File.separator+"hel...
分类:
编程语言 时间:
2014-06-30 07:41:22
阅读次数:
290
Linux下Nginx的安装 如果出现:error: 'ngx_http_file_cache_node_t' has no member named 'length'异常,可能是ngx_cache_purge-2.1.tar.gz版本太旧导致...
分类:
系统相关 时间:
2014-06-30 00:11:43
阅读次数:
401
格式化读写:
#include
int printf(const char *format, ...); //相当于fprintf(stdout,format,…);
int scanf(const char *format, …);
int fprintf(FILE *stream, const char *format, ...); //...
分类:
编程语言 时间:
2014-06-29 23:20:21
阅读次数:
328
题目
Given an absolute path for a file (Unix-style), simplify it.
For example,
path = "/home/", => "/home"
path = "/a/./b/../../c/", => "/c"
Corner Cases:
Did you consider the case w...
分类:
其他好文 时间:
2014-06-29 23:19:26
阅读次数:
223
前言
本文记录一个Java层与JNI层参数与数据交互的应用程序开发过程,为实现一个功能完整的带Java与JNI的应用程序打下基础。本文假设读者已搭建好Android的Eclipse与NDK开发环境,包括通过ADB连接手机的配置。
1. 构建基本的Android应用程序
1.1 引导界面配置
打开Eclipse,"File"->"New"->"Andro...
分类:
移动开发 时间:
2014-06-29 23:12:14
阅读次数:
298