A generic term meaning the process by which text transformed into a more meaningful or clearer output. A typical example would be the transformation of a decimal into a particular currency format with the correct number of decimal places.

learn more… | top users | synonyms

0
votes
0answers
23 views

Files in directory change detection script [on hold]

Got an internship invite as a Junior Python Developer and have a task to: Write a python script that detects changes in given type of files (*.php or *.js) in that path and reports it in a form ...
2
votes
0answers
19 views

Automatic flowchart generator

I wanted to see graphically what my programme was doing so I wrote this automatic flowchart generator: ...
2
votes
1answer
43 views

Kernighan & Ritchie - detabbing program

Task (1.20) Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Also, the condition is is not to use pointers and structs ...
1
vote
3answers
50 views

Print input one word per line

I'm doing K&R C Exercises. I could use a code review to see how I can improve my logic. The excercise is: Write a program that prints its input one word per line with ...
2
votes
0answers
25 views

Song search app with dynamic tables

I decided to make a Ruby app to search for songs, it uses the tinysong API. Things got really cryptic and weird in the view, I managed to get dynamic tables that adjust to data length, but I feel like ...
4
votes
2answers
61 views

K&R C section 1-20 - removing tabs

1-20 of K&R Exercise 1-20 Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every ...
0
votes
0answers
37 views

Rendering JSON array as a tree

This code is working fine for me, but I want to simplify it. Function parents is defining parents of the tree and children ...
2
votes
2answers
71 views

DFS Undirected Graph Code

The code included below was written in response to a programming exercise that was sent to me by a company that I am applying to. The purpose of the code is explained at the following link: ...
1
vote
1answer
53 views
2
votes
1answer
27 views

Printing simple histogram horizontally

I am new to programming and want to know if this is really bad code. I know my variable names may seem arbitrary but I spent some time trying to get them right. I am struggling on that. Would you do ...
7
votes
2answers
135 views

ASCII-fication of playing cards

I am making a small Blackjack game in Python 3. The part of the code I am unsure about is that which allows me to print nice ASCII versions of the card. ...
2
votes
2answers
121 views

Pascal's triangle in PHP

Are there any optimization suggestions? ...
2
votes
1answer
39 views

Date-filtering function

Please check if this date filtering function is inefficient code. It seems so to me, but I can't figure out the other way around it. ...
11
votes
4answers
1k views

To understand what recursion is, you must first understand recursion

This is the second assignment for my CS2 course: Write a recursive C++ function writeLine() that writes a character repeatedly to form a line of n ...
2
votes
2answers
85 views

Printing a triangle of stars

I've got a rather long function that will take the size of a triangle print it with stars and give the user the option of whether or not they want stars printed inside the triangle, and the ...
5
votes
2answers
139 views

Program to print a triangle of numbers

I want to print the following triangle: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 I tried to do but I cannot avoid two ...
2
votes
1answer
128 views

Producing a pyramid of capital letters

Now I'm reading C Premier Plus by Stephen Prata and there's an exercise 4 in chapter 6 which has no solution in the book, so I can't check if I did it properly. My code works like it should, but I ...
3
votes
4answers
91 views

Formatting MMyyyy to MMyy

The following is my sample code: String month = "09"; String year = "2014"; String monthYear = "092014"; The monthYear format is MMyyyy, I wish to format it to ...
2
votes
1answer
73 views

Formatting a date range, with shortening if the interval falls entirely within a calendar month

The graphic guy wants to display dates like 16. February 17. - 24. February, or ...
2
votes
2answers
266 views

PrettyPrint a Binary Tree (Follow Up)

I have improved the Pretty Printing of binary tree that I implemented previously. In this follow up I have made changes such that every tree is printed (not just a Complete binary tree). Here is my ...
5
votes
3answers
280 views

PrettyPrint a Binary Tree

I was going through this tutorial for Pretty Printing a binary search tree and decided to implement my own version. Here is my implementation. This version works only for trees that are complete ...
1
vote
1answer
107 views

Transposing rows and columns for file contents [closed]

This program transposes rows and columns for file contents: ...
4
votes
1answer
58 views

Sentence formatting

I wrote this function to format a given sentence via Java, and I'm wondering if there is a better way of doing this without use of external libraries, such as with regex. ...
4
votes
1answer
199 views

Convert number into hours : minutes

I wrote a simple extension to convert a number into a hours and minutes string in the ##:## format. This seems like a good way to do it, but let me know what you think. ...
2
votes
1answer
81 views

Text formatting with embedded markup for terminal output

I'm learning Rust. I wrote the following library to format text and output it to terminal, so that the formatting markup is embedded with the string itself (looks similar to HTML4). I feel the code ...
8
votes
1answer
82 views

Create a Christmas Tree

This function draws a Christmas tree (with an angel on top) with text (AKA, ASCII art). ...
4
votes
3answers
821 views

Rounding and formatting hours, minutes, seconds as HH:MM AM/PM

I have a program which is supposed to convert standard time to traditional time. (e.g: 15:24:31 = 3:25PM [rounded seconds]) I would like for someone to error check my code for me as well as give me ...
1
vote
2answers
86 views

Formatting a list of strings as a comma-separated string

I'm learning Haskell on my own and I'm following the material of a course. I would like to know if this is idiomatic Haskell. ...
4
votes
3answers
207 views

Script to generate templated PHP code

I've created a script to create a module in our MVC framework The structure of the module is like this (for this example, the module is called test ...
3
votes
2answers
54 views

Flexible presentation of a user's name based on a combination of available properties

The goal is to add a new displayValue property to each object depending on what it has available out of Firstname, ...
2
votes
2answers
83 views

Function to validate date format

I have this JavaScript function which checks if the format has 'yyyy' and replaces 'yy' with 'y': ...
7
votes
5answers
561 views

Python odd number diamond

I worked up a quick diamond program that takes only odd numbers while returning an error with even numbers or 0. The code looks rather ugly to me, especially with the recurring ...
10
votes
3answers
582 views

Beginnings of a base-conversion game in Python

I'm pretty very new to python, so I thought that I'd write a game to teach me python and better teach me how to think in hexadecimal and binary. I'm starting off by writing a few functions to convert ...
3
votes
3answers
353 views

Padding a hexadecimal string with zeros

I'm given a hexadecimal number in string form with a leading "0x" that may contain 1-8 digits, but I need to pad the number with zeros so that it always has 8 ...
3
votes
1answer
172 views

Convert between two bases, each between 2 and 36

I'm doing some Python practice for fun and I wrote some code that converts between two bases. I'm thinking about expanding on this later, so the docstrings are pretty redundant from function to ...
2
votes
1answer
45 views

Print dict with varying-length lists

Is there a shorter way of taking a dict with varying length lists and printing it to screen? Shortcomings of this method also include that values which aren't lists are printed as letters separated by ...
15
votes
2answers
1k views

Retro Rocket ASCII Art

Inspired by Nested for-loop ASCII art, I looked at building a more complicated ASCII art than just the normal 'diamond' and 'triangle' variations that crop up occasionally here. The challenge: ...
7
votes
3answers
107 views

Calendar Print Method

I'm currently learning Ruby and need help in editing code to be more idiomatic. I have the method below I could use some pointers on how to make more "Ruby" :-) ...
8
votes
4answers
924 views

Align Strings for Output

I wrote a class which can format input so that it is properly aligned. I'm interested in all suggestions (regarding structure, usability, style, naming, comments, etc). I'm especially wondering ...
7
votes
3answers
270 views

Validating lines in a file using certain specifications

I have written a program which basically reads a file named "data.txt" line-by-line. As a line is read, it validates the line with a certain specification. If the specification is met, it will ...
0
votes
1answer
172 views

Round division to two decimal places [closed]

I'm working on a revision of my electrical calculator. I used string formatting to round the answers it gives to two decimal places. On the operations that require multiplication (voltage, wattage), ...
3
votes
1answer
50 views

Format a number to include commas

This is my attempt to format a number and put commas where appropriate. I was wondering if this could be done in a simpler way. It's used by calling ...
3
votes
3answers
370 views

Parsing and formatting a time two ways (perfectionistic approach)

I'm still not satisfied by the readability of the code. The wanted behavior which would be self descriptive would sound like: "I've two fields; one is for the date and one for the hour. This two ...
2
votes
2answers
222 views

“Nice Angles” - Code Eval challenge

Out of fun, I solved "Nice Angles" challenge on CodeEval in C# 4.0: CHALLENGE DESCRIPTION: Write a program that outputs the value of angle, reducing its fractional part to minutes and ...
2
votes
0answers
33 views

sprintf for a microcontroller [closed]

I'm currently writing some code to running using a small micro controller, and need to implement a version of sprintf (the standard library version is too large). I ...
7
votes
2answers
182 views

writeln() and format() with variadic templates

I wanted to get better acquainted with variadic templates, so I decide to try to implement a function like D's writeln(), just for fun. ...
7
votes
1answer
304 views

Fully-working alternative to String.format(…)

PLEASE NOTE: The code below has "commented out" code; however, no code is actually commented out!! Check my GitHub link below. I did that solely to highlight the relevant code sections. Code in my ...
3
votes
1answer
88 views

Implementation of *nix ipcalc

I posted a JS subnetting calc before, but I wanted to try a CLI version, so I made this. The parts I'm most worried about are: structure (could I refactor the layout better?) Did I goof any math? ...
3
votes
1answer
126 views

How to better indent multiline strings with many string formatting args?

I have a function, that is used in flask, for logging application errors: ...
4
votes
3answers
145 views

Validate parameters within a range

Function to use several blocks of if:elif:else: that all take slightly different conditional statements. I'm trying to format integers into a 2 digit string, ...