Search Results

Search found 40730 results on 1630 pages for 'type erasure'.

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

  • Scala type conversion error, need help!

    - by Mansoor Ashraf
    Hello I am getting a weird error when trying to use a Java map in Scala. This is the snippet of code val value:Double = map.get(name) if (value eq null) map.put(name, time) else map.put(name, value + time) the map is defined as val map=new ConcurrentHashMap[String,Double] and this is the error I am getting error: type mismatch; found : Double required: ?{val eq: ?} Note that implicit conversions are not applicable because they are ambiguous: both method double2Double in object Predef of type (Double)java.lang.Double and method doubleWrapper in object Predef of type (Double)scala.runtime.RichDouble are possible conversion functions from Double to ?{val eq: ?} if (value eq null) map.put(name, time) I am new to Scala so I am having a hard time parsing the stacktrace. Any help would be appreciated

    Read the article

  • Retrieve a facebook page's type

    - by HectorMac
    I am trying to display a list of pages similar to the facebook search results. Along with the page's name, I would like to display the page type. The page's type property (from the Pages.getInfo API call returns the rather unfriendly looking strings from this list: http://wiki.developers.facebook.com/index.php/Page_Types Is there any way to map these to or retrieve the actual type descriptions facebook uses for page types in the facebook search results? These are not only more presentable, but appear to be less granular (both good things for my purpose).

    Read the article

  • Find elements based on xsd type with lxml

    - by joet3ch
    I am trying to get a list of elements with a specific xsd type with lxml 2.x and I can't figure out how to traverse the xsd for specific types. Example of schema: <xsd:element name="ServerOwner" type="srvrs:string90" minOccurs="0"> <xsd:element name="HostName" type="srvrs:string35" minOccurs="0"> Example xml data: <srvrs:ServerOwner>John Doe</srvrs:ServerOwner> <srvrs:HostName>box01.example.com</srvrs:HostName> The ideal function would look like: elements = getElems(xml_doc, 'string90') def getElems(xml_doc, xsd_type): ** xpath or something to find the elements and build a dict return elements

    Read the article

  • Drupal 5: CCK fields in custom content type

    - by Kuroki Kaze
    I have module that implements custom content type via NodeAPI hooks (hook_insert, hook_update etc). I want to add CCK field to this content type and populate it via hook_nodeapi calls like create or update (to show content nodes in Views). Problem is, I cannot access CCK fields for this content type. Sure, it's enabled on "Manage Fields" page, but when I load any node of this type with Devel module, I cannot see field attribute (field_flag) in node object. I can see it under "Dev Render" tab as part of "content" attribute, like $node-content['field_flag']['#value'], but if I assign value to $node-field_flag or $node-content['field_flag']['#value'] and call node_save, CCK fields are not saved. Maybe I must call some other function to save CCK fields? Or what may be wrong with this setup?

    Read the article

  • Convert float to decimal in Informix

    - by prabhu
    I have a table with a column of type decimal. There is a ESQL/C structure that represents the table. It has a member of type decimal. I also have a normal C structure for equivalent for the same table. The type of the above mentioned field is a float. Since we use memcpy to copy data to and from ESQL/C structure to C structure, there is an issue with decimal to float conversion. When I searched the Informix ESQL/C Programmer's manual, I couldn't find any function that can do this. Google search led me to the deccvflt() function. This function converts from a float to a decimal type. Though I couldn't find this function listed in the manual, I see the declarations in decimal.h. Are these functions still recommended to be used? Alternatively, I was also thinking about using the decimal type in the C structure also, as it happens to be a C structure. This way, I can still use the memcpy right? Please share your thoughts. IBM Informix Dynamic Server Version 11.50.FC3 Thanks, prabhu

    Read the article

  • Getting "value is not defined" while inheriting a type

    - by James Black
    I can't see what I am doing wrong, as the files are in the correct order. In this case it is: BaseDAO.fs CreateDatabase.fs They are in the same namespace, but even when I had them in different modules, and opened the module in CreateDatabase the same error. The error is: Error 1 The value or constructor 'execNonQuery' is not defined I am trying to inherit BaseDAO and use a member that will be common to several files, and I don't see why I get the error above. namespace RestaurantServiceDAO open MySql.Data.MySqlClient type BaseDAO() = let connString = @"Server=localhost;Database=mysql;Uid=root;Pwd=$$$$;" let conn = new MySqlConnection(connString) member self.execNonQuery(sqlStr) = conn.Open() let comm = new MySqlCommand(sqlStr, conn, CommandTimeout = 10) comm.ExecuteNonQuery |> ignore comm.Dispose |> ignore The type that does inherit is here, and execNonQuery is not defined. namespace RestaurantServiceDAO open MySql.Data.MySqlClient type CreateDatabase() = inherit BaseDAO() let createRestaurantTable conn = execNonQuery "CREATE TABLE restaurant(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), cur_timestamp TIMESTAMP(8))"

    Read the article

  • What permissions are required to create a new work item type in TFS

    - by harsha
    I am new to creating work item types in TFS and want to create a new Work Item type. I looked at work item template option, but that is not sufficient for me. I need to add few new fields and have a customized form. From search I got information about Work Item Type definition but I am looking for some detailed example. Also I would like to know the permissions needed to add a new work item type. I got administrator privileges for my project, but not on TFS as a whole. With that can I add a new template for my project. Please provide me direction.

    Read the article

  • rails: date type and GetDate

    - by cbrulak
    This is a follow up to this question: http://stackoverflow.com/questions/2930256/unique-responses-rails-gem I'm going to create an index based on the user id, url and a date type. I want date type (not datetime type) because I want the day, the 24 hour day to be part of the index to avoid duplication of page views counts on the same day. In other words: A view only counts once in a day by a visitor. I also want the default value of that column (viewdate) to be the function GETDATE(). This is what I have in my migration: execute "ALTER TABLEpage_viewsADD COLUMN viewdate datetime DEFAULTGETDATE()`" But the value viewdate is always empty. What am I missing? (as an aside, any other suggestions for accomplishing this goal?)

    Read the article

  • C# LINQ Where Predicate Type Arguments

    - by blu
    I have an XElement with values for mock data. I have an expression to query the xml: Expression<Func<XElement, bool>> simpleXmlFunction = b => int.Parse(b.Element("FooId").Value) == 12; used in: var simpleXml = xml.Elements("Foo").Where(simpleXmlFunction).First(); The design time error is: The type arguments for method 'System.Linq.Enumerable.Where(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly' The delegate supplied to Where should take in an XElement and return a bool, marking if the item matches the query, I am not sure how to add anything more to the delegate or the where clause to mark the type. Also, the parallel method for the real function against the Entity Framework does not have this issue. What is not correct with the LINQ-to-XML version?

    Read the article

  • Displaying UserControls based on the type a TreeView selection is bound to

    - by Ray Wenderlich
    I am making an app in WPF in a style similar to Windows Explorer, with a TreeView on the left and a pane on the right. I want the contents of the right pane to change depending on the type of the selected element in the TreeView. For example, say the top level in the Tree View contains objects of class "A", and if you expand the "A" object you'll see a list of "B" objects as children of the "A" object. If the "A" object is selected, I want the right pane to show a user control for "A", and if "B" is selected I want the right pane to show a user control for "B". I've currently got this working by: setting up the TreeView with one HierarchialDataTemplate per type adding all the UserControls to the right pane, but collapsed implementing SelectedItemChanged on the TreeView, and setting the appropriate usercontrol to visible and the others to collapsed. However, I'm sure there's a better/more elegant way to switch out the views based on the type the selection is bound to, perhaps by making more use of data binding... any ideas?

    Read the article

  • Findbugs warning: Equals method should not assume anything about the type of its argument

    - by Uri
    When running FindBugs on my project, I got a few instances of the error described above. Namely, my overriding versions of equals cast the RHS object into the same type as the object in which the overriding version is defined. However, I'm not sure whether a better design is possible, since AFAIK Java does not allow variance in method parameters, so it is not possible to define any other type for the equals parameter. Am I doing something very wrong, or is FindBugs too eager? A different way to phrase this question is: what is the correct behavior if the object passed to equals is not the same type as an LHS: Is this a false, or should there be an exception? For example: public boolean equals(Object rhs) { MyType rhsMyType = (MyType)rhs; // Should throw exception if(this.field1().equals(rhsMyType.field1())... // Or whatever }

    Read the article

  • Delphi> Please explain this: type... procedure of object

    - by Richard Woolf
    I've encountered some code that's new to me... I've never really seen a type declaration of a procedure of object, and I just don't see the point. Why couldn't the developer simply keep a field of type Boolean? interface type TFinishedCaptureEvent = procedure(AFinished: Boolean) of object; TFrameCard = class(TFrame) ... private FOnFinishedCapture: TFinishedCaptureEvent; public property OnFinishedCapture: TFinishedCaptureEvent read FOnFinishedCapture write FOnFinishedCapture; end; implementation ... if Assigned(FOnFinishedCapture) then FOnFinishedCapture(False);

    Read the article

  • How to add response headers based on Content-type, or getting Content-type before the response is co

    - by Bozho
    I want to set the Expires header for all image/* and text/css. I'm doing this in a Filter. However: before calling chain.doFilter(..) the Content-type is not yet "realized" after calling chain.doFilter(..) the Content-type is set, but so is content-length, which forbids adding new headers (at least in Tomcat implementation) I can use the extensions of the requested resource, but since some of the css files are generated by richfaces by taking them from inside jar-files, the name of the file isn't x.css, but is /xx/yy/zz.xcss/DATB/.... So, is there a way to get the Content-type before the response is committed.

    Read the article

  • Deserialize Stream to List<T> or any other type

    - by Sam
    Attempting to deserialize a stream to List<T> (or any other type) and am failing with the error: The type arguments for method 'Foo.Deserialize<T>(System.IO.Stream)' cannot be inferred from the usage. Try specifying the type arguments explicitly. This fails: public static T Deserialize<T>(this Stream stream) { BinaryFormatter bin = new BinaryFormatter(); return (T)bin.Deserialize(stream); } But this works: public static List<MyClass.MyStruct> Deserialize(this Stream stream) { BinaryFormatter bin = new BinaryFormatter(); return (List<MyClass.MyStruct>)bin.Deserialize(stream); } or: public static object Deserialize(this Stream stream) { BinaryFormatter bin = new BinaryFormatter(); return bin.Deserialize(stream); } Is it possible to do this without casting, e.g. (List<MyStruct>)stream.Deserialize()?

    Read the article

  • How to retrieve a bigint from a database and place it into an Int64 in SSIS

    - by b0fh
    I ran into this problem a couple years back and am hoping there has been a fix and I just don't know about it. I am using an 'Execute SQL Task' in the Control Flow of an SSIS package to retrieve a 'bigint' ID value. The task is supposed to place this in an Int64 SSIS variable but I getting the error: "The type of the value being assigned to variable "User::AuditID" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object." When I brought this to MS' attention a couple years back they stated that I had to 'work around' this by placing the bigint into an SSIS object variable and then converting the value to Int64 as needed. Does anyone know if this has been fixed or do I still have to 'work around' this mess? edit: Server Stats Product: Microsoft SQL Server Enterprise Edition Operating System: Microsoft Windows NT 5.2 (3790) Platform: NT INTEL X86 Version: 9.00.1399.06

    Read the article

  • Access to an inner type

    - by sohum
    A colleague of mine posted a question on an internal forum which got me thinking about whether this was possible through C#. Basically, he's got an interface as follows: public interface IProvider<T> { T GetT(); } Is it possible to use something that implements that interface as a type parameter to another generic class and have access to the type T without re-specifying it? For example: public class Foo<P> where P : IProvider<T> { P p; T GetInnerT() { return p.GetT(); } } This does not compile, because the type T is not defined and hence can't be used as a parameter for IProvider. Is something like this even possible? Just curious!

    Read the article

  • Font-awesome, input type 'submit'

    - by denis.peplin
    It seems no class for input type 'submit' in font-awesome. Is it possible to use some class from font-awesome for button input? I've added icons to all buttons (which actually links with class 'btn' from twitter-bootstrap) in my applications, but can't add icons on 'input type submit'. Or, how to use this code: input#image-button{ background: #ccc url('icon.png') no-repeat top left; padding-left: 16px; height: 16px; } html: <input type="submit" id="image-button">Text</input> (which I took from HTML: How to make a submit button with text + image in it?) with font-awesome?

    Read the article

  • Activator.CreateInstance with type name as string and including parameters

    - by Kelly
    I am working in .Net 3.5, looking at all the various constructors for Activator.CreateInstance. I want to create an instance of a class, calling a particular constructor. I do not have the class type, only its name. I have the following, which works, but actually winds up calling the parameterless constructor first, then the one I want. This is not a terribly big deal, but the parameterless constructor calls a rather busy base constructor, and the constructor I want to call does, too. In other words, given a type, calling CreateInstance with parameters is easy (only the last two lines below), but given only a type name, is there a better way than this? ObjectHandle oh = Activator.CreateInstance( "MyDllName", "MyNS." + "MyClassName" ); object o = oh.Unwrap( ); object newObj = Activator.CreateInstance( o.GetType( ), new object[] { param1 } ); return ( IMyDesiredObject )newObject; Thanks!

    Read the article

  • Bound a treeview control to user-defined complex type using EF 4

    - by GIbboK
    Hi, I use Asp.net, SQL 2008 and EF 4. I need display hierarchy data in a treeview control, Data is stored in a DB that use HierarchyId. Unfortunately, EF4 doesn't support HierarchyId. So in this case, I thought to have a stored procedure that deals with my hierarchy and return a result set back to EF that EF4 can turn into a collection of user-defined complex type that can then be bound directly to the treeview control. I imported a SPROC in EF 4 using Import Function and now I have a Complex DataType called: CategoryHierarchy_Result An image of my Model: Here some data from the Complex Type (in a GridView for example GridView1.DataSource = context.CategoryHierarchy(1);): My questions is: How to display my data from my Complex Type in a TreeView Control, showing a Tree structure that respect CategoryNodeString? I am a beginner an I never use TreeView before, any help or resource would be appreciated! Thanks!. Here some useful resource: http://www.robbagby.com/entity-framework/entity-framework-modeling-action-stored-procedures/

    Read the article

  • wanna store Object in MySQL database

    - by kandarp
    I have a variable in java which return type is Object(java.lang.Object). I want to store this variable value in MySQL database without casting in any other primitive data type. Is there any data type available in MySQL related to Object? If anybody knows, please reply at your earliest time. Thanks,

    Read the article

  • Jquery Ajaxform with input type=file and multifile

    - by crunchingnumbers
    Im using ajax form with multifile. However ajaxform just seems to quietly die and does not do anything if using multifile. Multifile is just a jquery plugin that builds a list of input type=file so that you can upload multiple files at once, before which you can add/delete your file upload list. I've looked at multifile and made one change to ensure that it generated a unique name as well as id which it didn't do before and i've checked the form elements multifile is building which all appear to be correct. From looking at ajaxform, it seems that it shoulld just generate the iframe as normal and post the multiple input type=file but it does nothing. Has anyone else experienced problems with multiple input type=file uploads

    Read the article

  • Type Declaration - Pointer Asterisk Position

    - by sahs
    Hello, in C++, the following means "allocate memory for an int pointer": int* number; So, the asterisk is part of the variable type; without it, that would mean something else (that's why I usually don't separate the asterisk from the variable type). Then what is the reason the asterisk is considered something else, instead of being part of the type? For example, it seems better, if the following meant "allocate memory for two int pointers": int* number1, number2; Am I wrong?

    Read the article

  • EntityFramework: Access dabase-column using user defined Type

    - by Nils
    I "inherited" an old Database where dates are stored as Int32 values (times too, but dates shall suffice for this example) i.e. 20090101 for Jan. 1st 2009. I can not change the schema of this database because it is still accessed by the old programs. However I want to write a new program using EF as the O/R-M. Now I'd love to have DateTime-Values in my Model. Is there a way to write a custom type and use this as a Type in the EF-Model. Something like a Type "OldDate" with properties: DatabaseValue : Int23 Value : DateTime (specifying the date-part whereas the time-part is always 0:00:00) Is something like this possible with the EF-Model ?

    Read the article

  • Why is the 'this' keyword not a reference type in C++ [closed]

    - by Dave Tapley
    Possible Duplicates: Why ‘this’ is a pointer and not a reference? SAFE Pointer to a pointer (well reference to a reference) in C# The this keyword in C++ gets a pointer to the object I currently am. My question is why is the type of this a pointer type and not a reference type. Are there any conditions under which the this keyword would be NULL? My immediate thought would be in a static function, but Visual C++ at least is smart enough to spot this and report static member functions do not have 'this' pointers. Is this in the standard?

    Read the article

  • Teaching a kid to type in order to start programming

    - by at
    My 5 year old wants to start programming, but he doesn't yet know how to type without looking for each letter 1 at a time. I know it's going to frustrate him to go so slow because of his typing speed. And it's not going to be fun looking for all the letters constantly... So what's the best way to get him to type fast? Clearly he'll need to type a lot of punctuation like semicolons, colons and symbols. So his little hands will have to get used to spreading over the keyboard... I did some google searches and found some very poor looking apps that focused on the letters.

    Read the article

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