Questions tagged [init]

May refer to Linux init, an abbreviation of initialization - giving variables a "starting" value, or Python's __init__ class initiation method.

May refer to :

  • Linux Init - the parent of all processes, which primary role is to create processes from a script stored in the file /etc/inittab.
  • variable init (abbreviation of initialization) - giving variables a "starting" value.
  • python magic __init__ - magic function that initializes an object.
1905 questions
14
votes
1 answer

Yocto using .bbappend file to override writing of default init scripts for initramfs

I am trying to write a .bbappend file that will append to the initramfs-live-boot_1.0.bb which has a statement inside the do_install() that writes the contents of init-live.sh, a shell script that manages the boot procedure, to init, an…
Shiri
  • 1,972
  • 7
  • 24
  • 46
14
votes
2 answers

Swift UIImage extension

I am trying to make my code safer using Enums and a connivence initializer when dealing with UIImage and the Asset Catalog. My code is here below. import UIKit extension UIImage { enum AssetIdentifier: String { case Search = "Search" …
Cody Weaver
  • 4,756
  • 11
  • 33
  • 51
14
votes
3 answers

viewDidLoad is called before whole init method is executed

EDIT: Here is whole code example for Xcode 6.4 I have simple iOS application without storyboards. I set rootViewController for UIWindow in AppDelegate.swift like this: func application(application: UIApplication, didFinishLaunchingWithOptions…
Deny
  • 1,441
  • 1
  • 13
  • 26
14
votes
6 answers

What is the list of all Android Init Language 'triggers'?

In /init.rc and the other Android Init Language '.rc' files, there can be 'actions' sections that start: 'on ' to execute a sequence of commands when an event occurs in the init process. What is the list of all 'triggers'? There seem to see some…
Ribo
  • 3,363
  • 1
  • 29
  • 35
14
votes
2 answers

cannot init a class object : objective-C

I'm trying to make a simple subclass of CCNode, but I can't create the object. It gives me the error "* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* +[ContentPane<0x206898> init]: cannot init a class…
Aeisys
  • 367
  • 1
  • 3
  • 13
14
votes
1 answer

RedHat daemon function usage

I'm working on an init script for Jetty on RHEL. Trying to use the daemon function provided by the init library (/etc/rc.d/init.d/functions). I found this terse documentation, and an online example (I've also been looking at other init scripts on…
quickshiftin
  • 66,362
  • 10
  • 68
  • 89
14
votes
4 answers

Python __init__ return failure to create

First off, I know that the __init__() function of a class in Python cannot return a value, so sadly this option is unavailable. Due to the structure of my code, it makes sense to have data assertions (and prompts for the user to give information)…
Philip Massey
  • 1,401
  • 3
  • 14
  • 24
13
votes
3 answers

How to initialise a binary semaphore in C

In the man page it appears that even if you initialise a semaphore to a value of one: sem_init(&mySem, 0, 1); It could still be incremented to a value greater than 1 with multiple calls to sem_post(&mySem); But in this code example the comment…
austinmarton
  • 2,278
  • 3
  • 20
  • 23
13
votes
2 answers

Objective-C: Should init methods be declared in .h?

First of all, as I understand it, init in Objective-C, functionally is similar to a constructor in Java, as it is used to initialize instance variables and prepare a class to do some work. Is this correct? I understand that NSObject implements init…
James Raitsev
  • 92,517
  • 154
  • 335
  • 470
12
votes
4 answers

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

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 { …
Dan Rosenstark
  • 68,471
  • 58
  • 283
  • 421
12
votes
1 answer

How to init MySql Database in Docker Compose

Scenario: I developed a microservice in Spring which uses a mysql 8 database. This db has to be initalized (create a Database, some tables and data). On my host machine I initialized the database with data.sql and schema.sql script. The Problem is,…
FishingIsLife
  • 1,972
  • 3
  • 28
  • 51
12
votes
4 answers

Can I have two init functions in a python class?

I'm porting some geolocation java code from http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates#Java (shown below) to python. It can be initialized using two functions (fromDegrees or fromRadians). I thought I could do something like class…
jul
  • 36,404
  • 64
  • 191
  • 318
12
votes
2 answers

Incomplete LSB comment. insserv: missing valid name for `Provides:' please add

Recently I installed: Debian x86_64, oracle 11g and OCI8. I'd like to turn automatic the shell script below, but I received the following message error: root@debian:/etc/init.d# uname -a Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64…
Marcos
  • 844
  • 3
  • 10
  • 25
12
votes
2 answers

H2 "runscript" command turns all table names into uppercase

I have a sql script (it is just schema definition). The script is a modified version (getting rid of the bad characters h2 doesn't like) of a mysql dumb. The script runs and the schema is inserted into the h2 database, but the issue is that all of…
Nacht
  • 10,488
  • 8
  • 31
  • 39
12
votes
3 answers

How to enable adbd to listen to a port at boot time in Android?

I have a rooted HTC Hero, and what I want to do is to enable the adbd to listen to a port at boot time. I tried some code found here: setprop service.adb.tcp.port 5555 stop adbd start adbd in an Android shell and it works great. I tried to change…
Thanasis Petsas
  • 4,378
  • 5
  • 31
  • 57