convert

Convert HTML to RTF (HTML2RTF converter)

I'm looking for a simple HTML2RTF converter that I can use on my website which is using a *nix like Operating System. I haven't found anything on the internet, and was hoping the SO community would help me. PS: I don't want to implement this from scratch, and it doesn't really matter what language it's in, as long as I can run it on a *...

Converting a number (1, 2, 3) to a string (one, two, three) in PHP

Does anyone know how to convert a number such as 1, 2, or 3 to their text version (one, two, three) in PHP? I only need to convert from 1 to 99. I know I could write a huge switch statement but that would be ridiculous. ...

Python Program converted into Java

Sooo I started taking my second computer science class ever! For my first class we used python and for this class we're using Java. Our first assignment (pretty much just practice) is to convert this craps program from Python to Java and I'm just having a hell of a time. Could someone please help with what I've done and umm give me som...

How do I convert NSDictionary to NSData as a plist (without saving the dictionary)

Does anyone know how to convert a NSDictionary object into an NSData object as a plist without saving the dictionary first? I would like my iphone app to send an email with a plist containing my dictionary attached. I am currently using skpsmtpmessage, http://code.google.com/p/skpsmtpmessage/, to send email. Thanks in advance ...

Convert image data to character array

I'm building a mobile advertising sdk for the iPhone and I assume that the only way to store the images that will represent the button icons for the landing page controller [in the library] is to convert the images into character arrays. When I have the character array defined inline like: const char backButtonData[] = { 0x00, 0x01, 0x...

using group_concat in PHPMYADMIN will show the result as [BLOB - 3B]

I have a query which uses the GROUP_CONCAT of mysql on an integer field. I am using PHPMYADMIN to develop this query. My problem that instead of showing 1,2 which is the result of the concatenated field, I get [BLOB - 3B]. Query is SELECT rec_id,GROUP_CONCAT(user_id) FROM t1 GROUP BY rec_id (both fields are unsigned int, both are n...

Question on Converting ints to datetimes in TSQL

I have a stored procedure that takes an int for the desired month and year as parameters. It uses these to compare some datetime values from the tables I'm pulling from. I need to conver them into DateTime values. I'm trying to do something like this: CONVERT(DATETIME, CONVERT(varchar(4), @year) + '-' + Convert(varchar(2),@month) + '-01...

Methods to convert C# code to a PowerShell Script?

Hi, I regularly have to convert an existing C# code snippet/.CS file to a PowerShell script. Can anyone offer any tools or methods that would allow some automation of this? Note, while I am aware that there are methods that can convert a .cs file to a cmdlet, I'm only interested in converting the C# code to a script or module. Than...

Is there even fast implementaion about multibyte character string convert to unicode wstring?

Hi, In my project, where I adopted Aho-Corasick algorithm to do some message filter mode in the server side, message the server got is string of multibyte character. But after several tests I found the bottleneck is the conversion between mulitbyte string and unicode wstring. What I use now is the pair of mbstowcs_s and wcstombs_s, whic...

How to convert a shape from Directx to gdi+ using c#

i draw the circle in c# using directx.i like to draw the circle with same dimensions in c# using GDI.It means i like to convert that circle from directx to GDI. Is any body help for me.plz provide the answer for me.how can i do it.Is any algorithm available for that........ And also i give the input for center of the circle is (x,y)in th...

Convert a string into an integer - each representation

Is there a function or library that can convert any (default, octal, hex, ...) integer in C given as a char[] into an unsigned long long int ? Examples: 1 1l 1ul 42e+10 0x2aLL 01234u ... atoi has some problems with 0x... and the suffixes u/l. ...

PHP convert one date into another date format

Hi, Is there a very simple way in PHP to convert one date format into another date format? I have this: $old_date = date('y-m-d-h-i-s'); // works $middle = strtotime($old_date); // returns (bool)false $new_date = date('Y-m-d H:i:s', $middle); // returns 1970-01-01 00:00:00 But I'd of course like it to r...

Java Applet - Convert File to String

How can convert a certain file into in a String? And then from that String to get the original file? This needs to realize it using Java. It would be greate an example of code or a link to a tutorial. Have to converted an entire File (not thecontent) in the String and then the String to the File. Thanks. ...

Converting / Stripping to iPhone Friendly HTML

Hi, I'm playing with some javascript for iPhone using Titanium Mobile. Being a newbie to JS, the challenge I'm at at the moment is pointing my app to a URL and converting/stripping the resultant full blown web page down to something that's iPhone friendly i.e. strip out page header images, other JS etc etc and just be left with the cont...

How to convert percentage string to double?

I have a string like "1.5%" and want to convert it to double value. It can be done simple with following: public static double FromPercentageString(this string value) { return double.Parse(value.SubString(0, value.Length - 1)) / 100; } but I don't want to use this parsing approach. Is any other approach with IFormatProvider or ...

Paperclip save images as jpg with white background

Hi, I'd like to know how to convert png and gif files with alpha channel to jpg with white background with paperclip I tried this but, it doesn't work has_attached_file :photo, :whiny => false, :styles => { :medium => ["300x300>", :jpg], :thumb => ["100x100>", :jpg] }, :convert_options => { :all => '-alpha white -background white'}...

How to convert concatenated strings to wide-char with the C preprocessor?

I am working on a project where I have many constant strings formed by concatenation (numbers, etc.). For example, I have a LOCATION macro that formats __FILE__ and __LINE__ into a string that I can use to know where I am in the code, when printing messages or errors: #define _STR(x) # x #define STR(x) _STR(x) #define LOCATION _...

Refactor for Speed: Convert To a Date

Hello, I work for myself, I am a self-employed coder and as a result I don't have the luxury of code reviews or the ability to improve based upon peer programming. I am going to use this as an exercise to see if the StackOverflow community might help to review a simple method which i've written; internal static DateTime CONVERT_To_D...

Convert Chrome history date/time stamp to readable format

I originally posted this question looking for an answer with using python, got some good help, but have still not been able to find a solution. I have a script running on OS X 10.5 client machines that captures internet browsing history (required as part of my sys admin duties in a US public school). Firefox 3.x stores history in a sqlit...

Convert DateTime to yyyyMMdd int

What is the quickest way to convert a DateTime to a int representation of the format yyyyMMdd. i.e. 01-Jan-2007 --> 20070101 (as in int)? ...