Tagged Questions
7
votes
5answers
211 views
Convert total minutes into “Hours:minute:seconds” for marathon data
The point of the script below is to read in the 10th column which is the total number of minutes a runner took to finish the marathon and convert it into form of "hours:minutes:seconds". Is there a ...
4
votes
4answers
1k views
Temperature converter that seems to violate SRP
I've written this class for two purposes (I think only this fact shows that this code violates SRP): convert weight from one unit to another and to represent them accurate or not accurate. So class ...
6
votes
1answer
106 views
Binary converter and sufficient tests
I just finished writing a basic binary conversion class in Ruby. I'm curious to see if anyone has suggestions for improvements. In particular, I'm looking for the cleanest, shortest, most succinct ...
5
votes
1answer
177 views
Converting between Fahrenheit and Celsius
I'm learning Ruby and working through some exercises. I completed the following exercise without truly understanding why and how it works. I know that's an embarrassing thing to say but I feel like my ...
4
votes
3answers
153 views
Number to words problem
This is a very long solution I've been working on to a Number to Words problem. I've identified that there's a lot of repeating logic (e.g. 'if writing > 0', 'writing = integer /',).
How would you ...
3
votes
2answers
242 views
Roman numeral converter in Ruby
For a Project Euler problem, I made a Ruby roman numeral converter:
...
14
votes
5answers
5k views
Use of a regex stored inside yaml file
I installed settingslogic and in the configuration file I put the regex for the email as follows
...