w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Entity Framework 5 table-per-type update, change sub type but keep same base type
I don't have a good answer, but I can think of four "solutions" that are really workarounds: Don't use DBMS-computed values for your primary keys (if you already use natural keys, it's fine). Use DBMS-computed surrogate keys. Follow something like the state pattern. Do some evil voodoo with the object state manager. Update: There seems to be a popular consensus that trying isn't even worth it; most people thus simply use stored procedures instead to work around the problem. Changing Inherited Types in Entity Framework Entity Framework: Inheritance, change object type Changing the type of an (Entity Framework) entity that is part of an inheritance hierarchy Changing the type of an entity that is part of an inheritance hierarchy Using natural keys First, remember that the objects tr

Categories : Entity Framework

Typescript Error Message error TS2173: Generic type references must include all type arguments
That line should have been: promise(type?: any, target?: any): JQueryPromise<any>; I'll send them a pull request. Thanks. JQueryPromise is a generic interface. i.e. it takes type parameters. Starting with TS 0.9.1.1 they are more strict about generic parameters. They must be specified from now on. This was allowed in previous versions (where the type was assumed to any implicitly) but the compiler analysis is stricter now (and the type must be specified explicitly).

Categories : Typescript

Error: Array type has incomplete element type and binary operand error
for "My first question: What does array type has incomplete element type mean?" this error occur because in c language you need to specify the array size if you are not declaring it like int arr[] = {6,1,2,3}; otherwise it should be int arr[<size of the array>]; for invalid operands to binary * error? it occurs because you are trying to multiply int and int * values consider seeing this http://forums.devshed.com/c-programming-42/dynamic-arrays-with-undeclared-size-62036.html and read some more tutorials about pointers and arrays and how to mix them

Categories : C

Scala: higher-kinded types, type projections and type mismatch error
@ziggystar says it: Drop the bound B and use M[X] directly: class TransM[X[_]](val b: M[X]) extends M[CurriedTrans[X, M[X]]#Type] { def from[A](f: T[A]) = b.from(f.r).get } val x1 = new TransM(new ListM) You could consider to do the same for Trans and CurriedTrans. If you need the inner type of M, you can always expose it through a type member of Trans and CurriedTrans.

Categories : Scala

Processing Java Error: The nested type (Node) cannot hide an enclosing type
Check if your tab or sketch name is the same as program's inner class name. Change the name of your tab/sketch and you'll be fine. Rename your sketch (foo.pde) which is also the name of the tab to something other than the class name. The main sketch in processing cannot have a nested class with the same name, other sketches (other tabs) can have classes that are the same name as the tab.

Categories : Java

Synat error - The type of the expression must be an array type but it resolved to String
Well yes - data is a String, and you can't use an indexing expression like data[i] on a string. Perhaps you want: if (b.toString().equals(data.substring(i, i + 1)) Although it's far from clear that that's a good idea. Byte.toString probably doesn't do what you expect it to. Perhaps you actually want: if ((char) b == data.charAt(i)) ?

Categories : Java

Oracle ODAC error setting up website in IIS: type A cannot be cast to type B?
Looks like an old version of the data access DLL is installed in the GAC. Does the DLL in c:windowsmicrosoft.net... exist? If not, you may have to provide a copy of it in a bin folder and update your config to use the DLL in the bin. This assumes you want to use the new version and not the old one in the GAC.

Categories : C#

scala type error for class with map member typed with existential type
Unless you explicitly require getting the keys back out as the statically correct subtype (which seems unlikely), then the following will work: case class DictVariant1(data: Map[MyBaseType, Double]) val d = List((Concrete1() : MyBaseType, 3.5)).toMap val dv1 = DictVariant1(d) Using a type ascription forces Concrete1() to be seen as an instance of the base type; you'd get the same effect if you added an explicit type to d: val d : Map[MyBaseType, Double] = .... Or if you put multiple entries in such that the type inferencer picks the base type: val d = List((Concrete1(), 3.5), (Concrete2(), 4.5)).toMap The 'get' you use is always going to fail, however, because you're trying to use the whole Map as an index: it works fine if you provide a sensible key: dv1.data.get(Concrete1())

Categories : Scala

Send an html email error content type or mime type
I have tested this example in my web host and it works perfectly : <?php $from = "xxxxx@gmail.com"; $subject = "Confirm Your Email"; $message = "<html><body>"; $message .= " <center> <b>You are reiciving this email because you Signed up at Alphaladys.com</b> <br> <font color="red">Thank You, $name</font><br> <b><a href="alphaladys.com/?71860c77c6745379b0d44304d66b6a13=emailVerify&key=$key">Confirm Your Email</a></b><br> </center> <br><br>© 2013 Copyright | AlphaLadys.Com | All rights reserved. "; $message .= "</body></html>"; $headers = "From: " . $from . " "; $headers .= "Reply-To: ". $from . " "; $headers .= "MIME-Version: 1

Categories : HTML

F# error FS0193 (VS 2010) : The type 'WebRequest' is not compatible with the type 'HttpWebRequest'
The error was quite small. The :> operator will only perform casts which are known to succeed at compile time and so won't cast from HttpWebRequest.Create(url) to HttpWebRequest as this actually returns a WebRequest. As a reult you need to use let req = HttpWebRequest.Create(url) :?> HttpWebRequest instead to allow for casting in the other direction in the inheritance tree. The difference is that casts made by :?> may fail at run time (but shouldn't in this case as all urls should be http)

Categories : Visual Studio 2010

Unity 3 and Error "The type name or alias "xxxxx" could not be resolved. Please check your configuration file and verify this type name."
The problem is in you config file. You are mixing two concepts with some incorrect syntax. The <assembly... /> and <namespace ... /> nodes provide an assembly and namespace search order when your <register ... /> node contains a type that cannot be found by itself. If a type cannot be found, it searches through all combinations of [namespace].Type, [assembly]. Here's where the error is: it does NOT search for Type, [assembly]. If any <namespace ... /> nodes are defined, it does NOT try appending only the assembly. So your <register type="Biblioteca.Contracts.IManterCategoriaBO" mapTo="Biblioteca.Business.ManterCategoriaBO" /> node has the type Biblioteca.Contracts.IManterCategoriaBO which does not contain the assembly, so it cannot be found. Therefore,

Categories : C#

Linkage error:Loader Constraint violation: previously initiated loading for a different type with name "org/w3c/dom/Type Info"
This happened to me with the JMX MBeanServer class. Groovy was loading one of them with its classloader and so was the JVM. In your case it sounds like the TypeInfo class exists in rt.jar just fine, but another class loader loads it from that jar (or another jar) again. Running the JRE with "-verbose:class" showed that double load behavior. Then I moved the offending jar out of my classpath and it worked just fine with the one loaded by Groovy. I would recommend moving rt.jar out of your classpath, or if you need other classes inside of rt.jar try unjaring and rejaring it without the Type class. That way the classloaders will be forced to use the ones in xmlbeans-2.5.0.jar or xbean-2.1.0.jar.

Categories : Misc

Project Server Console Application Error: The type name 'LoginWindows' does not exist in the type 'ProjectServer.WebSvcLoginWindows'
The problem is likely due to either the class name (LoginWindows) or the namespace (WebSvcLoginWindows) being incorrect when you create the loginWindows variable: public static WebSvcLoginWindows.LoginWindows loginWindows = new WebSvcLoginWindows.LoginWindows(); Make sure the namespace and class name are spelled correctly and have the correct capitalisation. If the class is contained in a separate asssembly, make sure your winforms project has a reference to the other assembly. Hope that helps.

Categories : C#

error: a value of type "void *" cannot be assigned to an entity of type "float *"
What is happening here is that most likely you are inadvertently compiling your code as C++ code. In C++ (as opposed to C) void * is not implicitly convertible to other pointer types. It you intend to write your code in C, make sure you compile it as C. It you intend to write your code in C++, you will have to use explicit type conversion operators to convert void * pointers to other pointer types. The conversion to long * pointer type probably happens in other translation unit (i.e. other file), which is compiled as C. That is probably why it succeeds. Note that compilers can use C and C++ mode independently for each translation unit. Many compilers will choose between C and C++ based on file extension, compiling .c files as C and .cpp files as C++.

Categories : C

What does the E2511 Type parameter 'T' must be a class type compiler error mean?
TObjectList<T> includes a generic constraint that T is a class. The type declaration is as follows: type TObjectList<T: class> = class(TList<T>) ... end; You might think that constraints are inherited, but that is not the case. And so you need to include the constraint in your class. Specify the constraint like so: type TSearchableObjectList<T: class> = class(TObjectList<T>) ... end;

Categories : Delphi

c++ std::map asignation error : cannot convert ' type **' to 'type *' in assignment
void findMessageId(R * aPointerType,const int & aPKValue, int & aResult) { if (aPKValue < 0) { aResult=-1; return; } //buscar valor dentro de la lista mMessageListIterador=mListMessage->find(aPKValue); if (mMessageListIterador!=mListMessage->end()) { aResult=0; aPointerType=&mMessageListIterador->second; } else aResult=-1; return; } In this method i changed this line: aPointerType=&mMessageListIterador->second; for this: aPointerType=mMessageListIterador->second;

Categories : C++

Mongo/DataNucleus/JPA with embedded type query gives: Cannot find type of (part of) ... since symbol has no type; implicit variable?
FINE: Compilation of filter to be evaluated completely in-datastore was impossible : Invoke expression is not supported by this mapper so it is not currently implemented to convert JPQL "collField.contains(val)" (the equivalent of what you typed in for your query) into a MongoDB query, hence cant evaluate it in the datastore. Since you know what it needs converting into, you can easily enough get the code for the DataNucleus MongoDB plugin and find class QueryToMongoDBMapper and contribute support for that particular query.

Categories : Mongodb

how does Cpython implement its type Objects, i.e. type's type is always type?
The code that defines PyType_Type.ob_type = &PyType_Type involves a couple of indirections. It all starts in the function _Py_ReadyTypes() when it calls PyType_Ready(&PyType_Type). Before the function is called, the members tp_base and ob_type are both NULL. The function first sets type->tp_base to &PyBaseObject_Type (which is object in Python space) and then sets type->ob_type = PyBaseObject_Type.ob_type. The code uses Py_TYPE() which is just a macro for ob->ob_type. Since the type of object is type the code sets the type of type to type. Now you have: >>> type.__bases__ (<class 'object'>,) >>> type(object) <class 'type'> >>> type(type(object)) <class 'type'> The definition makes type an instance of object plus itself a

Categories : Python

Type 'MyClass' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute. Consider marking the base type
One approach would be to override it: public new byte[] SomeByteArray { get; set; } and then you could ignore it with the IgnoreDataMember attribute.

Categories : C#

How to resolve the correct type from the container (static type vs runtime type)?
You'll need to do some sort of runtime resolution of the type. E.g. using the dynamic keyword: IBase a = new A(); Console.WriteLine(Resolve((dynamic)a)); A b = new A(); Console.WriteLine(Resolve((dynamic)b)); Or using reflection: int ResolveDynamic(IBase a) { MethodInfo method = typeof(IContainer).GetMethod("Resolve"); var handlerType = typeof(IHandler<>).MakeGenericType(a.GetType()); var enumerableType = typeof(IEnumerable<>).MakeGenericType(handlerType); MethodInfo generic = method.MakeGenericMethod(enumerableType); var result = (IEnumerable<object>)generic.Invoke(_container, null); return result.Count(); }

Categories : C#

Change input type="text" to input type="password" onfocus()
You dont need to replace the component, just set the type of the this to password like the code below: <asp:TextBox ID="txtPassword" runat="server" SkinID="txtLogin" value="Password..." TabIndex="2" onfocus="this.type='password'"> Here is a jsfiddle working example: http://jsfiddle.net/mZyTG/ Update I didn't test this code, but it add one onblur event listener to newO, and when invoked it replace the input to the old one. function replaceT(obj) { var newO = document.createElement('input'); newO.setAttribute('type', 'password'); newO.setAttribute('class', 'textbox'); newO.setAttribute('name', obj.getAttribute('name')); newO.addEventListener("onblur", function(){newO.parentNode.replaceChild(obj, newO)}, false); obj.parentNode.replac

Categories : Javascript

Scala type mismatch: default.type (with underlying type A1 => B1)
Strange, as soon as I renamed default variable, everything compiled fine: scala> def composeHandlingFuture[T](fut: Future[T], x: T): Future[T] = | fut recover { case e: Exception => x } composeHandlingFuture: [T](fut: scala.concurrent.Future[T], x: T)scala.concurrent.Future[T]

Categories : Scala

How can I get type information about a type created using the type provider framework
At runtime, STable isn't a real .NET type - it's erased down to some other type (obj in this case) - this is just how (erasing) type providers work. If you absolutely need to get the type programmatically, then it's possible to do it using the raw type provider API, but this will be pretty ugly. To do this, get an instance of the ITypeProvider (just like the compiler does behind the scenes), and then navigate the resulting namespaces and types until you get the System.Type instance you're looking for.

Categories : F#

LINQ To XML error: type of the expression in the select clause is incorrect. Type inference failed in the call to 'Select'
The problem is with your closing parenthesis - you've got it at the end of the ToList() call, when you meant to put it at the end of the object initializer. Also, you're not actually calling the method - you're just specifying a method group. Finally, you can let type inference work out the type argument for you: List<Data> dogs = (from q in doc.Descendants("dog") where (string)q.Attribute("name") == dogName select new Data { name = q.Attribute("name").Value, breed = q.Element("breed").Value, sex = q.Element("sex").Value }).ToList();

Categories : C#

F# error type 'X' is not compatible with type 'X'
Looking at this troubleshooting page, the phrase 'not compatible with type' seems to be used in the context of numerical values, rather than general type matching. Another guess is that your code sample has CSharpCode.Save( dom, filepath ), but in F# function arguments are whitespace-separated rather than comma-separated, so I would have expected CSharpCode.Save dom filepath. Wouldn't your sample be constructing a tuple of dom, filepath and attempting to pass it to .Save?

Categories : C#

g++ gives error : invalid initialization of reference of type ‘char&’ from expression of type ‘unsigned char’
Why isn't it possible to initialize 'char &' with a variable of type 'unsigned char' while it is possible to initialize 'const char &' with it? Because the latter creates a temporary to bind to the const reference when the unsigned char is converted to a char, something you can't do with non-const references. char, signed char, and unsigned char are three distinct types, as explained in C++11 § 3.9.1: Plain char, signed char, and unsigned char are three distinct types

Categories : C++

Dart bind JsonObject error: type 'List' is not a subtype of type 'JsonObject' of 'value'
I can't quite reproduce what you're showing with the data provided, but I think what the error message type 'List' is not a subtype of type 'JsonObject' of 'value'. is telling you is that at some point currentRow is containing a List instead of a JsonObject when you call ListTk.add(currentRow) JSON.parse(results).forEach((data) { JsonObject currentRow = new JsonObject.fromMap(data); ListTk.add(currentRow); }); This might be if your JSON looks like: [ {"Tk":"111","Ten_Tk":"Tiền mặt"...}, <-- Becomes a JsonObject {"Tk":"911","Ten_Tk":"Xác định kết quả kinh doanh"}, <-- Becomes a JsonObject [{...},{...}] <-- Becomes a List ] You could try adding a couple of print lines to help diagnose: p

Categories : Dart

error: incompatible types when initializing type 'struct taus88_t *' using type 'taus88_t'|?
What about breaking taus88_t* TAUS88 = make_taus88(6346456); into two lines like taus88_t* TAUS88; *TAUS88 = make_taus88(6346456); http://ideone.com/KVbf79

Categories : C

How to make Generic Type as out type if it is reference Type?
If you have an error with the return type of IEnumerable<IGrouping<string, MyClass>> in a generic class that has been declared using <T>, then I'm guessing that your return type should actually be IEnumerable<IGrouping<string, T>>... of course, without seeing your code, this can only be a guess.

Categories : C#

Method is returning int type, but I keep getting "this method must return a result of type int" error
What happens if control doesn't enter second level if? if (grid[i - 2][j] != 0) There is no return statement, isn't it? You need to have a return statement for all possible paths. How do I fix this? One possible way: Add return statement for first level if too. Example if (i - 1 >= 1){ if (grid[i - 2][j] != 0){ return xyTo1D(i - 1, j); } return -1; //OR whatever int you would like to return }

Categories : Java

How to use a generic type parameter as type parameter for a property declared as an interface with type constraints?
Try to add class constraint to the TItem: namespace Sample2 { public interface IInterfaceContainer<T1, T2> where T1 : T2 { } public interface IInterfaceParent { } public interface IInterfaceChild : IInterfaceParent { } public class ClassSampleDoesNotWork<TItem> where TItem : class, IInterfaceParent { IInterfaceContainer<IEnumerable<TItem>, IEnumerable<IInterfaceParent>> SomeProperty { get; set; } } } This works because variance only works for reference-types (or there is an identity conversion). It isn't known that TItem is reference type, unless you add : class. Read this article for more information. Here is a sample code to demonstrate this behavior: IEnumerable<Object> ite

Categories : C#

While using Table Type data type in PL/SQL getting 'NO DATA FOUND' error
In your code i is an index. It steps through the bounds monotonically. So if your minimum EMPNO is 1234 and your maximum EMPNO is 5678 the values of i will be 1234, 1235, 1236 ... 5676, 5677, 5678. But that probably is what you want to do, because EMPNO is likely to be a sparse array, with missing numbers. So if you have no row in EMP where EMPNO=1235 your query will throw NO_DATA_FOUND. What's the solution? Use a bulk collect instead: select * bulk collect into v_emp from emp ; That will select all the rows in the table, and it will be more efficient as well.

Categories : SQL

C#.NET Error: Unable to cast object of type 'System.Data.DataTable' to type 'System.Data.DataSet'
It's because you're setting the DataSource to a DataTable: gvPartNumber.DataSource = dsgvPartNumber.Tables["partNumbers"]; not a DataSet. So, instead of this: DataSet dsgvPartNumberDelete = (DataSet)gvPartNumber.DataSource; do this: DataTable dsgvPartNumberDelete = (DataTable)gvPartNumber.DataSource; and then in the following lines you won't need accessors like .Tables[0]. It will already be a DataTable and thus more direct to access anyway. This modification would of course have to be replicated to all of your methods where you're trying to cast the DataSource as a DataSet.

Categories : C#

Using a generic type argument in place of an argument of type System.Type. Is it a smell?
Methods that deal with types usually do just that: Dealing with types. IMO, Class.Method<SomeType>(); is much better than Class.Method(typeof(SomeType)); But that is a matter of opinion I guess. Consider LINQ's .OfType<T>(), for example: personlist.OfType<Employee>().Where(x => x.EmployeeStatus == "Active"); versus: personlist.OfType(typeof(Employee)).Where(x => ((Employee)x).EmployeeStatus == "Active"); which one would you prefer?

Categories : C#

asp.net json web service sending array error Cannot convert object of type 'System.String' to type 'System.Collections.Generic.List`1[System.String]'
You need to make your data parameter of the $.ajax call like this: JSON.stringify({'a': variables}) The JSON variable is not available in < IE8 so you'll want to include a JSON implementation like the one mentioned in the answer here Also, you had an extra } in the success function. So, in the future, if you want to add extra parameters to your data object passed to the web service, you'd construct it like so: var someArr = ['el1', 'el2']; JSON.stringify({ 'param1': 1, 'param2': 'two' 'param3': someArr // etc }); JavaScript: var variables = Array(); var i = 0; $('#Div_AdSubmition').find('.selectBox').each(function () { variables[i] = $(this).find('.selected').find(".text").html(); i++; }); $.ajax({ type: 'post', data: JSON.stringify({'a': variables}),

Categories : C#

How do I get type parameter from type with type parameter, inside scala macro?
You can use the TypeRef extractor: import reflect.runtime.universe._ // or in a macro "c.universe._" val tpe = weakTypeOf[List[Int]] // extract type parameters val TypeRef(_,_, tps) = tpe // tps has type List[Type] println(tps.head) // Int

Categories : Scala

C++ non-type template parameters: Is typedef of an integral type an integral type?
A typedef is just an alias for the given type. So any typedef of an integral type is itself an integral type. And types don't get any more integral than std::size_t.

Categories : C++

JCR node type nt:file is not allowed as child's node type for parent node type
Be careful when changing the nodetype definition like this, it may effects to the existing data in the system. You have to think about the "migration" for this modification. We're using Chromattic, therefore the nodetype's definition must be mapped with java class. You have changed soc:profiledefinition, therefore you have to added soc:music definition in the ProfileEntity.java as well (at package org.exoplatform.social.core.chromattic.entity). Hope it helps, Minh

Categories : File

confused about the type of the Instance of a binary tree data type of Int Nodes in Haskell
You defined the type Tree as a parametrised type. The a after Tree in the data type's definition is this parameter. This means that there is not just one Tree type, but many different ones. For example, you can have a type Tree Integer containing integers, a type Tree Bool containing booleans and a type Tree (String -> String) containing functions from string to string. Note that it's a good thing that you can distinguish these different types. It means that when you get a value out of such a tree, you know which type of value you're going to get. If there was just one Tree type, then you wouldn't be able to find out.

Categories : Haskell



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.