conversion

Converting a home-brew test application to a standard unit test framework

I've got a LOT of tests written for a piece of software (which is a GREAT thing) but it was built essentially as a standalone test in C#. While this works well enough, it suffers from a few shortcomings, not the least of which is that it isn't using a standard testing framework and ends up requiring the person running the test to commen...

Can anyone recommend a good, free javascript for punycode to Unicode conversion?

I found this the other day: http://0xcc.net/jsescape/ but the punycode conversion doesn't work if there's a dash in the middle. For instance - I need to convert the punycode NIATO-OTABD to nñiñatoñ. Any help much appreciated ...

Compiler fails converting a constrained generic type.

Hello, I have a class that has a Generic type "G" In my class model i have public class DetailElement : ElementDefinition Let's say i have a method like this public void DoSomething<G>(G generic) where G : ElementDefinition { if (generic is DetailElement) { ((Detai...

iPhone "Web Site Error"

I'm writing server-side programs in PHP for an iPhone app. And I have no iPhone. :P The iPhone app requests XML files from the site whenever a user runs the iPhone app. You may visit http://www.appvee.com/iphone/ads or http://www.appvee.com/iphone/latest for the XML files. And a message box will show up with the following error message...

C# Fastest Convert from Collection to List<T>

What I'd like to avoid: ManagementClass m = new ManagementClass("Win32_LogicalDisk"); ManagementObjectCollection managementObjects = m.GetInstances(); List<ManagementObject> managementList = new List<ManagementObject>(); foreach(ManagementObject m in managementObjects){ managementList.Add(m); } Isn't there a way to get that ...

How to store a recurring time window

What is a preferred way to store recurring time windows? For example. If I have a calendar system where I need to be able to accommodate daily, weekly or monthly recurring events, what sort of time management system is best? How is this best represented in a database? More Details The Specific goal of this is to provide sets of open...

atoi() conversion error

atoi() is giving me this error: error C2664: 'atoi' : cannot convert parameter 1 from 'char' to 'const char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast from this line: int pid = atoi( token.at(0) ); where token is a vector how can i go around this? ...

Any C++ libraries available to convert between floating point representations?

I recently had a need to interpret a DEC 32-bit floating point representation. It differs from the IEEE floating point representations in the number of bits allocated to the exponent and mantissa. Here's a description of a bunch of floating point formats: http://www.quadibloc.com/comp/cp0201.htm I managed to roll my own C++ code to s...

Converting a char string to its underlying data type.

I have a string(char*), and i need to find its underlying datatype such as int, float, double, short, long, or just a character array containing alphabets with or with out digits(like varchar in SQL). For ex: char* str1 = "12312" char* str2 = "231.342" char* str3 = "234234243234" char* str4 = "4323434.2432342" char*...

How to convert in SQL the number of seconds into a human-readable duration?

In a SQL-database I make some selects, that get an duration (as result of a subtraction between two dates) in seconds as an int. But I want to format this result in a human-readable form like 'hh:mm' or 'dd:hh'. Is that possible in SQL and how can I realize this? ...

Video Conversion API

Can someone recommend a good API for converting video types to FLV format? Something that is in .NET would be best, but anything will work. ...

How do you convert a C++ string to an int?

How do you convert a C++ string to an int? Assume you are expecting the string to have actual numbers in it ("1", "345", "38944", for example). Also, let's assume you don't have boost, and you really want to do it the C++ way, not the crufty old C way. ...

What's a good way to process RTF-encoded files and convert them to XML?

I have never done huge amounts of RTF processing, I always used a library to read or generate one and that was a long time ago. Now I need to get more intimate with the format again, and eventually convert it to XML. Can you recommend a good path to do it so that I have a lot of control on how RTF chunks are parsed and processed? Initi...

Is there a simple script to convert C++ enum to string?

Suppose we have some named enums: enum MyEnum { FOO, BAR = 0x50 }; What I googled for is a script (any language) that scans all the headers in my project and generates a header with one function per enum. char* enum_to_string(MyEnum t); And a implementation with something like this: char* enum_to_string(MyEnum t){ ...

UInt32 to Int32

If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc. How can I convert a variable "MyUintVar32" with a value of say "3392918397 into a standard Int32 in VB.Net? In c# if I just do a "return (int)(MyUintVar32);", I get -902048899, not an error. I've tried several different method...

Need RTF/doc to html converter, preferably free

I have a problem with low end users needed to convert word documents to html. Their formatting sucks and so does the standard word html conversion. I don't particularly feel like teaching marketing people html, so I was wondering what might be a good (cheap/free) solution. They are happy to copy paste text from word into RTF (as comple...

32-bit PNG loading in .NET

Howdy, I haven't written any code yet, but I've encountered a similar problem before. Hopefully things have changed since the last time I visited it. I'm trying to do my own image conversion for games into a special OpenGL image format. In order to perform the conversion correctly, I need all pixel data and more importantly, i need al...

Convert text to 7-bit ASCII from command-line

I'm on OS X 10.5.5 (though it does not matter much I guess) I have a set of text files with fancy characters like double backquotes, ellipsises ("...") in one character etc. I need to convert these files to good old plain 7-bit ASCII, preferably without losing character meaning (that is, convert those ellipses to three periods, backqu...

Converting hex to RGB and vice-versa

What is the most efficient way to do this? ...

Ghostscript PDF -> TIFF conversion is awful for me, people rave about it, I alone look sullen.

My stomach churns when I see this kind of output. and this was my command as suggested by http://stackoverflow.com/questions/75500/best-way-to-convert-pdf-files-to-tiff-files#221341 gswin32c.exe -q -dNOPAUSE -sDEVICE=tiffg4 -sOutputFile=a.tif a.pdf -c quit What am I doing wrong? (commercial products will not be considered) ...