conversion

How can I convert a java bean to a properties file?

What libraries are available that can do something like public class Person { private Long id; private Name; private List<Long> associations; // accessors } public class Name { private String first; private String last; // accessors } into something like id=1 associations=1,2,3,4,5 name.first=Franz name.last=See ...

PHP Script To ASP.NET (3.5)

Hi. I am not a PHP guy and would really love to see what the below PHP script looks like in ASP.NET (I am working in 3.5 but anything that gets me started would be wonderful). I have tried downloading Microsoft's migration assistant but am having difficulties running it on my machine. Any kind soul out there willing to convert this f...

Convert a Ruby on Rails project to a JRuby on Rails project

Hi, is there any particular way to convert a Ruby on Rails project to a JRuby on Rails project? There now is a need to get the Rails side to talk to a Java server via RMI so was wondering how to make the conversion. Thanks. ...

How to get all the info in XML into dictionary with Python

Let's say I have an XML file as follows. <A> <B> <C>"blah"</C> <C>"blah"</C> </B> <B> <C>"blah"</C> <C>"blah"</C> </B> </A> I need to read this file into a dictionary something like this. dict["A.B1.C1"] = "blah" dict["A.B1.C2"] = "blah" dict["A.B2.C1"] = "blah" dict["A.B2.C2"] = "blah" But the format of the dict doesn...

java - print() does not output char array if the array has int value?

I am bit confused about how Java handle conversion. I have char array consist of 0 (not '0') char[] bar = {0, 'a', 'b'}; System.out.println(String.valueOf(bar)); When this happens println method does not output anything. But when I treat zero as character: char[] bar = {'0', 'a', 'b'}; System.out.println(String.valueOf(bar)); Then...

Adding two Integers to array index without summing them.

Hi all , I'm a beginner in C# , I'm trying to do this ..... user input "43 24" and the application take this input , put 43 in arr1[0] , and 24 in arr1[1] . The arr1 is char[] type .. i tried this : (This is only a part of the code of course) (wholeLine is type string) foreach (char ch in wholeLine) { if (ch != ' ') ...

Convert Jagged array to several one-dimensional arrays.

Hi all , I wonder if there's a way to convert jagged array , say [3][] into three one-dimensional arrays ? ...

How to turn a hex string into an unsigned char array?

For example, I have a cstring "E8 48 D8 FF FF 8B 0D" (including spaces) which needs to be converted into the equivalent unsigned char array {0xE8,0x48,0xD8,0xFF,0xFF,0x8B,0x0D}. What's an efficient way to do this? Thanks! EDIT: I can't used the std library... so consider this a C question. I'm sorry! ...

C++ base conversion

Hello I'm trying to port some code from Windows to Linux. I have this: itoa(word,aux,2); But GCC doesn't recognize itoa. How can I do this conversion to base 2 on a C++ way? Thanks ;) ...

VB.NET - Conversion from string "11/07/2010 13:00:00" to type 'Date' is not valid.

Hi, I am getting the error: Conversion from string "11/07/2010 13:00:00" to type 'Date' is not valid. In my ASP.NET code when run on the web server. The date is valid and it can't be a US format issue because either way it would be valid. I have tested it and it seems to error when the time is > 12:00 (ie. a 24hour like 13:00 or 21:00)....

Unsigned char std::vector to unsigned char[]?

Simple question, how does one create a function which takes an unsigned char std::vector and spits out an unsigned char[] with a length. Thanks! Ah, well it seems my problem was my knowledge of std::vector. I always believed that std::vector did not hold its values in linear fashion. That solves a lot of my problems. Thanks! ...

display vector images in browser

I need to display vector images in the following formats(.eps, .ai, .cdr, .pdf, .cs3, .cs5 ) in major web browsers (IE, firefox, safari, chrome). How do I accomplish the same? I tried searching for java libraries that will convert the vector images to bitmaps but could not find a library that will convert all the formats mentioned abo...

Testing a image/video conversion class

I have a class that converts images and videos to other formats. A number of options are available such as size, scaling mode, background color, etc (think ImageMagick's convert command). Any ideas for how to test it? The code to exercise all of the options isn't that hard to write, but I'm unsure about how to confirm the results are val...

How to convert wchar_t** to char**?

I get argv as wchar_t** (see below), because I need to work with unicode, but I need to convert it to char **. How can I do that? int wmain(int argc, wchar_t** argv) { ...

NSDate from NSString

I have a string in the format "Fri Jul 09 17:57:44 +0000 2010" which I need to convert to an NSDate. I have tried a few unsuccessful operations to convert this date, and was wondering if anyone could tell me how I can achieve this. Regards ...

Correct C# conversion counterpart for VB's CTYPE()

The below is a snippet from VB that I am porting to a C# rewrite. My question is what is receipt_date after the assignment? Is it still an object or is it a string? Dim receipt_date As Object receipt_date = CType(dr.Item("RECTDT"), String) Would this be the correct C# counterpart? object receipt_date; receipt_date = dr["RECTDT"].To...

Merging multiple Access databases into SQL Server

We have a program in which each user is given their own Access database. We'd like to merge these all together into a single SQL Server database. The problem is that, using the SQL Server import/export wizard, the primary/foreign keys do not get updated. So for instance if one user has this table: 1 Apple 2 Banana and another us...

Parsing a decimal number

Guys, I have a string that contains a decimal number. The problem is, sometimes it is negative and it is stored in accounting format (positive number surrounded by parenthesis). In other words, I got a string like this: string s = "(35.00)"; What I'm doing currently is: decimal TheValue = decimal.Parse(s); This value of TheValue sh...

PHP code to convert PHP to JS

I need some PHP code to convert some PHP into JS. functionality - I'm using common PHP functions from php.js syntax - ??? The issue is converting the syntax. I don't need full PHP syntax, mind you; no need for supporting class definitions/declarations. Here's a small checklist of what needs conversion: "." should be "+" (string con...

class to class conversion using constructor+inheritance in C++

Hello Every one. Here I can do conversion from emp class object to emp class object. But I can't do conversion from employee class object to emp class object - I have added comment where I am getting error - 'setEmpID' is not a member of 'employee'. what should I do to resolve this error ? ( I am just preparing for C++ exam & this is t...