Search Results

Search found 34176 results on 1368 pages for 'project types'.

Page 107/1368 | < Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >

  • Rails polymorphic associations, two assoc types in one class

    - by snitko
    Consider a class: class Link < ActiveRecord::Base has_many :link_votes, :as => :vote_subject, :class_name => 'Vote' has_many :spam_votes, :as => :vote_subject, :class_name => 'Vote' end The problem is, when I'm adding a new vote with @link.link_votes << Vote.new the vote_subject_type is 'Link', while I wish it could be 'link_votes' or something like that. Is this an AR limitation or is there a way to workaround this thing? I've actually found one related answer, but I'm not quite sure about what it says: http://stackoverflow.com/questions/1168047/polymorphic-association-with-multiple-associations-on-the-same-model/1764117#1764117

    Read the article

  • Multiple file types in vim

    - by Chad
    When I am working on a PHP file for example the default filetype is php. This makes sense, however when that PHP file has HTML as well the filetype is still only php. For some plugins that means that I get the PHP functionality for that plugin, but miss out on the HTML functionality. A more specific situation where this happens is with my snippet plugin. I get php snippets and not html snippets when I am editing a php file. Possible solutions to this (which I obviously don't like, hence my posting this question) are: add a map to toggle between different filetypes when I am editing different sections of the file. update my php snippets file to include the html snippets as well (while this would work for the example above, it doesn't solve the fundamental problem). So, Is there a way to edit a file using multiple filetypes at the same time in vim?

    Read the article

  • Should primitive types or non-primitive types be preferred in Java interfaces?

    - by Greg Mattes
    (I thought I once read something about this in a book, but now I'm not sure where to find it. If this question reminds you of some material that you've read, please post a reference!) What are the pros and the cons of primitives in interfaces? In other words, is one of these preferable to the other and why? Perhaps one is preferable to the other in certain contexts? public interface Foo { int getBar(); } or public interface Foo { Integer getBar(); } Similarly: public interface Boz { void someOperation(int parameter); } or public interface Boz { void someOperation(Integer parameter); } Obviously there's the issue of having to deal with nulls in the non-primitive case, but are there deeper concerns?

    Read the article

  • What call from the Android Development Tools API should I use to poll project target loading?

    - by Ricardo Gladwell
    I'm writing my own eclipse plug-in that integrates with the Eclipse Android Development Tools (ADT). However, I'm getting a CoreException ("Project target not loaded yet.") thrown when I attempt to call IProject.build on an Android project as part of a unit test: IProject project = importProject(...); project.build(IncrementalProjectBuilder.FULL_BUILD, monitor); Should I be waiting for the project target to load before calling the above? If so, what call should I use to poll the project target loading status?

    Read the article

  • Question about registering COM server and Add Reference to it in a C# project

    - by smwikipedia
    I build a COM server in raw C++, here is the procedure: (1) write an IDL file to define the interface and library. (2) use msidl.exe to compile the IDL file to necessary .h, .c, .tlb files. (3) implement the COM server in C++ and build a .dll file. (4) add the following registry entris: [HKEY_CLASSES_ROOT\RawComCarLib.ComCar.1\CurVer] @="RawComCarLib.ComCar.1" ;CLSID [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}] @="RawComCarLib.ComCar.1" [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}\InprocServer32] @="D:\com\Project01.dll" [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}\ProgID] @="RawComCarLib.ComCar.1" [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}\TypeLib] @="{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}" ;TypeLib [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}] [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0] @="Car Server Type Lib" [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\0] [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\0\win32] @="D:\com\Project01.tlb" [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\FLAGS] @="0" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\0\win32] @="C:\Windows\System32\msdatsrc.tlb" (5) I try to add reference to the COM by click the Add Reference in the C# project. (6) In the COM tab, I saw my "Car Server Type Lib", it's ok until now. I try to use the Object Browser to browse my COM lib, but the Visual Studio said "the following components could not be browsed", and I noticed that there's no new reference added to the list in the C# project Reference. I can use the tlbimp.exe to generate a interop.CarCom.dll, and then use the COM through this interop dll, but I want this interop assembly to be generated automatically when I just add reference to the COM. Could someone tell me what's wrong? Many thanks.

    Read the article

  • ReadOnly Property in Custom Column Types in Sharepoint

    - by Ray Booysen
    Hey all I'm creating a custom column in a feature for Sharepoint. It is essentially this: <Field Type="Integer" ID="<insert guid here>" ReadOnly="true" Name="xxx" DisplayName="XXX" Group="YYY" /> When the field is deployed and attached to a content type, the content type shows no instance of this field being attached. The documentation about ReadOnly is a bit vague but definitely states that the column will be available for viewing in a View. However, when I create a view it is not available. The moment I remove ReadOnly from the field, it is available on the content type without any problems. Any ideas?

    Read the article

  • F# Multidimensional Array Types

    - by SHiNKiROU
    What's the difference between 'a[,,] and 'a[][][]? They both represent 3-d arrays. It makes me write array3d.[x].[y].[z] instead of array3d.[x, y, z]. Why I can't do the following? > let array2d : int[,] = Array2D.zeroCreate 10 10;; > let array1d = array2d.[0];; error FS0001: This expression was expected to have type 'a [] but here has type int [,]

    Read the article

  • Multidimensional Array with different types in java

    - by Christian
    I want to store a data structure thats a table with one column Strings and another column of Ints. List<Entry<String, Integer>> li = new LinkedList<Entry<String, Integer>>(); would do the job for a list but I would rather have the performance of an array. I tried Entry<String, Integer>[] = new Entry<String, Integer>[10]; but that doesn't seem to work.

    Read the article

  • NHibernate: Mapping collections of value types

    - by Anry
    I have a table Order, Transaction, Payment. Class Order has the properties: public virtual Guid Id { get; set; } public virtual DateTime Created { get; set; } ... I added properties: public virtual IList<Transaction> Transactions { get; set; } public virtual IList<Payment> Payments { get; set; } These properties contain a record of tables [Transaction] and [Payment]. How to keep these lists in the database?

    Read the article

  • Can ASP.net MVC 2 Project and CMS can be Combined together

    - by coolguy97
    Hi, I have developed project using Asp.net MVC 2.Now the content part of My site i don't want to build a Cms for that So my question is can i used any existing CMS developed in MVC2 so that The content part will be taken care of by the CMS and Application part by developed project by me. I have used CMS like Silverstripe which is quite easy which also provides ORM to develop application on their Sapphire engine which but developed in PHP. If it is Combined then when writing Code i will write like this [This just Sample Imaginary Code.I just want CMS to be easy] <logo><Pick_up_from_CMS ID=logo></logo> <menu><Pick_up_from_CMS ID=menu></menu> <header><Pick_up_from_CMS ID=header></header> <body> <Pick_up_from_CMS ID=body> <MY_Application_Logic ID=Logic1><!--This May be my Registration or Search form> --> </body> <footer><Pick_up_from_CMS ID=footer></footer>

    Read the article

  • .NET how to output csv from enumeration of anonymous type?

    - by Ronnie Overby
    Using FileHelpers, I decorated a class with [DelimitedRecord(",")] and was going to output an enumeration of objects of that type as CSV. But, it didn't work because my class inherits from ActiveRecordLinqBase<T>, which caused some problems. So, I was wondering if I could just select an enumeration of anonymous types and somehow have filehelpers generate csv from that. I don't like having to define a class just for FileHelpers to output csv. I would be open to using another csv library, but FileHelpers is proven. EDIT @Foovanadil: This would be the sort of thing I am trying to do: CreateCSV(MyCollection.Select(x=>new{ x.Prop1, x.Prop2, x.Prop3 })); Gives you: Prop1,Prop2,Prop3 val1a,val2a,val3a, val1b,val2b,val3b, etc.....

    Read the article

  • Binary comparison operators on generic types

    - by Brian Triplett
    I have a generic class that takes a type T. Within this class I have a method were I need to compare a type T to another type T such as: public class MyClass<T> { public T MaxValue { // Implimentation for MaxValue } public T MyMethod(T argument) { if(argument > this.MaxValue) { // Then do something } } } The comparison operation inside of MyMethod fails with Compiler Error CS0019. Is it possible to add a constraint to T to make this work? I tried adding a where T: IComparable<T> to the class definition to no avail.

    Read the article

  • The project is not configured for Facelets yet in RAD 8.0

    - by Jyoti
    I am trying to create JSF 2 pages. When I create pages using facelets template I get message on top that "The project is not configured for Facelets yet. You need to add a Facelets runtime to the project's classpath". I created file called Test1.xhtml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11 /DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com /jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com /jsf/html"> <h:head> <title>Test1</title> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> <meta name="GENERATOR" content="Rational® Application Developer for WebSphere® Software" /> </h:head> <h:body> Test </h:body> </html> When I run this I see same content of file in explorer, instead of Test. Also Page code is not created for it.

    Read the article

  • May volatile be in user defined types to help writing thread-safe code

    - by David Rodríguez - dribeas
    I know, it has been made quite clear in a couple of questions/answers before, that volatile is related to the visible state of the c++ memory model and not to multithreading. On the other hand, this article by Alexandrescu uses the volatile keyword not as a runtime feature but rather as a compile time check to force the compiler into failing to accept code that could be not thread safe. In the article the keyword is used more like a required_thread_safety tag than the actual intended use of volatile. Is this (ab)use of volatile appropriate? What possible gotchas may be hidden in the approach? The first thing that comes to mind is added confusion: volatile is not related to thread safety, but by lack of a better tool I could accept it. Basic simplification of the article: If you declare a variable volatile, only volatile member methods can be called on it, so the compiler will block calling code to other methods. Declaring an std::vector instance as volatile will block all uses of the class. Adding a wrapper in the shape of a locking pointer that performs a const_cast to release the volatile requirement, any access through the locking pointer will be allowed. Stealing from the article: template <typename T> class LockingPtr { public: // Constructors/destructors LockingPtr(volatile T& obj, Mutex& mtx) : pObj_(const_cast<T*>(&obj)), pMtx_(&mtx) { mtx.Lock(); } ~LockingPtr() { pMtx_->Unlock(); } // Pointer behavior T& operator*() { return *pObj_; } T* operator->() { return pObj_; } private: T* pObj_; Mutex* pMtx_; LockingPtr(const LockingPtr&); LockingPtr& operator=(const LockingPtr&); }; class SyncBuf { public: void Thread1() { LockingPtr<BufT> lpBuf(buffer_, mtx_); BufT::iterator i = lpBuf->begin(); for (; i != lpBuf->end(); ++i) { // ... use *i ... } } void Thread2(); private: typedef vector<char> BufT; volatile BufT buffer_; Mutex mtx_; // controls access to buffer_ };

    Read the article

  • Types of PNG image in iPhone app

    - by user297491
    I have an iPhone app that picks images from my internet server. It picks images with png extension but only PNG-24 is workings. The problem is that PNG-24 need some disk space and internet bandwith in iphone. I tried using PNG-8 but the iphone does not recognize it. Someone knows if I have a way to use PNG-8 into my app? Thanks!

    Read the article

  • Is it possible to alternate between two types in an XML Schema

    - by lief79
    I'm wondering if I am missing something obvious. I have a list of numbers, possibly including ranges (think of the print page option of a print dialog). Ideally I'd like to have the final XML output look like this, with page and pageRange in an order. <pages> <page> 1</page> <pageRange><start>3</start><end>6</end></pageRange> <page> 34</page> </pages> What would I have to put into a schema to allow this? From what I saw: Sequence with multiple page and page Range allowed doesn't permit alternation. Choice only allows one or the other. I tried messing with all, but I wasn't getting it to validate properly. My short term solution is to have a sequence of ranges, and to force single numbers into the range, but it seems potentially cumbersome. So am I missing something?

    Read the article

  • Return/consume dynamic anonymous type across assembly boundaries

    - by friism
    The code below works great. If the Get and Use methods are in different assemblies, the code fails with a RuntimeBinderException. This is because the .Net runtime system only guarantees commonality of anonymous types (<string, int> in this case) within assemblies. Is there any way to fool the runtime system to overcome this? I can expect the object in the debugger on the Use side, and the debugger can see the relevant properties. class Program { static void Main(string[] args) { UsePerson(); Console.ReadLine(); } public static void UsePerson() { var person = GetPerson(); Console.WriteLine(person.Name); } public static dynamic GetPerson() { return new { Name = "Foo", Age = 30 }; } }

    Read the article

  • create table based on a user defined type

    - by Glen
    Suppose I have a user defined type: CREATE OR REPLACE TYPE TEST_TYPE AS OBJECT ( f1 varchar2(10), f2 number(5) ); Now, I want to create a table to hold these types. I can do the following: create table test_type_table ( test_type_field test_type ); This gives me a table with one column, test_type_field. Is there an easy and automated way to instead create a table such that it has 2 columns, f1 and f2?. So that it's the equivilent to writing: create table test_type_table ( f1 varchar2(10), f2 number(5) );

    Read the article

  • Formatting address of different types

    - by mickyjtwin
    I have various classes which all contain address details, i.e. AddressLine1, AddressLine2, AddressLine3, Suburb, Town, etc. On the front end, I need to format the address in a particular way, i.e. AddressLine1<br /> AddressLine2<br /> Suburb State Postcode If AddressLine2 does not exist or empty, don't show it. Quite straight-forward. I am trying to determine the best way to show this info. At the moment, the Address property of each class calls a FormatAddress method which writes out the html string. This exists as a method of the class. My opinion is that any formatting should exist from the front-end control i.e. ascx etc. However, if these DetailClasses need to format the same address info, what would be the best option, also making it easier to maintain?

    Read the article

  • Has anyone used Ant4Eclipse with Project Lombok?

    - by gmcnaughton
    Has anyone successfully used Ant4Eclipse (http://www.ant4eclipse.org/) in combination with Project Lombok (http://projectlombok.org/)? Lombok provides annotations for removing boilerplate code; however, it doesn't appear to play nicely with Ant4Eclipse (headless compilation of Eclipse projects). For instance, the following Lombok sample compiles fine in Eclipse and javac: import lombok.Getter; public class LombokTest { private @Getter String foo; public LombokTest() { String s = this.getFoo(); } } But compiling with Ant4Eclipse's <buildJdtProject> yields the following: [javac] Compiling 1 source file [javac] ---------- [javac] 1. WARNING in C:\dev\Java\workspace\LombokTest\src\LombokTest.java (at line 4) [javac] private @Getter String foo; [javac] ^^^ [javac] The field LombokTest.foo is never read locally [javac] ---------- [javac] 2. ERROR in C:\dev\Java\workspace\LombokTest\src\LombokTest.java (at line 8) [javac] String s = this.getFoo(); [javac] ^^^^^^ [javac] The method getFoo() is undefined for the type LombokTest [javac] ---------- Has anyone successfully used these libraries together? Thanks! Edit: sample project demonstrating the issue

    Read the article

< Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >