FAQ Database Discussion Community


R Type Checking

r,histogram,typechecking
I have yet another R question. I am trying to do some type checking, but cannot exactly figure out what I am doing wrong. I am trying to create a histogram for each level of y. So for instance, I want to create overlaying histograms of the iris data species...

Disable typechecking from .hhconfig

typechecking,hhvm,hacklang
Assume we have a project with the following structure: root/ .hhconfig ├── directory1 ├── directory2 ├── directory3 ......................... ├── directory10 Is there a way to have a single .hhconfig file, and exclude onlydirectory8 from the typechecking? I think it would be really painful to put separate .hhconfig files, inside every...

Java null pointer checking for faster code execution

java,nullpointerexception,typechecking
Imagine a method which takes an object as a parameter and check with a for each loop for lets say some other values inside of some collection, which can be found/filtered according to the passed in argument. Is it a good practice to check at the beginning of the function...

checking cin input, clearing input buffer

c++,buffer,cin,typechecking
New to c++ - trying to check for format of input. Have tried everything, at wit's end. Any help would be appreciated. I've broken down my problem to this basic case: while(1) { cin >> x; cout << "asked!" << endl; cin.ignore(1000, 'n'); } will result in infinite loop of...

Efficient run-time type checking in C++

c++,runtime,typechecking
I've two class named 'Expression' and 'BinExp' as following codes: class Expression { public: virtual BinExp* IsBinaryExp() { return NULL; } }; class BinExp : public Expression { public: virtual BinExp* IsBinaryExp() { return this; } }; As example, I've a pointer variable type of Expression* but initialized as new...

Cannot construct a collection of type …Inclusive[Long] with elements of type Long based on a collection of type …Inclusive[Long]

scala,scala-collections,typechecking
I'm not sure I understand why the following happens. Compiles and works: With Ints without converting to a List import scala.util.Random val xs = 1 to 10 Random.shuffle(xs) With Longs after converting to a List import scala.util.Random val xs = 1L to 10L Random.shuffle(xs.toList) //<-- I had to materialize it...

How can I test if an unknown Delphi RTTI TValue reflects an object that is ANY type of generic TList<> (or at least TEnumerable<>)?

delphi,generics,rtti,typechecking
In Delphi, if I have a TValue instance reflecting an unknown object, how can I test if this object is an instance of ANY kind of generic TEnumerable<> (or even better, also which specific generic enumerable type it is an instance of, e.g. TList<>)? NOTE: I already know how to...