Questions tagged [initializer]

Initializers are called to create a new instance of a particular type. In its simplest form, an initializer is like an instance method with no parameters

684 questions
0
votes
1 answer

Configuration values wont set in Rails Engine 4.1.9

I have an engine whom, in the lib/ directory has a configuration file as such: # Default configration for groups, roles and permissions class Xaaron::Configuration # What is the memeber group name? attr_accessor :member_group # What is the…
TheWebs
  • 12,470
  • 30
  • 107
  • 211
0
votes
1 answer

EF drops Database after some inactivity

I'm using ASP.NET Web API with EF 6 (Code First) and for development purpose I created an initializer with a DropCreateDatabaseAlways. I deploy the application on a remote server (IIS 8.0) and I noticed that after some inactivity, when a call is…
boluo
  • 61
  • 6
0
votes
1 answer

Subclass _init_ method ignored - execution jumps straight to superclass _init_

I am using HTMLParser to parse some basic, well-formed HTML and for various reasons don't want to use BeautifulSoup. I subclassed HTMLParser and the actual parser works fine. However, the init_ method of the subclass is not being called. Instead,…
bsg
  • 825
  • 2
  • 14
  • 34
0
votes
1 answer

'Extra argument in call' when calling init! initializer on AVAssetReader swift

I see many versions of this question, but I've looked through many of them and haven't found something explaining my problem yet. I hope this isn't a repeat question. I am simply trying to initialize an AVAssetWriter with this init! method defined…
0
votes
1 answer

It's possible change dynamically devise configuration without app restart?

I'm using devise v.2.2.4 on my Rails 3.2.17 and I need some features related with security policies. The admin user will change the security policies at any time like show next image: but I don't know how make it with devise, because devise read…
enrique-carbonell
  • 5,836
  • 3
  • 30
  • 44
0
votes
3 answers

Error: Assigning to an array from an initializer list; code working on ubuntu 10.04 but not on 14.04

I would be very happy if someone here could point me in the right direction regarding my issue. I have read multiple posts about this matter on this and some other forums, but to no avail. I work under Ubuntu 14.04 in Qt Creator 3.2.1 with C++. The…
FlyingPlushie
  • 68
  • 1
  • 7
0
votes
1 answer

Initializers as a way of converting to new types in Swift

I have the following type called Maybe: enum Maybe:{ case Nothing case Something(T) init(){ self = .Nothing } init(_ something: T){ self = .Something(something) } } I was expecting this code to call my…
cfischer
  • 24,452
  • 37
  • 131
  • 214
0
votes
1 answer

How to initialize an array of doubles in c++?

I realized that in c++ I cannot initialize an array of double with memset. For an integer array I can easily initialize the array using: int* a = new int[n]; memset(a, n*n, n*sizeof(int)); But how can I initialize an array of doubles in c++? long…
orezvani
  • 3,595
  • 8
  • 43
  • 57
0
votes
3 answers

I am trying to practice C, but I receive an "initializer element is not constant" error

#include int numero=6; int numerodos=4; int result=numero*numerodos; main() { while (result<200) { printf("The product of %d and %d is %d", numero, numerodos, result); result=result+1 } } I know the algorithm is…
0
votes
1 answer

Background-image won't show using HTML5 boilerplate

I am having a hard time showing my background image in css. I created a div with a class .top, but every time I use the background-image css property nothing shows up except for color, height and width. I am also use a HTML5 boilerplate from…
0
votes
0 answers

When using object initializers, what does the parenthesis do?

I've recently found myself using initializers a bit more often than usual, so I thought I'd look into the finer details. I can vaguely remember reading something that Jon Skeet(?) wrote which showed some code that differed only by the inclusion of…
Kyle Baran
  • 1,793
  • 2
  • 15
  • 30
0
votes
0 answers

java.lang.ExceptionInInitializerError in search tool for docx files

I have created a search tool for seleecting a folder and searching the docx files for a given keyword in the selected folder, the program is supposed to return the file names containing the keyword. I used Apache POI for reading docx files. After I…
ygz23
  • 13
  • 1
  • 7
0
votes
2 answers

Changed devise initializer, now authentication is broken

I had tried to setup username based authentication in devise's initializer to begin with; but that turned out to require more work than I was willing to put into this app at this moment as it's just for mucking around with. So where I had initially…
Camden Narzt
  • 2,271
  • 1
  • 23
  • 42
0
votes
1 answer

Too many Initializers for 2D array (Arduino IDE)

I'm currently working on a 8x8 LED matrix program, and came across code which uses a 8x10 matrix engine. EDIT 'A' and 'R' are defined strings given: #define A …
user3739406
  • 254
  • 1
  • 3
  • 16
0
votes
0 answers

Apache initializes Rails application on first URL call only

There is Apache (httpd) + Phusion Passenger + Rails application bundle on server (CentOS 6.5). I have some background threads in application which are started in an initializer. The problem is: When httpd is started it does not run application and…
Paul
  • 25,812
  • 38
  • 124
  • 247