packages interview questions
Top packages frequently asked interview questions
I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2.
How can I install pip with Python 3?
Source: (StackOverflow)
Is there a straightforward way to find all the modules that are part of a python package? I've found this old discussion, which is not really conclusive, but I'd love to have a definite answer before I roll out my own solution based on os.listdir().
Source: (StackOverflow)
I'm new to a team working on a rather large project, with lots of components and dependencies. For every component, there's an interfaces
package where the exposed interfaces for that component are placed. Is this a good practice?
My usual practice has always been interfaces and implementations go in the same package.
Source: (StackOverflow)
Is it possible to find all classes or interfaces in a given package? (Quickly looking at e.g. Package
, it would seem like no.)
Source: (StackOverflow)
Recently I've installed brew and I was wondering if there is a list of available packages somewhere in the web.
Source: (StackOverflow)
OK here's what I would like: in the Eclipse package explorer, I see the following: (dot represents a clickable arrow that I can use to expand the folder)
- PROJECT
- Source Folder
- Package
- Package.SubPackage
- Package.OtherSubPackage
- Package.OtherSubPackage.VerySubPackage
- OtherPackage
- OtherPackage.SubPackage
Long story short, I want to have many packages, each with many subpackages, in a source folder (and several source folders, so making more won't solve the problem)--so on the order of a couple hundred packages per source folder--ten to twenty packages each with fifteen subpackages. Therefore, I want the hierarchy to look like this:
- PROJECT
- Source Folder
- Package
Class
- Package.SubPackage
- Package.OtherSubPackage
- Package.OtherSubPackage.VerySubPackage
- OtherPackage
Foobar
- OtherPackage.SubPackage
so I can open or close a package and see a list of subpackages instead of having package and subpackage all at the same level in the hierarchy--which again makes far too many packages simultaneously displayed. Note this is not a question about filesystem; the file system works fine as far as I can tell--it is only a question about the visual display in the Eclipse package explorer.
So: is there a way to add levels to the hierarchy? Thanks!! (Eclipse Helios on OS X 10.6)
Source: (StackOverflow)
I'd like to unload a package without having to restart R (mostly because restarting R as I try out different, conflicting packages is getting frustrating, but conceivably this could be used in a program to use one function and then another--although namespace referencing is probably a better idea for that use).
?library
doesn't show any options that would unload a package.
There is a suggestion that detach
can unload package, but the following both fail:
detach(vegan)
Error in detach(vegan)
: invalid name
argument
detach("vegan")
Error in detach("vegan")
: invalid name
argument
So how do I unload a package?
Source: (StackOverflow)
A little while ago, I saw a question answered here regarding the fine-grained organisation of java packages. For example, my.project.util, my.project.factory, my.project.service etc.
I can't find it now, so I may as well ask the question.
Are there best practices with regards to the organisation of packages in Java and what goes in them?
How do you organise your classes in your Java project?
For instance, a project I'm working on with a few people has a package called beans. It started out being a project containing simple beans, but has ended up (through poor experience and lack of time) contiaining everything (almost). I've cleaned them up a little, by putting some factory classes in a factory package (classes with static methods that create beans) but we have other classes that do business logic and others that do simple processing (not with business logic) like retrieving a message for a code from a properties file.
Your thoughts and comments are appreciated.
Source: (StackOverflow)
Python's easy_install
makes installing new packages extremely convenient. However, as far as I can tell, it doesn't implement the other common features of a dependency manager - listing and removing installed packages.
What is the best way of finding out what's installed, and what is the preferred way of removing installed packages? Are there any files that need to be updated if I remove packages manually (e.g. by rm /usr/local/lib/python2.6/dist-packages/my_installed_pkg.egg
or similar)?
Source: (StackOverflow)
There are quite a few modules which are listed on node's github page but are not published with the npm-registry. These modules can't be installed using npm.
What is the correct way to install these nodejs modules after cloning them from Git?
Source: (StackOverflow)
I've come across situations where a current version of a package seems not to be working and requires reinstallation. But pip install -U
won't touch a package that is already up-to-date. I see how to force a reinstallation by first uninstalling (with pip uninstall
) and then installing, but is there a way to simply force an "update" to a nominally current version in a single step?
Source: (StackOverflow)
In the Java APIs I can see Javadoc comments for packages.
How/where do I place Javadoc comments to document a package?
Source: (StackOverflow)
I have a downloaded module repo, I want to install it locally, not globally in another directory?
What is an easy way to do this?
Source: (StackOverflow)
I've used GOPATH
but for this current issue I'm facing it does not help. I want to be able to create packages that are specific to a project:
myproject/
├── binary1.go
├── binary2.go
├── package1.go
└── package2.go
I tried multiple ways but how do I get package1.go
to work in the binary1.go
or the binary2.go
and so on?
For example; I want to be able to import "package1"
and then be able to run go build binary1.go
and everything works fine without the error being thrown that the package cannot be found on GOROOT
or GOPATH
. The reason why I need this kind of functionality is for large scale projects; I do not want to have to reference multiple other packages or keep them in one large file.
Source: (StackOverflow)