conversion

Anyway to automatically convert DWF to PDF?

Hi all, Our eTendering solution, www.monaqasat.com, currently works exclusively with PDF documents for various reasons, some of them being security. We are being asked if we can support DWF documents. For this to happen, we would need to find a way to automatically convert DWF documents to PDF, using some kind of Unix application. Does...

Java: InputStream read() returns a byte bigger than 127?

Hi, I've this code: InputStream is = socket.getInputStream(); int b; while ((b = is.read()) != -1) { System.out.println(b); } A byte its range is -128 until +127. But one of the printed bytes is 210. Is this the result of converting the read byte to an int? (So that the negatif byte becomes a positif int) If so, can I do the same...

Javascript convert data from utf-8 to iso-8859-1

Hi, I work on a website which is all done in iso-8859-1 encoding using old ASP 3.0. I use Yahoo YQL to request data (XML) from external websites but which I request to be returned as JSON-P (JSON with a callback function so I can retrieve the data). The problem I am facing is that YQL seems to always return data encoded in utf-8, which...

What is the leanest way to convert a Dictionary<string, string> to a Dictionary<string, object>?

I'm using an API that returns a key-value collection as a Dictionary<string, string>. I need to convert that to a Dictionary<string, object>. I have a sense that there should be a way to do this conversion/mapping without "manually" looping through each key-value pair, but Googling or the C# object reference didn't immediately yield a so...

Double to int conversion behind the scene?

I am just curious to know what happens behind the scene to convert a double to int, say int(5666.1) ? Is that going to be more expensive than a static_cast of a child class to parent? Since the representation of the int and double are fundamentally different is there going to be temporaries created during the process and expensive too. ...

Convert all video format to 3gp and mpeg4 video format?

Right now i stuck in my application because of this issue. anyone help to get out of this. Want source code to covert all video format to 3gp and mpeg4 format. i developed this applicatoin on asp.net using c# as a backend language. ...

PHP Convert timestamp to months and days

How can I convert a timestamp difference between 2 dates ( $diff = abs(strtotime($date2) - strtotime($date1)); ) to months and days quantity (ouput: $res = 4.05 -> 4 months and 5 days)? Thanks. ...

Is there a better way to convert from decimal to binary in python?

I need to convert from an integer to a list of size 8 that is the binary representation of that number (number <= 255) and back. Currently I am using these lines list(bin(my_num)[2:].rjust(8,'0')) int("".join(my_list),2) I did some googling, but had a hard time finding relevant information. I'm just curious if there is a faster, or ...

Is it possible to transcode audio in C# using DirectSound?

I want to transcode a lot of audio from its source format to PCM without resampling or messing with the sample size. I figure if Windows Media Player can play the file and it doesn't use a legacy ACM codecs it must be using DirectSound to do so (this is on Windows XP and Windows Server 2k3). So is it possible to access DirectSound from C...

Convert "little endian" hex string to IP address in Python

What's the best way to turn a string in this form into an IP address: "0200A8C0". The "octets" present in the string are in reverse order, i.e. the given example string should generate 192.168.0.2. ...

conversion of multiple ascii characters in a char array to single int using their ascii values --- c/c++

hi, anyone know a good way for doing this conversion? for example, take the char array holding ascii charcters "ABC", the int conversion i'm looking for would change those characters to a single int with value 656667. any help would be very much appreciated. edit really appreciate the replies. as someone noted i did say char array, an...

Is there a way to turn XML into dictionary and lists?

<things> <fruit>apple</fruit> <hardware>mouse</hardware> ... </things> Turn it into: {'things':[{'fruit':'apple'}, {'hardware':'mouse'}]} Is there an easy way to do this? Thanks. ...

Convert currencies with the exchange rate of a past date

Is there a free/cheap service, accessible through a web service or simple HTTP/XML queries, that can convert from a currency to another, but with the exchange rate of a specific date in the past? Say I need to know how much 10 USD was in EUR on date March, 13, 2009. So far I've only found oanda.com offering this service to developers, bu...

COM - How to convert DATE data type to a formatted string in UTC

How to convert DATE data type to a formatted string in UTC without using the library class COleDateTime. I do not have ATLComTime.h on my system I would like to pass it as a DATE data type and return a string in 'yyyy-mm-ddThh:mm:ssZ' ...

manually converting between ASCII and .NET characters

I am working on writing some code to scrub user input to my ASP.NET site. I need to scrub input to remove all references to ASCII characters 145, 146, 147, 148 which are occasionally getting input from my mac users who are copying and pasting content they write in a word processor on their macs. My issue is the following three strings I...

Is it possible to convert an HTML document to Excel with multiple Worksheets/tabs?

Hi there, I know we can send regular html files through the tubes and have the browser open them as Excel documents (you do that by changing http headers and the file name, then excel does the conversion). BUT, is it possible to get an HTML document show up in Excel with two Worksheets/Tabs? Here's what I thought might work, but didn't...

C++ auto conversions.

For two unrelated classes "class A" and "class B" and a function B convert(const A&); Is there a way to tell C++ to automatically, for any function that takes "class B" as argument, to auto convert a "class A". Thanks! ...

Pointer type conversion: effect on buffer length?

Char is 1 byte unsigned short is 2 bytes So if I cast a char * to unsigned short *, will it change the length of the buffer? For example I am passing char * and length to a VUMeter function. The function casts the char * to unsigned short *: short* pln = (short*) buffer;` Now I loop through the buffer, so can I use same length which...

Help Understanding 8bit Floating Point Conversions with Decimals and Binary

I'm in a basic Engineering class and we're going through binary conversions. I can figure out the base 10 to binary or hex conversions really well, however the 8bit floating point conversions are kicking my ass and I can't find anything online that breaks it down in a n00b level and shows the steps? Wondering if any gurus have found anyt...

convert a shapefile (.shp) to xml/json

hi, i'm working with a shapefile (.shp, .dbf, etc) and would like to convert it to xml. i'm on a mac, and am having trouble finding an application that will help me with the conversion. does anyone know of a method for converting this file format into an xml file? thanks ...