packages

sublime text2中文乱码问题解决

时光总嘲笑我的痴心妄想 提交于 2019-12-03 19:15:02
sublime text 2 不支持 GB2312 和 GBK 编码, 解决这一问题。具体方法如下: 这一方法前提是 sublime text 2 的安装路径没有中文字符,且 系统路径的 %username% 中不包含中文字符 1. 安装 Sublime Package Control: 在Sublime Text 2上用Ctrl+~打开控制台并在里面输入以下代码,Sublime Text 2就会自动安装Package Control。 import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish

How to organise classes, packages [closed]

心已入冬 提交于 2019-12-03 17:43:57
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . How do you decide what a package name should be and what class should go into what package ? I'm working on a project where I am constantly adding/removing classes and not really sure if I need a new package, or should add it to an existing one that im not currently aware of. Do you follow a set of rules when

Running python scripts within a subpackage of my package

自作多情 提交于 2019-12-03 17:20:32
问题 Having some trouble figuring out the correct, python 2.x preferred way to do relative imports so that I can keep test scripts together in one subpackage, and have those test scripts be able to test my library. $ farm\testpad\testpad.py Traceback (most recent call last): File "C:\farm\testpad\testpad.py", line 4, in <module> from ..animals.dog import dog ValueError: Attempted relative import in non-package $ python -m farm\testpad\testpad C:\Python27\python.exe: No module named farm\testpad

Oracle Error PLS-00323: subprogram or cursor is declared in a package specification and must be defined in the package body

强颜欢笑 提交于 2019-12-03 16:34:49
问题 Can someone help me put my pl/sql procedure in a package? I've tried and I'm struggling with it: This is what I have, for my package specification: CREATE OR REPLACE PACKAGE film_pkg IS title VARCHAR2(100); PROCEDURE get_films(fname VARCHAR2); END film_pkg; -- This is my package body where im running into the problems: CREATE OR REPLACE PACKAGE BODY film_pkg IS PROCEDURE get_films (fname IN film.title%TYPE, r_date OUT film.release_date%TYPE, dur OUT film.duration%TYPE) AS BEGIN SELECT release

How to load packages in Octave permanently?

痴心易碎 提交于 2019-12-03 15:48:16
问题 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. 回答1: 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

`del` on a package has some kind of memory

懵懂的女人 提交于 2019-12-03 15:31:28
问题 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]:

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

孤街醉人 提交于 2019-12-03 15:11:55
问题 This question already has answers here : Java packages com and org (4 answers) Closed 3 years ago . 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? 回答1: 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

Must R Packages Unload Dynamic Libraries When They Unload?

家住魔仙堡 提交于 2019-12-03 14:23:27
问题 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

When developing an R package, do I have to recompile the package every time I make a change?

无人久伴 提交于 2019-12-03 12:50:32
I am developing a package in R When I am debugging a particular function or set of functions, what is the best way to test the function? Do I have to either use source('function.R') or R CMD build each time I want to check my changes? (extra credit for associated emacs ess key-bindings) hadley See also http://github.com/hadley/devtools/ which provides some tools to make this task easier. for example, after making changes to source code, you build, install, and reload a package with the function install() : library(devtools) install("package_name") devtools also makes it easier to: Reload

Python Packages?

自古美人都是妖i 提交于 2019-12-03 12:34:23
问题 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