conversion

Converting data from nvarchar to varchar in C#

As part of an integration task I am doing, I have a column in my database that has the type nvarchar(30) and I need call a WCF service and pass through the values in this column (among others) that will then be stored in a column that has the type varchar(30) in the other database. What should I do (presumably in the code that calls the...

Best Software to convert a swf file to mpg...

I am working on a software project that uses video. I am in the process of refactoring this software, the process of which requires me to convert some video files from swf to mpg (the swf files were created using Adobe Premiere). Can someone point me in the direction of a software package (open source, if possible) that will do a lossl...

Converting TIFF files to PNG in .Net

I have to build an application in .Net (3.5) to pick up a TIFF file saved from another piece of software and convert it into a PNG so that it can be rendered easily in Internet Explorer. Does anyone know of any libraries (preferably freeware/open source) that will do this conversion for me? If there aren't any simple ways of getting it ...

In Python, how do I transform a string into a file?

There is a read-only library function that takes a file as an argument. But I have a string. How do I convert a string to a file, that if you read the file it will return this string? I don't want to write to disk. ...

How can i convert a file from avi to flv with php?

It's possible? I don't need the complete solution, just an hint on how to do. Everything is appreciated, thanx. ...

Is conversion to String using ("" + <int value>) bad practice?

Is conversion to String in Java using "" + <int value> bad practice? Does it have any drawbacks compared to String.valueOf(...)? Code example: int i = 25; return "" + i; vs: int i = 25; return String.valueOf(i); Update: (from comment) And what about Integer.toString(int i) compared to String.valueOf(...)? ...

Javascript function to convert color names to hex codes

Hi, Is there a built-in function that would convert a color by name into its hex representation? Like I want to pass 'white' and receive '#FFFFFF'. I really want to avoid coding all hundred if's myself :) Thank you! Andrey ...

Javascript Date to IS8601 format?

Hi, I am learning javascript and I am trying to figure out if there is a simple way to convert a standard formatted Date to ISO8601 format (YYYY-MM-DDThh:mm:ssTZD). Advices? ...

convert video formats

Because the xbox 360 only supports specific video/audio codecs, I'd like to write a utility that would look in a directory and convert files to specific formats as they are dropped in the directory. In some cases, it would only need to convert the container format (ie, mkv to wmv or avi) and in some cases it might need to convert the a...

Human-readable binary data using Python

My work requires that I perform a mathematical simulation whose parameters come from a binary file. The simulator can read such binary file without a problem. However, I need to peek inside the binary file to make sure the parameters are what I need them to be, and I cannot seem to be able to do it. I would like to write an script in P...

Converting a decimal number into binary

I am currently reading Charles Petzold's book 'Code'. In it he explains how to convert a decimal number into binary using the following template: [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] ÷128 ÷64 ÷32 ÷16 ÷8 ÷4 ÷2 ÷1 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] In th...

Conversion from unsigned to signed type safety?

Is it safe to convert, say, from an unsigned char * to a signed char * (or just a char *? ...

How to convert Unicode NCR form to its original form in PHP?

To avoid "monster characters", I choose Unicode NCR form to store non-English characters in database (MySQL). Yet, the PDF plugin I use (FPDF) do not accept Unicode NCR form as a correct format; it displays the data directly like: &#36889;&#20491;&#19968;&#20491;&#20363;&#23376; but I want it to display like: 這個一個例子 Is there any met...

How do I convert a large array of 8 bit binary values in MATLAB?

This is a follow-up question to another SO question of mine. I have a large array of 8 bit binary values that I want to convert back to uint8. I have used Amro's lookupTable solution from the previous question. Now I want to do the reverse. I wanted to do a lookup table but sadly I am unable to. What I managed to do is the following: ...

DOC to PDF library (not necessarily free)

Hey all, Just after a bit of advice on peoples preference with DOC to PDF libraries for .NET. At the moment we currently piggy back on OpenOffice but this isn't really ideal. What i'm after is a library that will allow me to convert a .DOC and write out a .PDF in code. The library doesn't have to be free and it must also work with ASP....

How to automatically convert underscore_identifiers into CamelCaseIdentifiers ?

I have large C++ code base. It is quite inconsistent where uses underscore_identifiers and where CamelCaseIdentifiers, but is consistent within groups of files. Think about it as a smaller library merged into bigger one. I want to standardize it within this project to Google C++ Style Guide. How can I semi-automatize it ? Preferably wit...

Convert Byte String to Int in Scheme

I have code like this to convert hex into byte string (define (word->bin s) (let ((n (string->number s))) (bytes (bitwise-and (arithmetic-shift n -24) #xFF) (bitwise-and (arithmetic-shift n -16) #xFF) (bitwise-and (arithmetic-shift n -8) #xFF) (bitwise-and n #xFF)))) (word->bin "#x10000002") I'm thinking of a similar...

Coverting Enums to Key,Value Pairs

How to convert Enum to Key,Value Pairs. I have converted it in C# 3.0 . public enum Translation { English, Russian, French, German } string[] trans = Enum.GetNames(typeof(Translation)); var v = trans.Select((value, key) => new { value, key }).ToDictionary(x => x.key + 1, x => x.value);...

How can I convert a string into a regular expression that matches itself in Perl?

How can I convert a string to a regular expression that matches itself in Perl? I have a set of strings like these: Enter your selection: Enter Code (Navigate, Abandon, Copy, Exit, ?): and I want to convert them to regular expressions sop I can match something else against them. In most cases the string is the same as the regular exp...

Conversion of System.Array to List

Last night I had dream that the following was impossible. But in the same dream, someone from SO told me otherwise. Hence I would like to know if it it possible to convert System.Array to List Array ints = Array.CreateInstance(typeof(int), 5); ints.SetValue(10, 0); ints.SetValue(20, 1); ints.SetValue(10, 2); ints.Se...