Converting involves changing data from one data type or format to another.
2
votes
2answers
37 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
77 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
105 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
67 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
312 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
71 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
65 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
124 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
110 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
161 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
79 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
34 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
817 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
329 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
991 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
1k 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
409 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
54 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
411 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
261 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
64 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
68 views
Filter to convert duration to hours — in controller or model?
I have this before_action method :
...
3
votes
2answers
491 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
178 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
247 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
2k 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
578 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
422 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
129 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
190 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
269 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
1k 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
49 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
1k 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
1k 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
693 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
155 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
233 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
76 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
698 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
315 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
2k 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 ...
3
votes
1answer
328 views
Converting a CSV file to a social network graph for Pajek
The code will ask for a directory and will then read the CSV file and then generate a file in that directory describing a social network for Pajek.
Does anyone know a way to load this CSV file to a ...
4
votes
1answer
62 views
Brainf**k to Ruby interpreter — v3
Previous iteration.
I think this is about as good as it's gonna get, but just for kicks, let's do one more round of iterations.
As before, it's a very simple substitution from Brainfuck to Ruby, ...
8
votes
1answer
128 views
Brainf**k to Ruby converter — v2
Previous iteration.
You know, I think this is the fastest I've ever pushed out an update to anything. This is Version 2 of my Brainf**k to Ruby converter, and the generated code looks... Well, like ...
6
votes
2answers
412 views
Brainf**k to Ruby converter, written in Ruby — v1.0
I've seen a lot of Brainf**k interpreters in various languages. I decided that actually interpreting Brainf**k is too hard, so instead of that, I wrote a 'compiler' in Ruby that directly transcribes ...
5
votes
3answers
240 views
K&R 4-12 recursive converter int to string
The exercise is:
Adapt the ideas of printd to write a recursive version of itoa; that
is, convert an integer into a string by calling a recursive routine.
I wonder if I have correctly ...