摘要: 导入neuroph-core-2.93.jar neuroph-imgrec-2.93.jar neuroph-ocr-2.93.jar及slf4j 阅读全文
posted @ 2017-06-29 22:03 cnlixl 阅读(484) 评论(0) 推荐(0) 编辑
摘要: 在使用Flask的Wtforms时利用了以下代码来建立表单。 在实际使用中发现当输入为0时,无法通过表单验证。 即“0”无法通过DataRequired的验证。 该问题疑似wtforms的bug,参照以下。 https://github.com/wtforms/wtforms/issues/100 阅读全文
posted @ 2017-04-13 16:57 cnlixl 阅读(3639) 评论(0) 推荐(0) 编辑
摘要: 最近项目要求由Solaris 32-bit移植到Solaris 64-bit上。为防止意料外的符号扩展发生,在扩展时需使用显示转换。在此对c语言符号扩展规则总结如下。1 使用"="进行类型转换时,符号扩展规则如下。 ·"="右端为无符号类型,向高精度扩展时一直为无符号扩展。 例:unsigned int ui_a = 0x80000000; long l_a = ui_a; ui_a(32-bit unsigned int)向long(64-bit)转换时,ui_a转换为0x0000000080000000 ... 阅读全文
posted @ 2013-09-13 22:17 cnlixl 阅读(1177) 评论(0) 推荐(0) 编辑
摘要: //递归实现获取对应目录下的子目录及文件 1 package com.lixl.test; 2 3 import java.io.*; 4 5 public class FileList { 6 7 public static void main(String[] args){ 8 9 File f = new File("D:/eclipse");10 int level = 0;11 12 System.out.println(f.getName());13 level+... 阅读全文
posted @ 2012-08-02 22:57 cnlixl 阅读(263) 评论(0) 推荐(0) 编辑
摘要: errno(需include errno.h),当API调用出错时保留最后一次出错信息,在unix系统下作为一种常用的调试手段。但是errno是一个数字,代表的具体含义还要到errno.h中去阅读宏定义,而每次查阅是一件很繁琐的事情。有下面几种方法可以方便的得到错误信息(1)void perror(const char *s)函数说明perror ( )用来将上一个函数发生错误的原因输出到标准错误(stderr),参数s 所指的字符串会先打印出,后面再加上错误原因 字符串。此错误原因依照全局变量 errno 的值来决定要输出的字符串。(2) char *strerror(int errno)将 阅读全文
posted @ 2012-08-02 22:02 cnlixl 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 以下代码为什么会出错呢?不理解啊,只能研究研究了。 1 void main(){ 2 unsigned long i =0,*p,*p1; 3 p = (unsigned long *)malloc(10000); 4 p1 = p; 5 6 for(i = 0;i < 9999;i++){ 7 *p1 = 0x100; 8 p1++; 9 }10 free(p);11 }VC运行时,貌似是进入了死循环。难道是类型不兼容造成了什么问题?待解。。。 阅读全文
posted @ 2012-08-01 08:09 cnlixl 阅读(122) 评论(2) 推荐(0) 编辑
摘要: 求斐波纳契数列第n个数的两种实现方法。 1 public class TestFibo { 2 3 public static void main(String[] args){ 4 System.out.println(f(7)); 5 System.out.println(fn(7)); 6 } 7 8 //递归实现 9 public static long f(int index){10 11 if(index<1){12 System.out.p... 阅读全文
posted @ 2012-08-01 07:55 cnlixl 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 用冒泡算法实现对日期的排序 1 //日期类,包含年月日的信息。重写toString 2 //方法,输出年月日信息。 3 public class Date { 4 5 public int year ,month,day; 6 7 public Date(int year,int month,int day){ 8 this.year = year; 9 this.month = month;10 this.day = day;11 }12 13 public String toString()... 阅读全文
posted @ 2012-08-01 07:47 cnlixl 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 二分查找的实现。算法要求1.必须采用顺序存储结构2.必须按关键字大小有序排列。算法复杂度为o(logn),一般只要被查找的元素大于或等于序列中的最大元素,算法总要执行最大次数的比较。对于一个大小为n的排序数组,算法BINARYSEARCH执行的比较的最大次数为[logn]+1。 1 public class BinarySearch { 2 3 public static int BinarySearchMethod(int[] before,int target){ 4 int low = 0,high = before.length - 1,mid = 0,j =... 阅读全文
posted @ 2012-07-31 22:41 cnlixl 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 基础的java练习,数3退1,数组方式的实现。 1 public class Count3Quit { 2 3 public static void main(String[] args){ 4 5 boolean[] arr = new boolean[500]; 6 int leftCount = arr.length; 7 int count = 0; 8 int index = 0; 9 10 for(int i = 0;i < arr.length;i++){1... 阅读全文
posted @ 2012-07-31 22:37 cnlixl 阅读(207) 评论(0) 推荐(0) 编辑