I have an object with two different integer properties in it, and I'm trying to get a a new object in Linq to Entities, combining two integer properties from the same object as concatenated strings, as follows
List<DateRange> collection = (from d in context.dates
select new DateRange
{
DateString = from s in context.Seasons
wher...
I've encountered a strange behaviour in cast/melt from Hadley Wickham's reshape package. If I cast a data frame, and then try to melt it, the melt comes out wrong. Manually unsetting the "df.melt" class from the cast dataframe lets it be melted properly.
Does anyone know if this is intended behaviour, and if so, what is the use case whe...
My program needs to make use of void* in order to transport data or objects in dynamic invocation situation, so that it can reference data of arbitrary types, even primitive types. However, I recently discovered that the process of down-casting these void* in case of classes with multiple base classes fails and even crashes my program af...
Hi,
I am learning the cast iron tool (http://www.castiron.com/) which is widely used now a days for integration purpose,but i can only open 1 project and if i want to open the other project at the same time than i have to close the 1st project and open the 2nd project.
So many times i need to have to open the 2 projects at the same tim...
i need some help regarding the following:
HomeArrayPicBox[i, j].Image = (Image)Properties.Resources.ResourceManager.GetObject("Scan" + i);
SoundPlayer fire = new SoundPlayer(Properties.Resources.fire);
for the picbox i can load an image from resources using cast (Image).
i was wondering how to do this for audio i.e. some sort of (Au...
Hey
I've started to learn c++ using "C++ Primer by Stephen Prate" and I'm currently trying to complete one of the exercises. I am wondering if I should declare arc_to_minute & arc_to_degree as float or cast them as float as I've done already. Any tips welcome!
#include <iostream>
int main()
{
using namespace std;
cout.setf(ios...
I have an asp.net page with a code-behind class definition as follows:
public partial class examplepage : System.Web.UI.Page
I'd like to set a public property within the page that I can reference from other classes. My understanding is that if I cast to examplepage then I should be able to get at the public property that is specific ...
LastInput.time is an Integer and m_idleTime is an Integer too. This line sometimes generates an Overflow exception, I think that this happens when both values are big negative values.
(Environment.TickCount - lastInput.time) > m_idleTime
How can I avoid that? With casting?
(CType(Environment.TickCount,Long) - CType(lastInput.time,Lon...
Hey guys how can I convert a "timespan" datatype to "long"?
cheers
psilos
...
I've got a HashSet with a bunch of (you guessed it) integers in it. I want to turn it into an array, but calling
hashset.toArray();
returns an array of Object type. This is fine, but is there a better way to cast it to an array of int, other than iterating through every element manually? A method I want to pass it to
void doSomething...
Shouldn't the compiler automatically cast to a double in the following? At least according to Walter Savitch.
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int k;
for(k = 1; k <= 10; k++)
cout << "The square root of k is: " << sqrt(k) << endl;
return 0;
}//error C2668: 'sqrt' : ambiguous call...
I know Java doesn't allow unsigned types, so I was wondering how it casts an integer to a byte. Say I have an integer a with a value of 255 and I cast the integer to a byte. Is the value represented in the byte 11111111? In other words, is the value treated more as a signed 8 bit integer, or does it just directly copy the last 8 bits of ...
Hi all,
How can i convert int64_t to NSInteger in Objective-C ?
This method returns into score an int64_t* and I need to convert it to NSInteger:
[OFHighScoreService getPreviousHighScoreLocal:score forLeaderboard:leaderboardId];
Thank you.
...
If B is subclass of A.
And I have in main():
B** b = new B*[10];
... // some algorithm that does b[i] = new B(..);
So I have an array of pointers to objects B.
Then I have a function:
void f(A** foo);
If in main, I do: f(b); I get a warning, but obviously if I do: f((A**)b);, I don't.
The (A**) its a bit nasty. I was wondering i...
I was wondering how to do this, consider the following classes
public class Fruit
{
public string Name { get; set; }
public Color Color { get; set; }
}
public class Apple : Fruit
{
public Apple()
{
}
}
How can I instantiate a new fruit but upcast to Apple, is there a way to instantiate a bunch of Fruit and make th...
In SQL Server 2005, why does:
PRINT Cast('' AS datetime)
display:
Jan 1 1900 12:00AM
I would have thought it should be null?
...
I have problem while converting varchar type to Int type in Informix.
Actually I don't know if the value is really varchar or not which I want to convert to INT. It's a sandbox system.
As Example:
I am trying to run this kind of
Select telnumber from numbers n
where Cast(n.telnumber AS INT) between 1234 and 9999
I got this error:...
I have the following classes:
public class MyEventArgs : EventArgs
{
public object State;
public MyEventArgs (object state)
{
this.State = state;
}
}
public class MyClass
{
// ...
public List<string> ErrorMessages
{
get
{
return errorMessages;
}
...
I coded some calculation stuff (I copied below a really simplifed example of what I did) like CASE2 and got bad results. Refactored the code like CASE1 and worked fine. I know there is an implicit cast in CASE 2, but not sure of the full reason. Any one could explain me what´s exactly happening below?
//CASE 1, result 5.5
double a...
Say I've got an integer, 13941412, that I wish to separate into bytes (the number is actually a color in the form 0x00bbggrr). How would you do that? In c, you'd cast the number to a BYTE and then shift the bits. How do you cast to byte in Python?
...