packages

Why is the root package in source code called “com”? [duplicate]

南楼画角 提交于 2019-12-03 05:50:20
This question already has an answer here: Java packages com and org 4 answers In most source codes, the root package/folder is named "com". Why is that so? It it just convention or does it stand for something? The convention is that a programmer in a given organization will start package names with their organization's domain name, as a unique identifier -- in reverse order. This prevents namespace clashes between code from different organizations (within the organization you're on your own). So if I work for a company called Supercompany, and their domain is supercompany.com, all of my

How to load latex .sty files from a subdirectory?

旧街凉风 提交于 2019-12-03 05:28:11
问题 I use some .sty-files that are not part of texlive and want to have them in a subdirectory of the folder with my main.tex. I used the following line to load the package: \usepackage{sty/prettythesis} This works, but compiling the main.tex with xelatex and using rubber gives me a warning: sty/prettythesis.sty: You have requested package `sty/prettythesis', but the package provides `prettythesis'. (page 1) Is there a way to prevent this warning or handle this case without having to include "sty

When making a Laravel package, how do I register the service provider and alias of dependency packages?

对着背影说爱祢 提交于 2019-12-03 05:16:00
问题 I'm creating a package for Laravel and I've defined the Notification package (https://github.com/edvinaskrucas/notification) as a dependency for my package. In /workbench/vendor/package/src/composer.json I have: "require": { "php": ">=5.3.0", "illuminate/support": "4.1.*", "edvinaskrucas/notification": "2.*" } I'm then registering the service provider in my package's service provider's register method (not even sure if this is the right way to do this), and the alias using App::alias. So in

How to load packages in Octave permanently?

匆匆过客 提交于 2019-12-03 05:15:46
I am using Octave on Window vista. I am using 4 package in my code. But every time I restart octave, I have to load manually from command line, 'pkg load ...' Is there a way to load them permanently so that whenever Octave is started it finds them in its path. When Octave starts, it runs ~/.octaverc . If you want Octave to automatically load a package, simply add a pkg load pkg-name command to it. If the files does not exist, create it. If you do this, remember that other people may not have Octave configured to load packages at startup. Therefore, if you write code for others, remember that

Must R Packages Unload Dynamic Libraries When They Unload?

瘦欲@ 提交于 2019-12-03 05:14:00
From Hadley's C best practices : Like with C++, whenever you use C code in your package, you should unload the DLL when the package is unloaded: .onUnload <- function (libpath) { library.dynam.unload("mypackage", libpath) } Writing R Extensions on the other hand doesn't even mention this. I can see how it would be polite to unload the dlls, but doing so seems to cause some weird problems for me with packages that are loaded/unloaded/reloaded (see example further down). Additionally, there are some mentions that suggest maybe unloading isn't required. From ?library.dynam : Note that whether or

What is the significance of the reverse domain name for java package structure

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 04:19:34
Why do we use reverse domain name like com.something. or org.something. structure for java packages? I understand this brings in some sort of uniqueness, but why do we need this uniqueness? Globally unique package names avoid naming collisions between libraries from different sources. Rather than creating a new central database of global names, the domain name registry is used. From the JLS: The suggested convention for generating unique package names is merely a way to piggyback a package naming convention on top of an existing, widely known unique name registry instead of having to create a

`del` on a package has some kind of memory

邮差的信 提交于 2019-12-03 04:11:53
del seems to have some memory which puzzles me. See the following: In [1]: import math In [2]: math.cos(0) Out[2]: 1.0 In [3]: del math.cos In [4]: math.cos(0) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-4-9cdcc157d079> in <module>() ----> 1 math.cos(0) AttributeError: module 'math' has no attribute 'cos' Fine. Let's see what happens if we delete the whole math package: In [5]: del math In [6]: math.cos(0) --------------------------------------------------------------------------- NameError

Python Packages?

北战南征 提交于 2019-12-03 03:49:34
Ok, I think whatever I'm doing wrong, it's probably blindingly obvious, but I can't figure it out. I've read and re-read the tutorial section on packages and the only thing I can figure is that this won't work because I'm executing it directly. Here's the directory setup: eulerproject/ __init__.py euler1.py euler2.py ... eulern.py tests/ __init__.py testeulern.py Here are the contents of testeuler12.py (the first test module I've written): import unittest from .. import euler12 class Euler12UnitTests(unittest.TestCase): def testtriangle(self): """ Ensure that the triangle number generator

C++ Namespaces, comparison to Java packages

心不动则不痛 提交于 2019-12-03 03:27:55
问题 I've done a bunch of Java coding recently and have got used to very specific package naming systems, with deep nesting e.g. com.company.project.db . This works fine in Java, AS3/Flex and C#. I've seen the same paradigm applied in C++ too, but I've also heard that it's bad to view C++ namespaces as direct counterparts to Java packages. Is that true, and why? How are namespaces/packages alike and different? What problems are likely to be seen if you do use deep nested namespaces? 回答1: In C++

How to use packages installed by quicklisp?

江枫思渺然 提交于 2019-12-03 03:24:21
I've installed the CL-PNG package using quicklisp. (ql:quicklisp 'png) Now I want to define my own package which depends on the CL-PNG package. Like so: (defpackage :FOO (:use :CL :PNG) (:export :BAR)) When compiling it I get this error: The name "PNG" does not designate any package. [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR] It seems that I have to call (require :PNG) on the REPL before compiling my package. What do I have to do to make the CL-PNG package available for the compiler without manually call require on the REPL? UPDATE: I'm using SBCL. You confuse two separate notions: a