Questions tagged [code-conversion]

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.

272 questions
1
vote
1 answer

How to Convert Visual Basic Str() to Java code

I was wondering if there is a better implementation for converting the following VB6 snippets in Immediate window to Java: ? Format("002-", "") -2 ? Str("002-") -2 My Java code scans through the string and if it sees a negative sign, converts the…
nmenego
  • 846
  • 3
  • 17
  • 36
0
votes
3 answers

Convert code snippet from VB.NET to C#

I have tried a number of freely available code converters to convert the following piece, however without success. Dim resultList = ((From e In p_Xml.Elements() Where UCase(e.Name.LocalName) = searchName).Union( …
Rauld
  • 980
  • 2
  • 10
  • 19
0
votes
4 answers

Converting New With from C# to VB.NET - Compilation Error

I have the following code in C#: public static ArrayList GetGenders() { return new ArrayList() { new { Value = 1, Display = "ap" }, new { Value = 2, Display = "up" } }; } It's working fine. However, when I converted it…
satish
  • 41
  • 5
0
votes
2 answers

Conversion of php block to vbnet or c#

I have this block of php that i want to convert to c# or vbnet. I am stuck on the array methods since there is no direct equal to the is array and other bits like array merge. I know that arrays behave differently in php than in c# but thats about…
Ashok Padmanabhan
  • 2,110
  • 1
  • 19
  • 36
0
votes
0 answers

convert something from Javascript to C#

Okay so I was converting something from JS into C# (chess algorithm) and after some considerable thinking I had no idea how to convert this specific line : children.sort(function(a, b){return 0.5 - Math.random()}); Sorry if this sounds stupid but I…
Marki1234
  • 11
  • 1
0
votes
2 answers

Converting aiohttp script to asyncio + requests (aiohttp not working on ubuntu while asyncio + requests works)

I am using the following script to do queries on a website. It works on macos, however it does not work with ubuntu. I have tried requests and it works, I also tried a simple asyncio + requests with the website and it works. I need help converting…
anarchy
  • 3,709
  • 2
  • 16
  • 48
0
votes
0 answers

How can I convert my Python No Console code into An Android Package (APK)

Converting python to apk file. Hello, I have got a Python programme in windows and linux, and I have just prepared it for Android System, and I want to convert my python application into a APK file. My programme has not got any user interface and my…
NMS
  • 1
0
votes
1 answer

Does the method name need to be grammatical?

I have a question that may seem silly, my english is not very good, I often don't know how to name variables or methods. For example, There is a method, its function is to open a modal for creating users, I will name it openCreateUserModal, Its…
0
votes
1 answer

Translating xtabond call from Stata to R

I am trying to replicate findings from a particular study. The study uses the xtabond command in Stata to run an Arellano-Bond estimator with lags of the dependent variables. The goal of the study is to estimate the effects of being in year X of a 4…
0
votes
1 answer

Converting C++ API Post Request into Delphi Code

I am programming in Delphi and I'm having a hard time converting a C++ API POST Request into delphi. I have tried using Indy as I have before with previous API's but this one seems to not work with whatever I try. Could someone help me with…
0
votes
1 answer

Convert NodeJS code snippet into Java code for encryption/decryption

I want to convert this below piece of code into java but I am unable to do, Basically I have to implement 'crypto' module in Java. Thanks in advance! let encKey = "0Z8ZUcy1Qh8lnt199MTwTPEe2g1E2tE3"; encKey =…
0
votes
2 answers

Convert json query to insert a variable and re-convert it to json query

I am kinda frustrated. I copied the following Metabase query string from the network tab in the browser: query =…
ALL
  • 3
  • 2
0
votes
0 answers

Convert http request for vb.net to http client

I have this request in VB.NET (NET framework) that I need to convert to C# ASP.NET Core Http Client. The code in VB.NET looks like this: Public Function PostRundown(data As String) As String Dim url = "https://url/import" Dim result As…
Pettanord
  • 81
  • 1
  • 9
0
votes
1 answer

Convert Java Code To PHP - URL Connections and Reading Response

I wrote the following Java program to connect google.com, get its HTML source code in return, print the entire source code on the screen and then count the no. of line breaks (
) in the code. It is working fine. String QUERY =…
Nibhrit
  • 188
  • 1
  • 2
  • 14
0
votes
1 answer

Installation without Root Access in Linux

I have to compile Locally Aware NMS (lanms) in my remote server LINUX based with an user account without root access. In lanms there is a script named adapter.cpp , I have to convert it to .pyd so that it works with python. I have given the code…
Akash Chakraborty
  • 57
  • 1
  • 2
  • 13