Questions tagged [code-conversion]

The process of converting the logic of some source code from its original language/framework to a different language/framework. Not to be confused with porting, which deals with architectures/platforms.

272 questions
1
vote
2 answers

Is this conversion valid?

I've the code in Java where p1 is an object of Pixel class which accesses an array pixels and assigns it the value (at right side) at the proper index. R G and B are some int values. p1.pixels[index] = 0xff000000 | (R << 16) | (G << 8 ) | B; I'm…
user3863537
  • 101
  • 1
  • 12
1
vote
1 answer

Specific Java code to C#

I have a certain code in Java that I am trying to get over to C#. My problem so far is with the 'Method paint(Graphics g)'. Rather new to programming and still learning, I kinda don't have a clue how to properly "translate" this Method into C#. My…
Skyswimsky
  • 71
  • 2
  • 9
1
vote
1 answer

MathProg to C++ conversion

I wrote a problem using MathProg language to check whether my understanding of some mixed-integer problem was correct. After a while I was able to figure it out, and I can assume that this solution is correct. GLPK Simplex Optimizer, v4.45 37 rows,…
Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64
1
vote
4 answers

Convert this C# dictionary to VB.NET

How do I convert the following C# code to VB.NET? The conversion tool is not doing a good job. private static readonly Dictionary> ValidHtmlTags = new Dictionary> { { "param", new List()…
vamsivanka
  • 792
  • 7
  • 16
  • 36
1
vote
1 answer

Macro for both excel and openoffice calc

I am in need of creating a macro that will launch on both excel and openoffice calc. My first problem is format of a file that I should create (xls vs ods) to be able to open it in both applications. Another problem is creating a macro, what…
Ziker
  • 141
  • 4
  • 20
1
vote
3 answers

C to Python code conversion(print address-like values)

I am trying to convert the following code from c to Python. The C code looks like: seed = (time(0) ^ (getpid() << 16)); fprintf("0x%08x \n", seed); that outputs values like 0x7d24defb. And the python code: time1 = int(time.time()) seed =…
biggdman
  • 2,028
  • 7
  • 32
  • 37
1
vote
3 answers

What is the prefix `I` before class name like IController, IObserver?

I'm learning MVP patter. In some examples, I saw this! Any one could demonstrate why programmers use this name convention?
Milad Khajavi
  • 2,769
  • 9
  • 41
  • 66
1
vote
1 answer

equivalent for "ismember" of matlab in opencv?

What is the equivalent of "ismember" of matlab in opencv? I am trying to convert a matlab code to opencv ( C/CPP ). For this I need to convert the below step to Opencv. Can some one please guide me in this regard? [Lia Locb1] =…
2vision2
  • 4,933
  • 16
  • 83
  • 164
1
vote
2 answers

Build native c++ for use as .net library

I have the c++ source code of functionality which is appealing to me. What effort/work is involved/required in order to either reference this from a .net application or build this code as a .net assembly (preferably c#)? This is my first attempt at…
c0D3l0g1c
  • 3,020
  • 5
  • 33
  • 71
1
vote
3 answers

Represent ampl model code in java or c#?

I solved a problem with ampl model software. I need to convert the code to java or c# to print out the result. How can I represent the ampl model code in java. Is there any libraries? How can I represent objective function and maximize function in…
Googler
  • 525
  • 3
  • 12
  • 30
1
vote
1 answer

Converting an application from Unity3d to Flash

I am attempting to convert my Unity3d game to flash but am experiencing trouble with comments. Because of the socket trouble, I am trying to use Json and Post, but I don't know where to start. I saw this Java server- client socket communication but…
Superpan
  • 11
  • 1
1
vote
1 answer

Delphi - XE2 code to Delphi7 needed. Using wininet to download a file

Note: I only want to use wininet, not urlmon-urldownloadtofile. Well, I have the following code which works perfectly in XE2 to download a file: procedure DownloadFile(URL: string; Path: string); const BLOCK_SIZE = 1024; var InetHandle:…
Josh Line
  • 625
  • 3
  • 13
  • 27
1
vote
1 answer

convert to powershell script

@echo off :: :: Grabbing the users input of job number to create :: SET /P JobNum="Enter Job Number: " :: :: Creating the job number folder structure :: MKDIR "\\server\jobs\%JobNum%" MKDIR "\\server\jobs\%JobNum%\DataPrep" MKDIR…
randy ford
  • 11
  • 1
1
vote
1 answer

naming convention for sql tables

Possible Duplicate: mysql naming convention What is the best naming convention for sql tables? Can we name them in both upper and lower case or camel case? Which is correct?
Aliaksei Bulhak
  • 6,078
  • 8
  • 45
  • 75
1
vote
2 answers

Convert C# function to VB, char value overflow error

I need the following function converted to VB.NET, but I'm not sure how to handle the statement res = (uint)((h * 0x21) + c); Complete function: private static uint convert(string input) { uint res = 0; foreach (int c in input) res…
Anax
  • 9,122
  • 5
  • 34
  • 68