Questions tagged [converting]

Converting involves changing data from one data type or format to another.

Filter by
Sorted by
Tagged with
8 votes
1 answer
112 views

Convert integer to Roman numeral string

This is my 1st time developing PHP code and I am only 13 years old. I have experience in other programming languages like lua, python, and c++. This is a simple Number to Roman Numeral code I made for ...
3 votes
0 answers
57 views

Convert different address formats to German one

I would like to find out which address format is input and convert it to the German format. Examples: 5, Rue de l'exemple is luxembourgish. ...
  • 207
1 vote
0 answers
26 views

convert GPS coordinates to C-SQUARES, resolution 0.05°×0.05°

This is a simple C-Squares encoder in R. FYI, C-Squares is a geocoding algorithm that assigns GPS coordinates to a spatial grid with a chosen resolution. Its specifications is here: https://www.cmar....
0 votes
3 answers
102 views

Convert from decimal to binary and octal

I wrote a program that implements an algorithm that converts from decimal to binary and octal Please criticize my implementation. What else can I do to improve? ...
  • 199
-1 votes
1 answer
230 views

Best way to convert the string with Byte sequence to Byte Array

We had a string with byte array (hexadecimal) sequence, like: ...
  • 202
0 votes
2 answers
59 views

JSONtab library : A tool to reversibly convert between an arbitrarily deep nested object and a tabular format

Could the following code be improved in terms of clarity, performance, maintainability, best practices etc? JSONtab library A tool to reversibly convert between an arbitrarily deep nested object and a ...
1 vote
1 answer
202 views

Python IPv6 verifier, parser and converter

This is a simple Python 3 program that verifies whether a string is a valid IPv6 address or not, parses IPv6 address to its hexadecimal and decimal values, and converts an integer to IPv6 format. I am ...
3 votes
4 answers
269 views

Convert number 1-5 from its spelt-out form

I'm working with an API that for some strange reason returns star ratings as words, like FIVE,FOUR,THREE,TWO,ONE. As far as I can see, there's no way to just get ...
  • 185
3 votes
3 answers
177 views

Convert program arguments to std::wstring

Due to recent need I wrote a simple main function that has the goal to convert the C-style strings and arrays into a more STL-style. Then because I also had a need ...
2 votes
3 answers
297 views

Convert string to integer and catch errors

I have attempted [and made one] function to convert string to integer and catch errors in pure c Working method The whole working method is present in code itself The header file The str2num.h here:- <...
  • 77
4 votes
1 answer
464 views

Python 3 script to phonetically transliterate written English to Cyrillic and/or Greek

This is a Python 3 script I have written over three days that transliterates (not translating) English orthography written in Latin alphabet to the Cyrillic alphabet, the Greek alphabet or a mixed of ...
0 votes
2 answers
139 views

Python 3 integer seconds to date-time string convertor

I have written two functions that output a date-time string for any given non-negative integer. The integer is treated as representing total number of seconds in a given time period, the first ...
1 vote
1 answer
401 views

Python 3 arbitrary base converter and base36 encoder

This is a script that can convert any numerical value to any arbitrary radix representation and back, well, technically it can convert a number to any base, but because the output is a string ...
2 votes
1 answer
84 views

Is it good way to user dao when assembling dto to entity or not?

I have User entity that has relationship to other entities(Order,Profile) When I assemble entity from dto and back I need assemble order and profile entity too. User entity: ...
6 votes
1 answer
196 views

Assembler. Algorithm for incrementing a decimal number

I share an algorithm that I have written myself. It is useful for incrementing any digit of a decimal number. That way, a conversion to decimal is not necessary. Please excuse the mistakes. I am ...
  • 63
2 votes
3 answers
714 views

Python binary, decimal, hexadecimal, IPv4, octal converter

This is a Python (3) script that converts numbers among 5 data formats: binary, decimal, hexadecimal and octal, it supports 16 conversions, that is, it can convert each of the five data formats to and ...
3 votes
1 answer
408 views

PowerShell script binary-decimal-hexadecimal-ipv4 convertor

This is a fully functional PowerShell script I wrote not long ago that converts data (numerical data) among 4 data formats: binary, decimal, hexadecimal and ipv4. It supports 12 conversions, it can ...
6 votes
4 answers
1k views

Bytes to binary conversion function

I created a quick function to convert n bytes into binary for my student. She is not on that level yet, but I think it would be best for her if my demonstrative ...
  • 1,375
6 votes
2 answers
374 views

Flatten JSON to string

The code below is a Python module to flatten JSON-like structure (nested dictionaries and lists) to a single string. It also provides partial result in the form of flat list of strings. This ...
1 vote
1 answer
69 views

convert .sav SPSS files into long or flat format CSVs

I'm a long standing PHP, JS, C#(Unity) dev looking to get outside objects and lower down. I've written a quick program to read binary data from a .sav file, and output the data section into CSV's in ...
1 vote
1 answer
92 views

Binary-Decimal-Hexadecimal converter

I'm a fairly new programmer and have been learning c++ for about 8 months now. I've written a program that can take either binary, hexadecimal, and decimal inputs and convert them to the other two ...
2 votes
3 answers
260 views

ArrayDowncasters Implementation for Downcasting from System.Array to Array of Specific Type in C#

I am working with System.Array and I am trying to convert System.Array objects to array of specific type (such as ...
  • 3,596
3 votes
3 answers
1k views

PowerShell script to convert .reg files to PowerShell commands

This is a PowerShell script I wrote a while ago that converts Windows Registry files to PowerShell commands(New-Item, Remove-Item...
1 vote
1 answer
165 views

ConvertAll Methods Implementation for Jagged Arrays in C#

This is a follow-up question for ConvertAll Methods Implementation for Multidimensional Array in C# and ConvertAll Methods Implementation for Multidimensional Array in C# - follow-up. Besides the ...
  • 3,596
1 vote
1 answer
78 views

ConvertAll Methods Implementation for Multidimensional Array in C# - follow-up

This is a follow-up question for ConvertAll Methods Implementation for Multidimensional Array in C#. Thanks to aepot's answer and Olivier's answer. In order to match the usage of the build-in API <...
  • 3,596
9 votes
2 answers
326 views

ConvertAll Methods Implementation for Multidimensional Array in C#

I am trying to perform some conversions with multidimensional array in C# and I have checked the discussion ConvertAll and 2-dimensional arrays. I found that ...
  • 3,596
0 votes
2 answers
74 views

Format simple array in multidimensional

I have a simple array in PHP like this : ...
5 votes
2 answers
2k views

Represent integer as binary in C

To practice my C, I've written a small function in C to display an integer as an 8-bit binary number. Please let me know how to improve this function, and other C-style coding conventions. Thanks! <...
  • 9,652
3 votes
1 answer
77 views

Integer to Roman Numeral conversion

As a little standard exercise, I wrote an integer to roman numerals converter in F03. The result looks already neat enough, for my standards, but I wonder whether it could be made snappier without ...
2 votes
1 answer
35 views

Input any time, output timezones that are currently that time

I made a program that will take in a time and a weekday, and return which parts of the world are at times closest to the one specified. Part of the program focuses on extracting a date and country out ...
  • 962
6 votes
1 answer
844 views

C++ File Converter Program

Looking for input on how to clean up my code. I am writing a file converter that can read different but related file types (relatable like a wav and mp3 encode audio or how a jpg and tiff encode image ...
1 vote
0 answers
124 views

PowerShell - Convert English words describing numbers to their values in Arabic numeral

I am extremely new to programming, and I am a really fast learner if I am interested, I have only started using PowerShell in less than a month, to improve my programming skill, this is a script I ...
8 votes
2 answers
710 views

Binary to decimal (and back) converter in c++

I'm mainly looking for error checking / type safety advice. main.cpp ...
  • 879
3 votes
2 answers
112 views

Binary to decimal

Can I make this code somehow faster and is this readable? I'm a beginner and in later I'll make another class with Decimal to Binary conversion, but first I've to know how to do that. ...
8 votes
1 answer
2k views

JavaScript string to Unicode (Hex)

This set of questions are related to a project I've published for converting characters, or strings, to Hex based Unicode; eg... ...
  • 976
2 votes
2 answers
285 views

JavaScript -- Convert decimal to another base

The Source code is maintained on GitHub and may be cloned via the following commands. A Live demo is hosted online, thanks to GitHub Pages. ...
  • 976
3 votes
0 answers
459 views

Large Number Scales Names Generator

This JavaScript code generates the full name of the numeral scales for large numbers under the "Short Scale Numeral System" using the Conway-Guy system for forming number prefixes. Some very ...
3 votes
1 answer
128 views

Implementation of itoa

...
  • 1,375
2 votes
2 answers
178 views

Convert C to Swift

I trying to convert this C code for calculating distance from RSSI to Swift code. I try to do it by myself, but considering I'm beginner, I need help in how to do it. Here is C code: ...
  • 23
6 votes
3 answers
2k views

Conversion into hexadecimal using C++

I want to read a vector of eight bytes, convert them into hexadecimal, store them in a std::string and finally write them into a binary file. I am looking for ...
  • 63
1 vote
0 answers
74 views

Convert a TrueType font to a Game Boy tileset

I recently had a need to convert a TrueType font to a Game Boy tileset, so I wrote a program to do it. This correctly aligns the characters on an 8x8 plane and outputs in the form of RGBDS-style ...
  • 1,704
3 votes
0 answers
34 views

Decoding request object before use it in an Insert query

I want to decode a request object before use it in an insert query. Request object containes the following JSON body: ...
5 votes
2 answers
112 views

Code to support different measurement systems

I am developing an application in which the user can use different measurement systems. Currently, there is support for the metric and imperial measurement systems. To support these systems, I wrote ...
  • 417
1 vote
0 answers
195 views

Convert dict to array in Python [closed]

I have a dictionary that looks like this: Counter({(1, 9): 3, (4, 2): 2, (3, 0): 1, (5, 4): 1}) I would like to convert it to an array that would look like this: ...
11 votes
6 answers
3k views

Program that converts a number to a letter of the alphabet - follow-up

This is a follow up from my previous post: Program that converts a number to a letter of the alphabet This is meant to teach my little brother (who only knows how to make games in Geometry Dash) ...
3 votes
0 answers
119 views

Instant to-and-from Roman Numeral Conversion

Ⅰ Roman numerals are composed of digits taken from a small set of uppercase characters. Lowercase characters were first used in the Middle Ages. $$I,V,X,L,C,D,M$$ With these digits we can represent ...
  • 4,128
1 vote
1 answer
60 views

Image type convertion

So I have a piece a code that, altough it does what is expected, it doesn't seam very performant to me. I just wanted to know if there's a better way to do this or if my code is alright as it is. The ...
4 votes
1 answer
246 views

fasm convert hex byte to binary string

This fasm x64 (Linux) code seems very crude and repetitive, but it gets the job done. How could I perform this task in a more idiomatic manner? ...
  • 1,333
5 votes
1 answer
225 views

process numerical input arguments of mixed ints, floats, and "array-like" things of same length>1

I'm trying to process numerical input arguments for a function. Users can mix ints, floats, and "array-like" things of ints and float, as long as they are all length=1 or the same length>1. Now I ...
  • 401
5 votes
1 answer
726 views

Normalizing mixed format nested dictionary with delimiter separated keys

I recently worked with some pickle files which had a really strange format where the keys are sometimes delimiter separated with colons and placed in the same depth but also mixed with ordinary key ...
  • 917

1
2 3 4 5
8