随笔分类 - JAVA
摘要:本文将从设计理念层面:abstract class和interface所反映出的设计理念,来分析一下二者的区别。作者认为,从这个层面进行分析才能理解二者概念的本质所在。abstarct class在Java语言中体现了一种继承关系,要想使得继承关系合理,父类和派生类之间必须存在"is a"关系,即父类和派生类在概念本质上应该是相同的。对于interface 来说则不然,并不要求interface的实现者和interface定义在概念本质上是一致的,仅仅是实现了interface定义的契约而已。为了使论述便于理解,下面将通过一个简单的实例进行说明。考虑这样一个例子,假设在我们
阅读全文
摘要:上贴虽然失败,但是也有收获。上贴失败的原因是和ndk自己带的例子有关。备受折磨后,决定重新写个Ndk的程序。用eclipse新建一个android工程,其实不是android工程也可以。代码如下:package com.sun;import android.app.Activity;import android.os.Bundle;public class JNITest extends Activity { public native int version(); /** Called when the activity is first created. */ @Override publ
阅读全文
摘要:此帖转载,和该篇作者一样,编译完后不知道怎么使用。 marke to keep in mind.(此贴后来验证失败,不过还是给了很大的帮助),下帖是测试成功贴。要在android上用ffmpeg首先得奖ffmpeg工程移植到android上,这里就要用到ndk把这个开源工程编译成一个后缀为so的库,这个步骤这里就不多说了 网上的资料也挺多的,我是按照:http://www.cnblogs.com/scottwong/archive/2010/12/17/1909455.html在ubantu环境下编译的,你按照教程上一步一步来应该都没有问题,顺便给下在windows下编译ffmpeg的教程:h
阅读全文
摘要:使用yum安装ffmpeg出现后,编译example.c时老是出问题。使用源码重新安装,编译1000行代码tutorial01.c 时出错。使用编译实例文件里面的编译命令失败。出现undefined reference to `img_convert'错误。解决方法:使用下面两个函数代替img_convert(。。。。): img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->
阅读全文
摘要:ffmpeg 编译好像成功了。但是启动ffmpeg时失败了。错误:ffmpeg: relocation error: /usr/local/lib/libavfilter.so.1: symbol sws_isSupportedInput, version LIBSWSCALE_0 not defined in file libswscale.so.0 with link time reference应该是依赖的包有问题,网上找资料,很少,几乎没有参照。只能重新编译。后来发现下面的帖子,使用Yum安装。成功。http://gofedora.com/how-to-install-ffmpeg-f
阅读全文
摘要:public static void main(String[] args){ String string="测试<>《》!*(^)$%~!@#$…&%¥—+=、。,;‘’“”:·`文本"; System.out.println(string.replaceAll("\\pP|\\pS", ""));}输出结果为:测试文本参考的主要内容如下:Unicode 编码并不只是为某个字符简单定义了一个编码,而且还将其进行了归类。\pP 其中的小写 p 是 property 的意思,表示 Unicode
阅读全文
摘要:本文目标30分钟内让你明白正则表达式是什么,并对它有一些基本的了解,让你可以在自己的程序或网页里使用它。如何使用本教程最重要的是——请给我30分钟,如果你没有使用正则表达式的经验,请不要试图在30秒内入门——除非你是超人 :)别被下面那些复杂的表达式吓倒,只要跟着我一步一步来,你会发现正则表达式其实并没有你想像中的那么困难。当然,如果你看完了这篇教程之后,发现自己明白了很多,却又几乎什么都记不得,那也是很正常的——我认为,没接触过正则表达式的人在看完这篇教程后,能把提到过的语法记住80%以上的可能性为零。这里只是让你明白基本的原理,以后你还需要多练习,多使用,才能熟练掌握正则表达式。除了作为入
阅读全文
摘要:In XPath, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes.XPath TerminologyNodesIn XPath, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes. X
阅读全文
摘要:先贴代码:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package bookmark.model;import java.util.Properties;import org.springframework.mail.SimpleMailMessage;import org.springframework.mail.javamail.JavaMailSenderImpl;public class SimpleEmail { priv
阅读全文
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->int PTOsetApiOpt(int iOpt,void* lpValue,int iLen)Parameters: iOpt: intlpData: address from which data should be read.iLen: length of datareturns int values : 0 as success or -1 as failure.For examp
阅读全文
摘要:public class LabeledFor { public static void main(String[] args) { int i = 0; outer: // Can’t have statements here for (; i<10;i++) { // infinite loop inner: // Can’t have statements here for (; i < 10; i++) { out.print("i = " + i); if (i == 2) { out.println("continue"); co
阅读全文
摘要:If you shift a char, byte, or short, it will be promoted to int before the shift takes place, and the result will be an int. Only the five low-order bits of the right-hand side will be used. This prevents you from shifting more than the number of bits in an int. If you’re operating on a long, you’ll
阅读全文
浙公网安备 33010602011771号