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
1 answer

R equivalent of Python's heapq.heapify()?

Everything is said in the title. I'm looking for the R equivalent of Python's heapq.heapify(). I could not find it, but I hope it exists somewhere. heapq is a heap queue implementation module and its member function heapify accepts as input a list…
Antoine
  • 1,649
  • 4
  • 23
  • 50
0
votes
1 answer

Objective-C Translation to Swift: Bound Macros?

I'm going through this tutorial about how to make double sliders while also learning how to translate from ObjC to Swift (I only know Swift really but I'm learning a little about ObjC), it's going pretty well but I'm stuck at this one point trying…
Nathan McKaskle
  • 2,926
  • 12
  • 55
  • 93
0
votes
2 answers

C++ LinkedList ListElement class header file trouble

I'm pretty new to C++ and because I'm very interested in learning this language I'm trying to translate my old Java projects into C++. One of them is basic LinkedList, which is supposed to store objects of class "ListElement" containing objects of…
0
votes
0 answers

quick sort in mips (eclipse)/ error: No source available for

I'm going to convert from c program to mips(by using eclipse, ubuntu) In the process, when I debug it. I met No source available for "QuickSort()" and the cursor for debugging is stopped at add $t1, $s0, $t2 And then go to break(); I tried to…
Eunbi
  • 1
0
votes
2 answers

Translating jQuery to javascript

I'm new to SO and to JS. I want to translate this code to pure JS but I'm really struggling. May someone help me please? $(document).ready(function(){ var displayFix = function(num) { if (num.length > 9) { …
Haken
  • 17
  • 3
0
votes
1 answer

j2objc Error in Translate to Objective C

there is Android Source I Need to translate to Objective C but it shows error : java -Xbootclasspath:$J2OBJC_HOME/lib/jre_emul.jar -jar $J2OBJC_HOME/lib/j2objc.jar j2objcc Invalid layout of java.lang.String at value # # A fatal error has been…
Hossein Kurd
  • 3,184
  • 3
  • 41
  • 71
0
votes
0 answers

Java Float and C float IEEE754 doesn't match

I'm reading file, written with C floats in java. myFileRead(bptr, 4, n_row, stream); for (int i=0;i
Nalmelune
  • 78
  • 2
  • 10
0
votes
3 answers

How to translate this List to Java?

I am currently getting an error requesting that certain identifiers are expected as I try to translate this C# code: public static List stopWords = new List {"ON","OF","THE","AN","A" }; current faulty Java code: public static…
Rapharel
  • 33
  • 5
0
votes
1 answer

GARCH model specification in R and Matlab

I want to do to GARCH modeling in R and for this I need do translate a Matlab code to R. I tried different packages, e.g. rugarch. However, I could not figure the right specification in R which is equivalent to the one in Matlab. The Matlab code is…
stats_guy
  • 695
  • 1
  • 9
  • 26
0
votes
1 answer

Cocos2d C++ equivalent of objective-c function CCCallBlock actionWithBlock

Does anyone knows what is the c++ equivalent of objective-C CCCallBlock actionWithBlock ? [CCCallBlock actionWithBlock:^{ ... code here .. }]
vlg789
  • 751
  • 6
  • 20
0
votes
0 answers

control commonjs syntax

I'm using babel and trying to export some functions under exports. This is how I export my function export function test (param1, param2) { ... } currently, it does something like this: exports.test = test; function test(param1, param2) { ...…
Madd0g
  • 3,841
  • 5
  • 37
  • 59
0
votes
1 answer

Is there a tool to translate matlab to PHP automatically?

Especially I want to translate this answer in matlab to PHP, is it viable?
user198729
  • 61,774
  • 108
  • 250
  • 348
0
votes
2 answers

I have a piece of server-client code, however this bit is in AS3 and I'm working in C#. Can someone help me translate it?

I've been working on converting an old server from a Flash game into something I can use as a starting point for a new server-client system, however I just hit a stopping point I can't really figure out. Can someone look at this code and possibly…
Merlin
  • 929
  • 12
  • 33
0
votes
2 answers

C++ to Java DepthFirstSearch translation

I have to translate a C++ source code into Java. Unfortunately, I've never been taught C++. Most of it is fairly easy, but I could use a bit of help. void DepthFirstSearch(HeadNode *V[MaxCities], bool *Visited, int Start) { //display each cited…
0
votes
0 answers

translation of short c# script to java equivalent

I need to convert this short script posted below from c# to java, however I'm very unfamiliar with c#. I tried some of the automatic tools suggested in this question but some of them are proprietary and others of them generated nothing useful.…
smatthewenglish
  • 2,831
  • 4
  • 36
  • 72