conversion

How do I convert the below PHP code to VB.NET?

How do I convert the below PHP code to VB.NET? <?php $X_HOST ="foo.com"; $X_URL = "/index.php"; $X_PORT ="8080"; $X_USERNAME = "foo"; $X_PASSWORD = "bar"; $s_POST_DATA = "Channel=UK.VODAFONE"; // Channel $s_POST_DATA .= "&Shortcode=12345"; // Shortcode $s_POST_DATA .= "&SourceReference=3456"; // Source Re...

Converting a string number into sequence of digits - .Net 2.0

Given a string string result = "01234" I want to get the separate integers 0,1,2,3,4 from the string. How to do that? 1 The following code is giving me the ascii values List<int> ints = new List<int>(); foreach (char c in result.ToCharArray()) { ints.Add(Convert.ToInt32(c)); } ...

where should I do the conversion: Domain object<->DTO?

In Domain Layer or Data access layer? ...

What's a great way to convert a string to a number in C#?

I'm familiar with: Convert.ToInt32(texthere); But is there another cleaner way to do it? I like having readable code for coworkers and I'm always on the lookout for anything that'll make my work seem more obvious. ...

How to convert a dynamic XAML into a PNG or GIF using C#?

I'm creating dynamic templated XAML designs that I would like to convert to PNG or GIF from my C# code. Any ideas? ...

Input string was not in a correct format. Converting String to double .

I'm quite a beginner in C# , empty string to double conversion can be carried out under the button1_click event ..but doing it under Public Form1() it gives me this error Input string was not in a correct format. Here`s the code..(the form1.cs and the Guy.cs class) using System; using System.Collections.Generic; using Syste...

How to convert between different currencies?

Hey there, this is part of a question i got in class, im at the final stretch but this has become a major problem. In it im given a certain value which is called the "gold value" and it is 40.5, this value changes in input. and i have these constants const int RUBIES_PER_DIAMOND = 5; // relative values. * const int EMERALDS_PER_RUBY ...

How does one convert 16-bit RGB565 to 24-bit RGB888?

I’ve got my hands on a 16-bit rgb565 image (specifically, an Android framebuffer dump), and I would like to convert it to 24-bit rgb888 for viewing on a normal monitor. The question is, how does one convert a 5- or 6-bit channel to 8 bits? The obvious answer is to shift it. I started out by writing this: puts("P6 320 480 255"); uint16_...

How to convert from System.Int32 to System.UInt16 in F#

Is there a better (shorter?) way than the following? let cpucount = System.UInt16.Parse( reader.GetInt32(3).ToString() ) ...

Convert PPT to PNG via python

I want to convert PPT to png, or other image formats using Python. This question has been asked on SO, but essentially recommends running OpenOffice in headless X server, which was an absolute pain last time I used it. (Mostly due to hard to replicate bugs due to OO crashing.) Is there any other way, (Hopefully using Linux CLI utilitie...

Map tiling - What kind of projection?

Hi. I've taken a large image and divided it in to square tiles (256x256). It is made for google maps also, so the whole image is divided into z_x_y.png (Depending on zoom level). z=0 => 1x1 tile z=1 => 2x2 tilesthe z=2 => 4x4 tiles My imageMap is "flat" and is not based on a sphere like the worldmap. I'm gonna use this map on a wind...

Building a directory tree from a list of file paths

I am looking for a time efficient method to parse a list of files into a tree. There can be hundreds of millions of file paths. The brute force solution would be to split each path on occurrence of a directory separator, and traverse the tree adding in directory and file entries by doing string comparisons but this would be exceptionall...

Delphi To Java code conversion: image.canvas.pixels

I'm trying to convert an old Delphi program I wrote into Java to compile and run on my Android phone. I'm running the Android 2.1 operating system but am using version 1.6 of the SDK. I have a routine in Delphi where I set the colour of pixels on a canvas individually along the lines of: image1.canvas.pixels[x, y] := GetMyTColor(x, y);...

Generating Java classes from XML file

Hello, How can I get java classes from an xml file? In this situation, I don't have an XML schema and this way I can't use JAXB, Castor or other xml binding API as far as I know. ...

Converting a int to a BCD byte array

I want to convert an int to a byte[2] array using BCD. The int in question will come from DateTime representing the Year and must be converted to two bytes. Is there any pre-made function that does this or can you give me a simple way of doing this? example: int year = 2010 would output: byte[2]{0x20, 0x10}; ...

Can Ghostscript to start numbering pages from zero?

I am using Ghostscript to convert a multi-page pdf to individual jpg files and can get it to output the files numbered like page_%03d.jpg but it always starts at page_001.jpg and i need it to start numbering the output files starting from page_000.jpg. Is there a setting i can use to get Ghostscript to start at zero or am i going to hav...

Automatically Convert Prices on a Web Page to A Different Currency

Hi, I am interested in possible methods of automatically converting the prices given when a web page is loaded from the currency given to a specified currency. Ideally, the conversion would also make use of the current exchange rate to give valid prices. For example, in my specific case, I would like to convert the prices given in Eur...

How do I convert a windows forms app from C# to VB ?

I've been converting all kinds of other things, classes, interfaces, ASP.NET MVC apps, and WPF applications, but I am stumped as to how to convert a windows forms application, as the whole structure seems to be different. Does anyone have any advice on how to tackle this problem? I see essentially that you have two files, Form1.cs and F...

String / DateTime Conversion problem (asp.net vb)

I have this code: Dim birthdaystring As String = MonthBirth.SelectedValue.ToString & "/" & DayBirth.SelectedValue.ToString & "/" & YearBirth.SelectedValue.ToString Dim birthday As DateTime = Convert.ToDateTime(birthdaystring) Which produces errors (String was not recognized as a valid DateTime.) The string was "01/31/1963". Any assi...

Free Java library for converting existing PDF to PDF/A

Hi. I am trying to convert PDF to PDF/A. Currently I can do this using OpenOffice pdf viewer plugin together with Jodconverter 2. But this is pretty cumbersome to do. Does anybody know of any open source / free Java libraries I can use to do this? I have found these open source libraries so far, but none of which has support for conv...