text:
Format the given number of bytes to a human readable format
Challenge and origin
On Stack Overflow a popular question is: How to convert byte size into human readable format in java? The most up voted answer has a quite nice method for doing this, but this is codegolf and we can do better, can't we?

Your challenge is to write a method or program that coverts the given
  number of bytes to the correct human readable format and prints the
  result to the standard out of your language.*

*See the rules for more clarification!
Input
The input will always be a positive number of bytes with a maximum of (2^31)-1.
Output
You may choose if you prefer the International System of Units or the binary notation as output (the SI notation probably saves you some bytes).
SI:      B, kB,  MB,  GB
Binary:  B, KiB, MiB, GiB

Note: Higher units than GB or GiB are not posible due to the restricted input range.
Example output
International System of Units:
Input       Output
0           0.0     B
999         999.0   B
1000        1.0     kB
1023        1.0     kB
1024        1.0     kB
1601        1.6     kB
160581      160.6   kB
4066888     4.1     MB
634000000   634.0   MB
2147483647  2.1     GB

Binary:
Input       Output
0           0.0     B
999         999.0   B
1000        1000.0  B
1023        1023.0  B
1024        1.0     KiB
1601        1.6     KiB
160581      156.8   KiB
4066888     3.9     MiB
634000000   604.6   MiB
2147483647  2.0     GiB

Rules

Build-in functions for byte formatting are not allowed!
The output should always be in the same notation standard, you may not mix SI or binary;
The output should always be in the largest unit possible where the
resulting number is still higher or equal to one;
The output should always have one decimal number, but you may choose
to print an integer number when the resulting output is in bytes (B);
You may choose if you would like to add a space, tab or nothing between the number and the unit;
Input is received via STDIN or function parameters;
Output is printed to the console or returned as string (or similar character container);
This is code golf, so the shortest answer wins. Have fun!

Edit: Even more clarification
Some numbers have interesting rounding behaviors like the number 999950. Most code implementations would return 1000.0 kB instead of 1.0 MB. Why? Because 999950/1000 evaluates to 999.950 which is effectively rounded to 1000.0 when using String.format in Java (in most other languages too). Hench some extra checks are needed to handle cases like this.
For this challenge both styles, 1000.0 kB and 1.0 MB are accepted, although the last style is preferred.
Pseudo code / java test code:

public static String bytesToSI(long bytes){
      if (bytes < 1000){
          return bytes + ".0 B";
      }
      //Without this rounding check:
      //999950    would be 1000.0 kB instead of 1.0 MB
      //999950000 would be 1000.0 MB instead of 1.0 GB
      int p = (int) Math.ceil(Math.log(bytes) / Math.log(1000));
      if(bytes/Math.pow(1000, p) < 0.99995){
          p--;
      }
      //Format
      return String.format("%.1f %sB", bytes/Math.pow(1000, p), "kMGTPE".charAt(p-1));
}

Technically, SI kilobytes should use kB (note the lowercase k)

Good point, fixed!

Is there rounding up to convert the example 1601 to 1.6 KiB? Does this mean that 1997 should round up to 2.0 KiB?

You may choose if you would like to add a space or tab between the number and the unit Does this include the option of leaving no gap between the number and the unit, or must there be at least one of space or tab?

Yes it includes the option of leaving no gap ;)

1997 bytes should be 2.0 KiB: round(1997/1024, 1)

Does spacing have to be consistent? For example, can you have 999.0 B (with space) and 1000.0kB (without space)?

I don't want to limit to much, so I would say the spacing may be inconsistent. But with this rule: The difference in space and tab characters for different valid inputs may not exceed 10. (To keep it all a bit "human readable")

What's the expected output for 999999 and 1000000? 160581 exhibits rounding, so should it be 1000.0kB and 1.0MB?

Rule 2 The output should always be in the largest unit possible where the resulting number is still higher or equal to one is against example 2

@Sp3000 That's a good question, the nicest solution would be for 999999 to display 1.0 MB. But for this challenge I would say 1000.0 KB and similar rounding cases are fine too.

TI-BASIC, 44
Would be the right tool for the job if TI-BASIC had halfway decent string manipulation (I had to resort to overwriting the exponent of the number, displayed in engineering notation, with the unit). As it is it rounds and outputs correctly, but it's not even close to winning entries. Maybe a different calculator language could win this one?
Fix 1
Eng
ClrHome
Disp Ans
Output(1,15,sub(" kMG",1+iPart(log(Ans+.5)/3),1)+"B

Input in the form [number]:[program name] on the homescreen.
Given test cases:
Input       Output (leading spaces intentional; screen clear before each output)
0                      0.0 B
999                  999.0 B
1000                   1.0kB
1023                   1.0kB
1024                   1.0kB
1601                   1.6kB
160581               160.6kB
4066888                4.1MB
634000000            634.0MB
2147483647             2.1GB

I had absolutely no idea that TI-BASIC was so versatile haha

TI-BASIC isn't versatile, but there are often strange workarounds for a few of its shortcomings.

CJam, 35 27 bytes
ri{_e-3_i}g;1mOo]," kMG"='B

Thanks Dennis for removing 8 bytes.
This doesn't print .0 in the online interpreter. But as Dennis has pointed out, it works fine in the Java interpreter.
Explanation
ri         e# Read the input as an integer.
{          e# Do:
    _e-3   e#   Make a copy and divide by 1000.
           e#   This will generate one more item in the stack for each iteration.
    _i     e#   Make a copy and truncate to integer.
}g         e# until the integer part is 0.
;          e# Discard the final value with integer part 0.
1mOo       e# Output the number before it with the correct format.
],         e# Count the number of iterations - 1.
" kMG"=    e# Select a character according to the number of iterations.
'B         e# Output B.

ri{_e-3XmO_i}g;o]," kMG"='B (27 bytes)

@Dennis Thanks for the 1mO. But this code doesn't work for 1149999...

ri{_e-3_i}g;1mOo]," kMG"='B should.

Scratch that, that has other bugs.

999999 becomes 1000kB. Reading the question again, I'm not sure if 1000kB would actually be wrong.

@Dennis That probably need some clarification... My original code works like that too.

Pyth, 29 27 bytes
p@" kMG"Js.lQK^T3.RcQ^KJ1\B

Demonstration. Test Harness.
Explanation:
p@" kMG"Js.lQK^T3.RcQ^KJ1\B
                                 Implicit: Q = eval(input())
p                                print, in the order 2nd arg then 1st arg:
             K^T3                K = 10^3 = 1000
          .lQK                   log of Q base K
         s                       Floored
        J                        Store to J
 @" kMG"J                        The Jth character of ' kMG'
                     ^KJ         K^J
                   cQ            Q/K^J (Floating point division)
                 .R     1        Round to 1 decimal place.
                         \B      Print a trailing 'B'.

CJam, 28
r_dA@,(3/:X3*#/1mO" kMG"X='B

Try it online
Note: it doesn't show ".0" with the online interpreter, but does so with the official java interpreter.
Explanation:
r_          read and duplicate
dA          convert to double and push 10
@           bring the initial string to the top
,(          get the length and decrement
3/          divide by 3 (for thousands)
:X3*        store in X and multiply by 3 again
#           raise 10 to that power
/           divide the original number by it
1mO         round to 1 decimal
" kMG"X=    convert X from 0/1/2/3 to space/k/M/G
'B          add a 'B'

What is the backtick for?

@Dennis showing .0 in the online interpreter

It works fine in the Java interpreter without the backtick, so I don't think you need it.

Python 2 - 76 bytes
Uses the Internation System of Units, simply because it's easier to do in your head ;)
n=input();m=0;f=1e3
while n>=f:n/=f;m+=2
print"%.1f%s"%(n,'B kBMBGB'[m:m+2])

it seems not ok for me, it doesn't respect the asked formatting, for exemple if I submit "2147483647" I obtain "2.000000GB" - The question asks for one decimal, and maybe a space.

Also, this is 79 bytes according to this. This is 75 bytes. I don't believe it was specified that there needs to be a space between the number and the unit.

you can save one byte with f=1e3

@mbomb007 Actually it saved 2 bytes because 1e3 is a float

I knew it was a float. I guess I just can't count...

Haskell, 119
I sadly couln't find a shorter way in Haskell to ensure 1 decimal place in floats, but I'm posting for posterity.
import Text.Printf
a#n|p>=1=(a+1)#p|1<2=(a,n)where p=n/1000
m n=let(a,b)=0#n in printf"%.1f"b++["B","kB","MB","GB"]!!a

Usage:
> m 160581
"160.6kB"

Moderately less golfed version:
import Text.Printf

countThousands :: Int -> Float -> (Int, Float)
countThousands count num
 |nextNum >= 1 = countThousands (count+1) nextNum
 |otherwise    = (count,num)
 where nextNum = num/1000

printHuman :: Float -> String
printHuman n = let (a,b) = countThousands 0 n in
  (printf "%.1f" b) ++ (["B","kB","MB","GB"]!!a)

Ruby, 84
def f(n)
n2=Math.log10(n).to_i/3
return '%.3f'% (n/1e3**n2)+['','k','M','G'][n2]
end
p f(9012345678.0)=='9.012G'

Python, 94
import math
def f(n):
 n2=int(math.log10(n)/3)
 return '%.3f'%(n/1e3**n2)+('','k','M','G')[n2]
print(f(9012345678)=='9.012G')

JavaScript, 104
function f(n){
let n2=Math.trunc(Math.log10(n)/3);
return (n/1e3**n2).toFixed(3)+['','k','M','G'][n2];
}
console.log(f(9012345678)=='9.012G');

PHP, 105
<?php
function f($n){
$n2=(int)(log10($n)/3);
return sprintf('%.3f',$n/1e3**$n2).['','k','M','G'][$n2];
}
var_dump(f(9012345678)=='9.012G');

Dart, 146
import 'dart:math';
String f(double n){
var n2=(log(n)/ln10/3).toInt();
var n3=n/pow(1e3,n2);
return n3.toStringAsFixed(3)+['','k','M','G'][n2];
}
void main(){
print(f(9012345678)=='9.012G');
}

It's generally recommended to post different languages as separate answers.

@Razetime ok I split it in half - but 10 answers seems like a lot

Cool! Do keep in mind next time.

Java, 106 bytes
This one's a method that takes a number and returns a string.
String f(int n){int k=0;for(;n>1e3;k++)n/=1e3;return(int)(10*n)/10.0+new String[]{"","k","M","G"}[k]+"B";}

You are allowed to program a function returning a string instead of a complete program, it may save you some bytes ;)

Three things: If you're converting a to a double anyway (I don't know if it's necessary), you can use 1e3 for 1000; you can convert that while() to a for() and use the free semicolons; and I don't know if this works because it seems to display all the decimal digits, not just one past the decimal place.

@ThomasKwa: Last I checked, the question didn't seem to explicitly specify that. But I guess it does now.

POWERSHELL,190
$x=Read-Host
function f($a,$b){"$x`t"+[math]::Round($x/$a,1).ToString("F1")+"`t$b"}
if(1KB-gt$x){f 1 "B"}elseif(1MB-gt$x){f 1KB KiB}
elseif(1GB-gt$x){f 1MB MiB}elseif(1TB-gt$x){f 1GB GiB}

usage
PS C:\> .\makehum.ps1
1601
1601    1.6     KiB
PS C:\> .\makehum.ps1
4066888
4066888 3.9     MiB
PS C:\> .\makehum.ps1
160581
160581  156.8   KiB
PS C:\> .\makehum.ps1
634000000
634000000       604.6   MiB
PS C:\> .\makehum.ps1
2147483647
2147483647      2.0     GiB
PS C:\>

C, 77 75
f(float l){char*u=" kMG";while((l/=1e3)>=1)++u;printf("%.1f%cB",l*1e3,*u);}

This uses SI units and takes the 1000.0kB option for rounding.
Expanded code:
f(float l)
{
    char *u = " kMG";
    while ((l/=1000) >= 1)
        ++u;
    printf("%.1f%cB", l*1000, *u);
}

Output
9 => 9.0 B
9999 => 10.0kB
1023 => 1.0kB
1024 => 1.0kB
999990 => 1000.0kB
1048575 => 1.0MB
1048576 => 1.0MB
2147483647 => 2.1GB

Variants
To get binary units, change 1000 to 1024, and add i to the format string if there's a multiplier.  To avoid 4-digit rounding, compare >=.95 instead of >=1.  To accept larger units, extend the u string.  Combining all these options, we get:
f(float l)
{
    char*u=" kMGTPEZY";
    while((l/=1024)>=.95)++u;
    printf(*u-' '?"%.1f%ciB":"%.0fB",l*1024,*u);
}

Variant output
9 => 9B
9999 => 9.8kiB
1023 => 1.0kiB
1024 => 1.0kiB
999990 => 1.0MiB
1048575 => 1.0MiB
1048576 => 1.0MiB
2147483647 => 2.0GiB
1000000000 => 953.7MiB
1000000000000 => 931.3GiB
1000000000000000 => 909.5TiB
1000000000000000000 => 888.2PiB
1000000000000000000000 => 867.4EiB
1000000000000000000000000 => 847.0ZiB
999999999999999999999999999 => 827.2YiB
1176043059457204080886151645 => 972.8YiB

Test program
Pass any number of inputs as command-line arguments:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
    while (*++argv) {
        printf("%s => ", *argv);
        f(strtod(*argv, 0));
        puts("");
    }
    return 0;
}

Nice one ;) Well executed!

Rust, 124
fn f(n:f64)->String{
let n2=n.log(1e3);
let n3=n/1e3f64.powi(n2 as i32);
format!("{:.3}",n3)+["","k","M","G"][n2 as usize]
}
fn main(){
println!("{}",f(9012345678e0)=="9.012G");
}

Nim, 139
import math,strformat
proc f(n:float):string=
 let n2=int log10(n)/3
 let n3=n/pow(1e3,float n2)
 return fmt"{n3:.3f}"&["","k","M","G"][n2]
echo f(9012345678e0)=="9.012G"

Go, 145
package m
import(."fmt"
."math")
func f(g float64)string{h:=int(Log10(g))/3
i:=g/Pow10(h*3)
return Sprintf("%.3f",i)+[]string{"","k","M","G"}[h]}

D, 156
import std.format,std.math,std.stdio;
string f(real n){
auto n2=cast(int)log10(n)/3;
auto n3=n/pow(1e3,n2);
return format("%.3f",n3)~["","k","M","G"][n2];
}
void main(){
writeln(f(9012345678)=="9.012G");
}

C#, 168
using System;
class P{
static string f(double n){
var n2=(int)Math.Log10(n)/3;
var n3=n/Math.Pow(1e3,n2);
return String.Format("{0:f3}",n3)+new[]{"","k","M","G"}[n2];
}
static void Main(){
Console.WriteLine(f(9012345678)=="9.012G");
}
}

JavaScript (ES6), 71
Using SI units - A function returning the requested string.
f=(a,b=3)=>+(r=eval('a/1e'+b*3).toFixed(1))[0]?r+' kMG'[b]+'B':f(a,b-1)

This shorter one follows the rules, particularly 3 and 4

The output should always be in the largest unit possible where the resulting number is still higher or equal to one then 995 => 1.0kB
The output should always have one decimal number, but you may choose to print an integer number when the resulting output is in bytes (B) I choose not, so 10 => 10.0 B

Alas, this way, the results do not match the examples.
To match the examples, here is a longer one, special cased for small numbers (82 bytes)
f=(a,b=3)=>a<1e3?a+'B':+(r=eval('a/1e'+b--*3).toFixed(1))[0]?r+'kMG'[b]+'B':f(a,b)

Run the snippet to test (being EcmaScript 6, Firefox only)

f=(a,b=3)=>+(r=eval('a/1e'+b*3).toFixed(1))[0]?r+' kMG'[b]+'B':f(a,b-1)
Value <input id=I><button onclick="O.innerHTML+=f(+I.value)+'\n'">-></button>

Ruby, 91 bytes
n=gets.to_i;i=0;while n>1023;n/=1024.0;i+=1;end;puts "#{n.round 1} #{%w[B KiB MiB GiB][i]}"

I could probably do a bit better if I tried harder but here's what I've got so far.

Use 1024. instead of 1024.0.

Python, 61 bytes
f=lambda n,i=0:"%.1f%cB"%(n," kMG"[i])*(n<1e3)or f(n/1e3,i+1)

Call like f(999). Note that 1e3 is a float, so this works with both Python 2 and Python 3.

PHP4.1, 63 62 bytes
Not the best golfing, but surely is quite short.
<?for($S=kMG;$B>1e3;$I++)$B/=1e3;printf("%.1f{$S[$I-1]}B",$B);

To use it, access over POST/GET or set a value in the SESSION, on the key B.
Leave the key I unset!

@downvoter: care to explain why you downvoted this, 5 years later? Almost 5 and a half ...

SpecBAS - 100 bytes
Using the ISU convention.
I realised that having a variable set to 1e3 (which needs a LET statement to assign it), and then using that variable in the working out, actually used more characters than just hardcoding the 1e3 where it was needed.
1 INPUT n: LET i=1
2 DO WHILE n>1e3: LET n=n/1e3: INC i: LOOP
3 PRINT USING$("&.*0#",n);" kMG"(i);"B"

Python 2, 127 bytes
Using the ISU. The snippet declares a function 'C' that takes the number to be converted as argument.
C=lambda v:min(['%.1f %sB'%(x,u)for x,u in[(v/1000.0**i,'bkMG'[i])for i in range(4)]if x>=1]).replace('.0 b',' ')if v else'0 B'

Some test code:
    print 'Input\tOutput'
for v in [0,999,1000,1023,1023,1601,160581,4066888,634000000,2147483647]:
 print v,C(v)

You can use 1e3 instead of 1000.0

Javascript ES5, 69 bytes
This uses a different way to reach the end goal that @edc65's answer.
Actually, this is pretty close to my PHP answer.

for(i=+prompt(z=0);i>1e3;z++)i/=1e3;alert(i.toFixed(1)+' kMG'[z]+'B')

Simply run the stack snippet or paste this on your console.

Ruby, 128 bytes
c=->i{p i.to_s+'B'if i<1e3;p (i/1e3).to_s+'kB'if i>=1e3&&i<1e6;p (i/1e6).to_s+'MB'if i>=1e6&&i<1e9;p (i/1e9).to_s+'GB'if i>=1e9}

I did it the long way, this is pretty bad.
Output
c[0] # => "0B"
c[999] # => "999B"
c[1000] # => "1.0kB"
c[1023] # => "1.023kB"
c[1024] # => "1.024kB"
c[1601] # => "1.601kB"
c[160581] # => "160.581kB"
c[4066888] # => "4.066888MB"
c[634000000] # => "634.0MB"
c[2147483647] # => "2.147483647GB"

Edit
Added TB for an extra 39 bytes
c=->i{p i.to_s+'B'if i<1e3;p (i/1e3).to_s+'kB'if i>=1e3&&i<1e6;p (i/1e6).to_s+'MB'if i>=1e6&&i<1e9;p (i/1e9).to_s+'GB'if i>=1e9&&i<1e12;p (i/1e12).to_s+'TB'if i>=1e12}

Output:
c[1000000000000] # => "1.0TB"

Sed -r, 218+1
I'm using SI units; I think that choosing binary units would be a courageous policy. ;-)
s/(.)((...)+)$/\1z\2/;h;s/[^z]*z?//;s/.../k/g;s/kk/M/;s/Mk/G/;x;s/(z.)[5-9].*/\1c/;s/(z.c?).*/\1/;:;s/9c/c0/;s/zc/cz/;t;s/(^|0)c/1/;s/1c/2/;s/2c/3/;s/3c/4/;s/4c/5/;s/5c/6/;s/6c/7/;s/7c/8/;s/8c/9/;G;s/\n//;s/$/B/;y/z/./

Reformatted:
#!/bin/sed -rf

# Place decimal point (use z as shorthand for \.)
s/(.)((...)+)$/\1z\2/
h

# count thousands into hold space
s/[^z]*z?//
s/.../k/g
s/kk/M/;s/Mk/G/
x

# truncate to 1 decimal place
s/(z.)[5-9].*/\1c/
s/(z.c?).*/\1/

# propagate carry
:
s/9c/c0/
s/zc/cz/
t
s/(^|0)c/1/
s/1c/2/
s/2c/3/
s/3c/4/
s/4c/5/
s/5c/6/
s/6c/7/
s/7c/8/
s/8c/9/

# Append units
G;s/\n//
s/$/B/
y/z/./

Output
1 => 1B
9 => 9B
99 => 99B
999 => 999B
1000 => 1.0kB
9999 => 10.0kB
99949 => 99.9kB
99950 => 100.0kB
99999 => 100.0kB
999999 => 1000.0kB
9999999 => 10.0MB
9999999999 => 10.0GB
1000 => 1.0kB
10000 => 10.0kB
10005 => 10.0kB
10440 => 10.4kB
10450 => 10.5kB
10950 => 11.0kB

Variations
The rules seem to imply round-to-nearest, but for human display, I believe rounding down is an acceptable alternative, and saves 123 bytes (better than 50%):
s/(.)((...)+)$/\1.\2/;h;s/[^\.]*\.?//;s/.../k/g;s/kk/M/;s/Mk/G/;x;s/(\..).*/\1/;G;s/\n//;s/$/B/

The natural extension to larger units (still rounding down, 130+1 bytes):
s/(.)((...)+)$/\1.\2/;h;s/[^\.]*\.?//;s/.../k/g;s/kk/M/g;s/Mk/G/;s/MM/T/g;s/TT/Y/;s/TM/E/;s/TG/Z/;x;s/(\..).*/\1/;G;s/\n//;s/$/B/

Variation output:
1 => 1B
9 => 9B
99 => 99B
999 => 999B
1000 => 1.0kB
9999 => 9.9kB
99949 => 99.9kB
99950 => 99.9kB
99999 => 99.9kB
999999 => 999.9kB
9999999 => 9.9MB
9999999999 => 9.9GB
1000 => 1.0kB
10000 => 10.0kB
10005 => 10.0kB
10440 => 10.4kB
10450 => 10.4kB
10950 => 10.9kB
1000000000 => 1.0GB
1000000000000 => 1.0TB
1000000000000000 => 1.0MGB
1000000000000000000 => 1.0EB
1000000000000000000000 => 1.0ZB
1000000000000000000000000 => 1.0YB
999999999999999999999999999 => 999.9YB

Great job! I like that you thought about all the different options!

Ruby, 90 bytes
proc{|n|q=((1..3).find{|i|n<(1<<i*10)}||4)-1;[n*10/(1<<q*10)/10.0,%w[B kB MB GB][q]].join}

brainfuck, 396 376 bytes
,[<[->>+<<]>>+>,]<<[>[<<+>>-]<<<]<-------<---<--<-[>+>-->+>>>>>>+<<<<<<<<<-------]>>>>>>>+++>>++++<<<<<--[>>>+<<<++++++]+>-[-[-[-[-[-[-[-[-[-[-<->]<[>>.>.>.[<<]>.>>>-]>]<[->>.>>.>>.<<<.>>>>>.<<<.<<<<<]>]<[->>.>>.<.>>>.<.<<<<<]>]<[->>.>.>.>.[<]<]>]<[>>.>>.>>.<<<.>>>>>.[<<]>>.>>-]>]<[>>.>>.<.>>>.[<<]>>.>>-]>]<[->>.>.>.<<<<<<.>>]>]<[->>[.>>]<<[<<]]>]<[->>.>>.<<<<]>]<[->>.<<]<.

Try it online!


text:
Print Input Sideways
Your program must take an alpha/numeric input string and print it sideways (rotated 90 degrees clockwise). So for example, HI, would become:
#####
  #
#####

#####

Rules:
The shortest code wins. For the sake of objectivity this will be the standard font. The input still only has to be alpha-numeric. Capitalization does not matter.

Why the down vote? I think this is an ok question, just a bit broad.

I think the key problem here is "legible", which leans on the subjective side. It'd be better to provide an alphabet so we know what each letter should look like, but even then it'd only be a straight-out compression challenge.

That makes sense. I went and found a font to eliminate the vagueness.

The font does not have lowercase letters. You should either link to a font that does, or modify your sample output for "Hi".

Based on earlier experience, future questions may be: are functions accepted or needs to be a standalone program; can command line parameters be used instead of stdin; can the result returned instead of sent to stdout; number of empty lines between characters/words; is padding accepted/required; are other characters beside “#”, space and newline allowed. Is really irritating after you struggle to golf a solution strictly matching the specification to see someone else forcing the rules and the question owner just nodding that is acceptable too.

This contest would be a lot more enjoyable if the question already contained the 36 characters we have to support. It would also eliminate a few ambiguities, like, e.g., the required width of and padding between two characters.

Welcome to PPCG. Further to @Dennis's comment: 1. the H in your example does not comply with the linked font; 2. while I see nothing wrong with a variable width font, the fact that the spacing between letters is variable in the linked graphic is confusing and ambiguous. Can we assume that the spacing must always be exactly 1 blank cell after the printed area of the character?

Is input guaranteed to be ASCII or is å an acceptable input we need to account for?

Only worry about A-Z and 0-9.

C 550 503
#define L putchar('\n');
c,b,i,j,m[]={0xe9d72e,0x10fd25,0x9ace29,0x556b5,0x4fd184,0x16ad6bd,0x156ae,0xc5e10,0x556aa,0x756a8,0,0,0,0,0,0,0,0xfa51e0,0xaad7e0,0x118c5c0,0xe8c7e0,0x15ad7e0,0x14a53e0,0x16ac5c0,0x1f213e0,0xf8000,0x1e08440,0x11513e0,0x1087e0,0x1f4111f,0x1f223e0,0xe8c62e,0x8a53e0,0xd9462e,0x5d29f,0x12ad6a9,0x1087e10,0xf043e,0x18304d8,0x1c1f07c,0xd909b,0xf14bd,0xcd6b3};main(){for(;;){c=getchar();c=c<48?11:c>90?c-80:c-48;b=0;for(i=0;i<5;i++){for(j=0;j<5;j++)putchar(m[c]&(1<<b++)?35:32);L}L}}

(Incorporated BrainSteel's tips and optimized a bit more)
Here's the non-obfuscated code:
#include <stdio.h>

int map[]
={
    // 0 - 9
    0xe9d72e, 0x10fd25, 0x9ace29, 0x556b5, 0x4fd184, 0x16ad6bd, 0x156ae,     0xc5e10, 0x556aa, 0x756a8,
    // Other stuff
    0,0,0,0,0,0,0,
    // A - Z
    0xfa51e0, 0xaad7e0, 0x118c5c0, 0xe8c7e0, 0x15ad7e0, 0x14a53e0, 0x16ac5c0, 0x1f213e0, 0xf8000, 0x1e08440, 0x11513e0, 0x1087e0, 0x1f4111f, 0x1f223e0, 0xe8c62e, 0x8a53e0, 0xd9462e, 0x5d29f, 0x12ad6a9, 0x1087e10, 0xf043e, 0x18304d8, 0x1c1f07c, 0xd909b, 0xf14bd, 0xcd6b3
};

int main()
{
    for(;;)
    {
        int c = getchar();
        c = c < '0' ? 11 : c > 'Z' ? c - ('0' + 'a' - 'A') : c - '0';
        int bit = 0;
        for(int i=0; i<5; i++)
        {
            for(int j=0; j<5; j++)
                putchar(map[c] & (1 << bit++) ? '#' : ' ');
            putchar('\n');
        }
        putchar('\n');
    }
}

I've encoded the characters the following way: I wrote a C "script" that takes a 5x5 area of characters from STDIN, changes "space" to 0 and anything else to 1, rotates the whole area by 90 degrees and finally puts every cell of the area in one bit of a 32-bit integer (the hex numbers in 'map').
That's how the "script" looks like:
#include <stdio.h>

int main()
{
    int array[5][5];
    for(int i=0; i<5; i++)
    {
        for(int j=0; j<5; j++)
            array[j][i] = (getchar() != ' ');
        getchar();
    }
    int res = 0;
    int bit = 0;
    for(int j=0; j<5; j++)
    {
        for(int i=0; i<5; i++)
            res = res | (array[j][4-i] << bit++);
    }
    printf("0x%x\n", res);
    return 0;
}

I am pretty sure there are FAR smaller programs possible (for example in Perl or Ruby), but this is the best I can come up with right know.

Many compilers will allow you to skip the #include <stdio.h> entirely. You can also shorten int m[]={...};int main(){int c,b,i,j;...} to c,b,i,j,m[]={...};main(){...}, since the keyword int is the default if another type isn't specified.

Welcome to PPCG! Excellent first effort, +1. You could do with more compression of your font data by converting it to a string, which is a fairly standard practice round here. Check my answer for an example.

putchar('\n') --> puts("") , b=0;for(i=0;i<5;i++) --> for(i=b=0;i<5;i++)

Mathematica 120 119
This should work.
g@t_:=GraphicsGrid[Transpose@Reverse@ImageData@Binarize@Rasterize@Style[t,{12,FontFamily->"Pixelette"}] /.{1 ->" ",0-> "#"}]

The function g takes the input text, converts to Pixelette font, rasterizes it, flips it (Reverse and Transpose), examines the array of 1s and 0s, and outputs the ASCII text (as text, not as an image or graphic).
GraphicsArray conveniently displays the ASCII output in a table.
I used "HELLO" as the input because each letter in "HI" is horizontally and vertically symmetric, hence HI is a bad choice to use for testing.
g["HELLO"]

Interesting, but excluding the font data puts you at a big advantage. My program is 155 code + 180 font data.

Your concern was correct with regard to my earlier version.  Now Pixelette font is automatically called just as any font might be called.

Python 2, 376 364 361 315
This is my first attempt at code golf.
The font is encoded as a single large integer in which each character takes up 25 bits - 5 columns of 5 pixels each. It reads its input from stdin as a Python string (including the quotes).
Updated three times to reduce size. The third update incorporates changes suggested by Sp3000.
for c in input().upper():
 c=ord(c)-48
 if c>9:c-=7
 s,l='',int('17vhur2t4cze6tuj2ja3e1i8luj1b1frxdf9pg8dxjw7ian4517nliqqn8tdogkck15rn5n6vz3l5zf1u10cv5trc4n49xtznzx7egrjllrn8e1nlgyjp3z481ffsqmiw3pj3a538wnhwydpp85o9j85kzqxfl3qop50sokgcvwfn2',36)>>25*c
 for i in range(25):
  s+=' #'[l&1];l/=2
  if i%5>3:print s;s=''

I think you can also remove line 3 by turning the end of line 4 into 25*(c-7*(c>9)), which gets rid of a few lines of indenting

C,335
Score excludes whitespace, which is unnecessary and only included for clarity.
In the absence of further info from the OP, I have assumed exactly one blank space is required between characters. If padding is required, backtick (ASCII 96) can be used (not sure how that character will display here.)
After converting to uppercase with c-c/91*32, I search the big string for the required character, and set a pointer to the character after it. This makes it easy to handle the variable width font. It also avoids the need to unite the ASCII ranges for letters and numbers.
The font data is contained, column by column, in the big string. As only 5 bits are required, only ASCII codes 95 and over are used. The next code below 90 signals the end of the character.
The program tends to segfault on characters outside the alphanumeric range.
char*p,s[99],c,i,j,k;
main(){
  for(scanf("%s",&s);c=s[i];i++){
    p=strchr("A~ee~B_uujCnqqqD_qqnE_uuF_eeGnqu}H_dd_I_JhppoK_djqL_ppM_bdb_N_bd_OnqqnP_eebQnqivR_emrSruuiTaa_aaUoppoVclplcWgxgxgX{dd{YwttoZyuus0nyusn1r_p2ryur3quuj4ljk_5wuum6nuuh7aa}c8juuj9buun",c-c/91*32)+1;
    for(;*p>90;p++)for(k=5;k--;k||puts(""))putchar(*p>>k&1?35:32);
    puts("");
  }
}

Remove the & from scanf. You shouldn't use it when scanning a %s. Or use the dangerous gets in place of scanf.

It is amazing that you managed to do it in 335 bytes. I am still trying to understand how you did it. It would be even better if it can print out string including white spaces. This program might actually have some real world applications.

@someuser if you want to support the space character all you need to do is add a space followed by n backticks (ASCII 96)to the big string (where n is the width of the space character desired.) With the suggestion from CoolGuy I could save 8 bytes, and there's a further 1 byte to be saved by putting p=strchr() inside the following for loop bracket, so the program could actually be shorter.

Java 8 - 404
First time posting here. This program takes a single argument on the command line. Java 8 is required (Java 7 can be used at a cost of 3 additional characters).
class A{public static void main(String[]a){a[0].chars().forEach(c->{String o="";c-=c>57?c>90?87:55:48;for(char d:">AA>09O1009CE90AEE:06:BO0MEEF0>EE20@@GH0:EE:08EE>0?DD?0OEE:0>AAA0OAA>0OEE00ODD00>AEG0O44O0O0000211N0O4:A0O1100O848OO84O0>AA>0ODD80>AB=0ODF909EEB0@@O@@N11N0H616HL3L3LK44K0M55N0CEEI0".substring(c*=5, c+5).toCharArray()){for(d-=48;d>0;d/=2)o+=d%2==1?'#':32;o+="\n";}System.out.println(o);});}}

Unobfuscated version:
class A {
    public static void main(String[] a) {
        a[0].chars().forEach(
                c -> {
                    String o = "";
                    c -= c > 57 ? c > 90 ? 87 : 55 : 48;
                    for (char d: (">AA>09O1009CE90AEE:06:BO0MEEF0>EE20@@GH0:EE:08EE>0?DD?0"
                            + "OEE:0>AAA0OAA>0OEE00ODD00>AEG0O44O0O0000211N0O4:A0O1100O848O"
                            + "O84O0>AA>0ODD80>AB=0ODF909EEB0@@O@@N11N0H616HL3L3LK44K0M55N0"
                            + "CEEI0").substring(c *= 5, c + 5).toCharArray())
                    {
                        for (d -= 48; d > 0; d /= 2)
                            o += d % 2 == 1 ? ' ' : 32;
                        o += "\n";
                    }
                    System.out.println(o);
                }
        );
    }
}

Each row of pixels is encoded in the 5 least significant bits of a byte in the long string, and ASCII '0' is added to make the string contain only printable characters. The code simply translates each character in the input string to an index into the string, iterating through the 5 bytes representing the respective character, and decoding them using the reverse process. There are more compact encodings, but they would be more complex to decode and would probably inflate the code size too much to be worthwhile.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Refined Partitions
Consider an array of integers:
[1, 0, 9, 1, 3, 8]

There are a lot of ways to partition this list into consecutive sublists. Here are three:
A: [[1, 0, 9], [1, 3, 8]]
B: [[1], [0, 9], [1, 3], [8]]
C: [[1, 0], [9, 1], [3, 8]]

We will call a partition Y and refinement of another partition X if X can be obtained from Y by joining some of its sublists back together.
So B is a refinement of A: if we join the first two and the last two sublists back together, we obtain A. But C is not a refinement of A: we'd have to split up the 9 and the 1 in order to recover A from it. Also, any partition is trivially a refinement of itself.
Note that we're not allowed to rearrange any sublists or elements at any point.
The Challenge
Given two partitions (lists of lists of integers) X and Y, determine whether Y is a refinement of X.
You may assume that the partitions will only contain integers from 0 to 9, inclusive. You must not assume that X and Y are partitions of the same list (if they aren't, they also are not refinements of each other). X and/or Y may be empty but will never contain empty sublists.
You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.
Input may be taken in any convenient string or list format. Since the elements will only be single-digit integers, you may choose to omit a delimiter within the sublists, but make sure that leading 0s are possible. You may choose to take X and Y in opposite order.
Output should be truthy if Y is a refinement of X and falsy otherwise.
Your code must be able to solve each of the test cases below in 1 second on a reasonable desktop machine. (This is merely a sanity check to avoid simple brute force solutions.)
This is code golf, so the shortest answer (in bytes) wins.
Test Cases
Each test case is on its own line, written as X Y. I'm using GolfScript/CJam-style array notation to save some horizontal space:
Truthy:
[] []
[[0]] [[0]]
[[1 0 9 1 3 8]] [[1 0 9] [1 3 8]]
[[1 0 9 1 3 8]] [[1 0 9 1 3] [8]]
[[1 0 9 1 3 8]] [[1] [0] [9] [1] [3] [8]]
[[1 0 9] [1 3 8]] [[1 0 9] [1 3 8]]
[[1 0 9] [1 3 8]] [[1] [0 9] [1 3] [8]]
[[9 8 8 5 8 2 7] [5] [1 4] [2 0 0 6 0 8 4 2 6 4 2 3 7 8 7 3 9 5 7 9 8 2 9 5] [3 9 8] [7 1 4 9 7 4 5 9] [3 3 3] [9 0 7 8] [3 9 4 7 2 7 8 0 3 0] [8 2 2 7 3 9 3 2] [2 9 0 8 5 4 1 8 5 5 6 2 0 9 2 7 7 9 2 7] [3 6] [1 2 7 7 4 4 2 9]] [[9 8] [8] [5 8 2] [7] [5] [1 4] [2] [0 0 6] [0] [8 4 2] [6 4] [2] [3] [7 8] [7 3] [9] [5 7 9] [8 2] [9 5] [3] [9 8] [7 1 4] [9 7] [4 5 9] [3 3] [3] [9 0] [7 8] [3] [9] [4] [7 2] [7 8] [0] [3 0] [8 2] [2] [7 3] [9 3] [2] [2] [9] [0] [8 5 4] [1 8] [5 5] [6] [2 0] [9] [2] [7 7 9] [2 7] [3 6] [1 2] [7 7] [4 4 2] [9]]

Falsy:
[[0]] []
[[0]] [[1]]
[[1 0 9]] [[1 0 9] [1 3 8]]
[[1 0 9] [1 3 8]] [[1 0 9 1 3 8]]
[[1 0 9] [1 3 8]] [[1 0 9]]
[[1 0 9] [1 3 8]] [[1 0] [9]]
[[1 0 9] [1 3 8]] [[1 0] [9 1] [3 8]]
[[1] [0 9] [1 3] [8]] [[1 0 9] [1 3 8]]
[[9 8 8 5 8 2 7] [5] [1 4] [2 0 0 6 0 8 4 2 6 4 2 3 7 8 7 3 9 5 7 9 8 2 9 5] [3 9 8] [7 1 4 9 7 4 5 9] [3 3 3] [9 0 7 8] [3 9 4 7 2 7 8 0 3 0] [8 2 2 7 3 9 3 2] [2 9 0 8 5 4 1 8 5 5 6 2 0 9 2 7 7 9 2 7] [3 6] [1 2 7 7 4 4 2 9]] [[9 8] [8] [5 8 2] [7] [5 1] [4] [2] [0 0 6] [0] [8 4 2] [6 4] [2] [3] [7 8] [7 3] [9] [5 7 9] [8 2] [9 5] [3] [9 8] [7 1 4] [9 7] [4 5 9] [3 3] [3] [9 0] [7 8] [3] [9] [4] [7 2] [7 8] [0] [3 0] [8 2] [2] [7 3] [9 3] [2] [2] [9] [0] [8 5 4] [1 8] [5 5] [6] [2 0] [9] [2] [7 7 9] [2 7] [3 6] [1 2] [7 7] [4 4 2] [9]]

Leaderboards
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

Related Challenges

Compute the Join and Meet of Partitions

Would [[[1 0 9] [1 3 8]] [[1] [0 9] [1 3] [8]]] or [["109" "138"] ["1" "09" "13" "8"]] be an acceptable input format?

@Dennis Wrapping the entire input in an array seems odd. I'm not aware of that being standard practice but it might be worth a meta question. Without those outer brackets it's definitely fine.

I'll try to write up a meta question.

CJam, 13 10 9 bytes
lr.-F-U-!

Try it online in the CJam interpreter.
Thanks to @MartinBüttner for suggesting @edc65's ingenious input format.
Thanks to @jimmy23013 for improving the input format and golfing off 3 additonal bytes.
I/O
Input
Sublists are separated by ; and from each other by ,:
1;0;9,1;3;8
1,0;9,1;3,8

Output
1

How it works
lr e# Read line and a whitespace-separated token from STDIN.
.- e# Vectorized difference. Pushes the differences of corresponding code points.
F- e# Remove all occurrences of 15 (';' - ',') from the array.
U- e# Remove all occurrences of 0 from the array.
!  e# Push 1 if the resulting array is empty and 0 if not.

For strings of different length, .- will leave characters in the array, which cannot be equal to the integers 0 or 15.

If you can use ; as the separator... ll.m27m0-!.

@jimmy23013: I don't see why not. , and ; are both common array syntax (and none of them is used by CJam). Thanks!

Pyth, 19 bytes
&gF_m{.u+NYdYQqFsMQ

Try it online: Demonstration or Test harness
I'm using Pyth's tuple/list format as input. Simply replace the spaces of the test cases with commas.
Explanation:
                     implicit: Q is the evaluated input
    m        Q       map each input list d to:
      .u   dY          reduce with intermediate states over d, initial value = []
        +NY              update initial value N with sum of N and Y (current element of d)
     {                 generate a set
   _                 invert
 gF                  check, if the first element is >= (superset) than the second
&                    and
                sMQ  check, if the joined lists of the input
              qF     are equal

Since the pseudo-code is still a little bit confusing, I'll demonstrate the algorithm using an example input.
Input: [[1,0,9],[1,3,8]],[[1],[0,9],[1,3],[8]]

The .u+NYdY part computes all continuous sublists, that contain the first element.
[[1,0,9],[1,3,8]]     => [[], [1,0,9], [1,0,9,1,3,8]]
[[1],[0,9],[1,3],[8]] => [[], [1], [1,0,9], [1,0,9,1,3], [1,0,9,1,3,8]]

B is a refinement of the A, iff each continuous sublist of A is also a continuous sublist of B (there's only one exception).
So I simply check, if the set of continuous sublists of A is a subset of the set of continuous sublists of B (gF_m.u+NYdYQ).
The only exception is, if the first input list contains less elements than the second input list. For instance <Fm.u+YdYQ would return True for the input [[1]],[[1],[2]].
Therefore I also check if the joined lists are also equal &...qFsMQ.

JavaScript (ES6), 67 70
Edit 3 bytes saved thx @apsillers
Run the snippet below in Firefox to test

f=(a,b)=>a+''==b // same values in the lists ?
&![...a.join(' ')].some((c,p)=>c<','&b.join(c)[p]>c) // splits in a are present in b?

// TEST

out=x=>O.innerHTML += x+'\n';

OK=[
[[],[]],
[[[0]],[[0]]],
[[[1,0,9,1,3,8]],[[1,0,9],[1,3,8]]],
[[[1,0,9,1,3,8]],[[1,0,9,1,3],[8]]],
[[[1,0,9,1,3,8]],[[1],[0],[9],[1],[3],[8]]],
[[[1,0,9],[1,3,8]],[[1,0,9],[1,3,8]]],
[[[1,0,9],[1,3,8]],[[1],[0,9],[1,3],[8]]],
[[[9,8,8,5,8,2,7],[5],[1,4],[2,0,0,6,0,8,4,2,6,4,2,3,7,8,7,3,9,5,7,9,8,2,9,5],[3,9,8],[7,1,4,9,7,4,5,9],[3,3,3],[9,0,7,8],[3,9,4,7,2,7,8,0,3,0],[8,2,2,7,3,9,3,2],[2,9,0,8,5,4,1,8,5,5,6,2,0,9,2,7,7,9,2,7],[3,6],[1,2,7,7,4,4,2,9]],[[9,8],[8],[5,8,2],[7],[5],[1,4],[2],[0,0,6],[0],[8,4,2],[6,4],[2],[3],[7,8],[7,3],[9],[5,7,9],[8,2],[9,5],[3],[9,8],[7,1,4],[9,7],[4,5,9],[3,3],[3],[9,0],[7,8],[3],[9],[4],[7,2],[7,8],[0],[3,0],[8,2],[2],[7,3],[9,3],[2],[2],[9],[0],[8,5,4],[1,8],[5,5],[6],[2,0],[9],[2],[7,7,9],[2,7],[3,6],[1,2],[7,7],[4,4,2],[9]]]
];

KO=[
[[[0]],[]],
[[[0]],[[1]]],
[[[1,0,9]],[[1,0,9],[1,3,8]]],
[[[1,0,9],[1,3,8]],[[1,0,9,1,3,8]]],
[[[1,0,9],[1,3,8]],[[1,0,9]]],
[[[1,0,9],[1,3,8]],[[1,0],[9]]],
[[[1,0,9],[1,3,8]],[[1,0],[9,1],[3,8]]],
[[[1],[0,9],[1,3],[8]],[[1,0,9],[1,3,8]]],
[[[9,8,8,5,8,2,7],[5],[1,4],[2,0,0,6,0,8,4,2,6,4,2,3,7,8,7,3,9,5,7,9,8,2,9,5],[3,9,8],[7,1,4,9,7,4,5,9],[3,3,3],[9,0,7,8],[3,9,4,7,2,7,8,0,3,0],[8,2,2,7,3,9,3,2],[2,9,0,8,5,4,1,8,5,5,6,2,0,9,2,7,7,9,2,7],[3,6],[1,2,7,7,4,4,2,9]],[[9,8],[8],[5,8,2],[7],[5,1],[4],[2],[0,0,6],[0],[8,4,2],[6,4],[2],[3],[7,8],[7,3],[9],[5,7,9],[8,2],[9,5],[3],[9,8],[7,1,4],[9,7],[4,5,9],[3,3],[3],[9,0],[7,8],[3],[9],[4],[7,2],[7,8],[0],[3,0],[8,2],[2],[7,3],[9,3],[2],[2],[9],[0],[8,5,4],[1,8],[5,5],[6],[2,0],[9],[2],[7,7,9],[2,7],[3,6],[1,2],[7,7],[4,4,2],[9]]]
];

dump=l=>l.map(x=>'['+x+']').join(',');

out('YES');
OK.forEach(l=>out(f(l[0],l[1])+' a['+dump(l[0])+'] b['+dump(l[1])+']'));
out('NO');
KO.forEach(l=>out(f(l[0],l[1])+' a['+dump(l[0])+'] b['+dump(l[1])+']'));

One of these days I'm going to have to download Firefox to see your awesome solutions in action. :)

@AlexA. how can you live without it?

Use repl.it , I think that supports ES6 :D

I like how you named the variables OK and KO.

C, 69 75
A function with 2 string parameters, returning 0 or 1.
Parameter format: sublist separated with spaces (' '), list elements separated with commas.
Example: "1,0,9 1,3,8" "1,0 9,1,3,8"
f(char*a,char*b){for(;*a-44?*a&&*b==*a:*b<48;a++)b++;return!(*b|*a);}

Less golfed
int f(char *a, char *b)
{
    // expected in a,b: digit,separator,digit... with separator being ' ' or ','
    for(; *a; a++,b++)
       // ' ' or digit in a must be the same in b
       // comma in a must be comma or space in b
       if (*a != ',' ? *b != *a : *b > *a) return 0;
    return !*b; // must have a null in *b too
}

Test Ideone (outdated)

Clever choice of input format. I've borrowed it for another Haskell answer.

I ripped off your idea for input for my JS answer, and it turned out to be one byte longer than your C version until I upgraded it to ES6...  Who'd have expected that...

Haskell, 76 bytes
[]#[]=1<2
[x]#[y]=x==y
x@(a:b)#(c:d:e)|a==c=b#(d:e)|1<2=x#((c++d):e)
_#_=2<1

Returns True or False. Example usage: [[1,0,9],[1,3,8]] # [[1,0],[9]] -> False.
Simple recursive approach: if the first elements match, go on with the tails, else start over but concatenate the two elements at the front of the second list. Base cases are: both lists empty -> True; both lists with a single element -> compare them; only one list empty -> False.

CJam, 19 bytes
q~]{_,,\f>:sS.+}/-!

Try it online.
I/O
Input
[[1 0 9] [1 3 8]] [[1] [0 9] [1 3] [8]]

Output
1

Idea
Each partition can be uniquely identified by observing the following two properties:

The list formed by concatenating all sublists.
The "cutting points", including the extremes of the list.

We can combine both criteria into one by replacing each cutting point with the sublist of elements from the cutting point to the end of the list.
To verify that a given partition is finer than another, we only have to verify if the coarser partition, represented as above, is a subset of the finer one and that the largest lists of both partitions match.
Code
q~]   e# Read from STDIN and evaluate.
{     e# For each array P from the input:
  _,, e#   Push [0 ... L], where L == length(P) - 1.
  \f> e#   Push [P[0:] ... P[L]].
  :s  e#   Stringify each P[k:] (flattens).
  S.+ e#   Vectorized concatenation. This appends a space to the first element.
}/    e#
-!    e# Push the logical NOT of the difference A-B to check if A is a subset of B.

For the input form the I/O example, the stack holds
["109138 " "138"] ["109138 " "09138" "138" "8"]

before executing -!.
Note that the first element of each array has a trailing space. This makes sure we compare the full list of the first input with the full list of the second.

CJam, 24 bytes
l~L\{+_a2$1<={;1>L}&}/+!

Algorithm
Here we simply use a greedy algorithm to see if first N sub-lists of the second list can be merged together to form the first sub-list of the first list. Once such N is found, we remove the first N sub-lists from second list and the first sub-list from the first list and repeat the process.
Ideally, if the second list was a refinement of the first, we should be left with 2 empty lists on stack. We just check for that and print 1 if that is the case. In any other combination, after fully iterating over sub-lists of second list, we won't end up with 2 empty lists. Thus a 0 will be printed for such cases.
Code expansion
l~L\{+_a2$1<={;1>L}&}/+!
l~L\                       e# Read the line, evaluate the two lists and put an empty list
                           e# between them
    {               }/     e# Iterate over all sub-lists of the second list
     +                     e# Append the current sub-list to whatever is on stack. Originally
                           e# an empty array, but eventually the sum of first N sub-lists
      _a                   e# Copy this and wrap it in an array
        2$                 e# Copy the first list on top of stack
          1<               e# Get only its first element wrapped in an array. This approach
                           e# is exception safe in case the array was already 0 length
            ={    }&       e# If we have a match, remove both first sub-lists
              ;            e# Remove the first N sub-lists array
               1>          e# Remove the first element from the first array
                 L         e# Put an empty array on stack to repeat the process
                      +!   e# If we are left with two empty arrays, sum them and do logical
                           e# not to get 1. If any of the arrays is non-empty, logical not
                           e# gives 0

Try it online here or run the complete test suite here

C, 120 114 bytes
#define C(x),x+=(*x/93)*(1+!!x[1])|1
o;R(char*s,char*t){for(o=1;*s;o&=*s==t[2*(*t==93&&93>*s)]C(s)C(t));return o;}

I haven't golfed much recently, so I thought I'd try this one out.
We define a function R(char* s, char* t) which returns 1 if t is a refined partition of s, and 0 otherwise. s and t are expected to be in the format [DDDD...][DDDD...]... Where each D is another single-digit element.
Testing code:
#include "stdio.h"

int main(int argc, char** argv) {
    char* str1, *str2;
    str1 = "[109][138]";
    str2 = "[1][09][13][8]";
    printf("Input: %s, %s --> %d\n", str1, str2, R(str1, str2));

    str1 = "[109][138]";
    str2 = "[1][19][13][8]";
    printf("Input: %s, %s --> %d\n", str1, str2, R(str1, str2));

    str1 = "[109][138]";
    str2 = "[10][91][3][8]";
    printf("Input: %s, %s --> %d\n", str1, str2, R(str1, str2));
}

The above prints the following:
Input: [109][138], [1][09][13][8] --> 1
Input: [109][138], [1][19][13][8] --> 0
Input: [109][138], [10][91][3][8] --> 0

It seems to work, at least.

109 bytes

Haskell, 52 50 53 bytes
x#y=and$zipWith(\a b->a==b||a==',')(x++"..")(y++"..")

Completely different from my other solution. Uses the same clever input format as @edc65's answer, i.e. elements are separated with , and lists with .
Usage example: "1,0,9,1,3,8" # "1,0,9 1,3,8" -> True.
The second parameter is a refinement of the first, if they have either equal elements at every position or the first one is ,. I have to append a unique end token (->..) to both parameters, because zipWith truncates the longer parameter and for example "1,2,3" # "1,2" would also be True.

(\a b->a==b||a>b) is just (>=).

wouldn't adding just "." instead of ".." work too?

this fails on "2"#"1" because the functions only checks if the values are bigger, not equal

@alephalpha: oh dear, how stupid of me to overlook that. But it is wrong anyway. See other comments.

@proudhaskeller: damn last minute edits. Yes, this is a bug. Fixed it. Thanks for finding out. BTW, a single dot "."won't work, because it would give a false positive for  "2,1" # "2" which would first expand to "2,1." # "2." and then be truncated by zipWith to "2," # "2.". A comma in the first string matches everything.

@proudhaskeller: ... wait, not that easy ... My first version checked for a==',' to which I have reverted again. Here I need two dots as described in my last comment. With the (wrong!) test a>b a single dot would have been enough.

Python 2, 68 51 bytes
Thanks to xnor for some considerable byte-savings!
Anonymous function that takes two strings of the form "1,0,9 1,3,8" (taken from edc65's C answer) and returns True or False. New version with map(None) no longer works in Python 3.
lambda a,b:all(i in[j,","]for i,j in map(None,a,b))

Test suite:
>>> def runTests(f):
    assert f("1,0,9 1,3,8","1 0,9 1,3 8")
    assert not f("1,0,9 1,3,8","1,0 9,1 3,8")
    assert f("1 0,9 1,3 8","1 0,9 1,3 8")
    assert not f("1 0,9 1,3 8","1,0,9 1,3,8")
    assert not f("1 0,9 1,3 8","1 0,9 1,3")
    assert not f("1 0,9 1,3,8","1 0,9 1,3")
    print("All tests pass.")

>>> runTests(lambda a,b:all(i in[j,","]for i,j in map(None,a,b)))
All tests pass.

Previous 92-byte solution that takes input as "109 138":
def R(a,b):
 r=1
 for i in b.split():r&=a.find(i)==0;a=a[len(i):].strip()
 return r and""==a

I think you can avoid doing an explicit length check by mapping None. The case when one list is longer than another is rejected where one list has None but the other index has a number, since i==j or"0">i>j cannot hold.

Unless I'm missing something, the second test can just be i==','. This lets you combine the tests as i in[',',j] (we can't do i in ','+j) because j might be None.

@xnor Wow, thanks.  #1 didn't occur to me because I'm pretty used to thinking in Python 3 now; #2 didn't occur to me because "what if b has a number at that spot?" ... forgetting that with this input format, that's not possible.

Mathematica, 65 bytes
f@__=1<0;{}~f~{}=1>0;{a_,b___}~f~{c__,d___}/;a==Join@c:={b}~f~{d}

Nice solution. FYI, I've got a 59-byte solution that doesn't use recursion (or multiple definitions).

Maths with regular expressions is fun!
ES6 Javascript, 53 chars
(a,b)=>RegExp('^'+a.replace(/,/g,'[ ,]')+'$').test(b)

Vintage Javascript, 70 chars
function f(a,b){return RegExp('^'+a.replace(/,/g,'[ ,]')+'$').test(b)

Uses the same input format as edc65's answer.
Full demo including all test cases here.

Clever! Never thought about regular expressions for this task.

I wrote a perl program that factorised integers using a recursive function that found prime factors using a backtracking regular expression...  They aren't pretty and definitely aren't fast, but they can do some cool stuff!

I also wrote a parser generator, which converts a language specification into a regular expression, and that regular expression can then be used to parse expressions in the specified language.  Basically, "compiling" a human-readable language spec to an "executable" regular-expression.
https://github.com/battlesnake/d-slap
The generated regular expression for parsing AngularJS comprehension expressions is about 400-500 characters long...

Mathematica, 55 bytes
Equal@@Join@@@#&&SubsetQ@@(Accumulate[Length/@#]&)/@##&

This defines an unnamed function, taking the two partitions in a single list, in reverse order (i.e. Y first, X second).
Explanation
Equal@@Join@@@#

This checks that both partitions are actually partitions of the same list.
SubsetQ@@(Accumulate[Length/@#]&)/@##

This is a golfed form of my approach in this question over on Mathematica.SE, which inspired this challenge. Basically, a partition is defined as a number of indices where splits are inserted, and this checks that all the splitting positions in X also appear in Y by accumulating the lengths of the sublists.

Jelly, 7 5 bytes
O_/²Ƒ

Try it online!
This implements Dennis' string-based algorithm, with a slight modification to the input format. Sublists are separated by - and from each other by , (e.g. [[1], [0, 9], [1, 3], [8]] -> 1,0-9,1-3,8). If this is too much of a stretch, Dennis' input format is 9 bytes
A pure array based method comes out at 10 6 bytes.
ŒbF€€i

Try it online!
This takes inputs reversed (i.e. X on the right and Y on the left), and outputs a non-zero integer for truthy and zero for falsey. It's 2 bytes longer (ŒbF€€iɗ@) to take input the normal way around. This does time out on TIO for the 2 longest inputs however.
How they work
The 5 byter is simply an adaptation of of Dennis' CJam answer into Jelly:
O_/²Ƒ - Main link. Take the pair [X, Y] on the left
O     - Convert everything to ordinals
 _/   - Element-wise subtraction
      - This results in:
      -   A list entirely containing 0s and 1s for truthy outputs
      -   A list consisting of at least one non-0 or 1 element for falsey outputs
   ²Ƒ - All elements are unchanged when squaring, i.e. all elements are 1 or 0

The 7 byter works as follows:
ŒbF€€i - Main link. Takes Y on the left and X on the right
Œb     - Generate all partitions of Y, yielding [[]] if Y is empty
    €  - Over each:
  F€   -   Flatten each sub-partition
       -  This has the effect of generating all possible concatenations of Y
     i  - Index of X in these concatenations, or 0 if not found

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Deciding if x-y is 0 or negative without using conditionals
So,
My friend has come up with this interestng question, that is, given two numbers x and y deciding whether their difference: x-yis 0 or less without using any conditionals. The code should return 0 if they are 0 or less, or the result of the subtraction otherwise.
My attempt (In Pseudo-Java):
try {
Math.log(x-y);
} catch(Math.Error e) {
return 0; }

return x-y;

However, I have a feeling that Java exception handling or log method may use conditionals at some point, which in a way would be cheating.
Thoughts? :D

why not take the maximum between the subtraction and zero?

@WooiKentLee I was going to mention that, but I'm pretty sure the Max function would use a conditional. I assume he wants to have no conditionals whatsoever. I don't know why, but that's what it sounds like. EDIT: Although if that was the case, then I'm sure try-catches use conditionals too... max(0,x-y) would then fit the spec.

Wrong site. This might be on-topic on [so]

Could also do some math using the signum or abs methods. Either way, this question doesn't really fit in codegolf.

Welcome to PPCG! All questions on this site must be programming contests with an objective winnings criterion (or tips questions for such programming contests). Unless you specify how the winner is going to be picked (e.g., code-golf is shortest code in bytes, atomic-code-golf code in operations), this question will have to get closed.

Use something like this, assuming the integer type is signed and has 32 bits:
~((x-y) >> 31) & (x - y)

this shifts the sign bit of the difference right by 31 places, generating either 0 if x - y is positive or -1 if the result is negative. This inverted is anded with x - y to get 0 if x - y is negative, x - y otherwise.

There is a common misconception that comparison operators (e.g., > or <) somehow involve conditionals.
For most if not all architectures, this is not true. On x86, CMP sets the sign flag simply to most significant bit of the difference of x and y, so no conditionals are involved.
In C, Python and many other languages (but, notably, not Java), you can use
(x > y) * (x - y)

which will be x - y = 1 * (x - y) if x > y and 0 = 0 * (x - y) if x ≤ y.

Note: Since the OP's example is in "pseudo-java", you might want to point out that this won't work that well in actual java. (x>y) is a boolean type, and can't easily be multiplied without adding a conditional.

@Geobits: I don't know Java, so I had no idea. Is there no way to cast a Boolean to an integer type?

Well you can't do a straight cast ((int)mybool doesn't compile). Typically I use a ternary like x>y?1:0, but I can't see how that wouldn't count as a conditional here. There may be a builtin to do this, but it would probably use an internal conditional.

Jupp, and on x86 you could use this sequence of instructions to compute the desire result, assuming ecx contains x, ebx contains y and the result is supposed to go to eax: xor %eax,%eax; sub %ecx,%ebx; sets %ebx,%eax