int http_post_file(const char *url, const char *user, const char *pwd, const char *filename){ assert(url != NULL); assert(user != NULL); assert(pwd !=...
分类:
Web程序 时间:
2015-04-01 17:09:09
阅读次数:
130
Android的Logcat是一个很方便的调试工具,但是log的输出又分为好几种,介于以后的学习中都会用到Log,今天提前深入了解一下: 在Android系统中,verbose和debug信息在程序被调试时显示;Information、warn、error和assert在debug和release版...
分类:
移动开发 时间:
2015-03-31 20:05:27
阅读次数:
226
第一次使用Mockito进行测试,记录一下
package com.hxt.account.mpos.service.impl;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.junit.Test;
import org.junit.runner.RunWith;
impor...
分类:
其他好文 时间:
2015-03-31 18:10:12
阅读次数:
139
// 不用库函数实现strcmp
#include
#include
int my_strcmp( char const *p,char const *q )
{
assert( ( *p != NULL ) && ( *q != NULL ) );
while( *p == *q )
{
if( *p == '\0')
{
return 0;
}
p++;
...
分类:
编程语言 时间:
2015-03-31 09:07:46
阅读次数:
213
#include #include #include "unistd.h"#include "assert.h"#include #include "sys/wait.h"#include pthread_t ntid;void printids(std::string s){ pid_t p...
分类:
编程语言 时间:
2015-03-31 00:46:35
阅读次数:
126
// 若在同一块内存中拷贝,有可能实现内存重叠,为了处理这种情况,有了增强版的memcpy,与memmov功能相似
//不怕内存重叠的memcpy
#include
#include
void * my_memmov( void * dst, void const * src, int count )
{
void * ret = dst;
assert( ( dst != NULL ...
分类:
编程语言 时间:
2015-03-30 18:46:17
阅读次数:
187
//不用库函数实现memcpy
#include
#include
void * my_memcpy ( void *dst, void const *src, int count )
{
void * ret = dst;
assert( ( dst != NULL ) && ( src != NULL ));
while( count-- )
{
*( ( char * )...
分类:
编程语言 时间:
2015-03-30 16:26:21
阅读次数:
233
一、编译安装过程优化1.减小Nginx编译后的文件大小在编译Nginx时,默认以debug模式进行,而在debug模式下会插入很多跟踪和ASSERT之类的信息,编译完成后,一个Nginx要有好几兆字节。在编译前取消Nginx的debug模式,编译完成后Nginx只有几百千字节,因此可以在编译之前,修...
分类:
其他好文 时间:
2015-03-30 12:54:03
阅读次数:
147
1、字符串反转 – strRev void strRev(char *str)
{ assert(NULL != str); int length=strlen(str); char *end=str+length-1; while(end > str) { *str=(*str)^(*end); ...
分类:
编程语言 时间:
2015-03-30 01:21:30
阅读次数:
209
该错误意思是方法调用存在歧义,先看下面这个例子:
assertEquals(10L, (Long)10);
编译器就会报出The method assertEquals(Object, Object) is ambiguous for the type Assert的错误;
10L是long型,而(Long)10是Long型。而assertEquals()是一个重载的方法,其中就有
ass...
分类:
其他好文 时间:
2015-03-29 13:40:04
阅读次数:
959