convert

convert image to base64 string using java

i want to know how to convert image to base64 string in java. thanks and advance.. ...

How do I prevent ImageMagick convert from scaling images *up*?

I'm using ImageMagick's convert tool to generate image thumbnails for a web application. I'm using notation like so: 600x600> The images are indeed scaled to 600px wide/tall (depending on the longer side) and proportions are properly maintained, however images less than 600px in either direction are scaled up — this behavior is not desi...

SQL Convert Nvarchar(255) to DateTime problem

I'm using SQL server 2008. I have 2 Tables: Table 1 and Table 2. Table 1 has 1 column called: OldDate which is nvarchar(255), null Table 2 has 1 column called: NewDate which is datetime, not null Example data in Table 1: 26/07/03 NULL NULL 23/07/2003 7/26/2003 NULL 28/07/03 When i try CAST(OldDate as datetime) I get this error: ...

Convert java legacy code to generic - how to replace Object with type?

// legacy code void setCacheValue(String name, Object value){ getServletContext().setAttribute(name, value); } Object getCacheValue(String name){ return getServletContext().getAttribute(name); } // so I want to use generic for "type safety" // first, set method seems working perfectly <T> void setCacheObject(String name, T va...

[genshi] Print string as HTML

Hello, I would like to know if is there any way to convert a plain unicode string to HTML in Genshi, so, for example, it renders newlines as <br/>. I want this to render some text entered in a textarea. Thanks in advance! ...

C# cast string to enum with enum attribute

Hello, i've got the following question: I've got public enum Als { [StringValue("Beantwoord")] Beantwoord = 0, [StringValue("Niet beantwoord")] NietBeantwoord = 1, [StringValue("Geselecteerd")] Geselecteerd = 2, [StringValue("Niet geselecteerd")] NietGeselecteerd = 3, } with public class Stri...

Javascript Getting a string into kb format

I am new to javascript and I just wanted to convert a string into a format that a person like me can read. Here is an example of what I am trying to do... string2size(string){ //some awesome coding I have no clue how to make return awesomeAnswer } now the return should give me something like 56 bytes or 12kb or 1mb depending how much...

Convert .o file to .exe

Is it possible to convert an object file .o that was created from a .c source code to .exe? And if it is possible is there a direct command using gcc? ...

Convert string value back to GUID value

hi, i have a guid value that i store in my hidden variable. say for eg (303427ca-2a5c-df11-a391-005056b73dd7) now how do i convert the value from this hidden field back to GUID value (because the method i would be calling expects a GUID value). thank you. ...

Convert datetime field in sql server 2005....

I have a datetime field which has a value like this 5/11/2010 12:04:20 PM .... I am converting this field convert(varchar, dbo.Clients.CreatedDate,103) as CreatedDate and i get the result as 11/5/2010..... But how to get 11/5/2010 12:04 PM..... ...

openoffice document (odt) to PDF with commad line on Linux?

Hi, we are building a PHP script that we need at work to create reports in PDFs the reports will be created by using templates from postgrSQL. so far I found that it can be done with the use of php and odt (openoffice) files [http://www.odtphp.com/] (do you have any other suggestions?) now how I can convert the results to PDF so tea...

better params for a conversion to png with imagemagick

i have to convert 60px X 60px images to png for my web site with imagemagick. convert image.jpg image.png But it's return an image with 4kbyte size. I want get a size around 1kbyte. How can i do? thanks ...

Convert NSFileSystemSize to Gigabytes

I need to convert NSFileSystemSize to Gigabytes. NSDictionary * fsAttributes = [ [NSFileManager defaultManager] fileSystemAttributesAtPath:NSTemporaryDirectory()]; NSNumber *totalSize = [fsAttributes objectForKey:NSFileSystemSize]; NSString *sizeInGB = [NSString stringWithFormat:@"\n\n %3.2f GB",[totalSize floatValue] / 107374824...

How do I convert a double into a string in C++(without scientific notation)?

How to convert a double into a floating-point string representation without scientific notation in C++. "Small" samples (effective numbers may be of any size, such as 1.5E200 or 1e-200) : 0.0000000000000000000000000000000000000000000000000000000023897356978234562 Thank you. ...

Converting rich text that contains backslashes to plain text or html

I am trying to convert a rich text string to plain text or html. I am currently using the RichTextBox.Text feature which works correctly for almost all cases except when the text contains backslashes then some of the text is stripped out as the converter believes that it is part of the rtf formatting. Does anyone have any ideas of how to...

C++ conversion from string to object identifier

I'm writing a program in C++ that reads in some data from an external file in order to set the values of static variables. Is it possible to convert a string to an object identifier? (e.g. convert the string "CheckBox::Unchecked" into an identifier for the object CheckBox::unchecked) ...

Convert Lua data in asp.net?

Hi all, is there an easy way in .Net to convert Lua table to something else (XML, datatable, array etc.) I google it for few hours but i don't ask google right or there is no easy way :-) Thanks! ...

Converting PDF to PCL5 on Windows?

In my application, I need to convert PDF docs to PCL5 generic files to send to FTP PCL capable printers. Printing to file would be a last resort, I would prefer a small-footprint command line tool or API that will do the job. I've seen some mention of doing this on Linux using Ghostscript, but I've got no idea how to replicate this on w...

xquery function to convert tag elements to attributes

Hello, I need to write a function that takes a sequence of "tag" elements of the form: <tag type="markupType" value="topic"/> <tag type="concept" value="death"/> ... and turns them into attributes of the form data-markupType="topic" data-concept="death" So far I have the following function: declare function local:tagsToAttrs($ta...

MVVM:How am I supposed to convert a ViewModel into a Model ?

Hello, everyone speaks about wrapping a model by a viewmodel. fine so far. But when I want persist my Model, how do I convert a ViewModel into a Model ? Reading all properties from the ViewModel into a new Model object seems very cumbersome. Any better method? ...