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

c++ public function syntax error

I am attempting to convert a c# to c++ with reflector. The code compiled, disassembled and reconstructed code is generating this error: 1>c:\users\user\documents\visual studio 2008\projects\reflect_readoo\reflect_readoo\readoo.cpp(2) : error…
Nona Urbiz
  • 4,873
  • 16
  • 57
  • 84
0
votes
1 answer

Instruction detection at run-time

I would like to identify and analyze different machine instruction executed and required clock cycle for each of them, throughout running of a code. Is there any way to do this simply? Dynamic binary translation might be a way but i am looking for…
0
votes
5 answers

Translate code from Java to C#

I'm useing a method in Java, but I want it in C# too. It is used for tell if a matrix of int is transitive or not. static boolean isTransitive(boolean[][] matrix) { for (int i = 0; i < matrix.length; i++) { for (int j = 0; j <…
Knaks
  • 209
  • 3
  • 11
-1
votes
3 answers

How do you run equivalent of nested for loops in scheme

I am looking on how to translate this pseudocode to idiomatic scheme: for c in range(1, 1000): for b in range(1, c): for a in range(1, b): do something if condition is true
alwalo
  • 11
  • 3
-1
votes
1 answer

Equivalent of C# BeginInvoke((Action)) in VB.NET

I need to convert the following C# code to VB.NET: if (this.InvokeRequired) { this.BeginInvoke((Action)(() => { imageMutex.WaitOne(); pbCamera.Image = (Bitmap)imageCamera.Clone(); imageMutex.ReleaseMutex(); …
tmighty
  • 10,734
  • 21
  • 104
  • 218
-1
votes
1 answer

Converting this python line to C++?

diff = list(set(map(tuple, paths1)) - set(map(tuple, paths2))) Where paths1 and paths2 are list of list of pairs. Example: paths1 = [[(1,2),(2,3),(3,4)],[(1,3),(3,5)]] paths2 = [[(5,2),(2,3),(3,4)],[(1,3),(3,5)]] print(list(set(map(tuple, paths1))…
vxs8122
  • 834
  • 2
  • 10
  • 22
-1
votes
2 answers

C# Using With Equivalent in VB.NET

var baseAddress = new Uri("http://www.aaa.com"); var cookieContainer = new CookieContainer(); using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer }) using (var client = new HttpClient(handler){ BaseAddress =…
Pisagor
  • 147
  • 1
  • 2
  • 16
-1
votes
1 answer

Adding file as header in source-source transformation using clang

#include int main(void) { workFunc(); return 0; } I have a sample code as above, but the function being called in 'main' is in another header file 'header.h'. So after the transformation, the code must look like #include…
Jacaro
  • 321
  • 1
  • 3
  • 13
-1
votes
1 answer

Pseudo Code to Java translation error

I have a question about an error when translating the pseudo code below into Java. There is no problem with the loss of accuracy because of truncation but a programming language issue that I can't seem to find. I though the answer would be that the…
-1
votes
3 answers

Translate this C# comparison to VB.NET

I'm trying to translate a comparison between two Nullable(Of Byte) objects: public byte?[] header { get; private set; } public override bool Equals(object other) { // ... more code to translate if (this.header !=…
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
-1
votes
1 answer

Show connection status using visual basic 2010

I try to create visual basic 2010 program that detect which connection is connected and its ip address. For example if i connect with wireless and cable, it will show both media connected and its ip address. This code i take from WMI code…
-1
votes
2 answers

How to Convert This C# Event/Delegate Code Into VB.NET (2008 or 2010)

C# to VB.NET Here is the relevant C# Code namespace MyApp { public delegate bool AllocHandlerDelegate(int param1); public interface ILoader { event AllocHandlerDelegate evAlloc; bool Load(); } public class MyLoader : ILoader …
-1
votes
3 answers

Understanding a C function for C# translation

I am side-checking some code that was translated from C to C#. I have a question on the original C: ... #define getblock(p, i) (p[i]) ... void MurmurHash3_x86_32 ( const void * key, int len, uint32_t seed, void * out ) { …
IamIC
  • 17,747
  • 20
  • 91
  • 154
-2
votes
1 answer

Converting Visual Basic 6 source code into Java

I have a task to do code-translation of some parts of the application that is written in VB6 into Java. Now, I have two problems, first is that I have never done such a thing, so I'm inexperienced, and second - I never used VB6 before. I spent some…
JustQuest
  • 249
  • 4
  • 15
-2
votes
1 answer

what is the Maple translation for this Matlab code?

uu = polyval(polyfit(x,u,N),xx); % interpolate grid data The code above is written in Matlab. How to write this statement in Maple?
user1846458
  • 29
  • 1
  • 5