Questions tagged [converting]

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

Filter by
Sorted by
Tagged with
2
votes
3answers
143 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
1answer
90 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
4answers
846 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 ...
6
votes
2answers
168 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
1answer
29 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
1answer
69 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
3answers
253 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 ...
2
votes
2answers
248 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
1answer
109 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 ...
1
vote
1answer
72 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 <...
9
votes
2answers
178 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 ...
0
votes
2answers
69 views

Format simple array in multidimensional

I have a simple array in PHP like this : ...
5
votes
2answers
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! <...
3
votes
1answer
58 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
1answer
27 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 ...
7
votes
1answer
151 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
0answers
50 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
2answers
621 views

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

I'm mainly looking for error checking / type safety advice. main.cpp ...
3
votes
2answers
84 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. ...
7
votes
1answer
1k 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... ...
2
votes
1answer
97 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. ...
3
votes
0answers
266 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
1answer
87 views

Implementation of itoa

...
2
votes
2answers
110 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: ...
6
votes
3answers
1k 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 ...
1
vote
0answers
64 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 ...
2
votes
0answers
30 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
2answers
104 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 ...
1
vote
0answers
137 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
6answers
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
0answers
74 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 ...
1
vote
1answer
57 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
1answer
141 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? ...
5
votes
1answer
181 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 ...
5
votes
1answer
514 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 ...
2
votes
1answer
137 views

Convert char array to number

C++17 have <charconv>. However this header does not work on MacOS - It compiles, but can not link. Same header is not present in ...
-1
votes
1answer
147 views

Naming convention when converting between types? [closed]

If I have a method where the input is a list of integers, and within that method I convert the list to a list of strings, what is the best way to name the new list? For example (using ...
5
votes
2answers
1k views

Sum of all digits in a string

Given a string, return the sum of all the numbers in the string, 0 if none are present. Below is my solution for the problem above. I feel like this can be turned into one line. I would really only ...
6
votes
1answer
132 views

Convert a Hex value string to an ASCII Text String

We had a little bit of fun in the 2nd Monitor this morning, one user greeted another with a hex string. It turned out that the user being greeted deals with Hex Dumps enough that they were able to ...
7
votes
4answers
262 views

Code that reads/writes to bytes of an ascii-encoded hex string

Problem Statement Given a hexadecimal string (hascii) and its binary specification (a list of byte field names, their offsets, and byte lengths), design classes to parse all byte-fields, cast bytes ...
3
votes
1answer
67 views

Constructing constrained/validated objects

I'm trying to do some rudimentary DDD in validating my objects to ensure they are of a particular type. I.e. an Email object would always look like "my@example.com" ...
4
votes
1answer
879 views

Converting a binary string to hexadecimal using Rust

Once again, I am reinventing the wheel here to understand the fundamentals of rust. In a previous question I requested feedback on my function that performed a hexadecimal to binary conversion. In ...
5
votes
1answer
696 views

Converting a hexadecimal string to a binary string using Rust pattern matching lookup

I am getting started in Rust, and as a part of my first exercise, I decided to write a small program that converts a hexadecimal string to a binary string using a pattern matched lookup. I would ...
9
votes
1answer
202 views

Convert to dictionary

Earlier I did post with full code about Prepare and export data to MS Word file. The user t3chb0t recommended me to separate some part of full code to this post. Context The task of code for review ...
3
votes
1answer
125 views

Convert a Binary Tree to Doubly Linked List

Challenge Link on geeksforgeeks: Binary Tree to DLL Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL) In-Place. The left and right pointers in nodes are to be used as previous ...
4
votes
2answers
122 views

Converting a set into a string

The input is a set of alphabets. The output is a string of 32 in length. For any letter in the set if it is preceded by a '¬' we replace the n-th character in our output string with '0', such that n ...
7
votes
3answers
286 views

Convert HTML color to OLE

I have this function that takes a string which represents a html-color and returns the OLE value for it. If the string is null or empty or it can't be parsed, it uses a default value. However I have ...
1
vote
1answer
296 views

Format the output of Color.ToString() to RGB values [closed]

The method that I wrote below functions properly; however, I believe that the code I wrote is not clean nor "good". I know the basics of regex but I do not know more advanced techniques as I am still ...
2
votes
1answer
119 views

Static Methods for Dealing with Conversions from and to UTC

I asked this question over at stackoverflow but was told it may be better suited here. So I absolutely want to store DateTimeOffset objects in UTC format. To ...
3
votes
2answers
85 views

Excel To CSV Converter Ch 9 ATBS

I am learning more about python using the book "Automate The Boring Stuff". The problem I completed was "Excel To CSV Converter". I want to kick bad habits to the curb, and make sure I'm learning the ...

1
2 3 4 5
7