convert

Are there any tools for converting Managed C++ to C++/CLI?

We have an old project written using Managed C++ syntax. I would like to propose to the team a reasonably pain-free (I don't mind some level of human interaction, I think I'm realistic in my expectations that we'll still have to do some work by hand) method of updating the existing code to C++/CLI syntax so that we can also add XML docum...

Convert Char[] to a list<byte> (c#)

How can I convert a Char[] (of any length) to a list < byte> ? ...

Cast or convert when retrieving data from a database?

When accessing an object in a DataTable retrieved from a database, are there any reasons not to cast the object into your desired type, or are there reasons to use convert? I know the rule is cast when we know what data type we're working with, and convert when attempting to change the data type to something it isn't. Presuming we know w...

RFC timestamp in Flash/AS3

I'd like to know if Flash/AS3 has any nice way to convert an AS3 'Date' object to/from rfc-850 timestamp format (as used by HTTP date and last-modified). This question is very similar to this question about rfc 3339, except it's specific to AS3 and rfc-850. RFC-850 is like: Thu, 09 Oct 2008 01:09:43 GMT ...

How to format a string as a telephone number in C#

I have a string "1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a new variable. I was thinking: String.Format("{0:###-###-####}", i["MyPhone"].ToString() ); but that does not seem to do the trick. ** ...

VB.NET generics to C# syntax

Could you please show me the C# Equivalent of this VB.NET code: Public Partial Class Index Inherits System.Web.Mvc.Viewpage(Of List(Of Task)) End Class I am not sure where/how to add it in for C#: public partial class DirList : System.Web.Mvc.ViewPage { } The code is suppose to tell the class to expect a list of tasks from t...

How should C bitflag enumerations be translated into C++?

C++ is mostly a superset of C, but not always. In particular, while enumeration values in both C and C++ implicitly convert into int, the reverse isn't true: only in C do ints convert back into enumeration values. Thus, bitflags defined via enumeration declarations don't work correctly. Hence, this is OK in C, but not in C++: typedef en...

Convert a number to a string with specified length in C++

I have some numbers of different length (like 1, 999, 76492, so on) and I want to convert them all to strings with a common length (for example, if the length is 6, then those strings will be: '000001', '000999', '076492'). In other words, I need to add correct amount of leading zeros to the number. int n = 999; string str = some_func...

Convert Byte Array to Integer In VB.Net

I'm wonder what the best way to convert a byte array (length 4) to an integer is in vb.net? I'm aware of BitConverter, but it seems like quite a waste to do a function call to do something that should be able to be done by copying 4 bytes of memory. Along the same lines, what about converting a single/double from it's binary representat...

Convert DataRowCollection to DataRow[]

What's the best performing way to convert a DataRowCollection instance to a DataRow[]? ...

Convert Word doc to HTML programmatically in Java

Hi, I need to convert a Word document into HTML file(s) in Java. The function will take input an word document and the output will be html file(s) based on the number of pages the word document has i.e. if the word document has 3 pages then there will be 3 html files generated having the required page break. I searched for open source/...

Alternative to itoa() for converting integer to string C++?

I was wonding if there was an alternative to itoa() for converting an integer to a string because when I run it in visual Studio I get warnings, and when I compile my program under Linux, it won't even compile. Thanks, tomek ...

Date time format from string?

How do I convert a string to DateTime format? For example, if I had a string like: "24/10/2008" How do I get that into DateTime format ? ...

Convert calories to weight

The fundamental equation of weight loss/gain is: weight_change = convert_to_weight_diff(calories_consumed - calories_burnt); I'm going on a health kick, and like a good nerd I thought I'd start keeping track of these things and write some software to process my data. I'm not attentive and disciplined enough to count calories in food, ...

Using itext to convert HTML to PDF

Does anyone know if it is possible to convert a HTML page (url) to a PDF using itext? If the answer is 'no' than that is OK as well since I will stop wasting my time trying to work it out and just spend some money on one of a number of components which I know can :) Thanks in advance for your responses! ...

convert html to pdf with linked documents inline

I need to convert a bundle of static HTML documents into a single PDF file programmatically on the server side on a Java/J2EE platform using a batch process preferably. The pdf files would be distributed to site users for offline browsing of the web pages. The major points of the requirements are: 1. The banner at the top should not be...

How do you convert a string to a byte array in .Net

I have a string that I need to convert to the equivalent array of bytes in .NET. This ought to be easy but I am having a brain cramp. ...

What is the easiest or most effective way to convert month's abbreviation to a number in Perl? (ie "jan" to 1)

If I import a library to use a method, would it be worth it? Does importing take up a lot of memory? ...

C# code to convert XHTML doc to plain text

I'm writing a utility to export evernote notes into Outlook on a schedule. The Outlook API's need plain text, and Evernote outputs a XHTML doc version of the plain text note. What I need is to strip out all the Tags and unescape the source XHTML doc embedded in the Evernote export file. Basically I need to turn; <note> <title>Test Sy...

How do I convert big numbers to decimal?

0x34363932353433373538323038353135353439 ...