text:
Source code ecological footprint
You've just been hired by a German car manufacturing company. Your first task, as an engineer, is to write a program that computes the ecological footprint of ASCII strings.
The ecological footprint of character is computed as follows:

Write the character's ASCII code in binary, and count the number of 1's.

For example, A has a footprint of 2, but O is dirtier with a footprint of 5.

The global footprint of a string is the sum of the footprints of its characters. An empty string has a footprint of zero.

Your program must accept an ASCII string as parameter (through command line or input), compute its ecological footprint, and output it. The program itself must be ASCII encoded.
There is a hiccup though. As your company wishes to enter a new market with stricter environmental rules, you need to tune your program so that it behaves differently in "test mode". Thus:

The program should output 0 when it receives the string test as parameter.

Scoring
The source code with the smallest ecological footprint wins (and yes, the answer test is forbidden!)

When you said 'parameter', did you mean command line input or function argument or stdin?

I'm sorry, I haven't been keeping up with the news, but I've just read it. Can we assume the German car company is definitely NOT called Volkswagen?

@muddyfish either command line or stdin, up to you

Could you give some testcases?

For reference, most costly to less costly characters: \x7F}~_?{ow7yvu/s\x1F;=znm>k|OW[]^gc\x1Ex\x1D\eef\\'ZY+-VU.St\x173iNM5K6r\x0FG9:q<ljQ\x15\x13pC\aEF8IJL4\x0E21\x16RTh,X*)\x19\v&%\x1A#d\x1C\rab\!"$(\x180\x05A\x14B\x12\x11DHP\x03\f\x06\n\t\x80\x10\x01@\x04\b\x02 \x00`

@steveverrill It is a fictional company, but its name indeed starts with V and has a W somewhere in the middle. But any similarities with reality is mere coincidence, least someone sues us.

@alexanderbird: see last sentence of the question - scoring is based on ecological footprint, not length

@JacobKrall - thanks, and oops.

"Ecological Footprint"

Functions allowed (instead of programs)?

Hoping to see an x86 answer with POPCNT!

@Mindwin How about this for the company name: http://www.collinsdictionary.com/dictionary/german-english/verwackeln

I will not embarass the company in question so I'll only tell you the initials: ~IBM~VW

They're lying to you!  1's are much more ecologically friendly than 0's.  Want proof?  Print out your source code in binary.  0's use nearly twice as much ink as 1's.  And if you code with a dark background, they also waste more electricity to display on your screen.  (If you code with a white background, you're already wasting electrons rendering all that white, so clearly any environmentally conscious programmer should be using a black background in their editor.)  To be extra eco-friendly, we should all be writing in Whitespace...

I actually have a concept for a language where the program would just be one character, but unfortunately I haven't made an interpreter yet.

@DarrelHoffman that doesn't make sense with constantly backlit LCDs.

CJam, 33 31
"",AA#b:c~

There are 11300000000950000000034000000011600000001010000000115000000011600000000340000000061000000003300000000420000000058000000010500000000500000000102000000009800000000490000000102000000009800000000490000000098 null bytes between the double quotes.
The code is equivalent to
11300000000950000000034000000011600000001010000000115000000011600000000340000000061000000003300000000420000000058000000010500000000500000000102000000009800000000490000000102000000009800000000490000000098
AA#b:c~

which can be tested online.
How this works
"",  e# Push the length of the string.
AA#  e# Push 10000000000.
b    e# Turn the length into the array of its base-10000000000 digits.
:c   e# Cast each digit to character. This pushes the following:
     e# q_"test"=!*:i2fb1fb1b
~    e# Evaluate the string.

How that works
q_     e# Read all input and push a copy.
"test" e# Push the string "test".
=!*    e# Check for inequality and repeat the string 0 or 1 times.
       e# This replaces input "test" with the empty string.
:i     e# Cast each character to integer
2fb    e# Replace each integer by the array of its base-2 digits.
1fb    e# Replace each array of base-2 digits by the sum of its digits.
1b     e# Add the sums of digits.

This source code has an ecological footprint of 75.

Wow, that's clever. I guess the caveat is that you could never run it, since all the memory in the world couldn't hold the entire code.

That's a minor inconvenience. You can't put a price on nature.

That's a nice trick, but it is invalid if can't be run

@edc65 You are forgetting moore's law. It could be run, just not now.

@PyRulez : Not by anything unless it will be built out of something other than matter and occupy something other than space.

Why not just to use Lenguage?

@jimmy23013 I had only a few minutes to spare, and I've never written a BF program. If nobody beats me to it, I will.

Lenguage, 0

Output is in unary, since Lenguage/Brainfuck has no sane way of printing integers in base 10.
The actual source code contains
22360559967824444567791709913713659826044558304969374451791514225490473373040212332757409553558758107085015797320276213515502796255082717802632399123502087743818475438512153373406931103005017157351410347278489842099128517039634739852783737052963203448945756470632484148121769939122103257063633371522287190530269279693540898545359211009781370158317748609540216376596783541124510013448091325488601732964773653391702083563797082990404753843419895799343996435988722965711513708742853668363743953430527328863418281733901770990932025503662188187254784985474815936854540100376410040743052620419372327997519047616042603909398552951490180076364164838561112002025592431155898041427468731461614504254168899805662501979953318388813759833797929243626668399650485310047043700001093878284174322463350892654886806075148010832042248607926124030339950499631072150856939786062937034833055717723216663269161130154002679878012158315587925933383341827053312086716181702533743607685576475754259877651521989944802973721727159955208722180232955193930065862370838526521351991966172723976565264862909528310162816593997640732796289501819499741414526385058421824690665542546821941125191276568479078107133076037506211133628962099403163812267452274532219562823184225236020523509355625620557197876838014050964240952738109101849512504021041103516630358995290177306585560988278630098667702211916671663291473843258785929522017507744814910480115446168939335008597569919072874897148594826036210511162928991890818427747059833051607455121463371211282760364668765311589329918870071117807132901910082663054895226456039171170783440772764031568108965851688162729239711772886386306884508520204834432674839183166053019421652064937613583258148354531835035461504442885024563141848164279928769795684221364984104923764359842286827870778678989243517189772102669283996930513577004801536579491093711362942690905779844535371088542020595945700544234301668098553671685123172583259206072965508639556627967633275762621813851479909708616154198658896714629908456913467267354690109885368211752176196164620615081464122410029328694509842558492529684841818953632659248840216891072110853731776562597900145806210691868173380612838327841104919352821441230296200143603175486627682007399030356592930049570084097858148122367

null bytes and is equivalent to the following Brainfuck program:
,[<<+++++++++++++++++++++++++++++++++++++++++++++++++>>>>>>,]
>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<
<<<++++++++++++++++++++++++++++
[-<----<<<<----<<<<----<<<<---->>>>>>>>>>>>>]
<----<<<<---<<<<+++++++++++<<<<----
<<<<
[>>>>>>>>>>>>>>>>>>>>>>>>]
>>>>
[>>>>>>>>>>>>>>>>>>>>>>>>]
>>>>
[>>>>>>>>>>>>>>>>>>>>>>>>]
>>>>
[>>>>>>>>>>>>>>>>>>>>>>>>]
>>>>
[>>>>>>>>>>>>>>>>>>>>>>>>]
>>>>
[
 <<<<<<<<<<<<<<<<<<<<<<<<
 <<<++++++++++++++++++++++++++++
 [-<++++<<<<++++<<<<++++<<<<++++>>>>>>>>>>>>>]
 <++++<<<<+++<<<<-----------<<<<++++
 >>>>>>>>>>>>
 [
  -[<]<<[.<]
  >>>
  -[<]<<[.<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[.<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[.<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[.<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[......<]
  >>>
  -[<]<<[.<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[......<]
  >>>
  -[<]<<[..<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[......<]
  >>>
  -[<]<<[...<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[......<]
  >>>
  -[<]<<[....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[......<]
  >>>
  -[<]<<[.....<]
  >>>
  -[<]<<[......<]
  >>>
  -[<]<<[......<]
  >>>
  -[<]<<[.......<]
  <
 ]
]

Try it online on brainfuck.tk.
The length of the Brainfuck code is highly suboptimal – for starters, I've hardcoded the footprints of all ASCII characters – but score 0 is score 0...

No way, Lenguage actually supports null bytes?!

In a Lenguage program, the length of the program is the only thing that matters. I've checked and the interpreter from the Esolang page supports them.

I feel that answer like this one show no respect of the public: it's cheating, and gaming the system ... But this is the whole point of this challenge after all. +1

@edc IMO, languages like golfscript etc detract from one possible interpretation of code golf, that is as a "meta" challenge -- creatively working within the rules of languages that were designed for the purpose of writing useful programs, to instead solve arbitrary challenges in as few characters as possible.
Instead, the "challenge" has become using languages that were designed for the purpose of solving arbitrary challenges in as few characters as possible for their intended purpose.... a more appropriate challenge, perhaps, would be designing useful programs in golfscript?

@sig_seg_v What I meant: this is the whole point of THIS specific challenge. I have nothig against GolfScript, Cjam and the like. And it's not difficult writing useful programs in GS or CJam - it would be nightmarish to mantain and evolve such programs, but that is true for a golfed program in any language

"Output is in unary, since Lenguage/Brainfuck has no sane way of printing integers in base 10.".  I thought part of the point of Lenguage/Brainfuck was that it didn't have a sane way of doing anything :)

@edc I think I understood what you were saying, I was just taking what I understood as the "spirit" of your answer and making a connection with my fogey vision of the "spirit" of code golf itself. The thing is, lenguage wasn't even developed for this challenge (or golfing at all), it's basically an impractical joke afaict. It just happens to be appropriate to golf this particular challenge. That's part of the fun of codegolf the way I see it, is finding a language that can solve a particular problem with a small source. In practice, that language is cjam or golfscript. Disappointing.

This didn't quite work for me when I tried to recreate your program from the definition you gave.  Could you please post the full Lenguage source so that I can see where your program differs from my attempt at recreating it?  ;-)

What amazes me isn't that Lenguage supports nulls, but that you managed to make such a program in BF. Haunting...

PowerShell, 337 344 304 points
PARAM([CHAR[]]$A)$A|%{$B+=([CONVERT]::TOSTRING(+$_,2)-REPLACE0).LENGTH};($B,0)[-JOIN$A-CEQ"test"]

I'M SHOUTING AT YOU BECAUSE IT'S CHEAPER!
Takes input as $A, then casts as a char-array, then iterates over a for-loop on each character, uses the ridiculously wordy [convert]::ToString() to convert the character at that position to binary, replaces all the 0's with nothing, then counts the length, and adds that to $B. At the end, uses an equivalence to index into a dynamic array (i.e., if $A is test, then -CEQ is $TRUE, so it indexes to the second element, 0).
Edit1 -- Corrected test case "TEST"
Edit2 -- Golfed a couple points by iterating over the characters themselves rather than their indices, and by remembering that -replace doesn't need a second parameter if you're replacing it with nothing.

Double quote " 00100010 is more environmentally friendly than single quote ' 00100111.

Returns incorrect value 0 for input "TEST"

@JacobKrall Good catch on the double-quote ". Also corrected with -CEQ for case-sensitivity. It upped the points a little bit, because I was incorrectly scoring the ' ' as I didn't delimit it correctly on my tests.

Pyth - 52 49
Three points save thanks to @orlp.
*/.BQ`1nQ"test

Takes input in quotes to save footprint.
Test Suite.

Ugh, I almost got the same as you, but my answer is too similar and you posted first. Replace @,0 with * to save 3 :)

@Maltysen You say that you found three points but the source still says @,0, did you just forget to change?

@ConfusedMr_C yep. I just changed the permalink and forgot the actual answer.

Common Lisp, 294 281 235
In order to reduce the score, I used @ (cost 1) and ! (cost 2) as variable names (edit: and it is even better if I use @ for the variable occuring the most in the function).
I AM SHOUTING TOO because it is cheaper.
(LAMBDA(@)(IF(STRING="test"@)0(LOOP FOR ! ACROSS @ SUM(LOGCOUNT(CHAR-CODE !)))))

Pretty-printed
(LAMBDA (@)
  (IF (STRING= "test" @) 0
      (LOOP FOR ! ACROSS @ SUM (LOGCOUNT (CHAR-CODE !)))))

Well the score is more like 294 ;)

@Cabbie407 I missed the part about scoring, sorry :-)

@Cabbie407 I had the strange feeling of having a very low score for a couple of minutes...

Just wanted to let you know, because knowing about the scoring method you'd probably look at your code from a different angle. And I see you changed something already.

@Cabbie407 I forgot to thank you, btw. Thanks.

Python 3, 271
z=input();print([sum([bin(ord(i)).count("1")for i in z]),0][z=="test"])

A lot of little changes gives me 228

Why not take advantage that bools are ints? z=input();print(sum(bin(ord(i)).count("1")for i in z)*(z!="test")) ....@FryAmTheEggman jinx?

@NightShadeQueen Haha, does that mean I can't post for a day? :X Anyway that's a very nice catch for a new user to this site, nice job! Anyway, welcome to PPCG! :) Also, more on-topic, the semicolon could be removed as it costs slightly more than a newline.

JavaScript, 279
Edit Bug fix (did not count bit 1 of each char)
A complete program, with input and output via popup. Tested in Firefox, should work in any modern browser.

B=(P=prompt)(H=D=0)
while(B!="test"&&(A=B.charCodeAt(H++)))while(A)D+=A&1,A>>=1
P(D)

Some tools (Tested with Firefox)

w=c=>c.toString(2).split('').reduce(function(a,b){return a- -b})

t=[[],[],[],[],[],[],[],[],[]]
u=[[],[],[],[],[],[],[],[],[]]
for(c=1;c<256;c++)
  c<33|c>126&c<161 ? t[w(c)].push('\\'+c) : u[w(c)].push('&#'+c+';')
for(i=0; i++<8;)
  T.innerHTML+=i+': '+u[i].concat(t[i]).join(' ')+'\n'

function Calc()
{
  var r='', t=0, b
  I.value.split('').forEach(function(c) {
    c = c.charCodeAt(), r += '\n&#'+c+' '+((256+c).toString(2).slice(1))+' : '
    for(b=0;c;c>>=1) b += c&1
    r += b, t += b
  })
  R.innerHTML='Total '+t+'\nDetail'+r
}
#I { width: 400px }
Weight table

Counter
<textarea id=I></textarea><button onclick="Calc()">-></button>

This answer is invalid - it outputs 17 for test instead of 0.

@ASCIIThenANSI not it doesn't in my browser. But I'm going to check again

That's funny... Testing it with your counter, I get 279, and testing it with itself, I get 277. I wonder which is correct; could it have something to do with the newlines?

@ETHproductions I double checked and the right count is 279. But it does not work with a string containing a newline - it's a problem related to the prompt function. In Firefox, prompt translates the newlines (2bit) in spaces (1bit), so we get 277 instead of 279

@ETHproductions ... in Chrome (on Windows) the newline becomes a CR LF pair (3bit + 2bit) and the count is wrong again

Julia, 254 246 232
P=readline()
print(P=="test"?0:sum([count_ones(1*A)for A=P]))

The count_ones function counts the number of ones in the binary representation of its input.
Reduced my ecological footprint thanks to FryAmTheEggman!

No problem, I just really care about the environment ;)

MATLAB, 198 194 bytes
A=input('','s');~strcmp('test',A)*nnz(dec2bin(A)-48)

First, the string is read in from STDIN via the input function.  Once this happens, we compare the input string to the string test.  If the result isn't test, we convert each character to its ASCII code and then its binary representation via dec2bin.  A beautiful consequence of this function is that if you submit a string, the binary representation of its ASCII code is delimited as one character per line.
As an example:
>> dec2bin('ABCD')

ans =

1000001
1000010
1000011
1000100

dec2bin outputs a character array.  Once this happens, subtract by 48, which is the ASCII code for 0 so that the matrix gets converted to double consisting of 0s and 1s.  Once that happens, a call to nnz counts up the total number of non-zero elements in this matrix.  Take note that this result is multiplied by the opposite of the string compare with test.  Should the string not be test, we get the footprint calculation.  If it's equal, then the multiplication results in 0.
Some examples:
>> A=input('','s');~strcmp('test',A)*nnz(dec2bin(A)-48)
A

ans =

     2

>> A=input('','s');~strcmp('test',A)*nnz(dec2bin(A)-48)
O

ans =

     5

>> A=input('','s');~strcmp('test',A)*nnz(dec2bin(A)-48)
test

ans =

     0

>> A=input('','s');~strcmp('test',A)*nnz(dec2bin(A)-48)
  %// Note - no characters were added here.  Simply pushed Enter

ans =

     0

If you're allowed to use Communications Toolbox, you can use de2bi instead and avoid the -48 to cast it to a numeric type (as well as the 2 extra characters in the function name).

Perl, 136 118 73
$_=unpack"B*";$_=y@1@@

Replace all @ with \0
Usage example:
perl -p entry.pl entry.pl

Bash 440 430 412 405 403
A=0
[ test != "$1" ]&&for((D=0;D<${#1};D++)){
A=$((A+`bc<<<$(printf "obase=2;%d" "'${1:$D:1}")|tr -d "0
"|wc -m`))
}
echo $A

Pretty straightforward. Loops characters in the input converting first to ascii (with printf %d and the leading ' on the number then to binary (with bc), strips out the zeros and counts the number of characters.
Not a great answer but hadn't seen a bash attempt yet.
Modified since my first answer allowed the input string to be given simply on the command line (i.e. it became multiple input params if multipe words) but after reading some other answers I think I can assume it is quoted, so the whole string comes as $1

Welcome to Programming Puzzles & Code Golf! 1. You can replace do with { and done with }. 2. You also don't need the spaces around <<<. 3. You can replace \n with a literal linefeed.

THanks @Dennis.  One of the challenges on this site is unlearning a bunch of "good habits" :).

It sure is. If you haven't already, I recommend checking out Tips for golfing in Bash. It's a great resource.

This challenge is weird even by golf standards!  Extra characters can still save points.  Using = and || costs 15 whereas using != and && is only 13!  An extra character but saves two points...

Ceylon, 1431, 764, 697, 571, 547, 538, 501, 493, 467, 451
shared void p(){print(sum{0,if(exists a=process.arguments[0])if(a!="test")for(c in a)for(b in 0..7)if(c.hash.get(b))1});}

This was the original, ungolfed:
Integer footprintCharacter(Integer b) {
    return sum({0, for(i in 0..7) if(b.get(i)) 1 });
}
Integer footPrintString(String s) {
    if(s == "test") {return 0;}
    return sum({0, for(c in s) footprintCharacter(c.integer)});
}
shared void footprint() {
     if(exists s = process.arguments[0]) {
         print(footPrintString(s));
     } else {
         print("This program needs at least one parameter!");
     }
}

This takes the argument from a command line parameter ... process.arguments is an (possibly empty) sequence of strings, so before using one of them, we need to check if it actually exists. In the other case we output an error message (this is not required by the question and will be thrown away in the next versions).
Ceylon's sum function takes a non-empty Iterable of elements of some type which needs to satisfy Summable, i.e. has a plus method, like Integer. (It doesn't work with empty sequences because each Summable type will have its own zero, and the runtime has no chance to know which one is meant.)
The elements of a string, or the one bits of an integer, are not a non-empty iterable. Therefore we are using here the feature to build an iterable by specifying some elements, then a "comprehension" (which will get evaluated to zero or more elements). So in the character case we are adding ones (but only when the corresponding bit is set), in the string case we are adding the result of the characters. (The comprehension will only be evaluated when the receiving function actually iterates over it, not when building the Iterable.)
Let's see how we can shrink this down. First, each of the functions is only called at one place, so we can inline them. Also, as mentioned above, get rid of the error message. (764 footprint points.)
shared void footprint() {
    if (exists s = process.arguments[0]) {
        if (s == "test") {
            print(0);
        } else {
            print(sum({ 0, for (c in s) sum({ 0, for (i in 0..7) if (c.integer.get(i)) 1 }) }));
        }
    }
}

We don't actually need the inner nested sum, we can make this one big comprehension. (This saves us 37 footprint points for sum({0,}), and some more for whitespace, which will be eliminated at the end anyways.) This is 697:
shared void footprint() {
    if (exists s = process.arguments[0]) {
        if (s == "test") {
            print(0);
        } else {
            print(sum({ 0, for (c in s) for (i in 0..7) if (c.integer.get(i)) 1 }));
        }
    }
}

We can apply a similar principle to the special cased "test" string: as in that case the result is 0 (i.e. nothing is contributed to the sum), we can just do this as a part of the summation (but we have to invert the condition). This mainly saves us the print(0);, some braces and a bunch of indentation spaces, coming down to a footprint of 571:
shared void footprint() {
    if (exists s = process.arguments[0]) {
        print(sum({ 0, if (s != "test") for (c in s) for (i in 0..7) if (c.integer.get(i)) 1 }));
    }
}

We do the same for the first if, with the side effect that now giving no argument also outputs 0 instead of doing nothing. (At least I thought that would happen here, instead it seems to hang with an eternal loop? Strange.)
shared void footprint() {
    print(sum({ 0, if (exists s = process.arguments[0]) if (s != "test") for (c in s) for (i in 0..7) if (c.integer.get(i)) 1 }));
}

We can actually omit the () for the sum function here, using an alternative function call syntax, which uses {...} instead of (), and will fill in comprehensions into iterable arguments. This has footprint 538:
shared void footprint() {
    print(sum{ 0, if (exists s = process.arguments[0]) if (s != "test") for (c in s) for (i in 0..7) if (c.integer.get(i)) 1 });
}

Replacing the function name footprint (40) by p (3) saves another 37 points, bringing us to 501. (Ceylon function names have to start with lower case characters, so we can't get less than 3 points here.)
shared void p() {
    print(sum{ 0, if (exists s = process.arguments[0]) if (s != "test") for (c in s) for (i in 0..7) if (c.integer.get(i)) 1 });
}

The variable names s (5) and c (4), i (4) are also not optimal. Let's replace them by a (argument), d (digit?) and b (bit-index). Footprint 493:
shared void p() {
    print(sum{ 0, if (exists a = process.arguments[0]) if (a != "test") for (c in a) for (b in 0..7) if (c.integer.get(b)) 1 });
}

I don't see any remaining non-whitespace optimization, so let's remove the non-needed whitespace (1 point for each space, two for each of the two line breaks):
shared void p(){print(sum{0,if(exists a=process.arguments[0])if(a!="test")for(c in a)for(b in 0..7)if(c.integer.get(b))1});}

When browsing the API, I found that Character.hash actually returns the same value as its integer attribute. But it has just 14 points instead of 30, so we come down to 451!
shared void p(){print(sum{0,if(exists a=process.arguments[0])if(a!="test")for(c in a)for(b in 0..7)if(c.hash.get(b))1});}

C,374
Newlines (not included in score) added for clarity. Could be improved to 360 just by changing variable names to uppercase, but I'll try to think of something better.
Input is via commandline, which means it segfaults on absent input. I expect a worse score for input through stdin.
i,t;
main(int c,char**v){
for(;c=v[i][i/8];i++)t+=(c>>i%8)&1;
printf("%d",strcmp(v[1],"test")?t:0);
}

VBA, 475 418
Thanks Jacob for 57 points off

Converts String to Byte Array (128 is vba shortcut for "Converts the string from Unicode to the default code page of the system" So won't work on Mac....)
Loops though byte array converting to Binary and Concatenating everything together.
checks for test
Prints length of string with all the 0's replaced with nothing

VBA why are you so bad at golfing... :(
SUB A(D)
DIM B() AS BYTE
B=STRCONV(D,128)
FOR P=0 TO UBOUND(B)
H=H+APPLICATION.DEC2BIN(B(P))
NEXT
IF D="test" THEN H=0
MSGBOX LEN(REPLACE(H,0,""))
ENDSUB

VBA is case-insensitive, so you should use use uppercase everywhere to save a point per lowercase character! (except "test" of course)

JavaScript, 418 410
A=prompt();B=0;!A||A=="test"?0:A.split("").forEach(D=>B+=D.charCodeAt().toString(2).match(/1/g).length);alert(B)

Double quote " 00100010 is more environmentally friendly than single quote ' 00100111.

PowerShell, 273 336 328 324 293 288 295
PARAM($A)[CHAR[]]$A|%{$D=[INT]$_;WHILE($D){$B+=$D-BAND0X1;$D=$D-SHR1}};($B,0)[$A-CEQ"test"]

edit - forgot the 'test' case ... so much expensive.
editedit - missed an UPPERCASE opportunity.
editeditedit - incorporated the comment suggestions (Thanks TimmyD).
edit 4 - D is a cheaper varable than C (2 vs. 3)
edit 5 - Back to 295 due to the case-sensitivity check.
Loops over the string and counts the 1s which get shifted off the characters ASCII value.
Hat-tip to TimmyD for giving me the foresight to use uppercase characters AND to use the array index at the end.

Nice approach! A couple of golfs (removed the $B initialization, as it will default to zero, removed a couple parens, removed some semicolons), brings it down to 293 PARAM($A)[CHAR[]]$A|%{$C=[INT]$_;WHILE($C){$B+=$C-BAND0X1;$C=$C-SHR1}};($B,0)[$A-EQ"TEST"]

What does it mean when I read "Nice approach!" and heard the voice from Wii Golf? Thanks for the pointers! The initialization was tripping me up when testing it in the PowerShell console and I left it in. Good to know otherwise.

Yeah - if you're using the console, it's pretty much a REPL environment, in that variables assigned remain from one line to the next. If you save it as a .ps1, then the $B (and every other variable) is re-initialized, even if you press up-arrow-enter from the same shell. E.g., PS C:\scripts> .\ecological-footprint.ps1

Returns incorrect value 0 for input "TEST"

281 PARAM($A)(([CHAR[]]$A|%{$B=$_;0..9|?{[INT]$B-SHR$_-BAND1}}).LENGTH,0)[("TEST"-EQ$A)]

@tomkandy - I like the approach especially the better use of the -shr $_ while iterating over 0..9. I would have to change the final equality test to [($A-CEQ"test")] due to the case-sensitivity pointed out by Jacob Krall in a previous comment. However, still puts me in the 288 range. Thanks!

Matlab, 320
A=(input('','s'));nnz(floor(rem(bsxfun(@times,[A 0],2.^(-7:0)'),2)))*~strcmp(A,'test')

PHP, 377 337 299 Ecological Footprint (still a lot), 102 91 Bytes
Seems that PHP is environment friendly in test-mode only. ;)
WHILE($D<STRLEN($A=$argv[1]))$B+=SUBSTR_COUNT(DECBIN(ORD($A[$D++])),1);ECHO"test"!=$A?$B:0;

Runs from command line like:
php footprint.php hello
php footprint.php test

while is more environment friendly than for even though they share the same character count. Also uppercase variable names have a better footprint than their lowercase counterparts.
Edit

saved 40 points by using uppercase function names.
saved 38 points by using decbin instead of base_convert

@Adam Here is a discussion about the notices and here about the PHP opening tags. Hope this is useful for you.

Pyth, 64
?qz"test"0l`sS.Bz

Checks if the input is test and if not, counts the number of 1's in the binary representation of the input.

Ruby, 316 313
Very straightforward, looking for some more golfing possibilities:
b=gets.chomp;b=='test'?0:b.chars.map{|i|i.ord.to_s(2).count('1')}.inject(:+)

Used b instead of x to save 3 points.

You can use $*[0] instead of gets.chomp (takes input as a command line argument)

Double quote " 00100010 is more environmentally friendly than single quote ' 00100111.

Uppercase variable names are also more environmentally friendly than the equivalent lowercase. H is better than I for the same reason.

JavaScript (ES6), 521 478 458 449 473 465
alert(((A=prompt(),A!="test")&&(A!=""))?(A.split``.map(H=>(H.charCodeAt().toString(2).match(/1/g)||[]).length)).reduce((A,B)=>A+B):0)

This is my first attempt at a JavaScript golf, so it's probably very ungolfed.

It's generally agreed on that JavaScript golf needs some form of output other than implicit. This can be an alert, document.write, or even a function return.

You can move your prompt assignment into the first 's' in the if statement, surrounded by parenthesis, to save a couple bytes. You can also remove the '0' in charCodeAt. Also, a big savings you can make is using the ternary operator instead of the if/else statements =)

Thanks a lot! I ended up using a comma instead of parenthese for the prompt assignment, though; it saves another byte. (: @Mwr247

s.split('') can instead be s.split``, saving 2 bytes

Use uppercase variable names to reduce your ecological footprint

Also, use A instead of S and H instead of I to further reduce your ecological footprint

@ZachGates: now you have some backticks in your source code where the split('') used to be

Per Dendrobium's comment above @JacobKrall

It seems like the parentheses around (A.split``.map ... .length)) are unnecessary

Double quote " 00100010 is more environmentally friendly than single quote ' 00100111.

Python 2, 294 281 269 266
A=input()
print sum(format(ord(H),"b").count("1")for H in A)if A!="test"else 0

A port of my Pyth answer, above.
Input is received as a string (with quotes):
"ABC"

Double quote " 00100010 is more environmentally friendly than single quote ' 00100111.

A couple basic modifications get this down to A=input();print[sum(bin(ord(H)).count("1")for H in A),0][A=="test"] with a score of 243.

Haskell, 292
a 0=0
a b=rem b 2+a(div b 2)
b"test"=0
b d=sum$map(a.fromEnum)d
main=interact$show.b

Nothing much to say here: turn every character into ascii value (fromEnum) and calculate the 1s (via a). Sum all the results.

CJam, 123
q_"test"={;0}{{s2b2b~}%1e=}?

Pyth, 96
Iqz"test"0.q)/j""m.BdmCdz\1

A port of my CJam answer, above/below.

Just some Pyth general notes: instead of I try to use the ternary ?, but in this case since it is a bool you can just use * (after switching to n instead of q), k is automatically "" and s on strings is the same a jk. Hope you have fun learning pyth! :)

This was my first Pyth answer :P It was hard enough to get this, haha, fun though. Thanks for the tips! @FryAmTheEggman

CJam, 83 81 79 77
Best so far after trying a number of variations:
l0$"test"=!\:i2fbe_1b*

Try it online
Explanation:
l       Get input. Other options like q and r are the same number of bits.
0$      Copy input for comparison. This saves 2 bits over _.
"test"  Push special case string.
=       Compare.
!       Negate so that we have 0 for special case, 1 for normal case.
\       Swap input string to top.
:i      Convert characters to integers.
2fb     Apply conversion to base 2 to all values.
e_      Flatten array.
1b      Sum up the bits. This is 2 bits shorter than :+.
*       Multiply with result from special case test.

Ruby, 247
Straightforward approach looping through all bytes of the input and all bits in each byte, summing to variable d.
d is initialized to -2 because h contains the terminating newline from the input (worth 2 bits) and we do not want to count that.
Similarly h will contain test with a trailing newline, so a newline must included in the comparison value.
d=-2
h=gets
h.bytes{|a|8.times{|b|d+=a>>b&1}}
p h=='test
'?0:d

R, 251 246 241 236
s=readline();sum(if(s!="test")as.real(rawToBits(charToRaw(s))))

Usage:
> s=readline();sum(if(s!="test")as.real(rawToBits(charToRaw(s))))
topical subject
[1] 58
> s=readline();sum(if(s!="test")as.real(rawToBits(charToRaw(s))))
test
[1] 0
> s=readline();sum(if(s!="test")as.real(rawToBits(charToRaw(s))))
s=readline();sum(if(s!="test")as.real(rawToBits(charToRaw(s))))
[1] 236

Edits: Using as.double instead of as.integer lowers by 5 points the footprint.
as.real is deprecated in the current version of R but in R < 3.0 replacing as.double by as.real lowers the footprint by 10 additional points.

R, 279
sum(as.integer(rawToBits(charToRaw(if((s=readline())=='test')''else s))))

Pretty self explanatory.Tests:
> sum(as.integer(rawToBits(charToRaw(if((s=readline())=='test')''else s))))
sum(as.integer(rawToBits(charToRaw(if((s=readline())=='test')''else s))))
[1] 279
> sum(as.integer(rawToBits(charToRaw(if((s=readline())=='test')''else s))))
A
[1] 2
> sum(as.integer(rawToBits(charToRaw(if((s=readline())=='test')''else s))))
O
[1] 5
> sum(as.integer(rawToBits(charToRaw(if((s=readline())=='test')''else s))))
test
[1] 0
> sum(as.integer(rawToBits(charToRaw(if((s=readline())=='test')''else s))))
OAO
[1] 12

C, 378 footprint, 98 bytes
Another C solution:
s;main(c,a)char**a;{for(s=-17*!strcmp(a[1],"test");c=*a[1]++;)for(;c;s+=c&1,c/=2);printf("%d",s);}

The way this works is that s is initialized to 0 usually, but becomes -17 if the command-line argument is "test" (strcmp returns 0 on equal strings, and non-zero on distinct strings, so inverting it gives 1 if string is "test"). The number -17 was chosen to compensate for the footprint of 17 that will be calculated for "test". The computation of the footprint is easy with bitwise operators.
Snap! I initially missed the "shortest footprint wins" so I was aiming for shortest code... I'll see if I can make the "footprint" smaller.

Groovy, 326 242
B=0
P=args[0]
P.bytes.each{B+=0.bitCount(it)}print P=="test"?"0":B

Java, 594
class A{public static void main(String[]P){Integer D,H;for(D=H=0;D<P[0].length();)H+=D.bitCount(P[0].charAt(D++));System.out.print(P[0].equals("test")?0:H);}}

Java is not very green.
Ungolfed version:
class A {
    public static void main(String[]P) {
        Integer D,H;
        for(D=H=0;D<P[0].length();)
            H+=D.bitCount(P[0].charAt(D++));
        System.out.print(P[0].equals("test")?0:H);
    }
}

D is declared as an Integer so we can access Integer's static bitCount method in an environmentally conscientious manner. The bitCount method treats the chars as integers and returns the number of set bits.

Interesting comparing Java with Ceylon ... Java has some overhead due to the boilerplate, and a longer print statement. The bitCount does help, though, Ceylon doesn't have this. Ceylon has a longer way to access to the command line parameters, and also needs to check if they are actually given (where your program would simply throw an ArrayIndexOutOfBoundsException). Ceylon's sum function is certainly shorter than adding it manually in Ceylon (but Java has no comprehensions, so adding manually is better than building an Iterable yourself).

Whispers v2, 438

> InputAll
> 2
>> ?L
>> L⊥2
>> ∑L
>> Each 3 1
>> Each 4 6
>> Each 5 7
>> ∑8
>> Output 9
> "test"
>> 1=11
> 0
>> Output 13
>> If 12 14 10

Try it online!
Unfortunately, we are sort of bound to have a high score when using Whispers for this task, as the key character is >, which has a score of 5. Aside from using " instead of ' quotes, there isn't really much room for improvement without totally rewriting the method used. Using digits which score lower (01248) rather than the higher scoring ones (35679) doesn't allow us to improve, as no high-scoring single digit is repeated (3 occurs more than once, but restructuring doesn't allow us to change the 13 to something lower scoring)
Anyway, the way the program works is fairly understandable, especially for those familiar with Whispers. Our first thing to hold in mind is that 1 is the line reference for the input string. We begin on the last line, with the ternary statement
>> If 12 14 10

The thing to remember with Whispers is that, when a line begins with two > symbols, the numbers act as line references, rather than literal values. That makes this statement equivalent to
If line(12) Then line(14) Else line(10)

Lines 11 and 12, our condition, is
> "test"
>> 1=11

Remembering that line 1 is the input string, this compares the input with the string "test" and returns that boolean.
Our program then branches. First, as it's simpler, we'll take a look at the code executed if the input is the string "test":
> 0            ; line 13
>> Output 13   ; line 14
>> If 12 14 10

If so, we call line 14, which as you can see, outputs the value on line 13, a 0. Therfore, if the input is equal to the string "test", we output a 0, then quit.
However, if the input does not equal the string, we jump up to line 10. Lines 9 and 10 are as follows:
>> ∑8
>> Output 9

So, if the input isn't in test mode, we output the sum of the result from line 8, which is the final Each statement in a series of three:
> InputAll
> 2
>> ?L
>> L⊥2
>> ∑L
>> Each 3 1
>> Each 4 6
>> Each 5 7

Our first Each statement is >> Each 3 1. This maps line 3 over each character in the input. Line 3, >> ?L, takes the currently iterated character and converts it to its ordinal value. This value is then passed to line 7, which converts it to base 2, before line 8 takes the sum of that (the number of 1s in the binary expansion). This returns an array of integers, representing the number of 1s in the binary expansion of each ordinal of each character in the input. As stated above, we then take the sum of this, before outputting it and terminating.
Fun fact:

The markdown of this post is functionally identical to the program
This post has a score of 11125

Excel, 274
=(1-EXACT(A1,"test"))*SUM(MID(DEC2BIN(CODE(MID(A1,SEQUENCE(,LEN(A1)),1)),8),ROW(1:8),1)*1)

Link to Spreadsheet

EXACT is used because string comparisons using = are not case
sensitive in Excel (but they are in VBA which is weird).
MID(A1,SEQUENCE(,LEN(A1),1) lists all of the characters
horizontally.
CODE(~) returns the ASCII value of each character
DEC2BIN(~,8) converts the ASCII values to 8-bit binary
MID(~,ROW(1:8),1) lists each binary digit vertically creating a 2-dimensional array of characters
SUM(~*1) converts the characters to number and sums them

You can start the formula with - for a score of 271: -(1-EXACT(A1,"test"))*SUM(-MID(DEC2BIN(CODE(MID(A1,SEQUENCE(,LEN(A1)),1)),8),ROW(1:8),1))

awk, 339
{while(A++<NF){for(D=0;sprintf("%c",++D)<$A;);for(;D;D=int(D/2))B+=D%2}}$0=/^test$/?0"":B

Needs to be called with awk ' ... ' FS= so I calculated the fingerprint for the code plus FS=.
It's as always a bit longer when involving ASCII codes, because awk has no direct method of getting the code of a character. So I test for every number D starting at zero, if sprintf("%c",D) results in the character we want the ASCII code for.

CoffeeScript, 411 391
()->((A=prompt())!="test"&&A.split("").map((P)->P.charCodeAt().toString(2).replace /0/g,"").join("")||"").length

This can probably be improved.
Functions in CoffeeScript always return.
Thanks @Jacob Krall for reducing this 20 points.

Double quote " 00100010 is more environmentally friendly than single quote ' 00100111.

Stuck, 103
Certainly not great.. Explanation pending.
s_c"2b$o]];,":+;"test"=0u?

ES6, 360
alert((A=prompt())!="test"?A.replace(/./g,B=>B.charCodeAt().toString(2)).replace(/0/g,"").length:0)


text:
Make me a scrolling marquee
Introduction
Remember the roaring 80's? I mean, you know, like 30 years ago? No cell phones, no internet, no ATM's, fluorescent clothing (what was that?!) and scrolling marqee's! No, no, no! Not the online ones, but real ones, With LED lights.

Since I'm in a nostalgic mood, I'd like you to create a scrolling marquee.
Challenge
Create a program where you can enter a one line string. You program needs to create a 80 character wide scrolling marquee, repeating the text if necessary.
Rules

The user must be able to enter a string to your program as input. The string can be a command line parameter or a string entered while running the program.
Your program must continuously print a string of exactly 80 (visible) characters.
The string must be updated every 0.1 second (more or less; I won't be timing it), shifting the characters every iteration one position to the left.
The string "rotates". At the end of the user supplied string, another instance of the string must appear.
You program must print it's output on one line, without linefeeds (use a '\r' instead of a '\n')
Your program must run ad infinitum, until an user interrupt.
This is a codegolf, so shortest code in bytes wins.
There is a 10% bonus (rounded up to the next integer) for printing in red on a black background.
Standard loopholes apply.

Reference implementation in Python 2.7
This program isn't golfed, but it provides a reference implementation (and thus an upper limit to the size).
import time,sys
s=raw_input()*99
while 1:
    for i in range(80):
        print s[i:i+80]+'\r',
        sys.stdout.flush()
        time.sleep(0.1)

@mbomb007 similar, but not the same. Also this question looks like it (good for inspiration) but it is different on several respects, I think. Also, I found the scores (code lengths) quite disappointing. I really think we can do better!

Maybe as code golf + popularity contest?

Do we have to wait exactly 100 ms?

@Dennis well, more or less. It's ok if you set it to 99 to save a char. Let's say the execution of the other instructions will take 0.01 sec. :-)

I was asking because some languages do not have a sleep command. It's possible to cause a delay by using a CPU intensive instruction, but that will only achieve something close to 100 ms.

I was really proud of my code but I misread the spec... it prints a string the same length as the input string. My bad. Time to start from scratch :D

Is it acceptable that the user has to enter the input including the quotation marks? That, enter 'example text',  not example text

Since I'm not that strict on the precise input methods or requirements, I think it's ok.

@SuperJedi224 Code golf + popularity contest makes no sense.

You can use a scoring metric like bytes/(1+votes) or something.

@SuperJedi224 thanks for the suggestion, but I don't like to changes the rules of the game halfway the match.

What should happen if the input string is more than 80 characters? Your reference implementation, and my answer, get to s[80:160] and then jump back to s[0..] they never print the end of the long string, e.g. an input of 1 2 3 4 5 6 7 8 9 10 11 ... 300 cuts off after about 56.

CJam, 31 bytes
l80*{Dco_80<o(+es99+{es1$<}g;}h

Waits for exactly 100 ms.
This will only work with the official Java interpreter, since the online interpreter only shows output after exiting the program.
Red text on black background is possible in 40 (or 39) bytes, for a score of 36:
0000000: 6c 38 30 2a 7b 22 0d 1b 5b 33 31 3b 34 30 6d 22 6f 5f  l80*{"..[31;40m"o_
0000012: 38 30 3c 6f 28 2b 65 73 39 39 2b 7b 65 73 31 24 3c 7d  80<o(+es99+{es1$<}
0000024: 67 3b 7d 68                                            g;}h

How it works
l80*                             Read a line and repeat it 80 times.
    {                        }h  Do:
     Dco                           Print the character with code point 13.
        _80<o                      Print the first 80 characters of the string.
             (+                    Rotate the string one charcter to the left.
               es99+               Push the current time (ms) plus 99.
                    {     }g       Do:
                     es1$<           Compare the current time with the sum.
                                     Repeat the loop if 99 or less ms have passed.
                            ;      Discard the time stamp.
                                 Repeat the loop.

I suspect they won't come shorter than this. Congratulations!

Seems tlike the ; in the explanation is misaligned

@Ven Fixed, Thanks!

PowerShell, 118 113 112 108 102 101 99  96 - 10% = 86
Code
$s=(Read-Host)*180;for(){Write-Host($s.substring(($i=++$i%80),80)+"`r")-N -F R -B 0;sleep -m 99}

With the caveat that it now begins the first loop with the second character; The rules don't say it has to start from the front of the string, and the first one is included overall, so that's fine by me. I will get it to 100 chars somehow - edit: thanks @ConnorLSW for the edits to get it below 100.
Instructions

Run PowerShell (normal console, it doesn't work in PowerShell ISE)
Paste the single line version into PoSH, press enter
Type a message, press enter
Ctrl-C to break

Output

Notes
A more readable version with the variable names and parameters filled out a bit:
$test = (Read-Host) * 180
for () {
    Write-Host ($text.substring(($i=++$i%80), 80)+"`r") -NoNewLine -ForegroundColor Red -BackgroundColor Black
    sleep -Miliseconds 99
}

The parameters only need to be long enough to be unique, so -F R is unique enough to set a Red ForegroundColor, for example.
'Black' has to be 'Bla' to be unique compared to 'Blue', but -B 0 sets it to color Enum value 0 which is interpreted as Black.

Alternative, more 'correct' marquee:
The reference code doesn't handle strings longer than 80 characters nicely, skipping anything in the message past ~160 characters, and it glitch-resets every 99*len(string) characters. e.g. if the sign width was 5 characters long, it does this:
   here is my long test input
 0 |here |
 1  |ere i|          ^^^^ never shown
 2   |re is|
 3    |e is |
 4     | is m|
 0 |here |
 1  |ere i|
    ...

This version indexes modulo the text length instead of the sign width, so it runs through the whole string. 106 - 10% = 95 chars.
$l=($s=Read-Host).Length;for(){Write-Host(($s*160).substring(($i=++$i%$l),80)+"`r")-N -F R -B 0;sleep -m 99}

Alternative: sign which cycles like the .gif in the question, 118-10%=106
Because it looks better.
$s=' '*80+(read-host)+' '*80;for(){write-host($s.Substring(($i=++$i%($s.length-80)),80)+"`r")-N -F R -B 0;sleep -m 99}

I know this answer is pretty old, but this question is frontpage right now - Bla to 0 - Write-Host will interpret numbers to colors.

@ConnorLSW Thanks, you got it below 100 chars! And I have no idea why I missed your comment a year ago(!) someone just upvoted and I came back to see what it was.

no worries, I think you can also change while(1) to for() to save some bytes :)

@ConnorLSW so you can, done that too.  (I could probably do that in most of my golfs, it's not something I think of normally).

As you're using for(), you can save one more byte changing $s=(Read-Host)*180;for(){ to for($s=(Read-Host)*180){

Matlab, 76 bytes
What I think is nice here is that you can have vectors as array indices. This returns a vector of the corresponding array entries, which makes it very easy to append the given string independently of the length.
a=input('');k=1:80;while 1;pause(.1);clc;k=mod(k+1,nnz(a));disp(a(k+1));end

Result:

Nice trick with clc. You forgot to add 's' in input

What s do you mean? It works perfectly fine as it is in the Matlab version I have acces to (R2010b).

As it is now, you need to input the string with quotes. To enter the string contents directly (without qoutes) you need a=input('','s')

Now I see, I was not aware of that feature. As the specs do not require this, I think it is ok to require ' delimited strings as input. Many languages need a string delimiter or they would interpret a command line argument in the form of a sentence (words separated by spaces) as multiple arguments anyway.

QBasic, 116 113 bytes - 10% = 105 102
INPUT s$
COLOR 4
1CLS
FOR i=a TO a+79
?MID$(s$,i MOD LEN(s$)+1,1);
NEXT
?
a=a+1
t=TIMER+.1
2ON(TIMER<t)+2GOTO 2,1

Here's a formatted version with some comments:
INPUT s$
COLOR 4   ' 4 is the color code for red (the background's already black)

1 CLS   ' CLear Screen (and mark this as line number 1)

' The variable a represents an offset from the beginning of the string
' As a numeric variable, it is 0 at the beginning of the program
FOR i = a TO a + 79
    ' Print i'th character mod string length (+ 1 because QBasic strings
    ' are 1-indexed)
    PRINT MID$(s$, i MOD LEN(s$) + 1, 1);
NEXT i
PRINT
a = a + 1

' Do a busy-wait for .1 seconds
' (Unfortunately, QBasic's SLEEP command only takes integer values)
' Set t to the time we want to stop waiting, .1 seconds in the future
t = TIMER + .1
' We want to stay on line number 2 while TIMER < t; once that condition is
' no longer true, we want to goto the top of the outer loop (line number 1)
' Since true is -1 and false is 0 in QBasic, adding 2 to the conditional
' gives 1 for true and 2 for false; we can pass these values to the
' ON ... GOTO statement to branch conditionally
2 ON (TIMER < t) + 2 GOTO 2, 1

A couple of notes:

I don't know why the PRINT after the FOR loop is necessary. CLS should reset the cursor to the top left corner each time. But on QB64, at least, if I don't put the extra PRINT in, the marquee ends up on the second line instead of the first. If anybody has QBasic set up on DosBox or somesuch, I'd be interested to know if the same thing happens there or if it's a QB64 bug.
The code has a small glitch because it relies on TIMER (number of seconds since midnight) for the delay. If the code is running at midnight, the marquee will get stuck because TIMER will reset to 0 and always be less than t thereafter.

My first language! IIRC, in QB 4.5 anyway, a semicolon at the end of a printed string means the PRINT statement does not print a carriage return.

@bgStack15 Mine too. :^D The issue isn't really with PRINT but with CLS--after CLS, no matter what was printed before, the next PRINT statement should output at 1,1; but instead, I ran into a situation where it output at 2,1.

Perl, 99 98 bytes (-10% = 89)
$|=@_=split('',pop);printf("\e[31m\r%.80s",join('',@_)x80)while select($a,$a,$a,.1)|push@_,shift@_

Takes its input from command line parameter.
perl marquee.pl "Welcome to Programming Puzzles & Code Golf "

pb, ⌈(216 + 3)*0.9⌉ = 198
+3 bytes for interpreter flag d=1
c^w[Y=-1]{w[B!0]{>}t[X]<[X-79]w[X!0]{t[T-1]w[T=-1]{t[0]}<}vw[T=0]{^w[B!0]{t[B]^b[T]>v}<[X]^w[B!0]{t[B]vw[B!0]{>}b[T]<[X]^w[B=0]{>}b[0]>}v}}^w[1=1]{<[X-80]w[X!0]{<t[B]vb[T]^}w[B!0]{t[B]<b[T]>>}<[X]<t[B]w[B!0]{>}<b[T]}

A pretty horrible score, but considering how hard it is to do anything in this language it could be worse. This answer's ratio of (bytes used to get red text) to (bonus from having red text) is really good, the whole output is turned red with only the c at the beginning!
The time between each tick varies depending on the length of the input string but it's around 0.1 seconds.
By the way, this program's output looks like total garbage because the interpreter is so bad. Every millisecond it clears the terminal and redraws everything, so it gets really flickery.
With comments:
c           # Change paint colour to red

^w[Y=-1]{   # While Y=-1 (arbitrary condition we can break later)

    w[B!0]{>}   # Go to end of input

    t[X]        # Save length of input in T

    # SET T TO MAX(T-79, 0)

    <[X-79]     # Go to (79, -1)

    w[X!0]{     # While X is not 0
        t[T-1]      # Subtract 1 from T
        w[T=-1]{    # If T is now negative
            t[0]        # Set it back to 0
        }
        <         # Move left (position doesn't matter except to end the loop eventually)
    }

    # DONE SETTING T TO MAX(T-79, 0)
    # If T == 0, the string needs to be doubled. Otherwise this part of the program is done

    v           # Move down to break the loop unless this is specifically undone
    w[T=0]{     # While T == 0
        ^w[B!0]{    # For each byte of input
            t[B]^b[T] # Copy it up 1 place
            >v        # Go to the next byte
        }
        <[X]^     # First byte of the copy
        w[B!0]{   # For each byte of the copy
            t[B]      # Save the byte's value
            vw[B!0]{>}# Go to the first empty spot after the original
            b[T]      # Write the saved value
            <[X]^w[B=0]{>} # Go back to the first byte of the copy
            b[0]>     # Erase it and go to the next one
        }
        v       # Back to Y=-1 to reset the loop from the very beginning
    }

}

# After ALL OF THAT nonsense, we're now at (0, 0) and the input string is guaranteed to be
# at least 80 characters long

^
w[1=1]{       # While 1=1 (should hold true until mathematics itself breaks down)
    <[X-80]        # Go to the 81st character
    w[X!0]{        # While X!=0
        <t[B]vb[T]^    # Go left and copy that character down
    }

    w[B!0]{      # For each byte in the string
        t[B]<b[T]>>  # Copy that byte left
    }

    <[X]<t[B]    # Go get the first value (copied to (-1, -1))
    w[B!0]{>}<b[T]# Bring it to the end of the string
}

Perl - 120 bytes (-10% = 108)
$|=1;$_=<>;chomp;for(;;){print "\e[31m",substr(" "x80 .$_,$p++,80)," \r";select($z,$z,$z,0.1);if($p>length()+80){$p=0}}

Perl, 63 (70 chars - 10% for bonus)
Not a hugely different solution to the others, but I wasted my time making it, so I thought I'd post it as well!
$_=<>;s/
/ /;print"\x0d\x1b[91m",substr"$_"x80,$z++%y///c,80 until`sleep .1`

Relies on a Unix-compatible terminal for ANSI codes and the call to coreutils' sleep. The two \x.. chars in the above are actually a literal line-feed and escape char as per this hex dump:
0000000: 245f 3d3c 3e3b 732f 0a2f 202f 3b70 7269  $_=<>;s/./ /;pri
0000010: 6e74 220d 1b5b 3931 6d22 2c73 7562 7374  nt"..[91m",subst
0000020: 7222 245f 2278 3830 2c24 7a2b 2b25 792f  r"$_"x80,$z++%y/
0000030: 2f2f 632c 3830 2075 6e74 696c 6073 6c65  //c,80 until`sle
0000040: 6570 202e 3160                           ep .1`

Ruby, 79 76 75 bytes
t,i=gets.chop*81,0
loop{system'cls'
$><<t[(i=(i+1)%80)..i+79]
sleep 0.1}

I'm still not a ruby expert, possibly can be golfed down.
With red & black same score:
t,i=gets.chop*81,0
loop{system'cls&color 4'
$><<t[(i=(i+1)%80)..i+79]
sleep 0.1}

Perl, 84 bytes (- 10% = 76)
$_=' 'x80 .pop;$|=print"\b \r\e[31m".substr$_,++$p% length,80until select$z,$z,$z,.1

This takes a command line argument which is the text in the marquee.
Explanation:

Prepend 80 spaces to the text and store in $_
Print backspace (\b) and a space ( ). This removes the last character from the previous print. Then print the carriage return and colour.
Print the 80 characters of the text from position $p
$p = ($p+1) % length of text
Sleep for 0.1 secs

Matlab, ⌈188*.9⌉ = 170
This works in Matlab version R2014b or higher. The result is shown on a figure window.
h=text(.1,.1,repmat(' ',1,80),'fontn','courier','ba','k','co','r');set(1,'pos',[90 90 990 90]);axis off
s=input('','s');n=0;while 1
n=n+1;pause(.1)
h.String=s(mod((0:79)+n,numel(s))+1);end

In the following example, text is typed in boldface for better visualization (not done in the above code because it costs a few bytes). Note also that the speed of the GIF animation does not correspond to the required 0.1 s pause, but the timing is correct in the actual figure shown by running the program.

SpecBAS, 130 bytes (-10% = 117)
Multiplies the original string to make it 80 or more characters, then chops it to exactly 80.
TEXT is a command in SpecBAS that works the same way as PRINT (in this example) but saves one character.
The SCALE command adds a few extra characters to the code, but makes it look more marquee-ish.
The program keeps going until you press Esc.
1 INPUT s$: LET s$=s$*CEIL(80/LEN s$)
2 TEXT PAPER 0;INK 2;SCALE 1,2;AT 1,1;s$( TO 80)
3 LET s$=s$(2 TO)+s$(1): PAUSE 5: GO TO 2

bash, 121 bytes
A=$(printf ' %.s' {1..80})$1
while :; do
printf "%s \r" "${A:((P++)):80}"
if [ $P == ${#A} ];then
 P=0
fi
sleep 0.1
done

Japt, 12 bytes
Outputs an integer before starting into the marquee.
Li@Oq80îUéV´

Try it
But, if that's not valid then ...
Japt, 14 bytes
Oq80îUéV´ Lt@ß

Try it
Oq80îUéV´ Lt@ß     :Implicit input of string U
Oq                 :Overwrite output with
  80î              :  Mould the following to length 80
     Ué            :    Rotate U right this many times
       V           :      Second input variable, defaulting to 0
        ´          :      Postfix decerement
          L        :100
           t       :Set timeout for L milliseconds to
            @      :  Run this function
             ß     :    Recursive call with implicit arguments U & (now decremented) V

C, 293 269 bytes
(Newlines added for readability)
This takes input from standard input terminated by EOF; so it's best to enter a string, a newline, and then the EOF (e.g., Ctrl^D).
#include<stdio.h>
#include<string.h>
#define Z '\0'
main(){int i=0,j;char m[80],o[80],n[2];
while(~(j=getchar())&&i<80)j-'\n'?m[i++]=j:0;m[i]=Z;
while(1){for(i=0;m[i]-Z;++i){strcpy(o,&m[i]);
for(j=0;j<i;)*n=m[j++],n[1]=Z,strcat(o,n);
printf("\x1b[40;31m%s\x1b[0m\r",o);}}}

Ungolfed:
#include <stdio.h>
#include <string.h>
#define ANSI_COLOR_SET "\x1b[40;31m"
#define ANSI_COLOR_RESET "\x1b[0m"

int main(void)
{
  int i, j, c;
  char msg[80], out[80], next[2];

  for (i = 0; (c = getchar()) != EOF && i < 80; ++i) {
    if (c != '\n') {
      msg[i] = c;
    }
  }
  msg[i - 1] = '\0';

  while (1) {
    for (i = 0; msg[i] != '\0'; ++i) {
      strcpy(out, &msg[i]);
      for (j = 0; j < i; ++j) {
        next[0] = msg[j];
        next[1] = '\0';
        strcat(out, next);
      }
      printf(ANSI_COLOR_SET "%s\r" ANSI_COLOR_RESET, out);
    }
  }
  return(0);
}

179 bytes

Python 3, 96 bytes
import time;s=input()*80
while 1:print("\033[2J",end=s[:80],flush=1);s=s[1:]+s[0];time.sleep(.1)

This will only work on terminals that support ANSI escape sequences. If you are on Windows, try ansicon.
Hurrah for the flush keyword in Python 3, so we don't have to make an expensive sys.stdout.flush() call.

SmileBASIC BIG, 79 bytes
COLOR 3INPUT S$@L
CLS
FOR I=0TO 79?S$[(I+O)MOD LEN(S$)];
NEXT
WAIT 6O=O+1GOTO@L

I had a nice graphical solution almost done when I realized it has to scroll 1 whole character at a time.

Jelly, 20 19 18 bytes

-1 byte by replacing the first 80 by ⁹ (= 256) because it has to be multiplied by at least 80
-1 byte by changing infinite loop to Çß (from Ç1¿).

ẋ⁹ḣ80ṙ1;”ÆṄœS.1
Çß

With some tricks from @Dennis' answer here. Jelly is newer than the challenge, but not really specifically tailored for it. Suggestions on how to improve are welcome!
If your console is in utf-8, run export LC_ALL=en_US or similar before trying.
Example

Explanation
ẋ⁹ḣ80ṙ1;”ÆṄœS.1         Monadic helper link - Argument: s
ẋ⁹                      Repeat s 256 times.
  ḣ80                   Head. Set {output} to first 80 characters from repeated s.
     ṙ1                 Rotate. Rotates {output} one character to the left.
       ;”Æ              Concatenate character 0D, the carriage return, to {output}.
          Ṅ             Print and return {output}.
           œS.1         Wait 0.1 seconds before returning {output} from the
                        helper link.

Çß                      Monadic main link - Argument: s
Ç                       Execute helper link with argument s. Replace s by
                        result of helper link.
 ß                      Execute this link with argument s (while true).

LOVE2D Lua, 197-10% = 178 Bytes
f=io.open("t.t"):read().."  "love.graphics.setColor(255,0,0)love.window.setMode(640,14)function love.draw()s=""for i=1,80 do n=i+os.clock()s=s..f:sub(n%#f,n%#f) end love.graphics.print(s,0,0)end

Requires the input to be in a file called 't.t' in the root, thus 3 extra bytes were added to the score.
Really basic in functionality, just in a for loop of 80 iterations, append the character at index of i plus the current time in seconds modulated by the length of the current string, giving a repeated 80 character long string of the input, which shifts left as time goes on.
I used LOVE2D For the laughs.

Sinclair ZX81/Timex TS1000/1500 BASIC, 110 bytes 182 bytes (for the listing)
1 LET A$="I LIKE TO SCROLL IT... HELLO MUM, BY DONKEYSOFT... THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG... STILL SCROLLING... "
2 PRINT AT 0,0;A$(1 TO 80)
3 LET A$=A$(2 TO )+A$(1)
4 GOTO 3

It works by printing the first 32 80 characters of the string A$ at screen position 0,0 in line two, and then manipulating the string from position 2 to the end of the sting in line 3 (Sinclair ZX81 BASIC indexes strings from 1 and not zero), therefore adding the first character to the end and passing it back to the A$ variable; then there's a unconditional loop back to line 2.

Commodore 64, 434 bytes
0 A$="I LIKE TO SCROLL IT... SAMPLE SCROLLY ROUTINE FOR CODE-GOLF MADE BY DONKEYS
1 A$=A$+"OFT MMXVII... HELLO MUM... SCROLLING IS FUN, INNIT? GREETZ TO ALL...
2 POKE53280,6:PRINT"{CLEAR}";
3 PRINTLEFT$(A$,40)"{HOME}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}"MID$(A$,41,40)"{HOME}";
4 FORI=0TO99:NEXT:A$=RIGHT$(A$,142)+LEFT$(A$,1):GOTO3

As this requires 80 characters to show, and the C64 by default is only 40 characters, then 40 characters of the scrolly is printed on the top line of the screen area whilst the other 40 are printed near to the bottom.
To clear up what the {HOME} and other symbols translate into as PETSCII then here is a screen grab taken from my emulator:

I will do a full golfed-version when I get CBM PRG Studio installed (or when I'm not on lunch at work).

Ruby, 79 77 chars
->(s){t=0;loop{system("clear");puts (s*80)[t..(80+t)];t=(t+1)%80;sleep(0.1)}}

PHP, 136 bytes
<?php
$s="\e[0;31;40m".substr(str_repeat($argv[1],160),0,160);
while(true){for($i=0;$i<=80;$i++){usleep(100000);echo substr($s,$i)."\r";}}die;

Call it with php -f marquee.php hello\ world to marquee "hello world" string.
For some reason, I had to do 160 characters for the initial string, else the output would be something like hello worlddddddddddddddddddddddddddddddddddddddd, but it'll only loop through 80 characters - I hope that still counts.

It's been a long day, there's probably something I can do to improve it

PHP, 85 bytes
for(;;usleep(1e5))echo substr(str_repeat($s=$argv[1],80),$i=++$i%strlen($s),80),"\r";

takes input from first command line argument; run with -nr.
Starts scrolling with the second character. Add one byte to start at the first character:
Replace =++$i% with %= and ;; with ;;$i++,.

[Wolfram Language (Mathematica)], 110 bytes
(s=StringPadRight[#,80,#];Monitor[While[True,Pause@.1;s=StringRotateRight@s],Style[s,Red,Background->Black]])&

It works well with Mathematica desktop, but not with TIO/ATO (
So if someone can make a running string with TIO, it’ll be cool

source: Stack Exchange

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

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

sort: votes


text:
Telling time in French
Bonjour, PPCG ! Quelle heure est-il ? This means what time is it in French, for that is exactly what this challenge is about.
Telling time in French (at least formally) is a bit different from telling time in English. Telling the time starts out with Il est (It is). Then, you put the hour followed by heures (o'clock). (In case you don't know French numbers, here's a list: http://blogs.transparent.com/french/french-numbers-learn-how-to-count-from-1-to-1000/). If it is 1 o'clock, do une heure for this. For noon, use midi (with no heures), and for midnight use minuit.
Unless the minutes is 00, you then follow it with the number of minutes. There are a few exceptions to this however. For 15 minutes, you want to say et quart, and for 30 minutes you want to say et demi. For anything after 30 minutes, you increase the hour number by one, then add the word moins and 60 - the minutes. So 6:40 P.M is Il est sept heures moins vingt (vingt = 20). 45 minutes would be moins le quart.
Finally, you end it with the time of day. For the morning (1 A.M to 12 P.M), you say du matin. For the afternoon (subjective, but I'll define it as 1 P.M to 5 P.M), you say de l'apres-midi (technically there should be an accent above the e, but eh). And for night (5 P.M to 12 A.M) you say du soir. Note that for midnight and noon (minuit and midi) you don't put any of these afterwards -- the time of day is implied based on which one you use.
As you've probably already ascertained, the challenge here is to print out the current local time in French using these rules. Here's what sample output should look like at assorted times. (The time in the parenthesis does not have to be printed obviously, it's just there so you know what times are):
Il est sept heures du matin. (7:00 A.M)
Il est deux heures de l'apres-midi. (2:00 P.M)
Il est une heure du matin. (1:00 A.M)
Il est huit heures du soir. (8:00 P.M)
Il est midi. (12:00 P.M, Noon)
Il est minuit. (12:00 A.M, Midnight)
Il est cinq heures vingt du soir. (5:20 P.M)
Il est six heures et quart du matin. (6:15 A.M)
Il est neuf heures et demi du matin. (9:30 A.M)
Il est quatre heures moins dix de l'apres-midi. (3:50 P.M, not 4:50!)
Il est midi moins le quart. (11:45 A.M)

This is code-golf, so shortest code wins. Good luck!
EDIT: The period is required.

Related: Spell out numbers in French

What should be the output for 08:41 AM, for instance? Il est huit heures quarante et une du matin (correct) or Il est neuf heures moins dix-neuf du matin (sounds strange)?

Should we necessarily output the result, or can we just return it? Are internal functions that convert numbers to numerals allowed?

Should we put an accent in après-midi? Can we?

If you want. It's not necessary.

As far as the 8:41, use Il est neuf heures moins dix-neuf du matin.  I think the main part of the challenge comes from the moins which is why I'd like it to be like that. (Plus that's the way I was taught how to tell time in French, and this whole challenge is something of a nostalgia trip for me.)

Thanks for clarification :). I personally use "moins" only with round number ("midi moins cinq", "moins dix", "moins le quart", "moins vingt", "moins vingt-cinq"), but usage probably differs between regions, so it's okay ;).

What should the output be for 16:45?
Il est cinq heures moins le quart du soir.
or
Il est cinq heures moins le quart de l'apres-midi.
?

de l'apres-midi I believe.

Fun fact: There is a swiss german "Gelerettli" word for "pocket-watch" coming from rewriting "quelle heure est-il" as it is pronounced. (With li instead of il as a diminuitive.)

PHP - 521 473 bytes
I've added some newlines for readability:
$w=split(A,'AuneAdeuxAtroisAquatreAcinqAsixAseptAhuitAneufAdixAonzeAdouzeAtreizeA
quatorzeAAseizeAdix-septAdix-huitAdix-neufAvingtAvingt et une');$h=idate('H');if(
$r=($m=idate('i'))>30){$h=++$h%24;$m=60-$m;}echo'Il est '.($h?$h==12?midi:$w[$h%12]
.' heure'.($h%12<2?'':s):minuit).($r?' moins':'').($m==15?($r?' le ':' et ').quart
:($m==30?' et demi':($m?' '.($m<22?$w[$m]:"$w[20]-".$w[$m%10]):''))).($h%12?($h-=$r
)<12?' du matin':($h<17?" de l'après-midi":' du soir'):'').'.';

The method used to converting a number to its numeral in French is inspired by this answer on an other challenge by edc65.
Here is the ungolfed version:
/** Define numerals **/
$numerals = [
    '', 'une', 'deux', 'trois', 'quatre',
    'cinq', 'six', 'sept', 'huit', 'neuf',
    'dix', 'onze', 'douze', 'treize', 'quatorze',
    '', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf',
    'vingt', 'vingt et une'
];

/** Get current time **/
$hours = idate('H');
$minutes = idate('i');

/** Check if we need to count in reverse **/
$reverse = $minutes > 30;
if ($reverse) {
    $hours = ($hours + 1) % 24;
    $minutes = 60 - $minutes;
}

echo 'Il est ';

/** Print hours **/
if ($hours === 12) {
    echo 'midi';
}
else if ($hours === 0) {
    echo 'minuit';
}
else
{
    echo $numerals[$hours % 12] .' heure';
    if ($hours % 12 !== 1) {
        echo 's';
    }
}

/** Print minutes **/
if ($reverse) {
    echo ' moins';
}

if ($minutes === 15)
{
    if ($reverse) {
        echo ' le ';
    }
    else {
        echo ' et ';
    }

    echo 'quart';
}
else if ($minutes === 30) {
    echo ' et demi';
}
else if ($minutes !== 0)
{
    echo ' ';

    if ($minutes < 22) {
        echo $numerals[$minutes];
    }
    else {
        echo $numerals[20] .'-'. $numerals[$minutes % 10];
    }
}

/** Print daytime **/
if ($hours % 12 !== 0)
{
    if ($reverse) {
        --$hours;
    }

    if ($hours < 12) {
        echo ' du matin';
    }
    else if ($hours < 17) {
        echo " de l'après-midi";
    }
    else {
        echo ' du soir';
    }
}

echo '.';

Python 3, 586 547 556 506 505 502 498 497 493 Bytes
My first attempt at golfing anything. I’m really not sure about the way I choose, especially the n list. But I wanted to give it a try.
from datetime import*;t=datetime.now()
n='/une/deux/trois/quatre/cinq/six/sept/huit/neuf/dix/onze/douze/treize/quatorze/et quart/seize/dix-sept/dix-huit/dix-neuf/vingt//et demi'.split('/')
n[21:22]=['vingt-'+i for i in['et-une']+n[2:10]]
h,m=t.hour,t.minute;s=h//12;h%=12
e=' d'+('u matin',("e l'après-midi","u soir")[h>4])[s]
try:m=' '[:m]+n[m]
except:m=' moins '+(n[60-m],'le quart')[m==45];h+=1
e,h=('',e,('minuit','midi')[h//12^s],n[h]+' heures'[:h+5])[h%12>0::2]
print('Il est',h+m+e+'.')

Ungolfed:
from datetime import datetime

time = datetime.now()
numbers = [
    '', 'une', 'deux', 'trois', 'quatre',
    'cinq', 'six', 'sept', 'huit', 'neuf',
    'dix', 'onze', 'douze', 'treize', 'quatorze',
    'et quart', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf',
    'vingt', 'vingt-et-une', 'vingt-deux', 'vingt-trois', 'vingt-quatre',
    'vingt-cinq', 'vingt-six', 'vingt-sept', 'vingt-huit', 'vingt-neuf',
    'et demi']

status, hour = divmod(time.hour, 12)
if status:
    ending = " du soir" if h>4 else " de l’après-midi"
else:
    ending = " du matin"

try:
    if not time.minute:
        minutes = ""
    else:
        minutes = " " + numbers[time.minute]
except IndexError:
    hour += 1
    if time.minute == 45:
        minutes = " moins le quart"
    else:
        minutes = " moins " + numbers[60 - time.minute]

if hour%12:    # 'whole' hours
    hours = numbers[hour] + " heures"
    if hour == 1:
        # removing extra 's'
        hours = hours[:-1]
else:          # midnight or noon
    ending = ""
    if (hour == 12 and status) or (hour == 0 and status == 0):
        hours = "minuit"
    else:
        hours = "midi"

print('Il est', hours + minutes + ending + '.')

You can save some 50 bytes with 'minuit#une#deux#...#vingt-neuf#et demi'.split('#'). Might be even shorter to just compress the string somehow.

@Martin yeah, just saw it on Blackhole's answer too. But I wanted to try to shorten it using the repetitions involved with "vingt-xxx". But after some sleep since Il est deux heures moins trois du matin.

@MathiasEttinger a couple corrections, you have 'voingt' instead of vingt, and 21 is 'vingt et un', not 'vingt-et-une'

Thanks for vingt. For 21 it should be vingt-et-une since minute is feminine, the same way that 1:01 AM is il est une heure une du matin.

@BrianTuck Also 21 is vingt-et-un or vingt-et-une since 1990 instead of vingt et un or vingt et une: https://fr.wiktionary.org/wiki/vingt_et_une

@Blackhole Thanks for that, should be fixed now

Javascript (ES6), 506 495 bytes
Edit: Compressed a to save a few bytes.
a=`
un
j
k
yre
h
six
w
v
p}
onldoultreilyorl
seize}-w}-v}-p~~ et un{j{k{yre{h{six{w{v{p
et demi`,[...`hjklpvwy{}~`].map((x,w)=>a=a.split(x).join(`cinq|deux|trois|ze
|neuf|huit|sept|quat|~-|
dix|
vingt`.split`|`[w])),a=a.split`
`,alert(`Il est ${(e=(d=((b=(z=new Date).getHours())+(y=(c=z.getMinutes())>30))%24)%12)?a[e]+` heure${e-1?"s":""}`:d?'midi':'minuit'} ${y?"moins ":""}${y?c-45?a[60-c]:'le quart':c-15?a[c]:'et quart'}${e?[' du matin'," de l'apres-midi",' du soir'][(b>12)+(b>16)]:""}.`)

Explanation:
a = 'compressed string of french numbers with 'et demi' for 30 and 15 removed';
a = // code that decompresses a

// a,b,c,d,e,y,z are all inlined into the first expression that uses them
z = new Date();
b = z.getHours();
c = z.getMinutes();
y = c > 30; // true if 60 - minutes, false otherwise
d = (b + y) % 24; // the next hour if y
e = d % 12; // is it not noon and not midnight?

alert(
    "Il est " +
    // add the hour
    // if d is not 0 or 12, add d + 'heure(s)'
    (e ? a[e] + ` heure${e-1?"s":""}` : d ? 'midi' : 'minuit') +
    " " +
    (y ? "moins " : "") + // add 'moins' if necessary

    ( // add the minute
      y? // necessary to subtract from 60?
        c-45?
          a[60-c] // add normal number word
          :'le quart' // handle special case for 45
        :c-15?
          a[c] // add normal word
          :'et quart' // handle special case for 15
    ) +
    ( // select appropriate ending
      e? // is it not noon and not midnight?
        // create array of endings
        [" du matin"," de l'apres-midi"," du soir"]
          // selects item 0 if b in [0, 12], item 1 if b in [13, 16] and item 2 if b > 16
          [(b > 12) + (b > 16)]
        :"" // if it's noon or midnight, no ending is necessary
    ) +
    "." // add period
)

C, 860 835 794 bytes
Absolutely horrendous, but can probably be made even shorter. Many newlines were added for formatting purposes on this site. The actual source code has newlines after the #includes and #defines, but everything starting from char* to the last w(".\n");} are all in one line. I shortened it by removing the values from 22,...,29 in the string array, instead reusing the strings for 2,...,9 and prepending a "vingt-" when appropriate. (I really hope I didn't introduce a bug!)
#include <sys/time.h>
#define w printf
#define q tm_min
#define r tm_hour
char*a[]={"minuit","une","deux","trois","quatre","cinq","six","sept","huit","neuf","dix",
"onze","douze","treize","quatorze","quart","seize","dix-sept","dix-huit","dix-
neuf","vingt","vingt-et-une",0,0,0,0,0,0,0,0,"demi"};
h=1,s=1,m,e,l,t,p,o,v;struct tm j;
main(){struct timeval i;gettimeofday(&i,0);localtime_r(&i.tv_sec,&j);
j.q>30?m=1,++j.r,j.q=60-j.q:j.q==15||j.q==30?e=1:0;j.q>21&&j.q<30?v=1:0;
j.r%12?j.r<12?t=1:j.r-m<17?p=1:(o=1):0;
j.q==15&&m?l=1:0;j.r%12?j.r%12==1?s=0:0:(h=0,s=0);
w("Il est ");j.r==12?w("midi"):w("%s",a[j.r%12]);h?w(" heure"):0;s?w("s"):0;
m?w(" moins"):0;e?w(" et"):0;l?w(" le"):0;
j.q?v?w(" vingt-"):w(" "),w("%s",a[j.q-20*v]):0;
t?w(" du matin"):p?w(" de l'apres-midi"):o?w(" du soir"):0;w(".\n");}

Like this:
#include <sys/time.h>
#define w printf
#define q tm_min
#define r tm_hour
char*a[]={"minuit","une","deux","trois","quatre","cinq","six","sept","huit","neuf","dix","onze","douze","treize","quatorze","quart","seize","dix-sept","dix-huit","dix-neuf","vingt","vingt-et-une",0,0,0,0,0,0,0,0,"demi"};h=1,s=1,m,e,l,t,p,o,v;struct tm j;main(){struct timeval i;gettimeofday(&i,0);localtime_r(&i.tv_sec,&j);j.q>30?m=1,++j.r,j.q=60-j.q:j.q==15||j.q==30?e=1:0;j.q>21&&j.q<30?v=1:0;j.r%12?j.r<12?t=1:j.r-m<17?p=1:(o=1):0;j.q==15&&m?l=1:0;j.r%12?j.r%12==1?s=0:0:(h=0,s=0);w("Il est ");j.r==12?w("midi"):w("%s",a[j.r%12]);h?w(" heure"):0;s?w("s"):0;m?w(" moins"):0;e?w(" et"):0;l?w(" le"):0;j.q?v?w(" vingt-"):w(" "),w("%s",a[j.q-20*v]):0;t?w(" du matin"):p?w(" de l'apres-midi"):o?w(" du soir"):0;w(".\n");}

Ungolfed version, with no "space optimizations" (also pretty ugly):
#include <stdio.h>
#include <string.h>
#include <time.h>

#include <sys/time.h>

int main(int argc, char *argv[])
{
        struct timeval tv;
        struct tm local_time;
        char *nums[] = {"minuit", "une", "deux", "trois", "quatre", "cinq", "six", "sept", "huit", "neuf", "dix", "onze", "douze", "treize", "quatorze", "quart", "seize", "dix-sept", "dix-huit", "dix-neuf", "vingt", "vingt-et-une", "vingt-deux", "vingt-trois", "vingt-quatre", "vingt-cinq", "vingt-six", "vingt-sept", "vingt-huit", "vingt-neuf", "demi"};
        int heure = 1;
        int s = 1;
        int moins = 0;
        int et = 0;
        int le = 0;
        int matin = 0, aprem = 0, soir = 0;

        memset(&local_time, 0, sizeof local_time);
        gettimeofday(&tv, NULL);
        localtime_r(&tv.tv_sec, &local_time);

#if 0
        local_time.tm_min = atoi(argv[1]);
        local_time.tm_hour = atoi(argv[2]);
#endif
        if (local_time.tm_min > 30) {
                moins = 1;
                local_time.tm_hour += 1;
                local_time.tm_min = 60 - local_time.tm_min;
        } else if (local_time.tm_min == 15 || local_time.tm_min == 30) {
                et = 1;
        }

        if (local_time.tm_hour % 12) {
                if (local_time.tm_hour < 12)
                        matin = 1;
                else if (local_time.tm_hour < 17)
                        aprem = 1;
                else if (local_time.tm_hour == 17 && moins)
                        aprem = 1;
                else
                        soir = 1;
        }

        if (local_time.tm_min == 15 && moins)
                le = 1;

        if (local_time.tm_hour % 12 == 0) {
                heure = 0;
                s = 0;
        } else if (local_time.tm_hour % 12 == 1) {
                s = 0;
        }

        printf("Il est ");

        if (local_time.tm_hour == 12)
                printf("midi");
        else
                printf("%s", nums[local_time.tm_hour % 12]);

        if (heure)
                printf(" heure");

        if (s)
                printf("s");

        if (moins)
                printf(" moins");

        if (et)
                printf(" et");

        if (le)
                printf(" le");

        if (local_time.tm_min)
                printf(" %s", nums[local_time.tm_min]);

        if (matin)
                printf(" du matin");
        else if (aprem)
                printf(" de l'apres-midi");
        else if (soir)
                printf(" du soir");

        printf(".\n");
        return 0;
}

(The #if 0 stuff was just for testing different time values through the command-line).

Props for attempting a C answer :) Look on the bright side -- it's probably shorter than it would have been in Java!

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