init

setting up git for a project with many existing snapshots

I need to set up a project for git revisionning. The project team has kept backup snapshots of about 40 of the current 200+ numbered builds. What would be the most efficient way to bring that into a new git repo? My thinking is the obvious one: use the oldest backup to init the repo, then walk through the 40 snapshots one by one, for ea...

Can I have two init functions in a python class?

Hi, 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 geoLocation: _radLat = 0 _radLong = 0 _degLat = 0 _degLong = 0 ...

How to start a linux shell as from /etc/inittab

We used to have two entries in our /etc/inittab: ::sysinit:/etc/init.d/rcS ttyS0::respawn:-/bin/sh rcS is a shell script which normally starts our application, but in a special case we called "return" to terminate it which apparently lets the /bin/sh take over the tty as we got a shell prompt where we could do some maintenance. Now t...

NSObject default constructor

Hi all, The default constructor of NSObject is this? -(id)init { return self; } thanks! ...

For iPhone OS 4.0 "dateFromString" method of NSDateFormatter returns nil.

Hi I am using following code & its working perfectly fine in iPhone OS 3.2 +(NSDate *)NSDateFromString:(NSString *)dateString { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterShortStyle]; [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; [dateFormatte...

Objective C - subclassing classes with multiple init-methods

Hi, im searching for a convenient way of adding new arguments to multiple init-methods. its a little bit hard to discribe but my problem is the following: I have a class witch implements various init-methods. f.e. @interface Circle { CGPoint center; float radius; } - (id)initWithCenter:...radius:...; - (id)initWithRect:...;...

Compiler error when changing deprecated void _init() to use __attribute((constructor))

I decided it would be a fun side project to do some work on tsocks, since it hasn't seen any updates in 8 years. It's hosted here on GitHub. I only made cosmetic changes to the code so far, but now I've run into a compiler error. According to dlopen(3): The obsolete symbols _init() and _fini() [...] Using these routines [...] is not r...

Periodic Script- Daemon-

Hi i have hp-ux and i need delete a specific file every day. then I need to do a shell script or something else with a simple command for example # rm <filename> But i need add this script to init, or convert this script in daemon TO GRANT that every day at 20:00, this script run and delete the file. I guess that the above is the pro...

Linux kernel that runs python file for init

Would it be possible and not incredibly difficult to build a linux kernel, with a python interpreter built in or accessible from the kernel, that could run a python file as it's init process? ...

Using module's own objects in __main__.py

Hi, I am trying to access a module's own data inside it's __main__.py. The structure is as follow: mymod/ __init__.py __main__.py Now, if I expose a variable in __init__.py like this: __all__ = ['foo'] foo = {'bar': 'baz'} how can I access foo from __main__.py? ...

Drupal: Catcing userId in hook_init();

I have the following code in a custom module as well as I have firePHP installed (dfb($userId) is supposed to be written in the console). At every page pageload I want to catch and print the current users ID and I think the following should work but it isn't - can anyone tell me why? function live_update_test_init() { global $user; ...

How to create a custom UIView?

I've created a UIView subclass and corresponding xib file where I've laid out some UILabels and UIImageViews. I want to then put multiple copies of this custom UIView into a UIViewController. When I do that they appear blank in interface builder and don't appear when the app loads. What methods do I need to implement on the UIView subc...

Android init.rc import statement not working

I am trying to add a separate init file called init.Mine.rc that holds other services that I want to start myself. I am trying to import this from init.rc so that it will just run the stuff from init.Mine.rc but it doesn't seem to be doing anything. I am starting logcat from init.Mine.rc and its not even showing up when I do a ps. I k...

Calling singleton object initiated from nib.

Hi, I have an object which is initiated in my nib file. I want it to be a singleton but also accessible from code through [myClass sharedInstance];. Right now I have this: static myClass *singleton = nil; @implementation myClass + (myClass *)sharedInstance { if (!singleton) singleton = [[self class] new]; return singleton; } ...

Codlfusion ORM: Can not load SQL after an init of ORM.

Hi All, Trying to drop/create table with orm but facing a situation: When I try to drop/create table I see tables are created but data. I have a sql which contains data but no luck. I have proper definitions for the sql that has to be imported when I drop/create. this.ormsettings = {autorebuild="false"}; this.ormsettings.dialect= "...

Setting an NSDate to specific date, time and timezone

I need to set a NSDate to a specific date, time and timezone for an iPhone App. The example code below works fine on iOS 4 as the setTimeZone was introduced with iOS 4. How could I easily set a NSDate to a date, time and timezone without using setTimeZone so it can be used on iOS 3.0 devices? NSDateComponents *comps = [[NSDateComp...

Success with start-stop-daemon and mono-service2?

Has anyone had any success using start-stop-daemon and mono-service2 together? I've been fighting this for a few days now and have gotten various bits to work, but have had no success in getting a fully functional init script for a mono service. Here is what I have learned to date: The mono or mono-service exe must be named as the va...

Strange Exc Bad Access when using Init, PushViewController, Release. Anything wrong with this code?

Maybe I've been looking at this for too long ;) My app has a NavigationController and several ViewControllers. From one of the ViewControllers two levels down (mainViewController), loaded from the rootViewController, I have the code below. After the PushViewController to the dataViewController and back (e.g. back Button pressed), the app...

Upstart init is leaking memory, how do you debug it?

I've got a memory leak in Upstart init process (pid 1), what options I have on debugging it? EDIT: Suggest me some real tools for this, manually putting printfs or calculating memory allocations by hand isn't gonna cut it. Also dumping init core and poking around that is not really an option. UPD1: valgrind doesn't work. Replacing /sbi...

How move a jquery script like "ddaccordion.init" in an external js ?

Hi im trying to put all my js in external js file, for the header for my site be more light. So in my header i have this script, wich work well : ddaccordion.init({ headerclass: "p7ABtrig", //Shared CSS class name of headers group contentclass: "p7ABcontent", //Shared CSS class name of contents group ...