conversion

How to convert motion sensor data from Iphone to Android?

I have some motion sensor samples that were recorded with an Iphone. Now I'm into calculating a distance between a user gesture and the gesture that was recorded on the Iphone. My problem is that the sensor data on the Iphone is represented in a different way then the android sensor data. If i don't move the Iphone I get data between -...

spring 3 my converter is not used...

...but registered Using Spring 3 I have two converters registered as follows: <beans:bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean"> <beans:property name="converters"> <beans:list> <beans:bean class="mypackage.CalendarToStringConverter" /> <beans:bean class="my...

AutoMapper strings to enum descriptions

Given the requirement: Take an object graph, set all enum type properties based on the processed value of a second string property. Convention dictates that the name of the source string property will be that of the enum property with a postfix of "Raw". By processed we mean we'll need to strip specified characters e.t.c. I've looked...

PHP convert cyrillic

Which method of transliteration is true to convert cyrillic letters to latin letters? Like writing russian names using english alphabet. There are many methods of conversion, searching for one that is used on television or other mass media. Thanks. ...

How to convert .caf to .mp3 file programmatically on the iPhone or iPad?

Hi, is there a way to programmatically convert .caf audio files to .mp3 audio files on the iPad platform? ...

convert base type to derived type

Base class is Task. There are several derived classes such as PhoneCall, Fax, Email.... The framework is .NET 3.5 and the language is C# In our application, we want to create some automatic tasks based on certain rules for a customer. For eg. if the customer has been signed up for 30 days, a task will get created by the rules engine. ...

Problem with NSMutableArray and custom NSObject

Hi, I'm really desperate on this one. I'm trying to make a Framework which you can search and play YouTube videos with. But while testing it, I'm running in to a big problem. In the search operation I'm adding YTVideos (a subclass of NSObject) to a NSMutableArray. When I loop thru it in the main(), I'm getting nil-objects: Method - (N...

Problem with conversion

I have a class: template<class T> class MyClass { public: class Iterator { public: Iterator(MyClass<T>&){/*some code*/}; }; operator Iterator(); Iterator& begin(); }; template<class T> MyClass<T>::operator typename MyClass<T>::Iterator() { ret...

Fast float to int conversion and floating point precision on ARM (iPhone 3GS/4)

Hi, I read (http://www.stereopsis.com/FPU.html) mentioned in (http://stackoverflow.com/questions/78619/what-is-the-fastest-way-to-convert-float-to-int-on-x86). Does anyone know if the slow simple cast (see snippet below) does apply to ARM architecture, too? inline int Convert(float x) { int i = (int) x; return i; } To apply some ...

C++ to C# array declaration

I want to convert the below code to C#: struct Elf32_Ehdr { uint8 e_ident[16]; // Magic number and other info uint16 e_type; // Object file type uint16 e_machine; // Architecture uint32 e_version; // Object file version uint32 e_entry; // Entry point virtual address uint32 e_phoff; // Prog...

Convert Java Socket, BufferedReader, BufferedWriter to C#?

In Java we have Socket, BufferedReader and BufferedWriter, but what are the equivalent in C#? Socket socket; socket = new Socket(address, port); reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); ...

How to convert a binary file into a Long integer?

In python, long integers have an unlimited range. Is there a simple way to convert a binary file (e.g., a photo) into a single long integer? ...

Converting C Macros to Actionscript 3

I am trying to convert a macro in C to something that would work similarly in Actionscript. The C macro takes a string, and using ## checks the type against other macros to check that the item's property is of the right type. To clarify, the C: ... #define STACK_NUM 52 ... #define CHECK_TYPE(i, t) \ ( ((i).type == t##_NUM) ) ...

Convert five lines of Mootools to jQuery

Can someone please help me out with this? I'm using jquery-1.4.2. http://jsfiddle.net/Ymkpb/ Thank you so much! Edit - Adding the original so this is more useful later: $$('.clickables').each(function(clickable) { var list = clickable.getElements('li'); list.addEvent('click', function() { var link = this.getElement('...

Difference between converting strings

Possible Duplicate: Difference between Convert.tostring() and .tostring() Hi Carrying on from this question http://stackoverflow.com/questions/3486810/the-difference-between-convert-and-parse Here are two lines of code. Convert.ToString(myObject); myObject.ToString(); My question is what is the difference and which would ...

Convert managed String (C#) to LPCOLESTR (C++)

Hello, I wave a method in C++ that receives a parameter of the LPCOLESTR type. I'm accessing this method through C#, but I can't make the correct conversion between String and this type. Let's say the method signinature in C++ is: void Something(LPCOLESTR str) In C#, I'm trying to call it (all reference issues to access the method th...

Decimal Conversion Ranges in the IEEE 754 Specification (Binary Floating-Point Arithmetic)

Table 2 in section 5.6 on the bottom of page 11 of the IEEE 754 specification lists the ranges of decimal values for which decimal to binary floating-point conversion must be performed. The ranges of exponents don't make sense to me. For example, for double-precision, the table says the maximum decimal value eligible to be converted is (...

Scala: Why can I convert Int to Unit?

Hi folks! I've recently started playing with Scala (2.8) and noticed the I can write the following code (in the Scala Interpreter): scala> var x : Unit = 10 x : Unit = () It's not obvious what's going on there. I really didn't expect to see any implicit conversion to Unit. ...

C++ overloading conversion operator for custom type to std::string

Hi, I hope someone might be able to answer why the following doesn't work. Bear with me though, I am still very much a noob... I just cannot get to the bottom of why the following using namespace std; #include <string> #include <iostream> class testClass { public: operator char* () {return (char*)"hi";}; operator int () {return 77;}...

.Net, convert "8.33333333329E-2" to percents

I'm reading excel and there's cell that represents total cost of budget in percents. In excel it looks like 8%, but once i read it, i get string 8.33333333329E-2. Got confused a bit. What would be correct data type and parsing technique to use and avoid losing data? ...