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.
Questions tagged [code-conversion]
272 questions
3
votes
4 answers
Code to html converter
What is good free tool (both online, offline) to convert code (could be also html code) text snippet (already formatted) to html with code highlighting (keywords at least) and keep original formatting (as html snippet already) to make it possible to…

Mike
- 20,010
- 25
- 97
- 140
3
votes
1 answer
Convert Scss to Sass mixin
I'm looking for some documentation on Mixins specifically for .Sass
Not .Scss
but due to the naming conventions they keep coming up with the same search results.
@function calculateRem($size) {
$remSize: $size / 16px;
@return $remSize *…

Lee Barone
- 65
- 1
- 3
3
votes
8 answers
C# to C++ Translation
I am coming towards the end of a project that I created in C#. Unfortunately, the target hardware only comes with compilers for C/C++. My dad is an embedded programmer so he will be making the necessary code to integrate with the hardware, but in…

Scott S
- 187
- 2
- 11
3
votes
1 answer
What is the reason for this code conversion failure?
I'm using the telerik code converter to try to convert this VB code to C#:
'''
''' Return the name of a property, field, or local variable from a lambda expression.
'''
''' Type of the property, field, or…

rory.ap
- 34,009
- 10
- 83
- 174
3
votes
1 answer
Matlab to Python conversion of rand()
In Matlab I have the following:
duration = 20
n=5
times = rand(1,n)*duration;
The variable "times" gives a 1-by-n matrix, which is populated with random numbers between 0 and 1, then multiplied by 20. This will result in a set of 5 numbers between…

Spica
- 127
- 2
- 10
3
votes
3 answers
PEP-8 for function calls
I recently started working with Python/Django and I heard about the PEP 8 conventions. After having read PEP8 I had a better sense how to 'style' my code but I learned programming with Java and I used to just do whatever I like. Could you suggest…

yamm
- 1,523
- 1
- 15
- 25
3
votes
1 answer
Convert Python partition generator to Java
I am trying to convert the following partition generator from Python into Java and not getting the expected result:
Python:
def accelAsc(n):
a = [0 for i in range(n + 1)]
k = 1
a[0] = 0
y = n - 1
while k != 0:
x = a[k -…

Tyler Durden
- 11,156
- 9
- 64
- 126
3
votes
4 answers
How to parse *.py file with python?
I'd like to parse Python source in order to try making a basic source code converter from Python to Go.
What module should I use?
Should I proceed or not?
If I should proceed, how?

YOU
- 120,166
- 34
- 186
- 219
3
votes
2 answers
Foreach loop VB.Net to C# Code Conversion
Here's the code in VB.Net
If Not queryItems Is Nothing Then
For Each qItem As String In queryItems
qItem = qItem.ToLower()
Next
End If
and it's "equivalent" code in c# (using…

Sekhar
- 5,614
- 9
- 38
- 44
3
votes
2 answers
ext js4 to sencha touch convertor
Is there any code converter available for converting code for extjs4 to sencha-touch?
I am trying to put my efforts by reviewing docs. But I am getting stuck at many points.
Please let me know if anybody is having any idea.

Curious_k.shree
- 990
- 2
- 18
- 37
3
votes
3 answers
How to convert VBA script to Google Apps Script automatically?
VBA is the language, in which excel macros were written. Google sheets only supports Google apps script as a macro language. Is there a direct or automatic way to convert a VBA script to a Google Apps Script script without rewriting the code?
Here…

user1772434
- 39
- 1
- 2
3
votes
3 answers
Converting Matlab to VB.NET
I recently got assigned a task to convert a few algorithms written in matlab to VB.NET (or C# if VB.NET isn't efficient).
The matlab code itself consists of a lot of matrix algebra. I initially looked through here and found there was a Matlab Coder…

ajfigueroa
- 597
- 7
- 16
2
votes
2 answers
What is the equivalent of the SQL function REGEXP_EXTRACT in Azure Synapse?
I want to convert my code that I was running in Netezza (SQL) to Azure Synapse (T-SQL). I was using the built-in Netezza SQL function REGEXP_EXTRACT but this function is not built-in Azure Synapse.
Here's the code I'm trying to convert
-- Assume…

John E.
- 137
- 2
- 10
2
votes
1 answer
IntStream equivalence in Swift
I am investigating some of the components in Java and wondering what is the best practice to convert the following Java code snippet to Swift.
public void doTest(ArrayList items) {
// I know that I should check the count of items. Let's…

thus
- 1,326
- 1
- 14
- 23
2
votes
3 answers
For Loops Using Javascript
I'm trying to convert this code from Javascript to CoffeeScript:
for (var i = 0; i < names.length; i++) {
str += "Hello" + names[i] + "!
"; } But at the CoffeeScript project home page there is only a simple example of how to do for loops…
"; } But at the CoffeeScript project home page there is only a simple example of how to do for loops…

Nathan Campos
- 28,769
- 59
- 194
- 300