Converting involves changing data from one data type or format to another.
0
votes
0answers
6 views
Construct: bytes and bits conversion
This code is part of Construct library that converts between byte and bit representations.
...
3
votes
1answer
52 views
Map object types using custom converter
I'm trying to design a mapper that will convert one object type to another shown in the diagram below:
The object has structure as follows (it's not a JSON):
...
3
votes
1answer
157 views
Convert an image to 8-bit color
I have a function that will take an image and then return that image in 8-bit color. Almost all of the code was taken from MSDN.
The code is quite short compared to all of the other methods I've seen ...
0
votes
1answer
22 views
Generic Int conversion to scalar
I'm new to Scala and I'm trying to write a generic function to convert from Int to any scalar.
For example:
...
4
votes
0answers
34 views
Blender exporter for Unreal Engine 1 brushes
Unreal Engine 1 nowadays is slightly useless, but it still is (kinda) flexible and allows for modifications of extensive kinds, including many sorts of maps.
However, one of it's editor, Unreal ...
2
votes
2answers
42 views
Converting XML to DOT
I would like to show an XML tree as a tree using GraphViz Dot tool. Then I must convert it to a DOT file.
It is what I have tried
...
5
votes
1answer
84 views
Find a value in a comma delimited String
Here is a simple WPF converter method designed, where the object is a string, and the parameters are a string, which contain a set of comma separated values. The program return true if the list has ...
0
votes
2answers
121 views
C++ XOR Function
This XOR function is costing my program too much time (specifically the conversions.)
How can this code be made faster?
...
5
votes
2answers
75 views
Time conversion program optimization
I have just finished working on a problem on hackerrank dealing with time conversion in C++.
I'm still fairly new to programming as I only have a few semesters of programming classes under my belt ...
4
votes
4answers
785 views
Converting the DateTime to and from Unix epoch times
I'm currently working on a thing I needed this feature for. Essentially, these are two methods to convert DateTime objects to and from the Unix epoch time (two ...
3
votes
2answers
73 views
Decorator to convert a function's result into the desired units
I tried to collect some of my formulas inside classes so that I didn't need to browser the names of the functions anymore but only determine which Quantity I want to calculate and then check which ...
1
vote
1answer
69 views
Grabs 10 bytes and converts it into a hex formatted string
I'm working on some code right now where the goal is to take in a byte stream and grab the data from the body of a message. The data is 10 bytes long and is meant to be translated into hex. ...
3
votes
2answers
163 views
Python script converts after effects clipboard keyframe data to nuke keyframe data
This is my first 'proper' script since learning python and I'd love it if I could get some feedback on things I've done wrong / things I can improve on.
The script takes clipboard data from after ...
1
vote
1answer
115 views
Character-to-string converter
I created a program that will convert a 3-character combo into a 3-string combo. I used a lot of if statements to accomplish the conversion. I'm wondering if there ...
5
votes
1answer
251 views
Creating PDF files from a ODT template
The code is actually a TemplateBuilder.
We have 2 different templates, French and Dutch.
We need to change the template and then convert it to PDF so it can be stored in the DB later.
The main method ...
-6
votes
1answer
82 views
Python to Ruby: inconsistency with float ceil() [closed]
Just for fun, I am trying to convert the following Python
from math import *
print map(lambda count: ceil( 6 * cos((count + i) * pi / 5) ), range(100))
Which ...
2
votes
1answer
38 views
Handler for bidirectional unit conversion form
Building a form where values can be entered in either pounds or kilos.
Script is...
...
11
votes
6answers
845 views
Converting strings to PascalCase
I have a method which I use on occasion to convert strings (like enum and property names) to PascalCase for display.
It's ...
2
votes
2answers
462 views
Parsing from one enum to another
I face a problem I think I am not approaching appropiately.
I have two independent enumerators that both will contain the same members, the only difference being the values given.
I have to be able ...
6
votes
4answers
2k views
12 hours to 24 hours conversion function
I have made a time format converter which converts 12 hour format to 24 hour format. My convert_to_24() takes a string in format of ...
0
votes
2answers
2k views
Currency converter in Python [closed]
I am looking for some ways to make my code simpler for this currency converter.
...
3
votes
2answers
2k views
Converting a 12 hour time string to a 24 hour time string
Input - Standard input - HH:MM:SS[AM|PM] format.
Examples:
12:00:00AM
12:00:00PM
01:00:10AM
01:00:10PM
The program reads one line per instance.
Output - military format (24 hour format):
00:00:...
10
votes
3answers
424 views
Binary Converting Code
I made a program that converts a decimal number given from the user, and converts it to a binary number. For example, if I entered 2, it would return 10. It then, counts the amount of ones and zeros ...
3
votes
2answers
59 views
Convert hex encoded string to byte array
The following should read a hex string such as "ece998a2fb" into vector 236 233 152 162 251. I was unable to find any built in ...
5
votes
1answer
488 views
Converting IP Addresses to minimal binary formats
Once more, I come to you for assistance! I have written a significant bit of code that converts IP Addresses from strings to minimal byte-arrays. (So that you can store them in a binary format instead ...
2
votes
1answer
350 views
Convert string to integer or default
I need my string-to-int converter to handle all exceptions without throwing any errors. I also have a use case where I need the default value to be less than zero if the ...
1
vote
1answer
68 views
Celsius and Fahrenheit Converter
I'm very new to programming in C and I attempted to make a program that converts temperatures to and from Fahrenheit and Celsius. I have been running the program and I have realized that not all ...
1
vote
1answer
69 views
Filter to convert duration to hours — in controller or model?
I have this before_action method :
...
3
votes
2answers
674 views
Java Temperature Converter GUI
Today is my first time working with GUI, so I'm really interested in the best ways of handling various events to get the best habits from the jump. Most of the GUI-related code for this project was ...
4
votes
2answers
270 views
Basic distance conversion program
This is a simple program to convert miles, yards, feet, and inches appropriately. Everything intended for works but I feel my program is very redundant. How can I make it more efficient and less lines ...
4
votes
1answer
259 views
Hex to Double converter
I stumbled on this SO question which was asking about a way to convert larger hex values to a positive numeric value:
...
12
votes
1answer
3k views
Roman Numerals in Java
I wrote a class that can convert to and fro from Roman Numerals and Decimals. I would appreciate critical points on everything, especially:
Shortening my code.
Choosing a better approach.
Using ...
7
votes
5answers
1k views
Creating a numeric phone keypad
I'm writing a Telephone class and it has a method called getDigits which takes in a String parameter and returns the number that would appear on your phone if you ...
7
votes
1answer
757 views
Replacement string Base64 (and a Base32) conversion [closed]
This provides (my own) implementation of ToBase64String and FromBase64String (since the .NET implementations suck), and a ...
6
votes
5answers
459 views
Using functions to separate code for Fahrenheit to celsius conversion
I'm relatively new to programming, and I've been wondering about a problem such as this. How can I think about decomposing the code into its constituent functions? I went the simplest route I could, ...
6
votes
2answers
133 views
Number converter between bases
I just wrote a utility program in C that converts numbers of different bases to 'standard' well-known bases (hex, dec, oct, bin). I called it repnum, short for "...
9
votes
3answers
197 views
HTML to Markdown converter
I've made a simple HTML→Markdown converter in Javascript and am looking for any feedback. For now, I've basically used Stack Exchange's /editing-help as a guide as ...
4
votes
1answer
319 views
GUID to hex-string and back
I'm new to Python and I'm trying to convert between Microsoft GUIDs and plain hex strings:
...
3
votes
3answers
2k views
Unit Converter in Python
I am new to programming and I am trying to make a simple unit converter in python. I want to convert units within the metric system and metric to imperial and vice-versa. I have started with this code ...
3
votes
1answer
52 views
Map strings to (const) ints
I'm imagining go generate would be a good tool for this. I want to convert strings to ints to save space.
...
1
vote
1answer
2k views
Powershell to Convert HTML Table to Array of PSCustomObject
I created the below script to sent a request to a website, then convert the table in the results to an array of PSObjects which I can work with in PowerShell. This uses some nasty hacks (e.g. using a ...
3
votes
2answers
2k views
Currency converter using MVC pattern in C++ & QT
While understanding the MVC pattern, I came across this particular article. I thought to implement it using the C++/QT library.
The intent over here is to implement/use MVC concepts in correct way. ...
3
votes
2answers
853 views
Converting numbers to English words
This is a simple program to convert a number, from 0 up to 99999999, to English words.
Example:
If the input is:
1234
The output would be:
one thousand ...
12
votes
2answers
2k views
Convert Persian digits to English numbers
I use the following code to convert ۱۲۳۴۵ to 12345, effectively transliterating the persian numbers into latin numbers:
...
3
votes
2answers
168 views
Integer to English Conversion
I wrote some code to translate numbers ( for now just positive, up to the 32bit limit ) into English words.
Everything works and I'm happy. I searched through the site looking for a comparison code ...
6
votes
4answers
238 views
Converting from decimal to word
I'm still investigating the problem with decimal to word conversion. I understood the basics, but now my goal is to learn how to add in base-26 (the English alphabet) or base-52 (...
0
votes
3answers
77 views
Low-latency implementation of converting non null terminated char* to unsigned int
How would you rewrite this code which I have now:
...
12
votes
2answers
771 views
Returning result and error status for number type conversions
Looking for review of design strategy of using a struct to return the functional result and error status. Your experience of how my design approach may succeeded ...
4
votes
2answers
411 views
Recognizing number representation (and convert to decimal) from the base prefixes
Here is what appears to be a fairly easy problem:
Write a program that prompts the user to enter several integers in any
combination of octal, ...
4
votes
2answers
3k views
Converting CSV files to Excel workbooks
My converter converts all CSV files in the subfolders of folders 1, 2 & 3 into Excel workbooks. As of now, I am converting using codes for each folders. I previously tried to combine those into ...