packages

Modules vs Layers in Java package structure

拈花ヽ惹草 提交于 2019-12-05 23:37:17
问题 I used to put everything in packages like this: com.company.app.module1 com.company.app.module2 But it has made package-based AOP pointcuts difficult, and resulted in huge packages that need an IDE to make sense of. So now I realize I need a deeper package structure, but I am constantly torn. Give modules preference, like this? com.company.app.module1.domain com.company.app.module1.logic com.company.app.module1.persistence com.company.app.module2.domain com.company.app.module2.logic com

Can't use Jupyter Notebook: jsonschema apparently missing

我怕爱的太早我们不能终老 提交于 2019-12-05 23:02:23
问题 When using a an Anaconda environment, I can't start Jupyter to work in a notebook. I can do so without the environment, but I need to be able to use the environment. Here's what I do and the errors I get: ben@ben-K60IJ:~/surveillance_sound_classifier/surveillance_sound_classifier$ source activate EECS352 discarding /home/ben/anaconda/bin from PATH prepending /home/ben/anaconda/envs/EECS352/bin to PATH (EECS352)ben@ben-K60IJ:~/surveillance_sound_classifier/surveillance_sound_classifier$

package-info.java package annotations to affect all classes, including ones in sub packages

£可爱£侵袭症+ 提交于 2019-12-05 22:38:21
I want to apply an annotation on all of my classes and I am trying the best way to do so. So far I am stuck with the package-info.java file that can annotate a whole package, but not the class files contained in the sub-packages. Is there a more efficient way other than adding 100 identical package-info.java files in my project that only contain a single annotation? thanks It looks like there is no way to do this. I have added a static analysis checkstyle check for those package-info.java to make sure they are always there. See: http://checkstyle.sourceforge.net/config_javadoc.html for more

R语言数据挖掘:词云的绘制

冷暖自知 提交于 2019-12-05 22:37:50
最近的作业是用爬虫扒数据,自己探索做分析。 今天先把项目的文字云素材部分分享一下。 if ( ! require (devtools)) install . packages( 'devtools' ) devtools ::install_github ( "lchiffon/wordcloud2" ,force = TRUE ) 报错:没有htmltools包 找了网上的教程,修改为: ibrary(RCurl) library (httr) set_config( config( ssl_verifypeer = 0L ) ) if (! require (devtools)) install.packages( 'devtools' ) devtools::install_github( "lchiffon/wordcloud2" ,force = TRUE ) 载入成功。 library(wordcloud2) wordcloud2(demoFreq, size = 1 ,shape= 'star' ) wordcloud2(demoFreqC, size = 2 , fontFamily = "微软雅黑" , color = "random-light" ,background = "grey" ) 报错:不存在“yaml”程序包 install.packages(

Eclipse | Packge turns into a directory, breaks my whole project

寵の児 提交于 2019-12-05 21:55:52
So the issue i am having is extremely weird. When i have a preexisting project set up (and am moving it from computer A to computer B). I make a new project and import it the normal way. It is very, very package based and there are around 30-40 packages. Two packages are made into directories instead of packages. For example, instead of org.project1.tools.stuff it is org/project1/tools/stuff. I have checked the code, at the top it goes package org.project1.tools.stuff and then the imports and so on. Since it is in a directory listing and NOT in my actual packages, it is severely breaking my

Protected members in a superclass inaccessible by indirect subclass in Java

社会主义新天地 提交于 2019-12-05 21:26:02
Why is it that in Java, a superclass' protected members are inaccessible by an indirect subclass in a different package? I know that a direct subclass in a different package can access the superclass' protected members. I thought any subclass can access its inherited protected members. EDIT Sorry novice mistake, subclasses can access an indirect superclasses' protected members. Perhaps you're a little confused. Here's my quick demo and shows an indirect subclass accessing a protected attribute: // A.java package a; public class A { protected int a; } // B.java package b; //<-- intermediate

Namespaces in C# vs imports in Java and Python

家住魔仙堡 提交于 2019-12-05 19:11:48
问题 In the Java and Python world, you look at a source file and know where all the imports come from (i.e. you know in which file the imported classes are defined). For example: In Java: import javafoo.Bar; public class MyClass { private Bar myBar = new Bar(); } You immediately see that the Bar-class is imported from javafoo. So, Bar is declared in /javafoo/Bar.java In Python import pythonbaz from pythonfoo import Bar my_bar = Bar() my_other = pythonbaz.Other() Here, it is clear that Bar comes

os 获取目录下的所有目录 和 目录下所有文件方法

半城伤御伤魂 提交于 2019-12-05 18:17:39
获取目录下的所有目录( 包括各子目录中的目录 ) import os i=0 for root,dirs,files in os.walk('D:\Desktop'): for dir in dirs: print dir i+=1 print i 获取目录下所有文件方法( 包括 各 子目录中的文件 ) import os i=0 for root,dirs,files in os.walk('D:\Desktop'): for f in files: print file i+=1 print i for list_all in os.walk(" D:\Desktop "): print list_all for root,dirs,files in os.walk("D:\Desktop"): print root,dirs,files os.walk(" D:\Desktop ")返回的是生成器 list_all是元组,元组第一项是 字符串 ,为目录路径。元组第二项是 列表 ,是第一项目录中的所有目录(只是第一项次一层的而已)。第三项是一个 列表 ,为该目录中所有的文件。 import os.path path = '/home/vamei/doc/file.txt' print(os.path.basename(path)) # 查询路径中包含的文件名 print(os

Install package with separate source directory in editable mode

冷暖自知 提交于 2019-12-05 16:16:40
Situation This is the structure of an example package: $ tree Foo/ Foo/ ├── setup.py └── src ├── bar.py └── __init__.py The package's name shall be foo however the package's source files are placed in the src folder. The files' contents are: setup.py: from setuptools import setup setup( name='foo', version='1', packages=['foo'], package_dir={'foo': 'src'} ) __init__.py: from .bar import bar print(bar) bar.py: bar = 1 Problem When doing pip install Foo everything is fine and I can use the package as I'd expect: >>> import foo 1 However when I install the package in editable mode ( pip install

sudo apt update报错

試著忘記壹切 提交于 2019-12-05 13:45:29
在Ubuntu系统下,使用sudo apt-get update有时会出现“W: 无法下载 http://cn.archive.ubuntu.com/ubuntu/.... 校验和不符”, xj@xjVir:~/test$ sudo apt-get update 获取:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] 获取:2 http://cn.archive.ubuntu.com/ubuntu bionic InRelease [242 kB] 获取:3 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [573 kB] 获取:4 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [404 kB] 错误:2 http://cn.archive.ubuntu.com/ubuntu bionic InRelease 连接超时 [IP: 91.189.91.24 80] 获取:5 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB