conversion

How will I convert characters? Or other solutions.

I found out (though my other question) that my IME outputs Hangul Compatibility Jamo (U+3130 – U+318F) instead of regular Hangul Jamo(U+1100 – U+11FF). So I tried asking a question in superuser about other IMEs, no replies yet. Should I just convert it myself? What exactly does that entail? Is it too complicated? Any ideas on how to? ...

ASCII char to int conversions in C

Possible Duplicate: Char to int conversion in C. I remember learning in a course a long time ago that converting from an ASCII char to an int by subtracting '0' is bad. For example: int converted; char ascii = '8'; converted = ascii - '0'; Why is this considered a bad practice? Is it because some systems don't use ASCII? ...

Android - Storing Audio Files into the SQLite Database

Hi Folks, I am developing an application for android phone, In this I need to use at least 400 audio file which can be played for some respective texts, Now my question is which is the optimized way to do this.. One solution is putting all the audio files in the resource folder and referring from there, this will n...

How can I convert an excel spreadsheet (.xls) to a shapefile programmatically?

I have an excel spreadsheet I want to convert to an ESRI shapefile programmatically. It contains X and Y coordinates in two columns, as well as a variety of attribute data in other columns. The spreadsheet is in excel 97 format (i.e. not .xlsx). I would like to be able to convert this to a point geometry shapefile, with each row's x,y...

Best way to convert Java SQL Date from yyyy-MM-dd to dd MMMM yyyy format.

Hello Is there a straightforward way of converting a Java SQL Date from format yyyy-MM-dd to dd MMMM yyyy format? I could convert the date to a string and then manipulate it but I'd rather leave it as a Java SQL Date. at the time I need to do this, the data has already been read from the MySQL database so I cant do the change there. T...

Join MSB and LSB of a 16 bit signed integer (two's complement)

I'm working with a proprietary protocol that transmits integers as 16 bit two's complement in two parts. The LSB is transmitted first followed by the MSB. Is the following code to restore the original value correct? unsigned char message[BLK_SIZE]; // read LSB to message[0] and MSB to message[1] short my_int = (message[1] << 8) | messag...

How do I convert these generic method calls from C# to Java

I have the following C# helper class which retrieves a Json String from a remote server and casts it to the type I need. public class JsonHelper { private JavaScriptSerializer serializer = new JavaScriptSerializer(); public T GetValue<T>(string methodName, object param) where T : IConvertible { string result = GetJs...

How can I convert an .rtf or .doc document to LaTeX?

Unfortunately, I can't use rtf2latex2e because it says that DropUNIX "no longer supports the classic environment". I barely know what I'm doing otherwise, besides dropping my .rtf file onto the DropUNIX program. What else can I use? I don't mind which type of file it is I'm converting to LaTeX (.doc would also be OK, as long as it keep...

How to convert c code to matlab

I have a c code about 1200 lines long and i want to convert it into matlab. is there any software or website where i can do it. ...

Deplhi to .Net format string conversion

I am looking for a library or snippet to convert Date/Time format strings from Delphi to .Net. This is for Delphi version 2007. For example, Delphi 2007 specifies "m" as month, whereas .Net uses "M". However, in Delphi, if the "m" follows an "h", then it represents a minute value. Are any available, or do I have to roll my own? ...

pcm16 to pcm14 conversion using add + shift

I am studying a sound converting algorithm where an array of signed shorts is received. At a given point in the algorithm it converts the samples from 16 bits to 14 bits, and it does it like this: int16_t sample = (old_sample + 2) >> 2; For me its clear that the shifting is needed as we want to get rid of the least 2 significant bits,...

Enumeration relying on integer boolean conversion

In my compiler project, I have an enumeration that goes like enum Result { No, Maybe, Yes }; I have put No explicitly at the first position, so that i can rely on the boolean evaluation to false. If my compiler is not sure about something, and has to wait for facts until runtime, its analysis functions will return Maybe. Used li...

png24 to png8 conversion

Hello, I want to convert the input 24 bit PNG image to 8 bit, I have tried using Imagemagick and Python PIL, neither works. for instance: at Imagemagick I try convert console command as such: convert -depth 8 png24image.png png8image.png And here is the way I tried with python: import Image def convert_8bit(src, dest): """ ...

Javascript/HTML - converting byte array to string

Hi, How do I convert a byte array into a string? I have found these functions that do the reverse: function string2Bin(s) { var b = new Array(); var last = s.length; for (var i = 0; i < last; i++) { var d = s.charCodeAt(i); if (d < 128) b[i] = dec2Bin(d); else { var c = s.ch...

Fastest way to convert JavaScript NodeList to Array?

Previously answered questions here said that this was the fastest way: //nl is a NodeList arr=Array.prototype.slice.call(nl); In benchmarking on my browser I have found that it is more than 3 times slower than this: arr=[]; for(var i=0,n; n=nl[i]; ++i) arr.push(n); They both produce the same output, but I find it hard to believe th...

Java: how to convert a List<?> to a Map<String,?>

I would like to find a way to take the object specific routine below and abstract it into a method that you can pass a class, list, and fieldname to get back a Map. If I could get a general pointer on the pattern used or , etc that could get me started in the right direction. Map<String,Role> mapped_roles = new HashMap<String,Role>()...

MySQL - convert phone number data?

I have a MySQL InnoDB database. I have a 'phone_number' field. My data is dirtly in the sense that sometimes my data is: (111) 222-3333 111-222-3333 111.222.3333 (111) 222 3333 How can I strip all spaces and parenthesis from my 'phone_number' field to only store my phone_number in the following format '1112223333'? What would the S...

Javascript/HTML How do I change something that's in JOT format to GIF format.

Hi, I have an application that generates signatures. It is in JOT format: http://aspn.activestate.com/ASPN/CodeDoc/JOT/JOT/GD.html How do I write a JavaScript function to convert it into GIF format. I have been given this C example, but I don't know how to convert it. Thanks. void doJot2Gif(PODSObject *podsObj,const char* pBase64Da...

Cannot Convert ref double[] to ref object

It seems like I'm on here asking a question just about every day now. I'm not sure if that's a good thing or a bad thing... Today's "Flavor-Of-The-WTF" involves my complete and utter cluelessness when using a function from a NI Measurement Studio object. As with most of my previous questions, this is in regards to an internship project ...

Is it possible to format a date column of a datatable?

Consider i have a datatable dt and it has a column DateofOrder, DateofOrder 07/01/2010 07/05/2010 07/06/2010 I want to format these dates in DateOfOrder column to this DateofOrder 01/Jul/2010 05/Jul/2010 06/Jul/2010 Any suggestion.. ...