conversion

most elegant way to return a string from List<int>

What is the most elegant way to return a string from a List ok, yeah, I know I can do something like public string Convert(List<int> something) { var s= new StringBuilder(); foreach(int i in something) s.AppendFormat("{0} ",i); return s.ToString(); } but i m sure there is a way to do this with lambdas I tried also to a...

Convert CSS Style Attributes to HTML Attributes using Perl

Real quick background : We have a PDFMaker (HTMLDoc) that converts html into a pdf. HTMLDoc doesn't consistently pick up the styles that we need from the html that is provided to us by the client. Thus I'm trying to convert things such as style="width:80px;height:90px;" to height=80 width=90. My attempt so far has revealed my limited un...

convert text with html tag to formated word file

How can i convert the text with html tag to formated word document. Actually what i need to do is, I want to give text with the html tag as input in a text box, and when i click a button, i want the the text to be open in a word document where the html tags are removed and the text appears in its corresponding format. ...

Programmatically convert *.odt file to MS Word *.doc file using an OpenOffice.org basic macro

I am trying to build a reStructuredText to MS Word document tool-chain, so I will be able to save only the rst sources in version control. So far I -- Have rst2odt.py to convert reStructuredText to OpenOffice.org Writer format. Next I want to use the most recent OpenOffice.org (currently 3.1) that do a pretty decent work of generating...

How to convert char * to unsigned int in C programming in win32

Hi I am trying to convert char *str = "10.20.30.40" ; in to unsigned int . can u pls tell me any method is there or any sample code . pls share me. ...

MDB 2 CSV batch.

Does anybody know what I could use to write a script to convert all MDB files in a directory to CSV files? I'm working on Windows but have been using Cygwin for some work. ...

PDF, DOC and Execl to image conversion tool for web application

Hi all can you please suggest some web tool (will provide DLL) to convert doc, excel and PDF to image at minimum cost. i m a dot.net developer and need to implement these feature in my web application.... Thanks ...

Convert NSNumber to CLCoordinate

I want to pull a list of coordinates from a database into an array (Before displaying them on a map). however, in the database they are of type Number, and I can't figure out how to convert them to coordinates. This doesn't work: Where I have an ATM object (The coordinates are for atm machines) with NSNumbers for latitude and longitude....

Converting variable to integer

The shellscript shown below will show a warning if the page takes more than 6 seconds to load. The problem is that the myduration variable is not an integer. How do I convert it to integer? myduration=$(curl http://192.168.50.1/mantisbt/view.php?id=1 -w %{time_total}) > /dev/null ; [[ $myduration -gt 1 ]] && echo "`date +'%y%m%d%H%M%S'`...

How to select column values which throw an error if cast to a new type.

Hi there, I need an sql query to give me the following: All the values in a column of type varchar(50) which will NOT convert or will throw an error if cast / converted to an int. E.g. row 1: '1' row 2: '2' row 3: '3a' row 4: '4.5' I need row 3....however there are tens of thousands of rows. Thanks! ...

How to convert a String into an array of Strings containing one character each

I have a small problem here.I need to convert a string read from console into each character of string. For example string: "aabbab" I want to this string into array of string.How would I do that? ...

Converting ANSI escape sequences to HTML using PHP

This is a similar question to this one. I would like to convert ANSI escape sequences, especially for color, into HTML. However, I would like to accomplish this using PHP. Are there any libraries or example code out there that do this? If not, anything that can get me part way to a custom solution? ...

Diverge a Mercurial Repository in to two seperate repositories

Like many people, I have several SVN repositories that contains several projects. I've decided to convert one of these repositories to Mercurial for several reasons. I've successfully converted the repository using instructions located here. The new hg repo includes everything; all history and the correct tags. The conversion worked gr...

Cannot get ::WideCharToMultiByte to work

Dears, I've got a DLL for injection. This is injected via CBT-hook. Now, when the desired process is encountered via CBT, I've detoured WinAPI's ExtTextOutW with my own. The specification of ExtTextOutW is: BOOL ExtTextOutW(HDC hdc, INT x, INT y, UINT fl...

Python: convert seconds to hh:mm:ss

Hi, Please, how to convert an int (number a seconds) to these formats: mm:ss or hh:mm:ss ? I need to do this with Python code (and if possible in a Django template ?). Thank you very much ;-) ...

How to convert a document back to string?

I need a java script function that converts the document object of the current loaded page back to it's source text. In firefox it's smth like that: var doc = document; var str = (new XMLSerializer()).serializeToString(doc); alert(str); But i need a cross browser solution. How would this be done? For example: <html> <body> <sc...

Converting hex string stored as chars to decimal in C

I'm given a string hex_txt containing a 4 digit hex number in the way outlined in the code, split up in two array entries. I need to convert it to decimal. The following is the way I'm doing it. unsigned char hex_txt[] = "\xAB\xCD"; unsigned char hex_num[5]; unsigned int dec_num; sprintf(hex_num, "%.2x%.2x", (int)hex_txt[0], (int)hex_t...

Get a table count in SSIS from an Oracle view

In my SSIS package, I want to see if a particular Oracle view has data in it. I have a Execute SQL Task with a select count statement: Select CAST( count(*) as Integer) As Row_Count from OWNER.VIEW_MV My RowCount is in the Result Set, pointing to my Variable User:TableCount. If I set TableCount to anything except Object, I get an err...

Parse multiple doubles from string in C#

I have a string that contains a known number of double values. What's the cleanest way (via C#) to parse the string and plug the results into matching scalar variables. Basically, I want to do the equivalent of this sscanf statement, but in C#: sscanf( textBuff, "%lg %lg %lg %lg %lg %lg", &X, &Y, &Z, &I, &J, &K ); ... assuming that ...

Converting a C# class library to C++ on Red Hat Linux

We have developed a C# class library on VS 2008. We want the same functionality as a C++ library on Red Hat Linux. How do we accomplish that? I am sure we are not the first to migrate C# to C++. Are there any automated tools to convert the source code? We know about Mono, but we would very much prefer C++ source code. About 15% is the ...