conversion

How to implement " char * ftoa(float num) " without sprintf() library function in C, C++ and JAVA?

Today I appeared for an interview, and the question was writing my own "char * ftoa(float num) " in C, C++ and Java. Yes, I know float numbers follow IEEE standard while allocating their memory, but I don't know float to char conversion by using Mantissa and Exponent in C. I don't have any idea to solve the above problem in C++ and J...

Delphi "array of const" to "varargs"

Please help! I need this conversion to write wrapper for some C headers for Delphi. As an example: function pushfstring(fmt: PAnsiChar): PAnsiChar; cdecl; varargs; external; ... function PushString(fmt: AnsiString; const args: array of const): AnsiString; begin Result := AnsiString(pushfstring(PAnsiString(fmt), args)); // it's inco...

JSP/JSF conversion to ASP.NET

I have a pretty big JSF web application. I must convert the application to ASP.NET. I already converted the Java code to C# code manually and also using JCLA (Java Language Conversion Assistant from Microsoft). What is the best way to convert the JSF part to ASP.NET? Is there any tool that can help shorten the work? For example convert...

The problem of adapting the MSVC++ code for C++Builder- __declspec(align(n)).

I have a huge issue of adapting the code into C++Builder. What is the equivalent in C++Builder for __declspec (align (n))? I do not mean the #pragma pack ([show] | [push | pop] [, identifier], n). I need something for the macro. I have a problem with adopt a code below (especially for __declspec(align(n))): #elif defined(_MSC_VER) #d...

How do I convert a mySQL DATETIME type to a string for use in Javascript?

I want to display a DATETIME I get from a mySQL database as a String in Javascript. I'm using PHP to put the DATETIME into a variable: $mydatetime. It displays fine on the PHP page, but not in my javascript function. <?php echo $mydatetime --> 2010-04-19 13:00:00 echo "<script language=javascript>myfunction($mydatetime);...

C#: Convert String to DBType.AnsiStringFixedLength

Hi, I have a stored procedure. One of its input parameters is expecting a char(8). I try to convert a string "AAA" to this particular parameter type, which is a DBType.AnsiStringFixedLength. object v = Convert.ChangeType("AAA", param.DbType.GetTypeCode()); // param is AnsiStringFixedLength However, all I get is an exception: Input ...

How do I convert NSMutableString to double for storing in Core Data?

Hi, my app needs to store latitude and longitude values parsed from XML into Core Data. Currently, I have a Core Data Model which has these attributes set to type double. The header file for the Model Object has them defined as NSNumber How can I convert the string stored in my CurrentNodeText variable into the required type for stor...

Converting xml document structure from one to another in c#

Hi all: Currently I have an xml structure in an app. I needed to convert it from one structure to another. I have the xsds for it. The app is in C#. Naturally I thought of using good old coding to convert it, but that sounded like the least efficient idea. Someone recommended me to use XSLT, but I'm not 100% sure how it works. Doe...

long double to string

I'm developping in C++, using the Qt framework. I need to convert a long double value into a string (ideally a QString, but could be something else). So far, I always used QString::number() for numerical->string conversion, but there is no overloading for the long doubletype. Thanks ...

using std::string with Qt causes run-time error on destruction

Hi. I have a Qt app that uses another library where the function output is std::string instead of a QString. So in my program I have a method void doSomething() { ... std::string std_string = MyExternalLibraryThatReturnsSTLstring.getString(); QString myQString = QString::fromStdString(std_string); ... process(myQString); ... } When ...

Convert a docx document to pdf, as a service.

I'm looking for a way to convert docx documents to pdf, on a system which doesn't has office installed. In the end, this is supposed to run as a service. ...

To Convert MicrosoftOffice Docs+PDF+Images++Audio/Video into Swf file

HI, I want to convert MicrosoftOffice Docs(.doc,.docx,ppt,xlsx,xls) +PDF+Images++Audio/Video into an swf file. The idea behind this project is to open the documents on any machine which have a flash plugin. I want to do this in VC++. ...

what's the max characters generated by a base 10 to 36 conversion of a crc32 value

what's the maximum number of characters generated by the following statement? i need to format the output properly. echo base_convert(sprintf('%u',crc32($_string)),10,36); ...

WPF to Silverlight project conversion

I need to convert an existing WPF project to Silverlight. I know that there is no an automatic way of doing it. Could you share your experience and give advise regarding steps for this conversion and what pitfalls one should be aware of? ...

How to convert string to integer in C#

How do I convert a string to an integer in C#? ...

How can I convert the following java function into C++?

If I have the following Java code: int[][] readAPuzzle() { Scanner input = new Scanner(System.in); int[][] grid = new int[9][9]; for (int i=0; i<9; i++) for (int j=0; j<9; j++) grid[i][j] = input.nextInt(); return grid; } public static void main(String[] args) { // Read a Sudoku puzzle int[][] gr...

Can't use unichr in Python 3.1

Hi, new here! I'm a beginner in Python, and I've been looking through the Python Cookbook (2nd Edition) to learn how to process strings and characters. I wanted to try converting a number into its Unicode equivalent. So I tried using the built-in function called 'unichr', which, according to the Cookbook, goes something like: >>> prin...

Printing out Japanese (Chinese) characters

I read Japanese, and want to try processing some Japanese text. I tried this using Python 3: for i in range(1,65535): print(chr(i), end='') Python then gave me tons of errors. What went wrong? !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Traceback (most recent call last): File ...

HSL to RGB color conversion

Hi I am looking for a tool to convert between HSL color to RGB. HSL is not a very widely used so I am not having much luck googling for a converter. If you know of one, or an easily implementable algorithm it would be much appreciated. ...

Looking for a Pdf Printer to use in a Docx -> Pdf Conversion Service

I'm not sure if this is possible but as I was looking for a way to convert docx -> pdf serverside (Aspose is a bit expensive), I wondered if I could do this by printing my document to a Pdf Printer. Altho, I would need a decent one then, as it shouldn't show dialogs when trying to print ofc. Does anyone know if: This is possible Ther...