Search Results

Search found 8616 results on 345 pages for 'primitive types'.

Page 16/345 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • hook_form for multiple content types defined by the same module

    - by pao13gate
    A new module 'foo' implements foo_node_info() where one or more new content types can be defined. If foo_node_info() defines two content types, namely a content type 'footypea' and a content type 'footypeb', how does one go about implementing hook_form() (what should the name of the "hook" be?) to configure each node's editing form? In the drupal example, the name of the new content type is the same as the module name. What happens in the above described example where two new content types are defined by the module? Should the implemented hook_form() function be of the form: footypea_form() and footypeb_form() ? (this doesn't seem to work) Or should you implement a single foo_form() function and within this create and return an array $form with elements $form['footypea'] and $form['footypeb'] that are in turn arrays of the individual form field definitions?

    Read the article

  • Why is it that an int in C++ that isnt initialized (then used) doesn't return an error?

    - by omizzle
    I am new to C++ (just starting). I come from a Java background and I was trying out the following piece of code that would sum the numbers between 1 and 10 (inclusive) and then print out the sum: /* * File: main.cpp * Author: omarestrella * * Created on June 7, 2010, 8:02 PM */ #include <cstdlib> #include <iostream> using namespace std; int main() { int sum; for(int x = 1; x <= 10; x++) { sum += x; } cout << "The sum is: " << sum << endl; return 0; } When I ran it it kept printing 32822 for the sum. I knew the answer was supposed to be 55 and realized that its print the max value for a short (32767) plus 55. Changing int sum; to int sum = 0; would work (as it should, since the variable needs to be initialized!). Why does this behavior happen, though? Why doesnt the compiler warn you about something like this? I know Java screams at you when something isnt initialized. Thank you.

    Read the article

  • How are value types implemented in .NET

    - by Michael
    Been looking around the net and can't find any articles about how value types are actually implemented. For instance, an Int32 is a struct and it's direct parent is System.ValueType and that's ultimate parent is System.Object. Object is a class - I imagine ValueType is a class? What's the class hierarchy? What part does the CLR have to play? At what stage and how does the CLR know to allocate value types to the stack? (FYI, I am aware that value types are stored where they are declared).

    Read the article

  • Call methods on native Javascript types without wrapping with ()

    - by Anurag
    In Javascript, we can call methods on string literals directly without enclosing it within round brackets. But not for other types such as numbers, or functions. It is a syntax error, but is there a reason as to why the Javascript lexer needs these other types to be enclosed in round brackets? For example, if we extend Number, String, and Function with an alert method and try calling this method on the literals, it's a SyntaxError for Number and Function, while it works for a String. function alertValue() { alert(this); } Number.prototype.alert = alertValue; String.prototype.alert = alertValue; Function.prototype.alert = alertValue; We can call alert directly on a string object: "someStringLiteral".alert() // alerts someStringLiteral but it's a SyntaxError on numbers, and functions. 7.alert(); function() {}.alert(); To work with these types, we have to enclose it within brackets: (7).alert(); // alerts "7" (function() {}).alert(); // alerts "function() {}"

    Read the article

  • C++ associative array with arbitrary types for values

    - by Gerald Kaszuba
    What is the best way to have an associative array with arbitrary value types for each key in C++? Currently my plan is to create a "value" class with member variables of the types I will be expecting. For example: class Value { int iValue; Value(int v) { iValue = v; } std::string sValue; Value(std::string v) { sValue = v; } SomeClass *cValue; Value(SomeClass *v) { cValue = c; } }; std::map<std::string, Value> table; A downside with this is you have to know the type when accessing the "Value". i.e.: table["something"] = Value(5); SomeClass *s = table["something"].cValue; // broken pointer Also the more types that are put in Value, the more bloated the array will be. Any better suggestions?

    Read the article

  • C# : Problem in creating diffrent types of columns in a gridview

    - by Royson
    My windows form application has a grid view control with filename as a default column. User should create a column of following types Text, Number, Currency, Combo Box, Check Box, Radio Button ,Date time type (should display DateTimePicker control) and Hyper Link type. After that i want to pass all rows to next screen for further processing. We can create a column of these types in a grid view but how can i store it in a data table so that i can pass it to next screen. Or should i create a column in a data table and then assign data table to grid view by gridview.DataSource = dt; but can we create a these types of columns in a data table. I am so confused!! Please help me to solve this problem. Thanks

    Read the article

  • iPhone : Primitives getters and setters

    - by Burf2000
    I feel a bit miffed at the moment, I done a few iPhone projects that use floats and ints etc and all is fine. I now using OpenGL and GLFloat[] C arrays etc and it seems unless I make methods to set / get them it crashes on the device (not the simulator). Now as these are not setup as properties (I don't think c arrays can) it kind of makes sense. However the project has been working for months without them. It seems something in the code is wiping out anything float / ints to the point that the debugger can see an assigned value but accessing it crashes the phone. As soon as I think I know something for this platform, something changes my mind lol.

    Read the article

  • Available Instance types for marketplace ami's

    - by Christian
    I based my autoscaling AMI's on the Turnkey Linux nginx AMI from the marketplace. I am now unable to select any of the newer generation instance types; for instance, my autoscaling uses m3.large type but I'd really like it to use the c3.xlarge type but every time I try to create a c3.xlarge instance with my AMI I get errors; The instance configuration for this AWS Marketplace product is not supported. My question is; Can I override this? I'm not using TKL support or any of their services, just the AMI. If I can't override it, do I have any other options besides creating a brand new AMI from scratch to use?

    Read the article

  • hiera_include equivalent for resource types

    - by quickshiftin
    I'm using the yumrepo built-in type. I can get a basic integration to hiera working yumrepo { hiera('yumrepo::name') : metadata_expire => hiera('yumrepo::metadata_expire'), descr => hiera('yumrepo::descr'), gpgcheck => hiera('yumrepo::gpgcheck'), http_caching => hiera('yumrepo::http_caching'), baseurl => hiera('yumrepo::baseurl'), enabled => hiera('yumrepo::enabled'), } If I try to remove that definition and instead go for hiera_include('classes'), here's what I've got in the corresponding yaml backend classes: - "yumrepo" yumrepo::metadata_expire: 0 yumrepo::descr: "custom repository" yumrepo::gpgcheck: 0 yumrepo::http_caching: none yumrepo::baseurl: "http://myserver/custom-repo/$basearch" yumrepo::enabled: 1 I get this error on an agent Error 400 on SERVER: Could not find class yumrepo I guess you can't get away from some sort of minimal node declaration w/ hiera and resource types? Maybe hiera_hash is the way to go? I gave this a shot, but it produces a syntax error yumrepo { 'hnav-development': hiera_hash('yumrepo') }

    Read the article

  • How can I view a PDF in Firefox when the server specifies the wrong content type?

    - by Sam
    I am using Mozilla Firefox with a PDF viewer plug-in. The plug-in has been correctly associated with Adobe Reader files to view them in the browser in the settings. I would like to be able to view PDF files in Firefox rather than downloading them. This already works correctly when a web server indicates that a file has the Content-Type of application/pdf. However, some web servers provide other Content-Types for PDFs, such as application/octet-stream. (See this example of a PDF served with a non-pdf Content-Type.) I have looked at Firefox's MimeTypes.rdf file, and it appears to only support mapping applications based on file types for non-Internet-based files. How can I have Firefox view all PDF documents in-browser rather than only the ones with the application/pdf Content-Type?

    Read the article

  • block access to certain website types

    - by frustrated teacher
    Need to block access to certain website types without listing each URL to block. Students at secondary school are going to porn sites. Need to be able to block all such access without having to list each possible site URL. Having the Content -- Ratings tab set to None for all categories on the ratings files listed on my computers does not prevent access. Unchecking users may access sites with no rating, even with the security settings set to High, still allows the porn sites to come up. If that is checked, then ONLY listed sites can open and students would not be able to do any research via google, for example. I would rather not have to continue checking each computer and blocking sites as they find them.

    Read the article

  • Ndepend CQL to query types out of assembly wildcard

    - by icelava
    In order to determine what low-level framework types a web application is directly using, one has to define each and every assembly involved. SELECT TYPES FROM ASSEMBLIES "Company.System.Framework", "Company.System.Framework.ReferenceLookup", "Company.System.Framework.Web", "Company.System.Framework.Security", "Company.System.Framework.Logging", "Company.System.Framework.DMS" WHERE IsDirectlyUsedBy "WebAssembly" I cannot find any syntax to wildcard the list of assemblies. Is there no way to shortcut this? We have a lot of framework level assemblies. i.e. Company.System.Framework.*

    Read the article

  • .NET Settings File Available Types

    - by Mashmagar
    When modifying a .NET settings file, I'm given a choice of types for a setting. However, not all of the types accessible by my project appear, even in the 'Browse' window. What determines if a type can be used for a setting file setting? I have a type I created that I would like to be able to save, and I want to know what I need to change about it to use it in a settings file. (VS 2008 - .Net 3.5)

    Read the article

  • Model relationship types in cakePhP

    - by kwokwai
    I have checked out the cookbook web site of cakephp that there are four types Model relationship: http://book.cakephp.org/view/79/Relationship-Types Since the one I am more familiar with is belongsTo, I am not sure when I need to use hasManay and HABTM. What will be the result to my web site if I used a wrong Model relationship type? Please advise.

    Read the article

  • Multiple Connection Types for one Designer Generated TableAdapter

    - by Tim
    I have a Windows Forms application with a DataSet (.xsd) that is currently set to connect to a Sql Ce database. Compact Edition is being used so the users can use this application in the field without an internet connection, and then sync their data at day's end. I have been given a new project to create a supplemental web interface for displaying some of the same reports as the Windows Forms application so certain users can obtain reports without installing the Windows app. What I've done so far is create a new Web Project and added it to my current Solution. I have split both the reports (.rdlc) and DataSets out of the Windows Forms project into their own projects so they can be accessed by both the Windows and Web applications. So far, this is working fine. Here's my dilemma: As I said before, the DataSets are currently set up to connect to a local Sql Ce database file. This is correct for the Windows app, but for the Web application I would like to use these same TableAdapters and queries to connect to the Sql Server 2005 database. I have found that the designer generated, strongly-typed TableAdapter classes have a ConnectionModifier property that allows you to make the TableAdapter's Connection public. This exposes the Connection property and allows me to set it, however it is strongly-typed as a SqlCeConnection, whereas I would like to set it to a SqlConnection for my Web project. I'm assuming the DataSet Designer strongly-types the Connection, Command, and DataAdapter objects based on the Provider of the ConnectionString as indicated in the app.config file. Is there any way I can use some generic provider so that the DataSet Designer will use object types that can connect to both a Sql Ce database file AND the actual Sql Server 2005 database? I know that SqlCeConnection and SqlConnection both inherit from DbConnection, which implements IDbConnection. Relatively, the same goes for SqlCeCommand/SqlCommand:DbCommand:IDbCommand. It would be nice if I could just figure out a way for the designer to use the Interface types rather than the strong types, but I'm hesitant that that is possible. I hope my problem and question are clear. Any help is much appreciated. Let me know if there's anything I can clarify.

    Read the article

  • Problem determining how to order F# types due to circular references

    - by James Black
    I have some types that extend a common type, and these are my models. I then have DAO types for each model type for CRUD operations. I now have a need for a function that will allow me to find an id given any model type, so I created a new type for some miscellaneous functions. The problem is that I don't know how to order these types. Currently I have models before dao, but I somehow need DAOMisc before CityDAO and CityDAO before DAOMisc, which isn't possible. The simple approach would be to put this function in each DAO, referring to just the types that can come before it, so, State comes before City as State has a foreign key relationship with City, so the miscellaneous function would be very short. But, this just strikes me as wrong, so I am not certain how to best approach this. Here is my miscellaneous type, where BaseType is a common type for all my models. type DAOMisc = member internal self.FindIdByType item = match(item:BaseType) with | :? StateType as i -> let a = (StateDAO()).Retrieve i a.Head.Id | :? CityType as i -> let a = (CityDAO()).Retrieve i a.Head.Id | _ -> -1 Here is one dao type. CommonDAO actually has the code for the CRUD operations, but that is not important here. type CityDAO() = inherit CommonDAO<CityType>("city", ["name"; "state_id"], (fun(reader) -> [ while reader.Read() do let s = new CityType() s.Id <- reader.GetInt32 0 s.Name <- reader.GetString 1 s.StateName <- reader.GetString 3 ]), list.Empty ) This is my model type: type CityType() = inherit BaseType() let mutable name = "" let mutable stateName = "" member this.Name with get() = name and set restnameval=name <- restnameval member this.StateName with get() = stateName and set stateidval=stateName <- stateidval override this.ToSqlValuesList = [this.Name;] override this.ToFKValuesList = [StateType(Name=this.StateName);] The purpose for this FindIdByType function is that I want to find the id for a foreign key relationship, so I can set the value in my model and then have the CRUD functions do the operations with all the correct information. So, City needs the id for the state name, so I would get the state name, put it into the state type, then call this function to get the id for that state, so my city insert will also include the id for the foreign key. This seems to be the best approach, in a very generic way to handle inserts, which is the current problem I am trying to solve.

    Read the article

  • COBOL Data types

    - by Manasi
    Hi, I have confusion regarding COBOL data types. Like in many interviews it is asked to explain the difference between COMP-3 and COMP... what is the exact difference? what is the meaning of usage modes in COBOL and how is it related to data types? Thanks and Regards, Manasi Kulkarni

    Read the article

  • g++ compiler complains about conversions between related types (from int to enum, from void* to clas

    - by Slav
    g++ compiler complains about conversions between related types (from int to enum, from void* to class*, from const char* to unsigned char*, etc.). Compiler handles such convertions as errors and won't compile furthermore. It occurs only when I compile using Dev-C++ IDE, but when I compile the same code (using the compiler which Dev-C++ uses) such errors (even warnings) do not appears. How to mute errors of such types?

    Read the article

  • Unity view Registered Types during debug

    - by Jon Archway
    Possibly a stupid question, but during debug I simply want to see the types that have been registered with my Unity container. I have tried going through the container in the watch window, but can't seem to find what I am looking for? I am expecting there to be a list of registered types somewhere? Thanks in advance

    Read the article

  • Append INPUT to TEXTAREA as being types in JQuery

    - by Ricky
    I have an INPUT text box. As someone types into the INPUT text box, i need it to append/add-to a TEXTAREA value. Lets say user types '12345' into the text box. The textarea (default value="Comment: ") will automatically add: 'Comment: 12345'. Adding '12345' as they type.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >