packages

How do I show the source code of an S4 function in a package?

孤街浪徒 提交于 2019-12-17 17:39:39
问题 I used the packages topGO in R to analyze gene enrichment with the following code: sampleGOdata <- new("topGOdata", description = "Simple session", ontology = "BP", allGenes = geneList, geneSel = topDiffGenes, nodeSize = 10, annot = annFUN.db, affyLib = affyLib) resultFisher <- runTest(sampleGOdata, algorithm = "classic", statistic = "fisher") allRes <- GenTable(sampleGOdata, classicFisher = resultFisher, orderBy = "fisher", ranksOf = "classicFisher",topNodes = 10) I want to see and change

java packages: cannot find symbol

狂风中的少年 提交于 2019-12-17 16:32:06
问题 I'm having a strange error. I have 2 classes in the same package but they can't find each other. From what I remember, as long as the classes are in the same package, they should be able to call each other's methods. My code looks similar to this: in A.java: package com.mypackage; public class A{ public static int read(){ //some code } } in B.java: package com.mypackage; public class B{ public static void main(String args[]){ int x = A.read(); } } and it's giving me a cannot find symbol

npm使用介绍

╄→尐↘猪︶ㄣ 提交于 2019-12-17 13:06:06
1、npm介绍 NPM是随同NodeJS一起安装的包管理工具,能解决NodeJS代码部署上的很多问题,常见的使用场景有以下几种: 允许用户从NPM服务器下载别人编写的第三方包到本地使用。 允许用户从NPM服务器下载并安装别人编写的命令行程序到本地使用。 允许用户将自己编写的包或命令行程序上传到NPM服务器供别人使用。 由于新版的nodejs已经集成了npm,所以之前npm也一并安装好了。 同样可以通过输入 "npm -v" 来测试是否成功安装。 升级npm npm install npm -g MacBookPro:Desktop zhangxm$ sudo npm install npm -g /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js + npm@6.13.2 added 22 packages from 14 contributors, removed 18 packages and updated 59 packages in 46.768s MacBookPro:Desktop zhangxm$ npm -v 6.13.2 MacBookPro

How to properly use relative or absolute imports in Python modules?

你说的曾经没有我的故事 提交于 2019-12-17 10:36:13
问题 Usage of relative imports in Python has one drawback, you will not be able to run the modules as standalones anymore because you will get an exception: ValueError: Attempted relative import in non-package # /test.py: just a sample file importing foo module import foo ... # /foo/foo.py: from . import bar ... if __name__ == "__main__": pass # /foo/bar.py: a submodule of foo, used by foo.py from . import foo ... if __name__ == "__main__": pass How should I modify the sample code in order to be

Does uninstalling a package with “pip” also remove the dependent packages?

亡梦爱人 提交于 2019-12-17 10:13:33
问题 When you use pip to install a package, all the required packages will also be installed with it (dependencies). Does uninstalling that package also remove the dependent packages? 回答1: No, it doesn't uninstall the dependencies packages: $ pip install specloud $ pip freeze figleaf==0.6.1 nose==1.1.2 pinocchio==0.3 specloud==0.4.5 $ pip uninstall specloud $ pip freeze figleaf==0.6.1 nose==1.1.2 pinocchio==0.3 As you can see all the packages are still there but not the specloud package itself.

Fast Levenshtein distance in R?

泪湿孤枕 提交于 2019-12-17 09:36:05
问题 Is there a package that contains Levenshtein distance counting function which is implemented as a C or Fortran code? I have many strings to compare and stringMatch from MiscPsycho is too slow for this. 回答1: levenshteinDist (from the RecordLinkage package) calls compiled C code. Give it a try. 回答2: And stringdist in the stringdist package does it too, even faster than levenshteinDist under certain conditions (1) 回答3: You could try stringDist from Biostrings as well 来源: https://stackoverflow

How to wildcard include JAR files when compiling?

a 夏天 提交于 2019-12-17 09:10:11
问题 I have the following in a java file (MyRtmpClient.java): import org.apache.mina.common.ByteBuffer; and ByteBuffer is inside a JAR file (with the proper directory structure of course). That jar file and others I need are in the same directory as the .java file. Then I compile with the line: javac -cp ".;*.jar" MyRtmpClient.java But I get the error: MyRtmpClient.java:3: package org.apache.mina.common does not exist import org.apache.mina.common.ByteBuffer; How can I include jar files in my

How to wildcard include JAR files when compiling?

▼魔方 西西 提交于 2019-12-17 09:10:06
问题 I have the following in a java file (MyRtmpClient.java): import org.apache.mina.common.ByteBuffer; and ByteBuffer is inside a JAR file (with the proper directory structure of course). That jar file and others I need are in the same directory as the .java file. Then I compile with the line: javac -cp ".;*.jar" MyRtmpClient.java But I get the error: MyRtmpClient.java:3: package org.apache.mina.common does not exist import org.apache.mina.common.ByteBuffer; How can I include jar files in my

Only download sources of a package and all dependencies

别来无恙 提交于 2019-12-17 08:21:32
问题 I am wondering if there's a way to use install.packages() or other related functions to do the following: only download the sources (i.e. tar.gz files) of the specified packages and all their dependencies into a specified folder (on Windows). One reason to do this is: say I have a Linux account that is not enabled for internet access. In order to install the packages on the Linux machine, I would first download all the needed sources on my Windows machine, then ftp them over to the Linux

Can I use __init__.py to define global variables?

隐身守侯 提交于 2019-12-17 08:07:44
问题 I want to define a constant that should be available in all of the submodules of a package. I've thought that the best place would be in in the __init__.py file of the root package. But I don't know how to do this. Suppose I have a few subpackages and each with several modules. How can I access that variable from these modules? Of course, if this is totally wrong, and there is a better alternative, I'd like to know it. 回答1: You should be able to put them in __init__.py . This is done all the