init

Emacs Lisp error at init (file-error “Cannot open load file” “/home/user/a-m”)

こ雲淡風輕ζ 提交于 2020-01-03 03:12:11
问题 I've recently made a few changes in my init emacs file, and I've noticed with --debug-init that some load files seem to be missing. Here is the output from the debugger Debugger entered--Lisp error: (file-error "Cannot open load file" "/home/andre/a-m") load("/home/andre/a-m" nil nil t) load-file("a-m") eval-buffer(#<buffer *load*> nil "/usr/local/share/emacs/site-lisp/default.el" nil t) ; Reading at buffer position 269 load-with-code-conversion("/usr/local/share/emacs/site-lisp/default.el" "

UIViewController init vs initWithNibName:bundle:

佐手、 提交于 2020-01-02 04:37:13
问题 In my app I am pushing a view controller (a UITableViewController) that has also a property/outlet referencing a UITableViewCell. It appears that creating the controller with: PreferencesController *pController = [[PreferencesController alloc] init]; doesn't create the object for the UITableViewCell in the xib file, thus the outlet is null, thus the table loading generates an exception. I solved this with: PreferencesController *pController = [[PreferencesController alloc] initWithNibName:@

Python: Import file in grandparent directory

北城以北 提交于 2020-01-02 03:40:12
问题 Hierarchy: scripts/ web/ script1.py tests/ script2.py common/ utils.py How would I import utils in script1 and script2, and still be able to run those scripts seperately (i.e., python script1.py ). Where would I place the __init__.py files, and is that the correct way to go about this? Thank you! 回答1: package/ __init__.py scripts/ web/ __init__.py script1.py tests/ __init__.py script2.py common/ __init__.py utils.py I've added a bunch of empty __init__.py files to your package. Now you have 2

Using alloc, init in ARC enabled projects

删除回忆录丶 提交于 2020-01-02 03:28:19
问题 Actually I am working on a project with ARC enabled. I know using alloc and init is taking ownership of the object. I know, If I create a string like this NSString *myString = [[NSString alloc]initWithFormat:@"Something"]; then I need to release the myString on myself. What If I am using ARC enabled? I cannot release on myself. So will it create a leak? Or should I don't create object like this? I can create a string like below code too. NSString *myString = [NSString stringWithFormat:@

Launching Linux from Busybox (pivot_root or switch_root, or ? )

江枫思渺然 提交于 2020-01-01 10:17:22
问题 On a beaglebone hardware, I want to start on a partition with a minimalist busybox system (/dev/mmcblk0p2), run some checks on the 2 other partitions (/dev/mmcblk0p5 & /dev/mmcblk0p6) containing more complete Linux systems (Angström), then start on one or the other of the 2 Linux systems based on those tests. The problem is that I cannot find how to start another system correctly from busybox. What I did: From the (perfectly working) busybox system: export PATH=/bin:/sbin:/usr/bin:/usr/sbin

Launching Linux from Busybox (pivot_root or switch_root, or ? )

本小妞迷上赌 提交于 2020-01-01 10:17:12
问题 On a beaglebone hardware, I want to start on a partition with a minimalist busybox system (/dev/mmcblk0p2), run some checks on the 2 other partitions (/dev/mmcblk0p5 & /dev/mmcblk0p6) containing more complete Linux systems (Angström), then start on one or the other of the 2 Linux systems based on those tests. The problem is that I cannot find how to start another system correctly from busybox. What I did: From the (perfectly working) busybox system: export PATH=/bin:/sbin:/usr/bin:/usr/sbin

Why not throw an exception if [super init] returns nil?

时光总嘲笑我的痴心妄想 提交于 2020-01-01 08:38:47
问题 This is considered typical - (id)init { self = [super init]; if (self) { // <#initializations#> } return self; } but wouldn't it be better to go with something like this which actually responds appropriately? - (id)init { self = [super init]; if (self) { // <#initializations#> } else { @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"you think your constructor is executing, but it's not"] userInfo:nil] } return self; } The corollary to this question is, "under

ObjC-Why it is incorrect when implement [alloc] and [init] methods separatly? [duplicate]

我的梦境 提交于 2019-12-31 06:17:47
问题 This question already has answers here : Why should I not separate alloc and init? (4 answers) Closed 4 years ago . Never initialize an object without reassigning any pointer to that object. As an example, don’t do this: NSObject *someObject = [NSObject alloc]; [someObject init]; If the call to init returns some other object, you’ll be left with a pointer to the object that was originally allocated but never initialized. Actually, this is a example in Apple's ObjC document, but i'm not quite

Numpy Matrix class: Default constructor attributes for inherited class

落爺英雄遲暮 提交于 2019-12-30 19:00:16
问题 I want to implement my own matrix-class that inherits from numpy's matrix class. numpy's matrix constructor requires an attribute, something like ("1 2; 3 4'") . In contrast, my constructor should require no attributes and should set a default attribute to the super-constructor. That's what I did: import numpy as np class MyMatrix(np.matrix): def __init__(self): super(MyMatrix, self).__init__("1 2; 3 4") if __name__ == "__main__": matrix = MyMatrix() There must be a stupid mistake in this

Pygame.init() not working [duplicate]

爱⌒轻易说出口 提交于 2019-12-30 14:29:41
问题 This question already has answers here : i keep getting the error 'module' object has no attribute 'init' [duplicate] (2 answers) Closed last year . I downloaded pygame successfully but now when I do: import pygame pygame.init() size = [400, 400] pygame.display.set_mode(size) it gives errors: Traceback (most recent call last): File "<pyshell#11>", line 1, in <module> pygame.init AttributeError: 'module' object has no attribute 'init' And nothing is working for me. Please help me use init and