Problem The method receives an unformatted string and it needs to put line breaks after ‘;’ or before ‘i)’ and […]
Tag: formatting
Colour message prettifier in Bash
Problem Features: messages formatted with clear borders errors sent to stderr colour handling colours can be included in other strings […]
Using a MutationObserver to reformat numbers in the user’s locale
Problem I mostly just want to make sure I’ve understood the specs correctly with this code, but here goes: var […]
Formatting MMyyyy to MMyy
Problem The following is my sample code: String month = “09”; String year = “2014”; String monthYear = “092014”; The […]
Pretty-printed tables in Haskell
Problem Purpose A clean, reusable module to generate pretty tables (much like those in SQL-clients), like so: +——–+——–+——–+ | HEADER […]
Separate numbers with commas
Problem How should I approach refactoring this code? def separate_comma(number) a = number.to_s.split(”) b = a.size/3.0 if a.size < 4 […]
Mail merge (Parsec string formatting) example
Problem My intent is to perform “mail merge” where I can write strings like “hi <<name>>” and format them according […]
How to write SQL in a industry standard style [closed]
Problem Closed. This question is off-topic. It is not currently accepting answers. Lacks concrete context: Code Review requires concrete code […]
Automatic flowchart generator
Problem I wanted to see graphically what my programme was doing so I wrote this automatic flowchart generator: class Object […]
Javascript wrap text with conditions
Problem I have to wrap my text, when it’s longer then 16 characters and when there is space ” ” […]