I have a templated sparse_vector<T> class, and I am also using Boost UBLAS. How would I provide implicit conversions between sparse_vector<double> and boost::numeric::ublas::compressed_vector<double>?
I would also like to provide similar conversions between std::vector<double> and boost::numeric::ublas::vector<double>.
(I am using gcc...
Hello,
I'm trying to take a 2d vector of floats (input) and put them into a char* (output) in c++.
void foo(const std::vector<std::vector<float> > &input, char* &output )
{
char charBuf[sizeof(output)];
int counter = 0;
for(unsigned int i=0; i<input.size(); i++)
{
for(unsigned int p=0; p<input.at(i).size(); p++)
...
I have the following point class definition along with its type converter, and ...
[TypeConverterAttribute(typeof(MyPointConverter))]
public class MyPoint
{
public MyPoint(double x, double y)
{
X = x;
Y = y;
}
public MyPoint()
{
}
public double X { get; set; }
public double Y { get; set;...
We're using SQL Inserts to insert some data via a script into DB/2 tables, e.g.
CREATE TABLE TICKETS (TICKETID VARCHAR(10) NOT NULL);
On my home installation, this statement works fine (note that I'm using an integer which is autoatically cast into a VarChar):
INSERT INTO TICKETS (TICKETID) VALUES (1);
while at my customer's site I...
How does one convert an empty string to an int using Struts2. When the application encounters this parameter with no value, like from an empty text field, it throws the following exception.
java.lang.NoSuchMethodException:
com.XXXXXXXXXXXX.setID([Ljava.lang.String;)
Where ID is an integer, and the URL is:
Something.action?ID=&oth...
How to convert doc to pdf using java api. where document contains various formats such as tables in ms word. when converting to pdf using iText. where actual document looks different to converted pdf. please provide any api not an exe installed for converting . must be an open source
...
For a simple action class with these member variables:
...
private TestConverterEnum test;
private TestConverterEnum[] tests;
private List<TestConverterEnum> tList;
...
And a simple enum:
public enum TestConverterEnum {
A,
B,
C;
}
Using the default struts2 enum conversion, when I send the request like so:
TestConterter...
i am trying to call a function that is defined in a class RFIDeas_Wrapper(dll being used).
But when i checked for type of reader and after that i used it to call function it shows me error Cannot convert type T to RFIDeas_Wrapper.
EDIT
private List<string> GetTagCollection<T>(T Reader)
{
TagCollection = new ...
I'm wondering how to convert a List of one type to an array of another type in Java using Dozer. The two types have all the same property names/types.
For example, consider these two classes.
public class A{
private String test = null;
public String getTest(){
return this.test
}
public void setTest(String test){...
Hello there, i have very low C++ experiences and i need little help in casting a type.
I actually in a big dependence for that cast, need it rly hard.
So ...
I have this types :
typedef short DCTELEM;
typedef DCTELEM DCTBLOCK[64];
Array of last type and a pointer to a malloc'ed array of shorts:
DCTBLOCK MQUAD;
short * ptrArray;
...
I'm trying to serialize an entity and all its related entities for storing as xml before physically deleting the entity (leaving an audit trail).
I'm using a DataContractSerializer which seems to be getting around the shallow serialization performed when using an XmlSerializer.
The only trouble is that only related entities that have b...
Hi,
I have browsed and uploaded a png/jpg file in my MVC web app.
I have stored this file as byte[] in my database.
Now I want to read and convert the byte[] to original file.
How can i achieve this?
thanks,
kapil
...
I've created a small user control consisting of a button whose content is an Image. I created an "ImageSource" dependency property on the user control in order to bind to it from the Image inside the button.
However in the XAML where I placed an instance of my user control setting the property throws an error at runtime :
<ctrl:ImageBu...
I have a:
public class MyClass {
private string PrivateString;
}
and I have an interface that accepts:
object o
I have a list of MyClass that I need to push through object o, and my Google is failing me. What's the procedure to make this work? I know this must be crazy simple, but I've yet to do type casting in C#.
...
(Not really sure if I phrased the question correctly...)
I want to create a lambda expression that would take an Object, attempt to convert it to a passed-in Type, and print to the console whether it was successful or not.
At a glance, the lambda expression may seem a pretty silly way to accomplish this task, but I'd really like to kno...
I need to convert time from one format to another in C++ and it must be cross-platform compatible. I have created a structure as my time container. The structure fields must also be unsigned int as specified by legacy code.
struct time{
unsigned int timeInteger;
unsigned int timeFraction;
} time1, time2;
Mathematically the conv...
Is the following code legal?
std::string&& x = "hello world";
g++ 4.5.0 compiles this code without any problems.
...
For purposes of type checking I would like to define a function on the lines of
void myfunc(type1 a, type2 b)
{
...
}
where type1 and type2 are both typedefed to uint8_t. So far so good, but for sanity and checking purposes (think DbC) I would like to prevent the function being called with a type2 value for the first parameter or a t...
I have been trying out the new Spring MVC 3.0 Type Conversion Framework. I cannot find out how to trap conversion errors.
I am using the new mvc schema:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi=...
Eric Lippert's comments in this question have left me thoroughly confused. What is the difference between casting and conversion in C#?
...