Search Results

Search found 22298 results on 892 pages for 'default'.

Page 42/892 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Objective-C / C giving enums default values

    - by bandejapaisa
    I read somewhere about giving enums default values like so: typedef enum { MarketNavigationTypeNone = 0, MarketNavigationTypeHeirachy = 1, MarketNavigationTypeMarket = 2 } MarketNavigationLevelType; .. but i can't remember the value of doing this. If i don't give them default values - and then someone later on reorders the enum - what are the risks? If i always use the enum name and don't even refer to them by their integer value, is there any risks? The only possible problem i can think of is if i'm initialising an enum from an int value from a DB - and the enum is reordered - then the app would break.

    Read the article

  • create_function with default parameter values?

    - by SoLoGHoST
    Ok, I'm looking into using create_function for what I need to do, and I don't see a way to define default parameter values with it. Is this possible? If so, what would be the best approach for inputting the params into the create_function function in php? Perhaps using addslashes? Well, for example, I have a function like so: function testing($param1 = 'blah', $param2 = array()) { if($param1 == 'blah') return $param1 else { $notblah = ''; if (count($param2) >= 1) { foreach($param2 as $param) $notblah .= $param; return $notblah; } else return 'empty'; } } Ok, so how would I use create_function to do the same thing, adding the parameters and their default values? The thing is, the parameters are coming from a TEXT file, as well as the function itself. So, wondering on the best approach for this using create_function and how exactly the string should be parsed. Thanks :)

    Read the article

  • jquery.validation - how to ignore default values when validating mandatory fields

    - by jack
    I am using jquery validation plugin to validate a registration form. Each text input field has instructions pre-filled as values in the input box ex: for a text-input box id='Name', the default value will be set to 'Enter Your Name'. I have pasted below sample code: <input type="text" id="Name" value="Enter Your Name" onfocus="if(this.value == 'Your Name'){this.value = '';}" type="text" class="required" onblur="if(this.value == ''){this.value='Your Name';}" size="25" /> What I need to know is how to specify in the validation rule such that the plugin throws a required field error if the input box contains either the default message or empty values. Help much appreciated.

    Read the article

  • Html.RadioButton group defaulting to 0

    - by awrigley
    Hi A default value of 0 is creeping into a Surveys app I am developing, for no reason that I can see. The problem is as follows: I have a group of Html.RadioButtons that represent the possible values a user can choose to answer a survey question (1 == Not at all, 2 == A little, 3 == A lot). I have used a tinyint datatype, that does not allow null, to store the answer to each question. The view code looks like this: <ol class="SurveyQuestions"> <% foreach (SurveyQuestion question in Model.Questions) { string col = question.QuestionColumn; %> <li><%=question.QuestionText%> <ul style="float:right;" class="MultiChoice"> <li><%= Html.RadioButton(col, "1")%></li> <li><%= Html.RadioButton(col, "2")%></li> <li><%= Html.RadioButton(col, "3")%></li> </ul> <%= Html.ValidationMessage(col, "*") %> </li> <% } %> </ol> [Note on the above code:] Each survey has about 70 questions, so I have put the questions text in one table, and store the results in a different table. I have put the Questions into my form view model (hence Model.Questions); the questions table has a field called QuestionColumn that allows me to link up the answer table column to the question, as shown above (<%= Html.RadioButton(col, "1")%, etc) [/Note] However, when the user DOESN'T answer the question, the value 0 is getting inserted into the database column. As a result, I don't get what I expect, ie, a validation error. In no place have I stipulated a default value of 0 for the fields in the answers table. So what is happening? Any ideas?

    Read the article

  • Discovering the default gateway without DHCP

    - by JavaRocky
    A crazy question, but is there anyway to discover the default gateway without DHCP? This would be for a device on a network which does not use DHCP which does not have an IP address as yet. I was thinking if I could discover the default gateway, then i could try to guess an unused ip address then broadcast on the network to see if it's being used. I may be asking for trouble i understand. E.g. if there is already a computer which has a static IP and is shutdown.

    Read the article

  • Rails 3 respond_to: default format?

    - by bdorry
    I am converting a Rails 2 application to Rails 3. I currently have a controller set up like the following: class Api::RegionsController < ApplicationController respond_to :xml, :json end with and an action that looks like the following: def index @regions = Region.all respond_with @regions end The implementation is pretty straightforward, api/regions, api/regions.xml and api/regions.json all respond as you would expect. The problem is that I want api/regions by default to respond via XML. I have consumers that expect an XML response and I would hate to have them change all their URLs to include .xml unless absolutely necessary. In Rails 2 you would accomplish that by doing this: respond_to do |format| format.xml { render :xml => @region.to_xml } format.json { render :json => @region.to_json } end But in Rails 3 I cannot find a way to default it to an XML response. Any ideas?

    Read the article

  • host the silverlight application in a new website(default.aspx)

    - by Piyush
    when I create new silverlight project it asks Host the Silverlight application in a new Website followed by two fields- 1. Name: projectName.web 2. Type: ASP.Net Web Application Project OR Asp.Net Web Site when I uncheck this checkbox VS doen not create projectName.web project but when I check this VS creates two projects 1. projectName--contains .xaml pages 2. projectName.web-- contains default.aspx page.................. So my question is - Is it must to host silverlight app from a new website(default.aspx page) OR cant we directly host .xaml page? ProjectName.Web project is req.?? –

    Read the article

  • Get back the default browser styling for input fields

    - by meo
    I need to style all the input fields but one. So i have set a rule for all the inputs on the site. For the seachfield i need to use the browser default, so i was thinking i could just inherit all the values i have set for the general input fields. (have tried border: none to) This does not work in FF nor Safari :( The border just gets transparent. http://jsfiddle.net/N5KKH/1/ Any idea how i could get the default browser styling back? EDIT: i need the first input field look like the second one: http://jsfiddle.net/N5KKH/2/

    Read the article

  • Calling base class constructor

    - by The Void
    In the program below, is the line Derived(double y): Base(), y_(y) correct/allowed? That is, does it follow ANSI rules? #include <iostream> class Base { public: Base(): x_(0) { std::cout << "Base default constructor called" << std::endl; } Base(int x): x_(x) { std::cout << "Base constructor called with x = " << x << std::endl; } void display() const { std::cout << x_ << std::endl; } protected: int x_; }; class Derived: public Base { public: Derived(): Base(1), y_(1.2) { std::cout << "Derived default constructor called" << std::endl; } Derived(double y): Base(), y_(y) { std::cout << "Derived constructor called with y = " << y << std::endl; } void display() const { std::cout << Base::x_ << ", " << y_ << std::endl; } private: double y_; }; int main() { Base b1; b1.display(); Derived d1; d1.display(); std::cout << std::endl; Base b2(-9); b2.display(); Derived d2(-8.7); d2.display(); return 0; }

    Read the article

  • Inlining an array of non-default constructible objects in a C++ class

    - by porgarmingduod
    C++ doesn't allow a class containing an array of items that are not default constructible: class Gordian { public: int member; Gordian(int must_have_variable) : member(must_have_variable) {} }; class Knot { Gordian* pointer_array[8]; // Sure, this works. Gordian inlined_array[8]; // Won't compile. Can't be initialized. }; As even beginner C++ users know, the language guarantees that all members are initialized when constructing a class. And it doesn't trust the user to initialize everything in the constructor - one has to provide valid arguments to the constructors of all members before the body of the constructor even starts. Generally, that's a great idea as far as I'm concerned, but I've come across a situation where it would be a lot easier if I could actually have an array of non-default constructible objects. The obvious solution: Have an array of pointers to the objects. This is not optimal in my case, as I am using shared memory. It would force me to do extra allocation from an already contended resource (that is, the shared memory). The entire reason I want to have the array inlined in the object is to reduce the number of allocations. This is a situation where I would be willing to use a hack, even an ugly one, provided it works. One possible hack I am thinking about would be: class Knot { public: struct dummy { char padding[sizeof(Gordian)]; }; dummy inlined_array[8]; Gordian* get(int index) { return reinterpret_cast<Gordian*>(&inlined_array[index]); } Knot() { for (int x = 0; x != 8; x++) { new (get(x)) Gordian(x*x); } } }; Sure, it compiles, but I'm not exactly an experienced C++ programmer. That is, I couldn't possibly trust my hacks less. So, the questions: 1) Does the hack I came up with seem workable? What are the issues? (I'm mainly concerned with C++0x on newer versions of GCC). 2) Is there a better way to inline an array of non-default constructible objects in a class?

    Read the article

  • parsing command option with default values and range constrains in C

    - by agramfort
    Hi, I need to parse command line arguments in C. My arguments are basically int or float with default values and range constrains. I've started to implement something that look like this: option_float(float* out, int argc, char* argv, char* name, description, float default_val, int is_optional, float min_value, float max_value) which I call for example with: float* pct; option_float(pct, argc, argv, "pct", "My super percentage option", 50, 1, FALSE, 0, 100) however I don't want to reinvent the wheel ! My objective is to have error checking of range constrains, throw an error when the option is not optional and is not set. And generate the help message usually given by usage() function. The usage text would look like this: --pct My super percentage option (default : 50). Should be in [0, 100] I've started with getopt but it is too limited for what I want to do and I feel it still requires me to write too much code for a simple usecase like this. thanks

    Read the article

  • tortoisesvn - Error REPORT request failed on ../../../!svn/vcc/default

    - by John
    Users attempting to check out files from a particular Subversion 1.4.x repository with Apache 2.2 on Windows 2003 have suddenly begun getting an error message in their log windows upon checkout with TortoiseSVN 1.4: Error REPORT request failed on '/[path_to_repo]/!svn/vcc/default' Error REPORT of '/[path_to_repo]/!svn/vcc/default': 200 OK (http://[server_name]) This started following an hd crash on the server and subsequent restore of about 10 subversion repositories. Only one repository is having this problem after an attempted working directory reconciliation. The repo owner reconcile their working directory with the repository by modifying/deleting the hidden .svn directories (though this was not advised). I can't find anything on the Internets that represents my situation. The restored server is exactly as the original and no other repositories on this server are throwing errors. Any ideas on 1) what this error is and 2) how to fix it?

    Read the article

  • URL Routing to Default Page

    - by ewitkows
    Hi everyone, I have an asp.net 4.0 web forms app setup with url rereouting. In development, my app's URL looks perfect. I have a page called enrollnow.aspx that responds to the routing, so if I type in localhost/enrollnow/abc, my app responds as expected. Once promoted into my staging environment however, the URL is off. I have a domain, and a virtual dir created off of my domain called "enrollnow". So basically, my URL outside of development is: mydomain.com/enrollnow/enrollnow/abc - where the first enrollnow is the directory, the second enrollnow is the page name, and the abc is my route value. Is there any way I can have the "default page" respond, so the second enrollnow (which is enrollnow.asp) isnt required? Perhaps I can rename my enrollnow.aspx page to default.aspx, or I can change the mapping in my routetable? Heres my routetable, incase that helps. thanks! Routetable: RouteTable.Routes.Add("PURLRoute", New Route("EnrollNow/{PURL_ID}", New PageRouteHandler("~/EnrollNow.aspx")))

    Read the article

  • How to use default.ctp in cakephp

    - by Louis Stephens
    I just finished the "15 min Blog Post tutorial" included in the documentation for cakephp. I was asked for another tutorial to change the layout for first tutorial. However, I am fairly new to MVC programming/Cakephp and I have no real clue how to do so. Well, I know I need "default.ctp" placed in app/views/layouts/ and I presume I need to include to include my data? . . . I am really at a loss of what to do. I set up my default.ctp as I mentioned above, but when I go to localhost:9999/posts the layout is still the same. I guess I need to include a stylesheet (and if so, where?) I guess if someone can point me in the right direction to a beginner's guide to layout styling or how to use it I would greatly appreciate any help.

    Read the article

  • Horizontal scroll in rich:panel to default right to left

    - by TaylorSmolik
    I have a rich:panel with a style="overflow: scroll" tag inside. By default, the scroll slides left to right. I am constantly adding a new dataTable to a dataGrid with the click of a button and I want the user to always see the most recent one, and since I have it set up so that each dataTable is added as a column to the dataGrid, the most recent one will always be on the right side of the dataGrid. Is there a way I can default the scroll to go right to left? Or maybe creating the columns from right to left?

    Read the article

  • SQL insert default value

    - by Stan
    Say if I have a table like CREATE TABLE [Message] ( [MessageIdx] [int] IDENTITY (1, 1) NOT NULL , [Message] [varchar] (1024) COLLATE Latin1_General_CI_AS NOT NULL , [ValidUntil] [datetime] NULL , CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED ( [MessageIdx] ) WITH FILLFACTOR = 90 ON [PRIMARY] ) ON [PRIMARY] GO I am trying to insert value without specify column names explicitly. Below statement causes error. How can I do that? Thanks. set identity_insert caconfig..fxmessage on; insert into message values (DEFAULT,'blah',DEFAULT); set identity_insert caconfig..fxmessage off;

    Read the article

  • PHP strtotime() setting date to default

    - by Paddyd
    I have a script which is reading values from an excel sheet and inserting them into an sql table. My problem is when the script reads in some of the date fields it is setting them to a default value : 1970-01-01 01:00:00 I have noticed that this is happening when it comes across a date where the 'day' is greater than 12 : 13/05/2012 18:52:33 (dd-mm-yyyy hh-mm-ss) I thought this may be due to the script thinking that this is the month field (i.e american format) and it sees it as an invalid value, so I set the default timezone to my own hoping it may resolve the problem but it made no difference. date_default_timezone_set('Europe/Dublin'); Here is an example of what my code is doing: Excel field value : 01/05/2012 18:32:45 Script: $start_time = $data->val($x,5); echo $start_time = date("Y-m-d H:i:s", strtotime($start_time)); Output: 2012-01-05 18:32:45 This is the exact format I am looking for (except for the fact that the day and month fields are switched around i.e american date format) but it doesnt work for the type of dates I mentioned above.

    Read the article

  • VMWare ESXi, change the default path for a VM

    - by glenatron
    For some reason VMWare ESXi has decided that one of my VMs is on a completely different path to the path it is actually on. So my VM is on /vmfs/volumes/long-guid-here/my-vm-name but when I try to open it I get the message "File < unspecified filename was not found." Which is not really surprising as unspecified filenames are quite difficult to locate. I thought it was just the swap file, which was down in the .vmx file as /vmfs/volumes/long-guid-here/old-vm-name/old-vm-name.vmsd but when I changed that in the vmx it made no difference. What I can't figure out is where VMWare is getting the old-vm-name from- when I look in the "Settings" pane it believes the working file location to be "[datastore-name] old-vm-name\" and I can't find anywhere to change it. Now the files themselves are all named for old-vm-name - so the directory is /my-vm-name/old-vm-name.vmx and so on. Is this the cause of my problems or is there some arcane configuration option elsewhere around the VMWare machine that I need to be tinkering with?

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >