277 questions
1
vote
1
answer
307
views
How to identify code convention issues in PHP like ESLint + Prettier
I'm working on a PHP project and I'm looking for a way to identify and fix code convention issues. I'm familiar with ESLint and Prettier for JavaScript, and I'm wondering if there are similar tools ...
1
vote
0
answers
76
views
Can you Fix Translated code : Python to C#
I have a Python script for detecting corners in a polygon, and I need to convert it to C# for use in Unity3D. The script utilizes algorithms such as convex hull or corner detection to identify corners ...
2
votes
1
answer
137
views
Translating decryption function from VB6 to C#
I am updating code from VB6 to C#. I have a requirement of backwards compatibility. So files encrypted in the VB6 version need to be able to be decrypted in the C# version. So far I am unable to ...
0
votes
2
answers
119
views
Using Join in python [closed]
I am converting an SQL code, that has a join function, to Python.
This is the SQL code:
INSERT INTO tropical_fruits
SELECT DISTINCT A.*
FROM fruits A LEFT OUTER JOIN tropical_fruits B
ON A.[fruit1] =...
1
vote
1
answer
144
views
Need help in finding Spark SQL code equivalent to SAS Code
I have a piece of code which I need to convert from SAS to Spark SQL. I want to know what is the equivalent function for as that in SAS
SAS Code:
DATA NEW_TABLE;
SET
SOURCE_TABLE1
SOURCE_TABLE2
;
RUN;
...
0
votes
1
answer
153
views
Trying to convert reassigning declared variables SQL code to Snowflake
I’m trying to convert the following SQL code to snowflake using the snowflake UI. The converted snowflake code will be used in a stored procedure.
DECLARE @NumofDays int
SET @NumofDays = 15
Declare @...
0
votes
1
answer
63
views
Equivalent of Swift's subtractingReportingOverflow in Kotlin?
What would be the Kotlin equivalent of detecting overflow as is done in Swift's subtractingReportingOverflow?
For instance, the following in Swift yields shiftValue of 7212078330627782743 and ...
0
votes
0
answers
24
views
convert something from Javascript to C# [duplicate]
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 - ...
0
votes
2
answers
200
views
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 ...
-2
votes
1
answer
67
views
Format(rs.Fields(1), "#,###.00000") to C#
I'm converting some VBA code from Excel macro into C# and came across with this line of code.
VBA:
Format(12356, "#,###.00000")
How to translate this to C#?
1
vote
1
answer
491
views
How to convert 'if the do' from SAS to Pyspark
I've a df like this:
Zip
City
'River'
'London'
' '
'Rome'
'River'
'Berlin'
'River'
'Madrid'
' '
'Munich'
' '
'Paris'
SAS code below which I've converted in Pyspark
if Zip = ''
then do Flud = City;...
0
votes
1
answer
137
views
Does the method name need to be grammatical? [closed]
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 ...
0
votes
1
answer
228
views
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 ...
1
vote
0
answers
228
views
From Solidity To Dart : how reproduce an Solidity Address type construction in Dart
I have not managed to convert a line of code I have in one a Smart Contract of the back end of my DAPP into the Dart syntax for the front end part of it.
SOLIDITY :
address account = address(uint160(...
0
votes
1
answer
261
views
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 ...
-4
votes
1
answer
116
views
trouble understanding list.begin() | list.end() | list<int>::iterator i [closed]
void Graph::max_path(){
for(int i=0; i <N; i++){
cost[i]=0; cam_max[i]=999;
}
// Percorre todos os vertices adjacentes do vertice
int max = 0;
list<int>::...
0
votes
1
answer
897
views
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 = "...
2
votes
2
answers
2k
views
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.
...
1
vote
1
answer
1k
views
Translating "Bodies to Parts" Macro in CATIA V5 from VBA to C#
I'm trying to convert the Bodies from Parts to Parts in a Product in CATIA. I found a VBA script that works fine, but I have to translate it to C#.
The VBA script is the following:
Sub ...
0
votes
2
answers
95
views
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 = "{\"database\":17,\"query\":{\"source-table\":963,\&...
0
votes
0
answers
837
views
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 ...
-1
votes
1
answer
214
views
after converting c# to vb.net there is an error Syntax error ,Identifier expected,etc
is there a best code solution so that there is no error in the vb.net?.
is there a possibility of an error in the conversion?
I provide a share link because I failed continuously to post the code c #.
...
1
vote
1
answer
130
views
How to convert a condition check from C# to Java?
I am attempting to convert this line of code from C# TO Java and I am having quite a hard time wrapping my head around it.
isEqual = !dbCertDict.Keys.Any(x => !String.Equals(dbCertDict[x], ...
-2
votes
1
answer
351
views
How would I rewrite PCRE regular expressions so that they're compatible with JavaScript?
As part of a security related project written in Node.js, I'm looking at some of the work done by the team behind PHPIDS, specifically their filter list, which is composed of a large amount of regular ...
0
votes
1
answer
533
views
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 ...
0
votes
0
answers
44
views
What's the alternative to TAILQ_HEAD in Delphi?
The code I'm trying to convert from C is this:
struct DebugEventQueueElement {
TAILQ_ENTRY(DebugEventQueueElement) entries;
DebugEvent de;
};
#pragma pack()
TAILQ_HEAD(debugEventQueueHead, ...
0
votes
1
answer
135
views
VB .NET to C# Error: 'As' is not a member of 'Task(Of IFlurlResponse)'
I'm converting this C# line
return await _serviceUrl.WithOAuthBearerToken(bearerToken)
.AppendPathSegment($"api/v1/accounts/{accountId}/identities/{identityId}&...
0
votes
1
answer
126
views
What does binary plus operator do to int Array in C
I am porting an obscure library form C to dart.
a property is defined on a struct like this
unsigned char payload[256];
I interpret that as an array of chars. So I converted it to
List<int> ...
1
vote
1
answer
349
views
Convert a parameteric plot from mathematica to python
I have a small parametric plot that I am trying to convert to python from Mathematica. The problem is that my python script does not match this, I am struggling to get the list plot to work as it ...
-2
votes
1
answer
154
views
VBA object to delphi declaration
I have the below VBA code from a vendor website. I managed to import the TLB libraries into a Delphi project and made references to the corresponding unit files. However, I'm struggling to convert the ...
0
votes
1
answer
420
views
Isuues after converting project from java to kotlin
Hello there after a long time thinking about converting my project from java to kotlin , today I shift from java to kotlin , and as expected and warned by the community that the project will not ...
0
votes
1
answer
307
views
Converting c++ to c# code for image color matching script
I'm trying to create a script to match the colours between two images using EmguCV.
I've managed to find code that does exactly what I want to, here, however it's written in C++ which I'm not very ...
0
votes
1
answer
338
views
How can I evaluate pre-defined symbolic variables array in Python?
I have a MATLAB code and I'm trying to convert it to Python. I used the eval() to evaluate my symbolic arrays in MATLAB. But I couldn't find how to solve this in Python. Here's a simple example:
...
0
votes
2
answers
98
views
How do i convert kotlin code into java [Android]
This is the code that I'm trying to convert into java but I don't understand it,actually I get this code as an answer but he/she gives me in kotlin
Glide.with(context)
.load(url)
...
0
votes
2
answers
557
views
URL encode data RFC-3986 in vb.net
How do I convert this code to VB?
/// <summary>
/// Returns URL encoded version of input data according to RFC-3986
/// </summary>
/// <param name="data">String to be URL-...
0
votes
2
answers
597
views
How to tranform the following TensorFlow code to PyTorch?
I was searching for loss functions for a GAN model and then this one came out:
gd_loss = tf.reduce_sum(tf.square(tf.abs(dx_real) - tf.abs(dx_fake))) + \
tf.reduce_sum(tf.square(tf.abs(...
0
votes
1
answer
358
views
Convert C# `using` and `new` to PowerShell [closed]
There are many codes in C# that use the keywords using and new. They look very simple!
How to achieve that in in PowerShell elegantly!
For example I want to change the following C# code to PowerShell
...
-1
votes
1
answer
40
views
This code outputs different values for Python 3 and Python 2, how to get same result for both?
def mod_inverse_iterative(a, b):
x, y, u, v = 0, 1, 1, 0
while a != 0:
q = b / a
r=b % a
m = x - u * q
n=y - v * q
b, a, x, y, u, v = a, r, u, v, m, n
...
0
votes
2
answers
252
views
The name 'Fix' does not exist in the current context
In my project I am converting some vb.net to c# and I came to this line:
int thisdigit = Fix(countervalue / (Math.Pow(10, (numdigits - j - 1)))) - Fix(countervalue / (Math.Pow(10, (numdigits - j)))) * ...
2
votes
1
answer
258
views
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<Double> items) {
//...
0
votes
1
answer
200
views
How to replace a Word in DF Column with another Word using Python -without including the substring
I am trying to achieve the functionality of SAS TRANWRD Function in Python to replace a 'WORD' with another 'WORD'.
I have tried using str.replace and replace method available in Python but these ...
0
votes
1
answer
128
views
After converting from C# to vb.net it shows an error
I am trying to convert C# code to Visual Basic.
This is the C# code:
public static string RequestServer1(string methodName, List<string> parameters)
{
return RequestServer(methodName, ...
0
votes
0
answers
116
views
I need help converting this C# Linq query to VB.net. I dont really understand the certain aspects
I am converting an MVC C# application to VB.
I'm running across problem converting Linq.
I've got to do a number of these, so prefer a nice explanation.
When I convert to VB I seem to get null int ...
0
votes
1
answer
282
views
What's the equivalent of MATLAB's 'dbstack' in Python 3?
I am trying to convert a code written in MATLAB to python. In it a function called 'dbstack' is heavily used. This function return the name of the calling function, its file name and the line number ...
0
votes
0
answers
139
views
how to create object type in c++ like object type in javascript
I wanna create various objects like this in c++ and use them as function parameters. Is it possible?
How can I do that ?
example = {
"name": "example_name",
"values" : [{"key": "value"},{"...
-2
votes
1
answer
38
views
Not Able To use for-loop
** I want to use two for-loops instead of two while-loops **
i = 7
while i >= 1:
j = i
while j <= 7:
print(j, end =" ")
J += 1
i -= 1
print()
2
votes
5
answers
4k
views
Problems with Converting R Code to Python
from pyensae.languages import r2python
print(r2python(rscript, pep8=True))
I have problems converting filename.R into pythonfilename.py because these libraries are not useful for converting as it ...
1
vote
2
answers
1k
views
How to use/convert sed to Python?
Any idea to convert the given line below into Python?
sed 's+forwarding_link+'$link'+g' first.html > index2.html
1
vote
2
answers
346
views
How to convert "Set functions" such as removeAll and addAll from Java to C++? Can it be done using erase or insert?
I've been trying to convert a Java code to C++ and I stumbled upon this part of a code which repeats a couple of times.
//JAVA
TreeSet<String> currentState = new TreeSet<String>();
...
0
votes
3
answers
203
views
How to convert this jQuery code to plain JavaScript?
I'm trying to get the focus method (touch, mouse or keyboard) on links setting a data-attribute.
$(function() {
var i,
r = document.getElementsByTagName("a")[0];
if ("ontouchstart" ...