library_library文件夹 - CSDN
精华内容
参与话题
  • Library

    2014-12-03 23:39:14
    将一个应用打包为Library 设置工程A,右键->Properties->Android,将Is library项选中,然后Apply。 另外一个应用实现 设置工程B,右键->Properties->Android,在Library中,点击Add按 钮,将A工程加入,...

    将一个应用打包为Library  

    设置工程A,右键->Properties->Android,将Is library项选中,然后Apply。

    另外一个应用实现

    设置工程B,右键->Properties->Android,在Library中,点击Add按 钮,将A工程加入,然后Apply。此时在B中就引入了A中的资源和代码,这些资源和代码都可以直接调用。需要注意的是,因为A已经不再是一个完整的 Android应用,而是一个类库工程,所以有一些内容还需要在B中配置一下。比如A中有lib库引用,则B中也要加入该lib库;比如A中的 AndroidManifest.xml文件的内容,在B的AndroidManifest.xml文件中也要相应加上。。。



    二、引用Library库项目:
     
    右键项目文件夹,点击Properties,选择Android,然后点击Add,选择你的库项目,然后Apply,OK。
     
    需要注意的是,在你的项目AndroidManifest.xml中仍然需要声明库项目中需要用到的activity、service、receiver等组件。












    展开全文
  • R语言中library()和require()的区别

    千次阅读 2017-08-06 15:59:20
    While I was sitting in a conference room at UseR! 2014, I started counting the number of times that require() was used in the presentations, and would rant about it after I counted to ten....

    While I was sitting in a conference room at UseR! 2014, I started counting the number of times that require() was used in the presentations, and would rant about it after I counted to ten. With drums rolling, David won this little award (sorry, I did not really mean this to you).

    After I tweeted about it, some useRs seemed to be unhappy and asked me why. Both require() and library() can load (strictly speaking, attach) an R package. Why should not one use require()? The answer is pretty simple. If you take a look at the source code of require (use the source, Luke, as Martin Mächler mentioned in his invited talk), you will see that require() basically means “try to load the package using library() and return a logical value indicating the success or failure”. In other words, library() loads a package, and require() tries to load a package. So when you want to load a package, do you load a package or try to load a package? It should be crystal clear.

    One bad consequence of require() is that if you require('foo') in the beginning of an R script, and use a function bar() in the foo package on line 175, R will throw an error object “bar” not found if foo was not installed. That is too late and sometimes difficult for other people to understand if they use your script but are not familiar with the foopackage – they may ask, what is the bar object, and where is it from? When your code is going to fail, fail loudly, early, and with a relevant error message. require() does not signal an error, and library() does.

    Sometimes you do need require() to use a package conditionally (e.g. the sun is not going to explode without this package), in which case you may use an if statement, e.g.

    if (require('foo')) {
      awesome_foo_function()
    } else {
      warning('You missed an awesome function')
    }
    

    That should be what require() was designed for, but it is common to see R code like this as well:

    if (!require('foo')) {
      stop('The package foo was not installed')
    }
    

    Sigh.

    • library('foo') stops when foo was not installed
    • require() is basically try(library())

    Then if (!require('foo')) stop() is basically “if you failed to try to load this package, please fail”. I do not quite understand why it is worth the circle, except when one wants a different error message with the one from library(), otherwise one can simply load and fail.

    There is one legitimate reason to use require(), though, and that is, “require is a verb and library is a noun!” I completely agree. require should have been a very nice name to choose for the purpose of loading a package, but unfortunately… you know.

    If you take a look at the StackOverflow question on this, you will see a comment on “package vs library” was up-voted a lot of times. It used to make a lot of sense to me, but now I do not care as much as I did. There have been useRs (including me up to a certain point) desperately explaining the difference between the two terms package and library, but somehow I think R’s definition of a library is indeed unusual, and the function library()makes the situation worse. Now I’m totally fine if anyone calls my packages “libraries”, because I know what you mean.

    Karthik Ram suggested this GIF to express “Ah a new library, but requireNoooooo“:

    Since you have read the source code, Luke, you may have found that you can abuse require() a bit, for example:

    > (require(c('MASS', 'nnet')))
    c("Loading required package: c", "Loading required package: MASS",
      "Loading required package: nnet")
    Failed with error:  ‘'package' must be of length 1’
    In addition: Warning message:
    In if (!loaded) { :
      the condition has length > 1 and only the first element will be used
    [1] FALSE
    
    > (require(c('MASS', 'nnet'), character.only = TRUE))
    c("Loading required package: MASS", "Loading required package: nnet")
    Failed with error:  ‘'package' must be of length 1’
    In addition: Warning message:
    In if (!loaded) { :
      the condition has length > 1 and only the first element will be used
    [1] FALSE
    
    > library(c('MASS', 'nnet'), character.only = TRUE)
    Error in library(c("MASS", "nnet"), character.only = TRUE) : 
      'package' must be of length 1
    

    So require() failed not because MASS and nnet did not exist, but because of a different error. As long as there is an error (no matter what it is), require() returns FALSE.

    One thing off-topic while I’m talking about these two functions: the argument character.only = FALSE for library() and require() is a design mistake in my eyes. It seems the original author(s) wanted to be lazy to avoid typing the quotes around the package name, so library(foo) works like library("foo"). Once you show people they can be lazy, you can never pull them back. Apparently, the editors of JSS (Journal of Statistical Software) have been trying to promote the form library("foo")and discourage library(foo), but I do not think it makes much sense now or it will change anything. If it were in the 90’s, I’d wholeheartedly support it. It is simply way too late now. Yes, two extra quotation marks will kill many kittens on this planet. If you are familiar with *nix commands, this idea is not new – just think about tar -z -x -ftar -zxf, and tar zxf.

    One last mildly annoying issue with require() is that it is noisy by default, because of the default quietly = FALSE, e.g.

    > require('nnet')
    Loading required package: nnet
    > require('MASS', quietly = TRUE)
    

    So when I tell you to load a package, you tell me you are loading a package, as if you had heard me. Oh thank you!






    转载自:https://yihui.name/en/2014/07/library-vs-require/


    相关链接:http://www.cnblogs.com/todoit/archive/2012/10/24/2736514.html


    展开全文
  • 什么是库(library)

    千次阅读 2010-06-24 14:30:00
    什么叫程序库 所谓程序库,一般是软件作者为了发布方便、替换方便或二次开发目的,而发布的一组可以单独与应用程序进行compile time或runtime链接的二进制可重定位目标码文件。通俗一点说,所谓一个库,就是一...

    什么叫程序库

    所谓程序库,一般是软件作者为了发布方便、替换方便或二次开发目的,而发布的一组可以单独与应用程序进行compile time或runtime链接的二进制可重定位目标码文件。通俗一点说,所谓一个库,就是一个文件,这个文件可以在编译时由编译器直接链接到可执行程序中,也可以在运行时由操作系统的runtime enviroment根据需要动态加载到内存中。一组库,就形成了一个发布包,当然,具体发布多少个库,完全由库提供商自己决定。

    什么是lib,什么是dll,什么是.a,什么是.so,什么是静态库,什么是动态库

    所谓静态库,就是在静态编译时由编译器到指定目录寻找并且进行链接,一旦链接完成,最终的可执行程序中就包含了该库文件中的所有有用信息,包括代码段、数据段等。所谓动态库,就是在应用程序运行时,由操作系统根据应用程序的请求,动态到指定目录下寻找并装载入内存中,同时需要进行地址重定向。 win32平台下,静态库通常后缀为.lib,动态库为.dll linux平台下,静态库通常后缀为.a,动态库为.so 从本质上来说,由同一段程序编译出来的静态库和动态库,在功能上是没有区别的。不同之处仅仅在于其名字上,也就是“静态”和“动态”。由上面的介绍不难看出,相对于动态库,静态库的优点在于直接被链接进可执行程序中,之后,该可执行程序就不再依赖于运行环境的设置了(当然仍然会依赖于 CPU指令集和操作系统支持的可执行文件格式等硬性限制)。而动态库的优点在于,用户甚至可以在程序运行时随时替换该动态库,这就构成了动态插件系统的基础。具体使用静态库和动态库,由程序员根据需要自己决定。

    补充说明

    另外,需要说明的一点是,从底层实现上,动态库的效率可能会比静态库稍差一点点,注意,这里用了“可能”二字,具体差不差,还得看写程序的人。之所以可能会差,主要原因在于,程序总无法直接调用动态库中的函数符号,而只能通过调用操作系统的runtime enviroment接口来动态载入某个函数符号,同时获得该函数符号在内存中的地址,将其保存为函数指针进行调用,这就在函数调用时增加了一次间接寻址的过程。

    还是那句话,希望大家都能深入opencv源码库中去,不要仅仅满足于会调几个API,这样很难对自己有提高的。深入进去读源码,看看人家是怎么组织软件架构的,怎么划分模块的。实际上,如果任何一个软件体系的层次模块划分足够清晰和灵活的话,移植性就不会成为很大的问题,无非就是字节对齐、部分算法利用特殊指令集进行优化之类的,这些改动应该仅限于局部调整,而不用全盘重写的。软件架构,很重要的一条就是open-close 原则,要清楚哪些是可变的哪些是不可变的。就像上面,将来会发生变化的算法,就可以考虑放到动态库中,以免将来程序统一全部升级。

    另外,在移植软件的过程中,保持接口不变是有多重含义的,我们通常知道的是:

    1. 函数、变量名称不变
    2. 函数、变量语法属性不变(比如一个声明为C形式的函数,必须以C形式对其进行调用,否则由于重载特性会找不到函数名)
    3. 函数返回值类型不变
    4. 函数参数个数不变
    5. 函数参数类型不变

    这里,常常被人们遗忘的,也是最重要的一点是:

    保持函数语义不变

    这是什么意思,对于一段程序,除了词法分析、语法推导之外,还有很重要的一条就是语义分析。简单来说,对于一个函数,必须保持移植前后,该函数的返回值含义不变、参数含义不变、函数内部行为的外部表现不变。忽视其中任意一条,都会造成上层应用程序的行为变为未定义,从而移植失败。

    展开全文
  • 下表显示根据要使用的运行时库应忽略的库。 若要使用此运行时库 请忽略这些库  单线程 (libc.lib) libcmt.lib、msvcrt.lib、libcd.lib、libcmtd.lib、msvcrtd.lib  多线程 (libcmt.lib) libc.lib、msvcrt.lib、lib...

    下表显示根据要使用的运行时库应忽略的库。

    若要使用此运行时库 请忽略这些库 
    单线程 (libc.lib) libcmt.lib、msvcrt.lib、libcd.lib、libcmtd.lib、msvcrtd.lib 
    多线程 (libcmt.lib) libc.lib、msvcrt.lib、libcd.lib、libcmtd.lib、msvcrtd.lib 
    使用 DLL 的多线程 (msvcrt.lib) libc.lib、libcmt.lib、libcd.lib、libcmtd.lib、msvcrtd.lib 
    调试单线程 (libcd.lib) libc.lib、libcmt.lib、msvcrt.lib、libcmtd.lib、msvcrtd.lib 
    调试多线程 (libcmtd.lib) libc.lib、libcmt.lib、msvcrt.lib、libcd.lib、msvcrtd.lib 
    使用 DLL 的调试多线程 (msvcrtd.lib) libc.lib、libcmt.lib、msvcrt.lib、libcd.lib、libcmtd.lib 

    例如,如果收到此警告,并希望创建使用非调试、单线程版本的运行时库的可执行文件,可以将下列选项
    与链接器一起使用:

    /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib 
    /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib

     

    多线程调试(MTd):

    提示:默认库“MSVCRTD”与其他库的使用冲突

    msvcrtd.lib 与 libcmtd.lib 产生冲突

     

    解决方法有2个:

     

    1.右击工程 - 属性 ”配置属性 - 链接器 - 输入 - 忽略特定库“,添加 ”libcmtd.lib“

     

    2.右击工程 - 属性 ”配置属性 - 链接器 - 命令行” 添加:  /NODEFAULTLIB:"libcmtd.lib"

    展开全文
  • 自己写简单的Library

    2018-08-20 13:52:16
    在实际的工作中,肯定会发现有些功能RF自身的Library,或者第三方的Library都无法实现,这个时候我们就得自己写library来实现它了。 不要想的太复杂,太难,其实很简单。 下面我们举例子来演示吧一.编写Library 你有...
  • library

    2019-07-28 01:00:07
    NULL 博文链接:https://udukwilliam.iteye.com/blog/770674
  • library.rar

    2019-12-05 11:34:00
    weui引入的css和js
  • RU FORUM SitemapError report DOWNLOAD ...Libgen.io - 2M (main)Gen.lib.rus.ec - 2M (catalog only)Libgen.pwB-OK.org (BookZZ.org, BookOS.org, BookZa.org)BookFI.netI2P - 2M ...P2P...
  • 笔者使用的Navicat Premium 12启动界面截屏: 请注意是64位的。...连接Oracle时提示“oracle library is not loaded”。 解决方法: 1.前往“http://www.oracle.com/technetwork/database/database-te...
  • The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:XXXX出现原因分析:Tomcat建议使用apache的apr,来更好的运行...
  • 昨天在使用docker 时,将 image 文件从仓库抓取到本地一直报错,... [root@archlinux ~]# docker image pull library/hello-world Using default tag: latest Error response from daemon: Get https://registr...
  • Android Support Library介绍

    千次阅读 2016-06-21 10:43:21
    我们知道,android自第一代发布以来,它的版本更新迭代的速度可以说是非常快的,但是android又是一个移动操作系统,是面对所有的用户的,并不是一个行业专用的系统,这就是要求这个系统在频繁的更新中,必须使得已经...
  • Oracle Library Cache Lock 解决思路

    万次阅读 2012-09-07 23:26:27
     Library Cache Lock Library cacheHandle 里保存了lock 和 pin 的信息。而且在Library cache handle 和child cursor 上都有lock 和pin。它们称为library cache lock和library cache pin。 Library cachelock/pin...
  • Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1317, in do_open encode_chunked=req.has_header('Transfer-encodi...
  • 解决Could not load dynamic library 'libcudart.so.10.0'的问题

    万次阅读 多人点赞 2019-10-15 19:26:09
    问题表现与分析 在安装了CUDA和CUDNN还有Tensorflow最新的2.0正式版本后,我在使用Pycharm写TF代码并运行时,遇到这样的问题 主要表现就是提示找不到动态库文件,扫了一眼文件名,都是CUDA的库文件,那怎么会说...
  • gcc - shared library vs static library

    千次阅读 2015-04-14 16:47:42
    Shared libraries and static libraries Although the example program above has been successfully compiled and linked, a final step is needed before being able to load and run the executable file.
  • Oracle Library Cache 的 lock 与 pin 说明

    千次阅读 2011-07-28 16:29:23
    一. 相关的基本概念之前整理了一篇blog,讲了Library Cache 的机制,参考: Oracle Library cache 内部机制 说明 http://blog.csdn.net/tianlesoftware/article
  • Android Library的创建及使用详解

    万次阅读 2018-01-25 12:18:56
    Android Library和Android APP、Java Library的区别 Android Library在目录结构上与Android App相同,它能包含构建APP所需的一切(如源代码、资源文件、Android Manifest)。Android App最终被编译打包成能在...
  • 共享池部分-library cache、library cache object handle、library cache object、shared cursor、session cursor和解析一些基本概念 Posted on 2015 年 1 月 7 日 by xiaoyu 关于cursor是oracle中开发...
  • C Runtime Library 的来历

    千次阅读 2015-10-11 17:45:59
    运行时库就是C Run-Time Library,是C而非C++语言世界的概念。取这个名字就是因为你的C程序运行时需要这些库中的函数。 C Run-Time Library里面含有初始化代码,还有错误处理代码(例如divide by zero处理)。你写的...
1 2 3 4 5 ... 20
收藏数 978,159
精华内容 391,263
关键字:

library