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
0 answers

libhoudini/ ARM translation on Visual Studio Emulator for Android

I have been attempting to install libhoudini onto Android 5.0 on Visual Studio Emulator for Android but I have been unable to get it to work so far. I've managed to install the ARM translation files (can be found online) on genymotion previously but…
0
votes
1 answer

Converting code from MATLAB to R

I'm trying to convert some code from MATLAB to R. I'm having particular problems converting this part of a differential equation: In MATLAB : dA.*(A*N - N.*sum(A,2)) where dA is an integer, A is a 10x10 matrix and N is a 10x1 matrix (see example…
unknown
  • 853
  • 1
  • 10
  • 23
0
votes
2 answers

Convert C# to VB,NET: Event with a delegate type that has a return type

This is the original source-code written in C# public delegate Unit UnitResolveEventHandler(object sender, ResolveEventArgs args); public event UnitResolveEventHandler UnitResolve; public static Unit GetUnitByName(string name) { …
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
0
votes
1 answer

How to bind data in Excel Sheet in C#?

The code below is to bind a dataset to an Excel file in Vb.net One core record also binds in a .csv file I need this code to be translated to C# Public Function Write2CSV(ByVal ExlDs As Data.DataSet) As String Dim strfilename As…
Manohar A
  • 27
  • 2
0
votes
0 answers

Wrong result after PHP to Python 3.5 translation

I've written an implementation of the selection- and insertion-sortingalgorithms in PHP and wanted to translate them to Python as a test to compare the runtime. As I'm relatively new to Python I'm wondering why this code doesn't work properly. It…
pguetschow
  • 5,176
  • 6
  • 32
  • 45
0
votes
2 answers

C#.net XMLSocket app

I'm trying to make a C#.net app connect to a server using the XMLSocket protocal, I can do it with the following VB.net code but i'm not sure how to do it in C# as i'm just now learning it. Public Sub connect(ByVal host As String, ByVal port As…
James T
  • 3,292
  • 8
  • 40
  • 70
0
votes
0 answers

Bug in the translation of a C file to a Cython file

I've succeeded in converting a C file in cython. But the two codes are giving me different results and I really cannot find where the bug is. The relevant C code of my script is the following: double empirical_measure(int N, double K, double d,…
fdesmond
  • 35
  • 7
0
votes
1 answer

Odoo Arabic Translation.

In Odoo 8 , To do the translation from English to Arabic. I have did the following steps but could not achieve. Settings -> Translations -> Load a Translation Created a record with Arabic Then Changed the preference to Arabic. The view will be…
0
votes
1 answer

How do I convert a PCRE to EBNF?

I'm writing a spec thingamajig and I don't know EBNF. I have the following PCRE: ^(?:\$(?:\$|{\d+})|[^$])*$ Where, in the input: $$ is an escaped $. ${num} is an argument number. Everything else (that is not a $) is a literal. A $ not followed by…
SoniEx2
  • 1,864
  • 3
  • 27
  • 40
0
votes
1 answer

'webbrowser.documentCompleted += procedure' translation from c# to vb.net

Usually when i need to convert code from c# to vb.net i use this link http://converter.telerik.com/ but looking to an old answer (WebBrowser Control in a new thread) i found this line that i don't understand, and that the converter don't…
Marcello
  • 438
  • 5
  • 21
0
votes
1 answer

rpy2, copula, How to import parameters? Python

I would like to translate: library(copula) myCop.clayton <- archmCopula(family="clayton", dim =7, param=2) myMvd <- mvdc(copula=myCop.clayton, margins=c("norm", "norm"), paramMargins = list(list(mean=0.66,sd = 0.1), …
fafnir1990
  • 185
  • 2
  • 16
0
votes
0 answers

Vogel Distribution 3D javascript

I've been trying to translate this amazing tutorial, from Python to Javascript. I have no experience with Python, but I made the 2D translation work, is the 3D I'm having trouble with. Not sure how to properly translate the numpy.linspace function…
vulu
  • 1
  • 2
0
votes
0 answers

VB.net MD5 command translation from C++

I'm trying to write a code translation of a MD5 hash from C++ to VB.net but I am struggling to find the equivalent commands in VB.net. Here is my C++ code: md5_init(&md5); md5_append(&md5, text1, 16); md5_append(&md5, text2, 18); md5_finish(&md5,…
Luker501
  • 3
  • 3
0
votes
1 answer

How to convert Matlab code to Delphi?

How to convert this part of Matlab code to Delphi? for i=1:popsize fi=rand(1,dimension); % Generate a vector of uniform random numbers p=pbest(i,:); pbest(i,:)=x(i,:); end My code: for i:= 1 to popsize do begin fi:= // which function…
shdotcom
  • 157
  • 1
  • 11
0
votes
2 answers

Translate simple code with C#6 syntax to Vb.Net

Someone could help me to translate this simple snippet that uses the new C# 6 syntax, to Vb.Net? The resulting LINQ query is incomplete (wrong syntax) when doing a translation in some online services like one from Telerik. /// /// An…
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417