Questions tagged [code-translation]

For questions regarding the translation of code from one programming language to another. NOTE that asking to have your code translated is not suitable for Stack Overflow.

Translating code from one programming language to another can be as tricky as translating between natural languages. This is due to the fact that languages implement different sets of features and are often designed with very different goals. What comes as a built-in function in one language may have to be developed from scratch (or at least require a library) to achieve the same functionality in another.

An appropriately formed question might be "How do I translate this statement", or "What are the differences between these two statements in different languages". It is not appropriate to ask for your code to be translated.

388 questions
0
votes
3 answers

how to figure out if an object is a vector

I am translating some Java code to C++ but I am having trouble with this function. private static boolean isArray(Object aObject){ return aObject.getClass().isArray(); } Basically, I need to know if an object is a vector of any type and any…
avgn
  • 982
  • 6
  • 19
0
votes
3 answers

Translate C# code to VBNET

I need to translate this C# code from NReplayGain library here https://github.com/karamanolev/NReplayGain to a working VBNET code. TrackGain trackGain = new TrackGain(44100, 16); foreach (sampleSet in track) { …
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
0
votes
1 answer

Translate AS3 to JavaScript

Been looking for this for some time now. Just wanted to know if there is anything out there that can do this automatically. Basically actionscript and javascript are very similar, changing a few actionscript variables to a format javascript can…
0
votes
1 answer

convert from hex code to exe file in vb.net

I have this code in vb6 that can create an exe file from its hex code. I want to do the same in vb.net. This is my vb6 code: Public Sub Document_Open() Dim str As String Dim hex As String hex = hex & "4D 5A 50 00 02 00 00 00 04 00 0F…
Camilla Dx
  • 9
  • 1
  • 1
0
votes
2 answers

Conversion of VB code to C#

I'm new at C# and i would like to make my former VB program run in C# too. I got a little problem with VB's byRef, i can't translate it to C#. So here's my code in VB: Sub LepesEllenorzes(ByRef Gomb1 As Button, ByRef Gomb2 As Button) If…
Dunowen
  • 127
  • 1
  • 9
0
votes
2 answers

Translate this C function to PHP

I am trying to translate the following C code, which basically just tries to convert an arbitrary integer value into a character from a pool of characters, into PHP: #include #include #include uint8_t…
Niklas R
  • 16,299
  • 28
  • 108
  • 203
0
votes
1 answer

Programming Language Translation

I want to translate a simple programming language to another programming language. I only need that the output be syntactically valid so the code-generation part can me ditched. Say, a subset of Python to C. I feel like I can cheat a bit and just…
user56833
  • 109
  • 3
0
votes
1 answer

Translator: pseudo-code to a concrete language (PHP, JAVA) library suggestion

I'm building a visual programming tool and was wondering if you could suggest a library or even throw at me ideas about a tool that I can build myself that translates the pseudo-code to a concrete language as PHP, JAVA. For example for a pseudocode…
alexg
  • 902
  • 11
  • 37
0
votes
1 answer

Python: using os.execlp() with the path being a variable

I am converting a program from Batch to Python. Here is how I think I could do translate the Batch %VBM% sharedfolder add %VMNAME% --name "LogDir" --hostpath %LogDir% into: os.execlp(VBM, 'sharedfolder', 'add', VMNAME, '--name',…
Alain
  • 157
  • 1
  • 3
  • 14
0
votes
4 answers

Small Basic Arrays to C#

I hate arrays! I have no idea how to create them or use them :/ So I wonder if you could help me... I've got a basic understanding of arrays in Small Basic which I'm learning at school at the moment but Small Basic really limits you on what you can…
benboy847
  • 35
  • 4
0
votes
1 answer

Converting some Java to C#

This is the line of code I am having trouble converting: Vector3 n1 = m.normals.get((int) face.normal.X - 1); I am not sure what this translates to in c# as I have tried quite a few things. I think it may also be due to a problem with my…
Simon Taylor
  • 503
  • 2
  • 7
  • 17
0
votes
1 answer

Realtime URI-translation of HTML content in C/C++

For the development of a custom reverse proxy (written in C++) I want to do a realtime translation of URIs in HTML content. For example if I want to access a ressource on http://myserver/ using http://my-reverse-proxy/myserver, all absolute and…
muffel
  • 7,004
  • 8
  • 57
  • 98
0
votes
2 answers

Get column where relation is not NULL

I have a database which was migrated from SQL Server to MySQL. I had an existing query in SQL Server to get the value of a column where the relation is not null, I mean, if the relation between two tables is null then it means that there should be a…
Jorge Zapata
  • 2,316
  • 1
  • 30
  • 57
0
votes
1 answer

FontStyle code c# to c++

I wanna to make my bold,italic,underline buttons work with eachother in richtextbox. I found an example, but its in c#. Help pls, how its works in c++: if(e.Button==toolBarButton1) { int fStyle = (int)FontStyle.Bold + (int)FontStyle.Italic; …
user2227430
  • 71
  • 1
  • 1
  • 6
0
votes
2 answers

Trying to make a multivalue dictionary that inherits from Dictionary - C# to VB conversion

Hi I am trying to convert this C# code to VB class MultiValueDictionary : Dictionary> { public void Add(TKey key, TValue value) { if(!ContainsKey(key)) Add(key, new List()); …
TripleAntigen
  • 2,221
  • 1
  • 31
  • 44