Questions tagged [human-readable]

Human-readable is a representation of data or information that can be naturally read by humans.

Human-readable is a representation of data or information that can be naturally read by humans.

In computing, human-readable not only refers to information or data, and how this is presented, but also the medium which to produces or processes the data or information, e.g. a programming language or a database front-end application.

129 questions
277
votes
20 answers

Converting file size in bytes to human-readable string

I'm using this function to convert a file size in bytes to a human-readable file size: function getReadableFileSizeString(fileSizeInBytes) { var i = -1; var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB']; do { …
Hristo
  • 42,002
  • 60
  • 155
  • 224
61
votes
24 answers

iOS convert large numbers to smaller format

How can I convert all numbers that are more than 3 digits down to a 4 digit or less number? This is exactly what I mean: 10345 = 10.3k 10012 = 10k 123546 = 123.5k 4384324 = 4.3m Rounding is not entirely important, but an added plus. I have looked…
Kyle Begeman
  • 7,019
  • 9
  • 37
  • 57
37
votes
6 answers

Natural/Relative days in Python

I'd like a way to show natural times for dated items in Python. Similar to how Twitter will show a message from "a moment ago", "a few minutes ago", "two hours ago", "three days ago", etc. Django 1.0 has a "humanize" method in django.contrib. I'm…
jamtoday
  • 4,734
  • 5
  • 37
  • 48
30
votes
4 answers

How to use HTTP status code symbols in RSpec?

I use HTTP status code symbols in code in a controller such as: render json: { auth_token: user.authentication_token, user: user }, status: :created or render json: { errors: ["Missing parameter."] }, success: false, …
JJD
  • 44,755
  • 49
  • 183
  • 309
27
votes
9 answers

Code-Golf: Friendly Number Abbreviator

Based on this question: Is there a way to round numbers into a friendly format? THE CHALLENGE - UPDATED! (removed hundreds abbreviation from spec) The shortest code by character count that will abbreviate an integer (no decimals). Code should…
27
votes
7 answers

htop output to human readable file

I've tried piping htop to a text file (e.g. htop > text.txt) but it gives me text garbled by formatting strings (see below). Is there a way to get nicer, human readable output? ^[7^[[?47h^[[1;30r^[[m^[[4l^[[?1h^[=^[[m^[[?1000h^[[m^[[m^[[H^[[2J^[[1B…
DilithiumMatrix
  • 15,044
  • 15
  • 64
  • 102
26
votes
7 answers

Convert enums to human readable values

Does anyone know how to transform a enum value to a human readable value? For example: ThisIsValueA should be "This is Value A".
Jedi Master Spooky
  • 5,143
  • 11
  • 49
  • 85
23
votes
14 answers

Code formatting: is lining up similar lines ok?

I recently discovered that our company has a set of coding guidelines (hidden away in a document management system where no one can find it). It generally seems pretty sensible, and keeps away from the usual religious wars about where to put '{'s…
Ned
  • 1,944
  • 14
  • 24
21
votes
4 answers

Make big and small numbers human-readable

I would like to print my very small numbers in C# in a human friendly way, such as: 30µ for 3E-5 or 456.789n for 0.000000456789. I know of the Humanize_number() function from BSD in C, but only compatible with bit ints, not floats and doubles. Is…
Gui13
  • 11,951
  • 16
  • 49
  • 98
19
votes
5 answers

Convert human readable to bytes in bash

So I am trying to analyze very large log files in linux and I have seen plenty of solutions for the reverse of this, but the program that records the data doesn't allow for output formatting therefore it only outputs in human readable format (I…
Devon
  • 30,524
  • 9
  • 46
  • 78
18
votes
5 answers

I Need a Human Readable, Yet Parse-able Document Format

I'm working on one of those projects where there are a million better ways to accomplish what I need but I have no choice and I have to do it this way. Here it is: There is a web form, when the user fills it out and hits a submit a human readable…
macinjosh
  • 5,581
  • 9
  • 45
  • 69
15
votes
3 answers

Human readable alternative for UUIDs

I am working on a system that makes heavy use of pseudonyms to make privacy-critical data available to researchers. These pseudonyms should have the following properties: They should not contain any information (e.g. time of creation, relation to…
tobib
  • 1,656
  • 1
  • 17
  • 32
10
votes
2 answers

A minimalistic human-readable serialisation format parser for an embedded system

By "human-readable serialisation format" I mean YAML, JSON, INI or like. Please note, XML is too verbose and too inconvenient for my purposes, so let's leave it alone as the last resort. The format should store the data as "named key -- value" pairs…
vines
  • 4,959
  • 1
  • 24
  • 47
10
votes
8 answers

Java - Convert Human Readable Size to Bytes

I've found lots of information about converting raw byte information into a human-readable format, but I need to do the opposite, i.e. convert the String "1.6 GB" into the long value 1717990000. Is there an in-built/well-defined way to do this, or…
Dan Forbes
  • 2,354
  • 2
  • 26
  • 55
10
votes
3 answers

Finding human-readable files on unix

I'd like to find human-readable files on my linux machine without a file extension constraint. Those files should be of human sensing files like text, configuration, html, source-code etc. files. Could you suggest a way to filter and locate.
Yiğit
  • 157
  • 1
  • 1
  • 7
1
2 3
8 9