text:
GO OUT AND VOTE
Today is November 8th, 2016, Election Day in the United States of America.
If you are a U.S. citizen eligible to vote, then go out and vote if you haven't already before answering this challenge. Do not discuss who you voted for. It only matters that you voted.
If you are not a U.S. citizen or not eligible to vote, then, before answering this challenge, do the U.S. a favor by telling anyone you know who is an eligible citizen to go out and vote if they haven't already.
Challenge
Write a program that indicates that you voted, like a digital "I Voted" sticker.
It should take no input and must output in a reasonable way the phrase I Voted where the I, o, and e are red (#FF0000) and the V, t, and d are blue (#0000FF). The background must be white (#FFFFFF).
For example:

These colors are of course representative of the American flag (though not the official colors). Red comes first simply because it comes first in the common idiom "red white and blue".
To be valid, an answer must:

Use the colors specified in the arrangement specified.

Use a single legible font and font size. The example uses 72pt Times New Roman bold but any common font above 6pt is probably fine.

Have just the phrase I Voted on a single line, capitalized correctly, with a clear space between the two words. It shouldn't look like IVoted.

Not indicate who the answerer voted for or supports for president or any down-ballot races. Let's not start any internet debates. This is about celebrating voting, not candidates.

Any reasonable way of displaying or producing the output is valid, such as:

Drawing the text to an image that is then displayed, saved, or output raw.

Writing the text to a console using color formatting. In this case you may approximate pure red and blue if necessary, and it's ok if only the area directly behind the text can be made white.

Displaying the text on a WPF/Windows form.

Outputting an HTML/RTF/PDF file with the text.

Please post an image of your output.
The shortest answer in bytes wins.

A bit disappointed my actual sticker doesn't look like yours.

"It only matters that you voted." - @HelkaHomba ... That's like saying "it doesn't matter what code you write, as long as you wrote some code." :/

@MichaelYaeger Well, writing some code is better than writing none. Voting is better than not voting. Chances are people will put some thought into coding and voting if they choose to do it. But really I said that to help avoid angry debates.

If it helps anyone, vowels are red, consonants are blue.

@mbomb007 Or more usefully, the letters with odd code points are red, and the letters with even code points are blue.

Can red letters be one font and blue another, or red one size and blue another, or blue letters bold, etc.?

@ETHproductions Also a stretch, so no.

@Calvin'sHobbies - not to attack the challenge - but the initial part of your post is very misleading: ...then go out and vote ... It only matters that you voted. -  Yes, everyone SHOULD vote (esp. with how many people don't), but everyone who votes has the responsibility to vote informed, and opt out if you deem yourself uninformed, or better yet, ensure yourself to never be uninformed. Your vote matters, and should be treated as such. Study the ballot ahead of time for all the different elections, and know your choice well before election day. Don't throw away your vote with ignorance.

@James You make a fair point, but see the undeleted comments above.

Ya know, seeing this in the HNQ on November 14th (2 hours away from the 15th) does make this a teensy weensy bit late...

Does the program have to exit, or can it just hang?

@anonymous2 A window where the message is drawn that stays open is fine, but if there's no gui, it should end normally.

@allthepeoplewhoarearguingaboutgoingoutandvoting, check out this link about what Mike Rowe says about it. It's definitely something you might want to think about... https://www.facebook.com/TheRealMikeRowe/posts/1254500967893377

 Minecraft Chat (vanilla 1.10 client, spigot 1.10 server): 19 bytes
&4I &1V&4o&1t&4e&1d

or from the clientside:
§4I §1V§4o§1t§4e§1d

Minecraft uses a color coding system with these colors programmed in.

Mind the rules:

Writing the text to a console using color formatting. In this case you may approximate pure red and blue if necessary, and it's ok if only the area directly behind the text can be made white.

All of these are true, as:
the red and blue ARE approximations (though still very similar).
The background in Minecraft chat is transparent, meaning that it's possible to put this on a white background (such as an empty world or a world which is still generating).

Wow. I'm speechless. That's a very clever answer!

I don't think Minecraft Chat is Turing-complete or considered a programming language (although this may no longer be a requirement). Very creative though! :)

@Shebang http://gaming.stackexchange.com/questions/20219/is-minecraft-turing-complete  Minecraft chat has (nearly) all the same commands as command blocks, and  certainly all the commands from back when the question was asked :-)

@HelkaHomba I'll be home in 2 hours! count on it then!

Wait I thought they removed the ability to do that I remember spending a whole day trying to get colors

Technically, in vanilla Minecraft, the &s should be §s

Hmmm I think it can be done in Quake 3, too

For what versions does this work? Certainly not for 1.10.

@Oliver thankyou, I've added that possible interpretation. In vanilla minecraft, the ampersand is filtered and escaped. In Spigot (a modified server), the ampersand is not filtered.

Note that this won't work on some Spigot (and other third-party servers) if the admin didn't decide to allow color-code formatting, which may very well be the case.

Also, the server will kick the client any time it receives a § from a client, so a modded server is a requirement to use this exact code.

@JustinKrejcha do you have a source for that?  I've never had problems with the symbol before.

@tuskiomi According to the wiki, the section symbol can only be entered into a book and quill and command blocks. Additionally, I just tried it on a test server (with a client that allows me to enter the symbol) and I got kicked for "Illegal characters in chat".

I must say very impressed. Never would have thought of using Minecraft Chat!

& isn't valid on spigot without plugins; if you allow it then you should count the code of the plugin that's translating it.  However, it is valid on unmodified Minecraft Classic (though getting a classic server to work is somewhat difficult nowadays).

@Pokechu22 It works on my pluginless spigot server.

This was Extremely Impressive!!

C, 82 80 78 74 54 bytes
Thanks to @WillihamTotland and @criptych for saving 2 bytes each!
f(){puts("␛[47;31mI␛[34m V␛[31mo␛[34mt␛[31me␛[34md");}

Where the ␛s represent 0x1B bytes (escape key). As this code contains unprintable control characters, here is a reversible hexdump:
00000000: 6628 297b 7075 7473 2822 1b5b 3437 3b33  f(){puts(".[47;3
00000010: 316d 491b 5b33 346d 2056 1b5b 3331 6d6f  1mI.[34m V.[31mo
00000020: 1b5b 3334 6d74 1b5b 3331 6d65 1b5b 3334  .[34mt.[31me.[34
00000030: 6d64 2229 3b7d                           md");}

Output on my phone:

What does the a"\x1B[%dm" do?

@KritixiLithos that line defines a as "\x1B[%dm", which is an ANSI escape sequence for coloring, with a placeholder. The numbers in printf() fill those placeholders.

Two bytes can be shaved off by replacing a with "\x1B[47;31m" and defining b to "\x1B[34m", then using puts with alternating a and b prefixes.

However, if you want to clean up the output stream with a final a and ,0 (which you should when doing it live, but this is codegolf ;), the solution as stated is shorter by two bytes.

You can save another 2 bytes with "\33" instead of "\x1B".

Extending what criptych said, I don't know if this is allowed, but you'd save another four bytes by using a literal escape character instead of \33. Not sure what the C standard thinks of that...

@yellowantphil I've thought that too, but it would be hard to test on mobile :)

I have an ssh app and keyboard that lets me type control characters, so I could do it if I wanted to. :) It works fine on my computer.

@yellowantphil I tried making an hexdump but it didn't work, can you please post a dump with 0x1B (escape character)?

@betseg I tried, but the edit reviewers said I was a spammer. I can't fit the hexdump in a comment, so never mind.

This is truly unreadable. a should be r so as to have meaningful variable names :-) More seriously though, it's not a program, missing main as it is.

@paxdiablo according to this meta thread, functions are OK for code golf.

I stand corrected :-)

Google Blockly, 10 14 blocks, 28 41 35 blytes
Code

Output

Try it here
Not counting the hide turtle block because it's just aesthetics.
A blyte is a combination of a block and a byte, there's no meta post yet as how to count this, but I'll create one later. As for now, this is how I count:

I   o  e, 8 blytes
V  t   d, 10 blytes (2 leading spaces here)
Colours, 1 blyte each, 2 total
90, 2 blytes
999, 3 blytes
0, 1 blyte
turn right, 2 blytes
move forward, 2 blytes
normal blocks, 1 blyte each, 5 total

Since Google Blockly is rarely used for golfing and I'm thinking waaay outside of the box for this challenge, I hope this is a valid submission.

For the record this is valid. It's nice to see unique languages. Though, unless there's a meta concensus on byte-counting in Google Blockly, I may ignore it when selecting a winner.

You may find discussion here relevant. CC @HelkaHomba.

Have you though about replacing those three spaces in I   o with two em spaces?

Google Blockly will be translated to JavaScript and then run. You need to Inspect Element and run code in Blockly API to get the real JavaScript code.

Wait so could Scratch be used?

HTML, 52 bytes
I <c>V<e>o<c>t<e>e<c>d<style>*{color:red}c{color:0ff

Remove spaces to save bytes

@KritixiLithos you mean space (singular) instead of spaces (plural). The first can indeed be removed, the second however would change the text to Ivoted.

Mind adding an image? (Or stack snippet.)

Also, I think that #FF0000 -> #F00 and #0000FF -> #00F works

Actually there is a constant for #F00: red.

Also IMO blue instead of #00F looks nicer

If you replace b with c you lose the boldness and if you nest, you can save 14 bytes
<style>r{color:red}c{color:blue}</style><r>I</r> <c>v<r>o</r>t<r>e</r>d</c>

Also leaving out the last closing tag should work: <style>r{color:red}c{color:blue}</style><r>I</r> <c>v<r>o</r>t<r>e</r>d (please test before editing)

Also you can move style to the end to remove the closing tag for style and the last closing brace.

<r>I</r> <c>v<r>o</r>t<r>e</r>d</c><style>r{color:red}c{color:blue67 bytes - credit @betseg

also, you don't need the closing tags.

Why not turn this into a Stack Snippet?

<r>I <c>V<r>o<c>t<r>e<c>d<style>r{color:red}c{color:blue works

If you style *, you don't need r tags and save some bytes. You can also continue the "don't close the final tags" mentality and get an answer of 56 bytes: I <c>v</c>o<c>t</c>e<c>d<style>*{color:red}c{color:blue

actually you can just keep nesting without closing I <c>V<e>o<c>t<e>e<c>d<style>*{color:red}c{color:0ffand note change to blue 0ff

@tolos color:0ff doesn't do anything for me in Firefox 49. What browser are you using?

chrome 54, and other characters to reach the minimum required to post.

@tolos It does indeed work in Chrome! But why?

@ETHproductions see http://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color

@tolos The technique described there applies to e.g. <c color="chucknorris">, but not c { color: chucknorris; }. I would expect c { color: 0ff; } to be cyan anyway, so I wonder what's really going on here...

@Neil feel free to edit the question.

@tolos it fails in Chrome.

Sadly the current version doesn't seem to work as a Stack Snippet, the latest version that works for me is the c{color:blue} version.

@Neil Stack snippets automatically insert a doctype. Omitting the # before the color value is only supported in quirks mode.

0ff is invalid. It should be #0ff. Actually it should be #00f.

LaTeX, 147 126 bytes
\documentclass{proc}\input color\begin{document}\def\z{\color{red}}\def\y{\color{blue}}\z I \y V\z o\y t\z e\y d\end{document}

Saved 21 bytes and got better kerning thanks to @AndreïKostyrka.
This prints an a4 page with this on the first line (note that this also prints page 1 on the bottom):

I would have thought LaTeX would typeset the Vo kerning prettier... But apparently it considers each letter separately due to the colours.

@sanchises Since each letter is in a separate command, I think it destroys proper kerning.

Yeah exactly. Although I'm sure it would be possible somehow if golfing was not a requirement.

@sanchises this is definitely possible, but this is indeed longer than this ugly solution.

\documentclass{proc}\input color\begin{document}\def\z{\color{red}}\def\y{\color{blue}}\z I \y V\z o\y t\z e\y d\end{document} saves 21 bytes and results in 126 bytes of pure typographical beauty.

@AndreïKostyrka Thanks!

\documentclass{proc}\input color\begin{document}\def\y{\color{blue}}\color{red}{I{\y~V}o{\y t}e{\y d}\enddocument saves 13 more bytes. By the way, \input color doesn't work for me (\usepackage{color} does). What version of pdflatex are you using (pdflatex --version)? I'm using 3.14159265-2.6-1.40.17 (TeX Live 2016).

Windows 10 Batch, 51 50 bytes
@color fc&echo I ␛[94mV␛[91mo␛[94mt␛[91me␛[94md␛[m

Where ␛ represents the ANSI Escape 0x1B character. Outputs using colour formatting. Edit: Saved 1 byte thanks to @brianush1. I tried writing the code to generate this but it took 97 bytes. Output:

You can golf it down by 1 byte if you use @color fc&echo I...

interesting, I didn't realise Windows terminal supported ANSI escape sequences

@MarkKCowan It's only Windows 10, and (I think!) post Redstone Update. It's one of the few things that stop me from just installing XP over it.

@wizzwizz4 ConEmu supports these too :) Indeed this is from Windows 10 anniversary (ie redstone 1)

@Asu I installed XP over it.

JavaScript, 71 bytes
console.log('%cI %cV%co%ct%ce%cd',r='color:red',b='color:blue',r,b,r,b)

Makes use of console.log's ability to print in color. Doesn't work in a stack snippet so you should paste this answer to the console to test it.

Picture credits to @Mast

That's exactly what I just came up with, haha. I think the shortest alternative would be console.log([...' I Voted'].join`%c`,r='color:red',r,b='color:blue',r,b,r,b)

Doesn't work in Node.js either. :(

I was surprised this actually works, but it does.

R, 113 85 81 74 73 55 bytes
Edit: Saved a bunch of bytes thanks to @rturnbull and @JDL
plot(8:1,0:7*0,pc=el(strsplit("detoV  I","")),co=2:1*2)

The size of the output (and spacing etc) depends on the resolution of the currently open graphics device. Tested in RGui and RStudio on my monitor and produces:

Oh, I've never seen el() before. Thanks for helping me learn more R! Since text is vectorized, you can skip the for-loop and just write: text(seq(.3,.6,.05),.5,s,col=c("red","blue")). (I modified your x positions for golfier code, although the spacing may be a little less neat.)

Also, thanks to partial argument matching you can use co= rather than col=. And finally, 6:12*.05 is several bytes shorter than seq(.3,.6,.05).

Good catch! And now I realize that 6:12/20 is of course 1 byte shorter than 6:12*.05, apologies for leading you astray and suggesting suboptimal edits.

Aren't the colours off? Shouldn't the "I" and "V" be different colours?

If the colours aren't wrong, then plot(7:1,0:6/Inf,pc=el(strsplit("detoV I","")),co=1:2*2) is 56 bytes.

Fair enough: add a space, plot(8:1,0:7*0,pc=el(strsplit("detoV  I","")),co=1:2*2) is 55 bytes. (Edit: SO automatically reduces a double space to one space, but there should be two in the quoted string! Also saved two bytes by replacing \Inf with *0)

Did you correct for the SO auto-correct? (I.e. the string should be "d-e-t-o-V-space-space-I")

@JDL I must be stupid somehow. Updated the answer, thanks!

I'm pretty sure el() improves 99% of all previous strsplit answers by 1 byte.

Brings it back up to 60, but gets the colors correct as specified: plot(c(1,3:7),0:5*0,pc=c("I","V","o","t","e","d"),co=c(2,4)) (red I, blue V).

@JonathanCarroll I just changed 1:2*2 to 2:1*2 instead. Thanks, didn't notice the colors were still wrong though.

LÖVE, 152 142 136 bytes
Let's show some löve for a fun little prototyping language! It's not perfect for the task of golfing (c'mon, it's LUA based), but it's easy to write.
function love.draw()l=love.graphics
a=255
l.setBackgroundColor(a,a,a)s=l.setColor
p=l.print
s(a,0,0)p('I   o e')s(0,0,a)p('  V  t d')end

Screenshot:

Fully ungolfed version:
function love.draw()
    love.graphics.setBackgroundColor(255,255,255)
    love.graphics.setColor(255,0,0)
    love.graphics.print('I   o e')
    love.graphics.setColor(0,0,255)
    love.graphics.print('  V  t d')
end

I löve that you used something other than Java.

So many 255… A variable for them?

@manatwork Yep. Not sure how that slipped by. Thanks!

I don't know the language--what would a full program look like?

@ConorO'Brien This is a full program. love.draw() is a built-in function that you override, which runs on the draw step. There's also things like love.update() and love.load() for various parts of the render loop, but they're optional. It's a nice language, and you can get started with it very easily. I sometimes use it to prototype game ideas.

@Geobits Whoa, that's pretty nifty.

does lua support hexnumber literals? if so, you could change a=255 to a=FF.

Not as a bare FF, no :/

How come the spaces in the second print don't overwrite the chars in the first?

@cat They just don't. It's not like I'm overprinting them on a console, it's a graphical print. So a space here is just "paint nothing in this area", not "paint this area background colored".

Can't you remove the alpha parameter while setting the colour, like l.setBackgroundColor(a,a,a)?

@KritixiLithos Huh. I didn't even check that since there wasn't an overload listed like that for setColor(), but it appears it works for both. Thanks!

And also, can you not shorten the setBackgroundColor by calling it with just one parameter setBackgroundColor(a) like my Processing answer?

No, there is a one-arg variant, but it expects an rgb packed-int, so it ends up being longer that way.

ever since I'm reading this site, this is the first LÖVE answer I see. I'm honestly touched

@ZoltánSchmidt Thanks! There are a few other LÖVE answers, if you want to take a look through them :D

Hot Soup Processor, 48 bytes
color 255
mes"I  o e
pos,0
color,,-1
mes"  V t d

The ungolfed version is:
color 255,0,0
mes "I  o e"
pos 0,0
color 0,0,255
mes "  V t d"

If you bear in mind that mes (message) is HSP's echo, I think this is fairly readable.
Weirdly, if you try to do pos or pos,, the blue line doesn't overwrite the red line and appears beneath it. Even weirder, color is only meant to take values in 0-255, but 0,0,-1 works for blue, 0,-1,0 works for green and -1,0,0 works for... black? (-257,0,0 and 511,0,0 work for red though, so something's funky about the mod 256 going on)

Why don't the spaces in the second mes overwrite the first?

@cat Spaces don't actually draw anything, it just advances the cursor position in a sense

Clever using -1 for 255. Have a +1

@Cyoce Or maybe it's actually -255?

MATLAB, 74 bytes
We create a white 50x50 (one column for each state) background using imshow of an array of ones. We then display a text, using my trick of shortening property names to get the colours. Since the default font is not fixed width, the text is padded with spaces.
imshow(ones(50))
text(2,9,'I   o e','Co','r')
text(8,9,'V  t  d','Co','b')

MATLAB, 99 bytes, fixed width font
The first version uses fiddling with spaces and coordinates to get a proper kerning on the default font, and might not display properly on your computer. Instead, we can use a fixed width font, like Courier (or, for some more bytes, FixedWidth which works on any system that has a fixed width font installed). This does come at the cost of quite a few extra bytes. We can mitigate this slightly by using a for loop to print the text. The text and corresponding colours are stored in a cell array. The background needs to be a little bit larger.
imshow(ones(80))
for y={'I  o e ','  V t d';'r','b'}
text(9,9,y{1},'Co',y{2},'FontN','Courier')
end

Matlab, 80 bytes bonus edition
Sadly, underlined blue text is not allowed. Otherwise, this answer would have highlighted some interesting behaviour in MATLAB. You can print red text using fprintf(2,txt), and you can print blue underlined text with fprintf('<a href="">txt</a>'). Combining this works... sometimes. Completely at random, it may also create red underlined text. You can issue drawnow between consecutive f calls if this is the case on your system.
f=@(p)fprintf(2,'%s<a href>%s</a>',p(1:end-1),p(end));f('I V');f('ot');f('ed');fprintf('\n')

You can write <a href> instead of <a href="">. If you don't like it, you can use <a href=#>.

@IsmaelMiguel Clever. <a> didn't work.

Using only <a> isn't considered a clickable link. to get it's blue color, it has to be considered as one. In CSS, the selector may be a[href]. As long as the attribute href is there, it is a clickable link. That's why using only <a> won't work.

ImageMagick, 102 bytes
magick xc:[x60] -fill red -draw 'text 5,30 "I     o  e"' -fill blue -draw 'text 15,30 "V   t   d"' x:

Ungolfed:
magick convert canvas:white[60x60!] \
       -fill red  -draw 'text 5,30   "I     o  e"' \
       -fill blue -draw 'text 15,30      "V   t   d"' \
       show:

Golfing the full ImageMagick command consisted of

not explicitly calling the default convert utility
using xc: instead of canvas: (xc: is an old synonym for canvas:; I don't foresee ImageMagick ever eliminating it)
not specifying the canvas color but relying on ImageMagick's default, which happens to be white
removing the width 60 from the geometry (when it's omitted, width==height)
removing the "!" from the geometry which is only needed to produce a non-square canvas, like canvas:white[60x30!]
using the older x: instead of show: as the output file (assumes that ImageMagick was built with X support)
removing some whitespace that I had used to line up the text strings
joining the multiple lines of the command (removed the backslash-CR between lines)

If you are so inclined after the election, add 12 bytes -rotate 180 preceding the show: directive:

I love how the ungolfed version drastically differs from the golfed one.

Mathematica (REPL image output), 65 49 bytes
Overlay@{"I  o e"~Style~Red,"  V t d"~Style~Blue}

Graphical REPL expression.

"Private use?" What is that?

@ConorO'Brien http://enwp.org/Private_Use_Areas

This is 49 bytes: Overlay@{"I  o e"~Style~Red,"  V t d"~Style~Blue} (there are supposed to be two spaces between I and o and before V)

Bash, 35 bytes
My script looks like this
echo "^[[47;31mI hope^[[34md^H^H^Ht^H^H^Hv"

xxd of script file:
0000000: 6563 686f 2022 1b5b 3437 3b33 316d 4920  echo ".[47;31mI
0000010: 686f 7065 1b5b 3334 6d64 0808 0874 0808  hope.[34md...t..
0000020: 0876 22                                  .v"
Typing it: ctrl-v-esc and ctrl-v-h will insert the escapes and backspaces (^[ and ^H).

How does this work? An explanation would be super

@cat it appears to write all the red letters (with "h" and "p" as stand-ins), then sets the colour to blue and writes "d" at the end. Finally it moves the cursor left to add the "t" and "V" over the earlier stand-ins (ascii 0x08, represented by "^H" in the display above, moves left 1 character). Clever way of avoiding lots of escape sequences for colour changes. It also uses a literal escape character (0x1B, represented as "^[") which saves some space compared to similar answers like mine.

Also: could save 3 bytes by assuming the terminal is set to a white background by default (most other terminal answers already assume this).

You can save a byte by removing the two quotes and adding a backslash (escape character) before the semicolon. Also your script has a lower case v (your command line one is fine).

Java, 322 319 318 309 304 229 217 bytes
-9 Bytes thanks to kevin.
-75 Bytes thanks to Angzuril, nice callout on the old awt classes, always forget those exist.
-12 Bytes thanks to user902383.
import java.awt.*;
void n(){new Frame(){{add(new Panel(){public void paint(Graphics g){int i=0;for(String c:"IVoted".split("")){g.setColor(i%2<1?Color.RED:Color.BLUE);g.drawString(c,i++*8,10);}}});setVisible(0<1);}};}

Output:

JFrame j= can be golfed to Frame j=; (c==' '||i++%2==0)? can be golfed to c<33|i++%2<1? and true can be golfed to 1>0. Also, @HelkaHomba, is this a valid output? Since it also has spaces between the V o t e d? Oh, and why 0,0,999,99? 0,0,99,99 is large enough for the text on my screen.

@KevinCruijssen 99 covers the text, but not the min size of the panel. Also, it doesn't have spaces; if you change the font to something where the characters are guaranteed to be the same width, it'd look better.

Your byte count was wrong because you separated the imports from the rest of the code. You have to have it all together, because you need to count the newline between them.

(c<33||i++%2<1)? can stil be golfed by three bytes by removing the parenthesis and change || to |

I found some more things to golf: new JComponent to new Container (-1); remove char c="IVoted".charAt(i); and change g.drawString(c+"" to g.drawString("IVoted".charAt(i)+""(-8).

I also tried to golf the colors but couldn't find anything useful. Changing Color.WHITE;Color.RED;Color.BLUE; to Color x=null;x.WHITE;x.RED;x.BLUE; or Color x;x=Color.WHITE;x.RED;x.BLUE; is both longer, and changing i%2<1?Color.RED:Color.BLUE to new Color(i%2<1?255<<16:255) or new Color(255<<(i%2<1?16:1)); is also both slightly longer.. :(

Oh, two more things to golf xD for(int i=0;i<6;){g.setColor(i%2<1?Color.RED:Color.BLUE);g.drawString("IVoted".charAt(i)+"",i++*8,10);} to for(int i=0;i<6;g.setColor(i%2<1?Color.RED:Color.BLUE),g.drawString("IVoted".charAt(i)+"",i++*8,10)); (-2); and new JFrame(); to new Frame(); (-1)

First improvement, change Frame j=new JFrame();j.add(new JComponent() to Frame j=new Frame();j.add(new Container() and you can also drop the import import javax.swing.*; and g.setColor(Color.WHITE);g.fillRect(0,0,99,99) as a result (-63)

Another, change for(int i=0;i<6;){char c="IVoted".charAt(i); and g.drawString(c+"", to int i=0;for(String c:"IVoted".split("")) and g.drawString(c, gives (-7)

void n(){new Frame(){{add(new Panel(){public void paint(Graphics g){int i=0;for(String c:"IVoted".split("")){g.setColor(i%2<1?Color.RED:Color.BLUE);g.drawString(c,i++*8,10);}}});setVisible(0<1);}};} allows you to reduce by 12 bytes

@KevinCruijssen damn you've been helping my answers for 3 years now?! Didn't realize we went this far back ;).

@MagicOctopusUrn Hehe. :) I joined this stackexchange in March 2016, although I doubt I've made many suggestions in the first few months. I mainly received suggestions back then, haha. Now I'm making suggestions myself pretty often (although I still receive them as well of course ;p)

You can replace setVisible(0<1) by show(), saving 9 bytes.

PowerShell v2+, 71 59 57 55 bytes
"I Voted"[0..6]|%{Write-Host -b w -n -f (9,12)[$_%2]$_}

Saved two bytes thanks to @flashbang ... saved two more thanks to @ConnorLSW
Takes "I Voted" and turns it into a char-array, then loops |%{...}. Each letter, we execute Write-Host with the -background color to White, -noNewLine, and the -foreground color to be the appropriate index. This leverages the fact that odd ASCII values are Red, while even ASCII values are Blue via $_%2 as the index.
Console colors in PowerShell are very limited, so this is the closest approximation I could get. It would be golfier to use 4 (DarkRed) for the red, but it doesn't look right, so I'm sacrificing a couple bytes for the sake of color accuracy.
Below is the output, followed by the 16 available colors the console can display. Note that the background isn't truly white, since Microsoft in their wisdom opted to have the background colors ever-so-slightly-off from the foreground colors.

IIRC, in ancient stuff, you had 4 bits for the foreground and 3 bits for the background, so backgrounds could only be the 'dark' colors 0-7. Is the console still following that?

@Hurkyl Kinda. It appears to be based on the EGA color palette, but I'm not sure the historical reasons for PowerShell keeping that scheme. Likely something buried in the Win32 API backwards-compatibility that forced them to only use those 16 colors.

It doesn't work if you set the background color to 15?

@Random832 it is for the sake of the white background of the sticker.

@geisterfurz007, TimmyD, I was asking if you could set the background to "15" rather than "white" [since the actual background in your image appears to be #7] to get a brighter white. But on looking at it more, your whole display looks strange - the borders between the lines in your example and the gray line between "I" and the following space don't make sense if PowerShell is being run in the console - are you using some other tool like ConEmu? If so it doesn't make sense to blame Microsoft for this.

@Random832 Ah. In the code, the background is set to 15. I used white in the 0..15 example just to show the colors. I think this is at least one of the (many) differences between the console and the ISE, as running this in the console is more white, though it's still not 255,255,255 on my computer.

saved  2 bytes using a nice little loop hack on the string. "I Voted"[0..6]|%{Write-Host -b w -n -f (9,12)[$_%2]$_}

Bubblegum, 28 bytes
0000000: 938e 3636 ccf5 0492 e6b9 0a40 d224 370c  ..66.......@.$7.
0000010: 2c92 0f66 9780 d9a9 6076 0a00            ,..f....`v..

Does not work online since it uses ANSI color codes for coloring.

Is this a straight-up encoding, or is does it employ some other clever trick?

@ConorO'Brien There is no such thing as clever tricks in Bubblegum. To be honest, this answer was mostly a side-effect of the actual answer I'm working on.

Python, 91 bytes + termcolor
Not gonna win, but posted it for fun.
from termcolor import*
for c in'I Voted':cprint(c,'brleude'[ord(c)%2::2],'on_white',end='')

Half the credit goes to Sp3000.

Using ANSI codes should be shorter

@TùxCräftîñg It isn't supported on all platforms, i.e. Windows.

Mind adding an image?

You can save 5 bytes by changing 'blue' if c else 'red' to 'brleude'[c^1::2].

@Shebang It's even available on DOS, come on...

You should probably put + termcolor in the title since it's not a standard module. Also: from termcolor import*\nfor c in'I Voted':cprint(c,'brleude'[ord(c)%2::2],'on_white',end='')

I assume this is working on other OS than Windows 7.

@Shebang It work on Windows 10 at least, and the problem is from the terminal emulator

I think you could save some bytes by changing from termcolor import* to import termcolor as t. I haven't check it on your code, but it usually helps me

Python IDLE, 97 96 78 69 bytes
Thanks to DrMcMoylex for shaving off some bytes!
EDIT: Figured out that a direct .write() was 9 bytes shorter
Not really a proper answer, more abuse of a standard theme. IDLE is Python's IDE, and unless it's customized, STDOUT is blue, STDERR is red, and the background is white. So, the following code:
from sys import*
for i in'I Voted':[stdout,stderr][ord(i)%2].write(i)

Prints this:

This works because ord(i)%2 checks the parity of the letter's code point and prints it to ERR/OUT accordingly.

Jolf, 53 bytes
"<z>I <w>V<z>o<w>t<z>e<w>d<style>w{ΞΩ4blue}z{ΞΩ4red

There are unprintables. Try it here!
Jolf's output is HTML capable. I tried doing something clever like modulus 2 to decide color, but that only wound up longer (around 69 bytes). So, the output is in HTML.
Output:

(larger version)

This is terrible you've only saved three bytes over HTML :P

@EriktheGolfer It really only works in firefox.

@ConorO'Brien Oh, I use Chrome. Thanks.

...aand the HTML answer outgolfed this.

Can't blue be written as 00f?

@IsmaelMiguel No, it would need to be written as #00f.

sh, 61 49 bytes
echo "[47;31;1mI [34mV[31mo[34mt[31me[34md"

Because this contains unprintables, here is a reversible xxd hexdump:00000000: 6563 686f 2022 1b5b 3437 3b33 313b 316d  echo ".[47;31;1m
00000010: 4920 1b5b 3334 6d56 1b5b 3331 6d6f 1b5b  I .[34mV.[31mo.[
00000020: 3334 6d74 1b5b 3331 6d65 1b5b 3334 6d64  34mt.[31me.[34md
00000030: 22                                       "

Xterm(322)
Thanks to 4198 (manatwork) for -12 bytes.

Why setting the background and foreground colors separately? Start it with [47;31;1m. And the 1 for bold persists until a 0, so no need to set it again and again for each letter.

@manatwork Oh god, I thought you have to re-set it!

If that sh is anything more modern than the old Bourne shell, some parameter expansion may help: s=":1;47;1mI :4mV:1mo:4mt:1me:4md";echo ${s//:/^[[3}.

@manatwork It does not work. It seems it's not more modern.

@manatwork ${VAR/FROM/TO} requires ksh93, bash or zsh, not just “anything more modern than the old Bourne shell”. POSIX requires the # and % parameter expansion modifiers but not /…/ or :…:

In a unibyte terminal (i.e. in a non-UTF8 locale), you can use the byte 0x9b instead of the two-byte sequence 0x1b 0x5b (^[ with the high bit set instead of ESC [, likewise ^Z for ESC Z etc.).

@Gilles, or yash. Or more. Just tried to use a description instead of enumeration.

Python, 99 87 bytes
from turtle import*
up()
for c in"I Voted":color("brleude"[ord(c)%2::2]);write(c);fd(7)

Try it online

Mind adding an image?

@HelkaHomba All you need to do it click the link.

REBOL, 100 90 95 bytes (-7 bytes with REPL for 88)
REBOL[]view layout[style b tt blue white space 0 across b"I"red b b"V"b"o"red b"t"b"e"red b"d"]

In REPL, the initial REBOL[] is not required. That's 7 bytes.
The ungolfed version is:
REBOL[]
view layout[
  ; by default, tt (text) has a grey background and a 2x2 padding
  style b tt blue white space 0
  ; this one doesn't appear in the golfed version as it's slightly shorter to just manually set red everywhere needed
  style r b red

  ; by default, vertical stack panel
  across
  r "I"
  r
  b "V"
  r "o"
  b "t"
  r "e"
  b "d"
]

On the left, with "space 0x0" added to each text block, on the right, with the default 2x2 padding.

(source: canardpc.com)

SVG + bzip2, 1807 bytes
A vectorized version of the example image, then compressed with bzip2 to about half (4385 -> 1807 bytes). You can download it here. (direct GitHub Pages link)
BZh91AY&SY!�l�ß�x��>�ߠ/���`    0����Ҁ�D�5��ޠII�T�O!45J??��i�@JzH���
.�M�&�Q�vا����bB���� �쾾�4AV�8�8���)Z�ޣ�j�q}�����?�t�/
�±%��"A����B�X�(␌�[⎺;Z/┐├*��%�␤�       I���Uƒ�Y�9ǝK���B��┤�=���±?�W���
            ��ڰj�?�H��\����^��m�=X�d���>�!C�@�.���9�" DZ+��V1+�;�����58Q���-:�5,HDQŧ`A>����W�+h��>m��G�m�uWv�&�U�|mq�u���?=S�\{(��Z�a�I��G{Cd��;Bz���qX7��?P�@�Jt[w�]����%W���37f���-�iԳ]c��|�;i�k�H��
    sHz��Y�$�.�*�?�ڐ��Us=\뫅6%�Ud�9w���D
                                          ��H��^�Q��P��%n�O����l��+*q�U�"F%��*�     *b��
                                         @mP���Z�(ZL`
  bIv⦳�~�F=��>H�Ti����0@≠R≥��T�E��┴��D����␍│��2*◆=└6&⎽M�◆␊?�/�U�����r�.�`gƅ���E'��^��ILPz@���zR&u$��l^�U�n�'O\�Xj+چ�o�*�O�w��JP8���]���r��k=��N�b�ƵpM�8|���=7���N��W�M(����*�E�DݐT��Zi�v"���49�J�0}�F�*x�K���P��⎼*�������6[G,4� ү)UUT␍��%4D��Թ␉��⎻�8�CZ_3ɷwW�9��-&�Ov�a՜
�'ӥtߢ�>��^�m-������c�]:��*��2��촄Ujr�?"�J�"���DE�f?┴⎻��␍3·└���Ԉ��? ׌�5|ᫎ���|DO���%�4Ư`W�ƐV/=�]V`gˇ��^Z��cP������.{������6   o.*�sɽ���U?E.3�,�H$�{�?
             �%�0��2    ��n�C!%�>��]��
#߽v�E��K��?X|���5�ΰ@>A;#J���,��Q��$���ݨ��^����7�g�Xn�k����d욒�`fQ/7��vh|�ȥ*^M
                            �[����׈���i�I��    $��4��
  Y��`V.��ح��?�eT����5K˱~�瞯r�fL^I �#b�@�pBƞ���V`5��a��qH���Ş�t�V3��┌���T���1␉�␍$5��@T␤$�>$����π���S�[۸£�[ȟ␋CO≥�ގ^��>��]E�A��┘���I(�㴨Z�J'��:�-_┤±�K␌�ۓ#:�?m��^�Z�+�����G
�k�t�O��SD�4����^o��Z�n���6M�)!��r��w�3\�R����
�X6<#����.��p� Cj"�2�ĭ�*h�S�`}�L���C?�� �چZc'kG��

Not gonna win, but posted it for fun.

bzip2 is not a programming language.

@PeterTaylor Per meta rules, it doesn't have to be a programming language. (http://meta.codegolf.stackexchange.com/a/10426/41088

should post a reversible xxd of the file

try using brotli for even more compression

If you're really interested in golfing this, it would probably make more sense to just create the SVG by hand with a couple text elements set to the right colors. Here's a starting point: <svg xmlns="http://www.w3.org/2000/svg"><text  fill="blue"><tspan fill="red">I</tspan> V<tspan fill="red">o</tspan>t<tspan fill="red">e</tspan>d</text></svg> Note that this actually renders it outside the printable area and has no background color. Like I said, it's just a start.

Are compression algorithms allowed? Certainly, it is not allowed to compress the source code in other languages.

C, 65 bytes
i;main(c){for(;c="I Voted"[i++];printf("\33[3%dm%c",c&1?1:4,c));}

or, more accurately:
i;main(c){for(i=90;c="\0.noitcele ym saw ti fi enod evah dluow I sseug I tuB .hsitirB ma I esuaceb ,etov ton did I"[i--];printf("\33[3%dm%c",c&1?1:4,c));}

Uses the same bash colour technique used by betseg, but with the octal escape sequence instead of hex, and with Sp3000's observation that all odd codepoints are red.
Leaves the terminal in blue. Reset with:
printf "\33[0m";

If || works in C like it does in JavaScript (x||y -> x?x:y), you could do c&1||4 to save a byte.

@ETHproductions doesn't work that way in C. While || and && are short-circuiting, they always return 1 or 0, regardless of the values involved.

@Dave I learned something today...

This doesn't set the background color. Also, you could use a literal escape character instead of \33 to save two bytes, if that isn't against the rules somehow.

@yellowantphil this assumes the default terminal background is set to white (since the challenge says it just needs to be possible to have it on a white background). In fact in OS X, the terminal is black-on-white out-of-the-box.

Node, 57 55 41 bytes
console.log("q47;91mI  o eHHHHq94mV t d")

Replace each q with the literal byte 1B and H with byte 08 before running.
Here's how it looks in the ConEmu terminal emulator on my Windows computer (zoomed in):

What terminal emulator is that!?

@cat ConEmu: https://conemu.github.io/

Perl, 57 + 17 = 74 bytes
Run with -MTerm::ANSIColor
sub c{color$a++%2?blue:red}say c,"I ",c,V,c,o,c,t,c,e,c,d

Your terminal may be blue at the end (append ,c("reset") at the end of the code to restore it to normal).
By default, terminals are usually black background, but they can be optionally changed to white, which I personally don't think is cheating.
With picture:

x86 machine code + DOS + BIOS, 25 bytes
Hexdump:
b8 02 13 b1 07 bd 0b 01 cd 10 c3 49 74 20 74 56
71 6f 74 74 71 65 74 64 71

Assembly code (suitable as input to debug.com, so all numbers are hexadecimal):
mov ax, 1302
mov cl, 7
mov bp, 10b
int 10
ret
db 'It tVqottqetdq'

It uses a BIOS routine to output the string to the display memory. The string will appear at a "random" position on screen (see below), like this:

The string contains the letters I   V o t e d, interleaved with "attributes"
74 74 71 74 71 74 71

that specify the colour of the letters. Here 7 as the most significant digit means "white background", and the least significant digit specifies the foreground (1=blue; 4=red).
The display position of the string is specified by the dx register. As mentioned here, the initial value of this register is equal to the value of the cs register. And the value of that one is the first available address in memory, after DOS is loaded.
The size of DOS is typically less than 64K, that is, the segment address of the loaded user's program is less than hexadecimal 1000. So the output will appear somewhere around the first 16 lines of text on the display. In my example, it appeared at line 8 (the upper half of dx, called dh, is equal to 8).
The low half of dx, called dl, contains the column at which the text is output. Experiments show that BIOS doesn't check overflow, so it doesn't matter
if dx asks for output at e.g. column 100.

clever, short, and really intuitive.

PHP, 199 201 151 bytes
This script outputs image to standard output. Updated thanks to manatwork
imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);

Run it in the command line like this:
php -d error_reporting=0 -r "imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);" > output.png

Output:

Skip the header() call. Your code works fine run from command line too. As error_reporting's default value not shows notices, is generally acceptable to not quote your string literals. Or if you not like that, str_split("I Voted") is still shorter than enumerating the characters separately. And move the assignment to $i to its first usage.

~2**24 seems to work instead of 0xFFFFFF. Not sure if this is valid for all architectures. If not, 2**24-1 should be portable.

@manatwork awesome thanks. That got it down to 152. I tried ~2**24 and 2**24-1 but I got errors. I don't even know how those work.

Probably your PHP is older than 5.6.0: “Added an exponentiation operator (**).” – PHP changelog. Same as pow(), but handier for golfing. http://pastebin.com/jFn6ahFk

Oh I see. Well since php 5.5 seems to be unsupported, I'll use your solution. Now it's 150. Thanks again.

~2**24 is not valid for x64 builds. 2**24-1 works correctly.

Xamarin.Forms C#, 317 313 bytes
using Xamarin.Forms;public class A:Application{public A(){var s=new StackLayout{BackgroundColor=Color.White,Orientation=(StackOrientation)1,VerticalOptions=LayoutOptions.End};foreach(var c in"I Voted")s.Children.Add(new Label{Text=c+"",TextColor=c%2<1?Color.Blue:Color.Red});MainPage=new ContentPage{Content=s};}}

VerticalOptions=LayoutOptions.End is needed for iOS, otherwise the text will be overlayed by status bar. No problem on Android so can save 34 bytes including comma.
Edit: 2016-11-14: -4 bytes
Ungolfed
using Xamarin.Forms;
public class A : Application
{
    public A()
    {
        // Make a horizontal StackLayout for labels
        var s = new StackLayout
        {
            BackgroundColor = Color.White,
            Orientation = (StackOrientation)1,   // StackOrientation.Horizontal
            VerticalOptions = LayoutOptions.End
        };
        foreach(var c in "I Voted")
            // Make a new label for each letter, then add to StackLayout
            s.Children.Add(new Label
                {
                    // Cast char to string
                    Text = c + "",
                    // Happens that 'I', 'o', and 'e' are all odd in ASCII, and 'V', 't', and 'd' are all even :)
                    TextColor = c%2<1 ? Color.Blue : Color.Red
                }
            );
        // Set app MainPage to be a new ContentPage, where the content is the StackLayout above
        MainPage = new ContentPage { Content = s };
    }
}

Well that's a new kind of idea. +1

Qbasic, 137, 126, 124, 122, 115, 114, 113 bytes
a$="I m C n d a ":b$=" '   a a i n"
FOR i=1TO 12
c$=MID$(a$,i,1)
IF c$<>" "THEN
COLOR 4,7:?c$;
ELSE
COLOR 7,4:?MID$(b$,i,1);
ENDIF
NEXT

:)  And the real program
a$="I  o e":b$="  V t d"
FOR i=1TO 7
c$=MID$(b$,i,1)
IF c$=" "THEN COLOR 4,7:?MID$(a$,i,1);ELSE COLOR 1:?c$;
NEXT

Output:

BASIC (zx spectrum), 24 bytes
1 PRINT "{BRIGHT 1}{INK 2}I {INK 1}V{INK 2}o{INK 1}t{INK 2}e{INK 1}d"

But it’s not a real spectrum code, it is just a text that should be feed to BAS2TAP compiler.
70 ASCII-chars (including the end of line).
Actually, it produces a .TAP file. To easily run it, I give you the encoded version:
data:text/cmd;base64,EwAAAFZPVEUgICAgICAdAAAAHQAIHwD/AAEZAPUiEwEQAkkgEAFWEAJvEAF0EAJlEAFkIg0r

This URI is 93 characters in Base64, but the real TAP file size is 54 bytes.
Visit this online emulator and press “Open file” (4-th button, «folder»), flip “Spectrum 128K” to “Spectrum 48K”, paste that "data:text…" to “Load from web:” field and finally hit “Open URL”!
But my program is even smaller. You see, Spectrum uses one byte for language keywords and control codes.
So PRINT (and spaces around it) is just one “char” from ZX’s point of view. If I will not count line number “1” (piece of code could be executed directly) and final ENTER, then program dump looks like this:
Offset   |  0  1  2  3  4  5  6  7   8  9 10 11 12 13 14 15 |
---------+--------------------------------------------------+-----------------
00000000 | F5 22 13 01 10 02 49 20  10 01 56 10 02 6F 10 01 | х"....I ..V..o..
00000016 | 74 10 02 65 10 01 64 22                          | t..e..d"

24 bytes
Color codes are represented as two byte sequences. But they could be written as one logical character from the keyboard!
Since we don’t need to restore colors after line, my logical length is this: “1” as line number; keyword “PRINT” (typed with only one keypress); quote char. Then comes BRIGHT mode (to make background pure white) and BLUE ink. Then type all letters with according color (can switch to RED directly). And a final quote. That way, I got 18.
Also we can count actual keystrokes that are needed to write this program to Spectrum! Go here.
Ctrl key stand for SYMBOL SHIFT and Shift stand for CAPS SHIFT. The combination “Ctrl+Shift” will put the cursor in "E" mode and back, so don’t hold it for long.
To type my golfing, press this key sequence:
1 P CTRL+P CTRL+SHIFT 9 CTRL+SHIFT SHIFT+2 SHIFT+I SPACE CTRL+SHIFT SHIFT+1 SHIFT+V CTRL+SHIFT SHIFT+2 O CTRL+SHIFT SHIFT+1 T CTRL+SHIFT SHIFT+2 E CTRL+SHIFT SHIFT+1 D CTRL+P ENTER R ENTER
We have as much as 28 keystrokes!

Moderator Note: for anyone interested in seeing the remaining part of this answer (the polyglot code which is not a serious competitive contender), it is now in a gist here to save space.

Holy hell, this might be the craziest (as in crazy good) thing I've seen on PCCG. You got my upvote!

Welcome to PPCG! I think this is the best first post I've ever seen!

Link to Bas2tap compiler is dead.

Processing, 83 85 83 bytes
Had to increase byte count to include spaces to avoid overlapping letters
Then I reduced byte count by changing the positions and removing spaces
Processing is basically Java, but more artistic and less verbose (emphasis on less verbose).
background(255);fill(#ff0000);text("I   o e",2,9);fill(#0000ff);text("V  t d",9,9);

Explanation:
background(255); //sets background colour to white
fill(#ff0000); //setting the text colour to red
text("I   o e",2,9); //Display text "I   o e" (in red) at position (2,9) [Origin is top left]
fill(#0000ff); //set the text colour to blue
text("V  t d"); //Display text "  V  t d" (in blue) at position (9,9)

@sanchises I don't know how to fix it yet

@sanchises I tried it, but that just messes things up even more so

@sanchises Done!

Could you try tabs (\t) instead to try and save bytes?

@Artyer The tabs don't help, I've tried.

Bash, 61 bytes
b="\e[34m";r=${b/4/1};echo -e ${r}I ${b}V${r}o${b}t${r}e${b}d

with white background 61 + 9 byte:
b="\e[34m";r=${b/4/1};echo -e "\e[107m"${r}I ${b}V${r}o${b}t${r}e${b}d

Could you set the background to white, please?

@PaŭloEbermann , done

oddly, in my terminal program (ROXTerm), the first one is on a white background, while the second one has a slightly light grey background.

@trlkly the first one doesn't set any background, so it will show with the default background. (Which would be a light green for me, and seemingly a white for you.) The second one selects the "white" background from the palette, which looks white here, but can be configured in most terminals.

Quake 3/Live Colour Codes (19 characters)
^1I ^4V^1o^4t^1e^4d

Add an image showing your output

Encapsulated Postscript, 103 bytes
Copy-paste and save as .eps to display it:
%!PS
/run{100 500 moveto setrgbcolor show}def/Courier 60 selectfont(I  o e)1 0 0 run(  V t d)0 0 1 run

Explanation:
/run{100 500 moveto setrgbcolor show}def

Declares a procedure "run" that expects to have in the stack a string and 3 rgb values. The procedure moves the cursor to 100 500, takes the 3 rgb values from the stack to set the color, then takes the string from the stack and displays it,
/Courier 60 selectfont

Sets the Courier font with size 60
(I  o e)1 0 0 run

Puts the string and the 3 rgb componets in the stack and calls "run"

Printf (in sh), 49 44 bytes
Sad to see no one has used printf, only echo.  (See Why is printf better than echo?)
:)
printf '\e[47;1;31m%s\e[34m%s' I\  V o t e d

Thanks to matatwork for helping shave off five bytes.  :)

As noted in the comments, two more bytes could be shaved off by using literal escape characters rather than \e in both places where that appears.
(I've chosen not to update the screenshot, and of course can't include literal escape characters in the code anyway.  I don't know if I should reduce the byte count to 42 bytes, since I didn't make those updates.)

My comment is valid for this one too.

@manatwork, thanks!  See any other way to reduce it down?

Only the usual one of using literal escape character instead of \e. In terminal press Ctrl-V, Esc – will appear ^[ but is a single character.

@manatwork, ah, that would be codegolf indeed.  I think I'll pass on updating the screenshot and code, but I'll include a note.  Thanks!

IRC - 19 bytes
4I 2V4o2t4e2d

Here it is with the nonprintables escaped, UNIX style:
^C4I ^C2V^C4o^C2t^C4e^C2d

xxd output:
00000000: 0334 4920 0332 5603 346f 0332 7403 3465  .4I .2V.4o.2t.4e
00000010: 0332 64                                  .2d

This makes use of IRC coloring, which uses ASCII character 03 and a colour palette.

Emmet, 49 62 61 68 bytes
a{I}+r{V}+a{o}+r{t}+a{e}+r{d}+style{r{color:red}}
r{I }+w{V}+r{o}+w{t}+r{e}+w{d}+style{r{color:red}w{color:#00f}}
Running this will generate the following HTML code:
<w>I</w>
<r>V</r>
<w>o</w>
<r>t</r>
<w>e</w>
<r>d</r>
<style>r{color:red}w{color:00f}</style>
And it looks like this:

It's using the blue of links, so the only color that needs to be set is red, saving us some bytes.

That's a cool approach. Unfortunately, I don't think it counts. The OP specified that is not allowed

I managed to miss that, removed links and added 13 bytes.

OK, thanks. BTW, welcome to the site!

I like the answer, and I would let it slide, but you may want to add a space between the I and V. you can also change 'blue' to 0ffto save a byte!

I did have a space in there at first, but Emmet adds a newline after every element. Because of this, adding a space would not increase the distance between the two letters.

Sorry but the words should be distinct. You don't need a space char necessarily, but make it clear there are two words.

Also, the colors are reversed.

Thanks, I suppose I can just add a non-breaking space, fattening it to 68 bytes.

@DecentM you could replace   with an Alt+255 character code if you wanted to, right?

Unfortunately, no. Emmet replaces it with a regular space

SVG, 71 bytes
This may not parse as an .svg file, but it works if you save it as html.

<svg letter-spacing=8><text y=20 fill=red>I oe<tspan x=16 fill=blue>Vtd

Python 2 (or 3), (75 bytes)

a="\033[3%sm"
r,b=a%"1;47",a%4
print(r+"I "+b+"V"+r+"o"+b+"t"+r+"e"+b+"d")

Resized my terminal font size to 72 for a bigger picture, outputs in colour in most terminals.

If you allow Python 2, you can save a byte by replacing print(...) with print ...; you can save another byte by replacing \033 with \33.

Befunge, 47 bytes
41+:+"detoV I":v:,,,\<
93"[47;3m"g0%2:_@>,,,^#*

Try it online  - you'll need to Compile then Execute

C#, 262 201 180 170 166 bytes
using c=System.Console;using o=System.ConsoleColor;static void M(){c.BackgroundColor=(o)15;foreach(var a in "I Voted"){c.ForegroundColor=(o)(a%2<1?9:12);c.Write(a);}}

Saved 46 bytes thanks to Link Ng
Outputs the following to console:

Modify M() to be {o r=o.Red,b=o.Blue;c.BackgroundColor=o.White;foreach(var a in"I Voted"){if(a%2<1)f(b);else f(r);c.Write(a);}} to save 46 bytes. If you can make if-else into ternary operator you may save more.

@LinkNg Managed to save even more thanks to that, a whole lot more now

Mouse2002, 84 bytes
"[47;31;1mI "#B,86;#R,111;#B,116;#R,101;#B,100;$B1%c:"[34m"c.!'@$R1%c:"[31m"c.!'@

Ungolfed:
"[47;31;1mI " #B,86; #R,111; #B,116; #R,101; #B,100;

$B 1% c: "[34m" c. !' @
$R 1% c: "[31m" c. !' @

A hexdump of the golfed code (note the unprintables), reversible with xxd -r:
00000000: 221b 5b34 373b 3331 3b31 6d49 2223 422c  ".[47;31;1mI"#B,
00000010: 3836 3b23 522c 3131 313b 2342 2c31 3136  86;#R,111;#B,116
00000020: 3b23 522c 3130 313b 2342 2c31 3030 3b0a  ;#R,101;#B,100;.
00000030: 0a0a 2442 3125 633a 221b 5b33 346d 2263  ..$B1%c:".[34m"c
00000040: 2e21 2740 0a24 5231 2563 3a22 1b5b 3331  .!'@.$R1%c:".[31
00000050: 6d22 632e 2127 40                        m"c.!'@

Bash, 51 bytes
GREP_COLORS='sl=34;47' grep [Ioe] --col<<<I\ Voted

Without the white background (who says terminals have to be black??), it is even shorter: 46 bytes.
GREP_COLORS=sl=34 grep [Ioe] --col<<<I\ Voted

But it looks like OP wouldn't accept the latter.
grep highlights any of letters I, o or e red (default coloring). I don't think there is a regex for vowels in general which could shorten the syntax. For blue color and white background, instead of stating the complicated bash color codes, you can let grep do that when defining GREP_COLORS:

grep  takes care of assembling the result into a complete SGR sequence (\33[...m).

Looks like the syntax highlighting on Codegolf is a bit based though.

Geometry Dash, 2 objects/276 bytes
Raw text that the level is stored as:
H4sIAAAAAAAAE6WPzQrCMBCEX2iFnc1PU8RDexGPUvC66EWkvoDgw5tkKyJYtHjIDJlhPpJxcImgEoJKVVcVFsEyWOh1BY0KZtZGoQhFkrImxR3ZJZfyGwL_I9qPiIVfES37TyDIC8TfMGEWw0teE2cwNHZwxMWCWTTzlDVSLseusWiyVGxwbb1JVSPUovNVrQWbgXgNajNUCDGQI3CgNuPJo0gGHHEsB-RAw9CdT7f--hqlZhoJ8vU5WkHedodLz7vtfrN-APfUD_t-AgAA

Level editor

Object count in the top-left

This is made by converting RGB to Geometry Dash's version of HSL (in Geometry Dash its hue, saturation, and brightness), and coloring "V t d" blue (hue -120, saturation 1, and brightness 0) and "I  o e" red (hue 0, saturation 1, and brightness 0).

How many bytes is this? Surely this level is saved somewhere as a file.

@JoKing Sure, I'll check.

@JoKing Updated.

I never expected to see this game on this SE. Very creative

@Belhenix I have other submissions in Geometry Dash

@Belhenix You can see other answers by typing in is:answer "Geometry Dash" into the search bar

Trackmania Nations Forever, 31 bytes
Uses colour codes for in-game nickname. When selecting profile on startup, the background is white.
Code
$f00I $00fV$f00o$00ft$f00e$00fd

Output

+1 just for the absolutely abstract choice of "language"

Ruby - 46 45 bytes
puts"1I 4V1o4t1e4d".gsub(/\d/){"\e[47;3#$&m"}
The digits are placeholders for colors. They are injected into escape sequences via '#$&' (interpolation of the last match).

PHP, 132 bytes
imagefill($i=imagecreatetruecolor(62,13),0,0,~0);($s=imageString)($i,6,0,0,"I Vote",255<<16);$s($i,6,18,0,"V t d",255);imagepng($i);

Based on Kodos Johnson´s answer (prints image data to stdout)
create image with full alpha background, add I Vote in red, add V t d in blue, output image.

Python 2, 77 bytes
r='\033[91m'
b='\033[94m'
print r+'\033[47mI '+b+'V'+r+'o'+b+'t'+r+'e'+b+'d'

I don't know about other platforms, and it does not work online but on Windows 10 this works just fine with the command line, it looks like this:

I tried this:
e='\033[9
r=e+'1m'
b=e+'4m'
print r+'\033[47mI '+b+'V'+r+'o'+b+'t'+r+'e'+b+'d'

And this:
r='\033[91m'
b='\033[94m'
v,o,t,e,d='Voted'
print r+'\033[47mI '+b+v+r+o+b+t+r+e+b+d

But they did not actually help (but they are much cooler!)

@HelkaHomba I completely forgot, thank you!

Could you use a printf-like syntax to reduce this? (don't do Python, just a thought, seeing all those +s).

@mojimonster I don't think that exists in Python, though it might just be called something else, I am not sure.

Are you sure the background is #FFFFFF?

SVG - 205 bytes
(167 bytes bzip2, for comparison's sake)
Yes, I know this is old and been over for a while, but I finally had time to do what I said in my comment on the SVG + bzip2 example.
Here's just plain SVG, golfed down by hand as much as I can. UTF-8 is the default, which means this each character is one byte:
<svg xmlns="http://www.w3.org/2000/svg"><rect fill="#fff" width="99" height="99"/><text fill="blue" y="99"><tspan fill="red">I</tspan> V<tspan fill="red">o</tspan>t<tspan fill="red">e</tspan>d</text></svg>
Problem is, there is no default font or text size for SVG, so I had to just guess a reasonable number for other elements. The background white rectangle is 99x99 (and the text bottom at y=99) just because that's the largest 2 digit number, and every default font I've seen is at most 2 digits high.
And, while SVG is already an image format, here's a PNG from Wikimedia Commons:

Ruby, 85 Bytes
UPDATE: Forgot the white background
require"colorize";puts ("I".red+"V".blue+"o".red+"t".blue+"e".red+"d".blue).on_white

Output:

The challenge also includes “The background must be white (#FFFFFF).”

@manatwork Whoops, thanks for mentioning; fixed it.

Uhm… .colorize(:background=>:white) → .on_white?

By the way, if you count 61 byte code $><<("I ".red+?V.blue+?o.red+?t.blue+?e.red+?d.blue).on_white + 11 byte command line option -rcolorize , it looks less lengthy.

Welcome to PP&CG stack exchange!

OCL 2, 96 bytes
ShowCanvas
setFillColor 255 0 0
DrawText 0 9 "I  o e"
setFillColor 0 0 255
DrawText 4 9 "V t  d"

I'm a bit late for this, but I think I did alright. I've tried optimizing it, but I literally can not find any way of making it shorter, despite it looking very optimizable.

Decimal, 108 88 bytes
Saved 20 bytes by reusing resources (manipulating stack instead of pushing ANSI colors repeatedly)
13027091051049109D13027091051052109D00D301I12032D301201D301V00D301o01D301t00D301e01D301d

Try it online! Be warned that the online version displays raw ANSI escape sequences and not the actual colors. Ungolfed and commented:
13027091051049109D     ; push STRING "ESC[31m" (idx 0)
13027091051052109D     ; push STRING "ESC[34m" (idx 1)
00D301I                ; set DSI to 0, print, print I
12032D3012             ; push CHAR ' ', print, pop
01D301V                ; set DSI to 1, print, print V
00D301o                ; set DSI to 0, print, print o
01D301t                ; set DSI to 1, print, print t
00D301e                ; set DSI to 0, print, print e
01D301d                ; set DSI to 1, print, print d

How it works:

ESC[31m is the ANSI color code to set the foreground output color to red.
ESC[34m is the ANSI color code to set the foreground output color to blue.
Decimal automatically prints every non-Decimal character in the source (I,V,o,t,e,d)

SmileBASIC 3, 57 bytes
GCLS-1GPUTCHR.,.,"I  o e",#RED
GPUTCHR.,.,"  V t d",#BLUE

In recognition of the upcoming US midterm elections.

Rust, 61 bytes
fn main(){print!("[47;31mI[34m V[31mo[34mt[31me[34md")}

Since the code above contains unprintable bytes, here's a reversible hexdump:
00000000: 666e 206d 6169 6e28 297b 7072 696e 7421  fn main(){print!
00000010: 2822 1b5b 3437 3b33 316d 491b 5b33 346d  (".[47;31mI.[34m
00000020: 2056 1b5b 3331 6d6f 1b5b 3334 6d74 1b5b   V.[31mo.[34mt.[
00000030: 3331 6d65 1b5b 3334 6d64 2229 7d         31me.[34md")}

CodingLang, 136 bytes
(I )>b(color:red)@style(V)>b(color:blue)@style(o)>b(color:red)@style(t)>b(color:blue)@style(e)>b(color:red)@style(d)>b(color:blue)@style

Try it!(code needs to be pasted)
I'm not sure how classes and stuff work in this. If someone else knows how to use predefined classes repeatedly, it would save a lot of bytes.
Please do vote this year!

SmallBasic, 244 bytes
s="IVoted"
For i=1 To 7
x=Text.GetSubText(s,i,1)
If Math.Remainder(i,2)=0 then
If i=2 then
TextWindow.Write(" ")
EndIf
TextWindow.ForegroundColor="Blue"
TextWindow.Write(x)
Else
TextWindow.ForegroundColor="Red"
TextWindow.Write(x)
EndIf
EndFor

This is also self explanatory. It changes console colors at even and odd character in the string, plus insert a space after first char.
I wish I could use With here....

PostScript, 157 bytes
Code (compressed):
0 0 moveto/Courier 72 selectfont 1 0 0 setrgbcolor/i true def{pop 73 eq{30 0 rmoveto}if i{0 0 1}{1 0 0}ifelse setrgbcolor/i i not def}(IVoted) kshow showpage

Code (uncompressed, with comments):
0 0 moveto
/Courier 72 selectfont
1 0 0 setrgbcolor     % red
/i true def
{
    pop
    73 eq {           % 'I' ?
        30 0 rmoveto  % insert space
    } if
    i {
        0 0 1         % blue
    }{
        1 0 0         % red
    } ifelse
    setrgbcolor
    /i i not def      % toggle i
} (IVoted) kshow
showpage

Result:

Julia, 50 bytes
print.("\e[47;$(34-3Int(c)%6)m"*c for c="I Voted")

(Don't) Try it online!

05AB1E, 32 bytes
"25I 6V5o6t5e6d"₁Ƶsç•7η/•2ô«'m«‡

Try it online!
"..."₁Ƶsç•7η/•2ô«'m«‡  # full program
"..."                  # literal...
                    ‡  # with each character of...
     ₁                 # 256...
                    ‡  # replaced by corresponding element in...
                       # (implicit) list of length of...
         •7η/•         # 473134...
               ô       # split into pieces of length...
              2        # literal...
        ç              # character with codepoint...
      Ƶs               # 155...
                       # (implicit) s with each element...
                «      # concatenated with...
                       # (implicit) corresponding element in...
         •7η/•         # 473134...
               ô       # split into pieces of length...
              2        # literal...
                       # (implicit) with each element...
                   «   # concatenated with...
                 'm    # literal
                       # implicit output

«'m« can also be 'm«« with no change in functionality: Try it online!

QBasic, 76 bytes
SCREEN 7
FOR i=1TO 6
COLOR(i MOD 2)*3+1,15
?MID$("IVoted",i,1)SPC(1\i);
NEXT

Explanation
Observing that the colors alternate between red and blue, we run a FOR loop for six iterations, one for each letter. On odd values of i, we want color 4 (red), and on even values we want color 1 (blue). The formula (i MOD 2)*3+1 achieves this. We use color 15 (bright white) for the background.
We pull the correct letter out of the string IVoted using MID$. Now, we need to put a space after the I, which is to say we want to print an extra space on just the first iteration. Conveniently, 1\i is 1 when i is 1 and 0 when i is greater than 1, so after the letter, we use SPC to print 1\i spaces. A trailing ; suppresses the newline, and we go on to the next iteration.
Running at Archive.org gives this output:


text:
Generate a Markdown Template for your Post
Your task is simple: Write a program (or function) that takes no input and outputs something like this:
## *name*, *length* bytes
    *code*

Where *name* is the name of the language you are using, *length* is the number of bytes in your code, and *code* is your program's source code. If *code* contains multiple lines, it have four spaces before each line.
Here's a 124-byte example implementation in Python 3:
s = "## Python 3, 124 bytes{2}    s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
print(s.format(s,chr(34),chr(10)))

The output is:
## Python 3, 124 bytes
    s = "## Python 3, 124 bytes{2}    s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
    print(s.format(s,chr(34),chr(10)))

Which in Markdown is:

Python 3, 124 bytes
s = "## Python 3, 124 bytes{2}    s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
print(s.format(s,chr(34),chr(10)))

This is code-golf, so the shortest answer (in bytes) wins.

I'm pretty sure this is a dup, but can't find the old one...

Related

I'd say this is different enough from that one because it's generating one for itself. The idea is similar, but you need to write a quine for this one.

Should we assume standard quine rules (e.g. no opening your own code and reading it)?

@GabrielBenamy Yes.

Strange, I had this idea like two days ago...

This is definitely a duplicate as I remember: Pyke, 0 bytes. Click the copy answer button on the website

@muddyfish I searched that on Google. Was it this  one?

@muddyfish this has been posted in TNB as a chat mini challenge a couple times, it could have been that.

RProgN 2, 28 Bytes
«"  %s"F"#RProgN 2, 28 Bytes"

As is, this isn't a serious contender and subject to deletion. Please golf your answer.

@Dennis Golfed.

Nice! The dot after the byte count doesn't seem to be required, but there should be four spaces (or a tab) before the code.

Underload, 48 bytes
(#Underload, 48 bytes
)(~:S(    ):S*aSaS(:^)S):^

Post is exactly as produced by the code. The quine is payload-capable (place the payload after the final S), thus making it a true quine by one widely-used definition, but uses a string eval (that said, string eval is the only way to do a loop in Underload; it's fairly fundamental to the language).

After a discussion in Underload quines in chat, we decided this is also a quine by the other widely-used definitions too; the :^ at the end of the program is encoded by the :^ a little earlier, and thus one part of the program encodes a different part.

You can discuss in Underload quines? (Cool!:aSS)Cool!:aSS

@CalculatorFeline Unfortunately, that doesn't work because of the (!).

Python 2, 58 bytes
_='## Python 2, 58 bytes\n    _=%r;print _%%_';print _%_

The contents of this post are exactly as printed by the code.

reticular, 58 bytes
"'34'c: 4*91+c:s:e:t:y:b: 85: :,:r:a:l:u:c:i:t:e:r: :#dqO;

Try it online!
Explanation: :c pushes the single-char string c. This builds the string "## reticular, 58 bytes", backwards character by character, reverses the stack, and Outputs everything, including the string captured by the initial quote.

CJam, 33 bytes
{"## CJam, 33 bytes"N@S4*\"_~"}_~

Works a lot like the Underload answer.
Stack trace (N represents \n)
{"## CJam, 33 bytes"N@S4*\"_~"}
{"## CJam, 33 bytes"N@S4*\"_~"} {"## CJam, 33 bytes"N@S4*\"_~"}
{"## CJam, 33 bytes"N@S4*\"_~"} "## CJam, 33 bytes"
{"## CJam, 33 bytes"N@S4*\"_~"} "## CJam, 33 bytes" N
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"}
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"} " "
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"} " " 4
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"} "    "
"## CJam, 33 bytes" N "    " {"## CJam, 33 bytes"N@S4*\"_~"}
"## CJam, 33 bytes" N "    " {"## CJam, 33 bytes"N@S4*\"_~"} "_~"
<implicit output>

JS, 50 49 27 30 bytes
f=_=>`#JS, 30 bytes\n    f=`+f

Try It

f=_=>`#JS, 30 bytes\n    f=`+f
console.log(f())

V, 25 bytes
ñi#V, 25 bytes<esc>o´ Ñ<esc>~"qpx

(This is not counted in the generated markdown, because I like providing explanations for my code :P)
Here is a hexdump, since the source code contains unprintable/non-ASCII characters:
00000000: f169 2356 2c20 3235 2062 7974 6573 1b6f  .i#V, 25 bytes.o
00000010: b420 d11b 7e22 7170 78                   . ..~"qpx

This answer is just a trivial modification of the standard extensible V quine.
Explanation:
ñ                                   " Run the following code one time, storing it in
                                    " register 'q'
 i                                  "   Enter insert mode
  #V, 25 bytes<esc>                 "   And insert the header
                   o                "   Open up a newline, and enter insert mode again
                    ´ Ñ             "   Enter four spaces, then a 'Ñ' character.
                                    "   (The reason we insert it uppercase, is because
                                    "   lowercase would end the loop now)
                       <esc>        "   Return to normal mode
                            ~       "   Toggle the case of the char under the cursor ('Ñ')
                             "qp    "   Paste the contents of register 'q' (this is the
                                    "   same as the entire program minus the initial 'ñ',
                                    "   followed by a 'ÿ' character because V is weird)
                                x   "   Delete the last character (the ÿ)

Go, 102 bytes
import.`fmt`;func f(){s:="## Go, 102 bytes\n    import.`fmt`;func f(){s:=%q;Printf(s,s)}";Printf(s,s)}

Attempt This Online!
From my variant in a comment under the post below. A callable function. Prints:
## Go, 102 bytes
    import.`fmt`;func f(){s:="## Go, 102 bytes\n    import.`fmt`;func f(){s:=%q;Printf(s,s)}";Printf(s,s)}

Go, 134 bytes
package main;import.`fmt`;func main(){s:="## Go, 134 bytes\n    package main;import.`fmt`;func main(){s:=%q;Printf(s,s)}";Printf(s,s)}

Attempt This Online!
Using the quine found here. A full program. Prints:
## Go, 134 bytes
    package main;import.`fmt`;func main(){s:="## Go, 134 bytes\n    package main;import.`fmt`;func main(){s:=%q;Printf(s,s)}";Printf(s,s)}

Factor, 80 bytes
"# Factor, 80 bytes\n    %uUSE: formatting dup printf"USE: formatting dup printf

Try it online!

source: Stack Exchange

license: 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/

sort: votes


text:
Solve the Laplace equation
Introduction to Numerical Mathematics
This is the "Hello, World!" of PDEs (Partial Differential Equations). The Laplace or Diffusion Equation appears often in Physics, for example Heat Equation, Deforming, Fluid Dynamics, etc... As real life is 3D but we want to say "Hello, World!" and not sing "99 bottles of beer,..." this task is given in 1D. You may interpret this as a rubber robe tied to a wall on both ends with some force applied to it.
On a \$[0,1]\$ domain, find a function \$u\$ for given source function \$f\$ and boundary values \$u_L\$ and \$u_R\$ such that:

\$-u'' = f\$
\$u(0) = u_L\$
\$u(1) = u_R\$

\$u''\$ denotes the second derivative of \$u\$
This can be solved purely theoretically but your task is it to solve it numerically on a discretized domain \$x\$ for \$N\$ points:

\$x = \{\frac i {N-1} : 0 \le i \le N-1\}\$ or 1-based: \$\{\frac {i-1} {N-1} : 0 \le i \le N-1\}\$
\$h = \frac 1 {N-1}\$ is the spacing

Input

\$f\$ as a function, expression or string
\$u_L\$, \$u_R\$ as floating point values
\$N \ge 2\$ as an integer

Output

Array, List, some sort of separated string of \$u\$ such that \$u_i = u(x_i)\$

Examples
Example 1
Input: \$f = -2\$, \$u_L = u_R = 0\$, \$N = 10\$ (Don't take \$f=-2\$ wrong, it is not a value but a constant function that returns \$-2\$ for all \$x\$. It is like a constant gravity force on our rope.)
Output: [-0.0, -0.09876543209876543, -0.1728395061728395, -0.22222222222222224, -0.24691358024691357, -0.24691358024691357, -0.22222222222222224, -0.1728395061728395, -0.09876543209876547, -0.0]
There exists an easy exact solution: \$u = -x(1-x)\$

Example 2
Input: \$f = 10x\$, \$u_L = 0\$, \$u_R = 1\$, \$N = 15\$ (Here there is a lot of upwind on the right side)
Output: [ 0., 0.1898688, 0.37609329, 0.55502915, 0.72303207, 0.87645773, 1.01166181, 1.125, 1.21282799, 1.27150146, 1.29737609, 1.28680758, 1.2361516, 1.14176385, 1.]
The exact solution for this states: \$u = \frac 1 3(8x-5x^3)\$

Example 3
Input: \$f = \sin(2\pi x)\$, \$u_L = u_R = 1\$, \$N = 20\$ (Someone broke gravity or there is a sort of up- and downwind)
Output: [ 1., 1.0083001, 1.01570075, 1.02139999, 1.0247802, 1.0254751, 1.02340937, 1.01880687, 1.01216636, 1.00420743, 0.99579257, 0.98783364, 0.98119313, 0.97659063, 0.9745249, 0.9752198, 0.97860001, 0.98429925, 0.9916999, 1.]
Here the exact solution is \$u = \frac {\sin(2πx)} {4π^2}+1\$

Example 4
Input: \$f = \exp(x^2)\$, \$u_L = u_R = 0\$, \$N=30\$
Output:
[ 0.          0.02021032  0.03923016  0.05705528  0.07367854  0.0890899 0.10327633  0.11622169  0.12790665  0.13830853  0.14740113  0.15515453 0.16153488  0.1665041   0.17001962  0.172034    0.17249459  0.17134303 0.16851482  0.1639387   0.15753606  0.1492202   0.13889553  0.12645668 0.11178744  0.09475961  0.07523169  0.05304738  0.02803389  0.        ]

Note the slight asymmetry
FDM
One possible method to solve this is the Finite Difference Method:

Rewrite \$-u_i'' = f_i\$ as \$\frac {-u_{i-1} + 2u_i - u_{i+1}} {h^2} = f_i\$, which equals \$-u_{i-1} + 2u_i - u_{i+1} = h^2 f_i\$
Setup the equations:

$$
u_0 = u_L \\
\frac {-u_0 + 2u_1 - u_2} {h^2} = f_1 \\
\frac {-u_1 + 2u_2 - u_3} {h^2} = f_2 \\
\dots = \dots \\
\frac {-u_{n-3} + 2u_{n-2} - u_{n-1}} {h^2} = f_{n-2} \\
u_{n-1} = u_R
$$

Which are equal to a matrix-vector equation:

$$
\begin{pmatrix}
 1 & & & & & & \\
-1 & 2 & -1 & & & & \\
 & -1 & 2& -1& & & \\
 & & \ddots & \ddots & \ddots & & \\
 & & & -1 & 2 & -1 & \\
 & & & & -1 & 2 & -1 \\
 & & & & & & 1
\end{pmatrix}
\begin{pmatrix}
u_0 \\ u_1 \\ u_2 \\ \vdots \\ u_{n-3} \\ u_{n-2} \\ u_{n-1}
\end{pmatrix}
=
\begin{pmatrix}
u_L \\ h^2 f_1 \\ h^2 f_2 \\ \vdots \\ h^2 f_{n-3} \\ h^2 f_{n-2} \\ u_R
\end{pmatrix}
$$

Solve this equation and output the \$u_i\$

One implementation of this for demonstration in Python:
import matplotlib.pyplot as plt
import numpy as np
def laplace(f, uL, uR, N):
 h = 1./(N-1)
 x = [i*h for i in range(N)]

 A = np.zeros((N,N))
 b = np.zeros((N,))

 A[0,0] = 1
 b[0] = uL

 for i in range(1,N-1):
  A[i,i-1] = -1
  A[i,i]   =  2
  A[i,i+1] = -1
  b[i]     = h**2*f(x[i])

 A[N-1,N-1] = 1
 b[N-1]     = uR

 u = np.linalg.solve(A,b)

 plt.plot(x,u,'*-')
 plt.show()

 return u

print laplace(lambda x:-2, 0, 0, 10)
print laplace(lambda x:10*x, 0, 1, 15)
print laplace(lambda x:np.sin(2*np.pi*x), 1, 1, 20)

Alternative implementation without Matrix Algebra (using the Jacobi method)
def laplace(f, uL, uR, N):
 h=1./(N-1)
 b=[f(i*h)*h*h for i in range(N)]
 b[0],b[-1]=uL,uR
 u = [0]*N

 def residual():
  return np.sqrt(sum(r*r for r in[b[i] + u[i-1] - 2*u[i] + u[i+1] for i in range(1,N-1)]))

 def jacobi():
  return [uL] + [0.5*(b[i] + u[i-1] + u[i+1]) for i in range(1,N-1)] + [uR]

 while residual() > 1e-6:
  u = jacobi()

 return u

You may however use any other method to solve the Laplace equation. If you use an iterative method, you should iterate until the residual \$|b-Au| < 10^{-6}\$, with \$b\$ being the right hand side vector \$u_L,f_1 h^2,f_2 h^2, \dots\$
Notes
Depending on your solution method you may not solve the examples exactly to the given solutions. At least for \$N \to \infty\$ the error should approach zero.
Standard loopholes are disallowed, built-ins for PDEs are allowed.
Bonus
A bonus of -30% for displaying the solution, either graphical or ASCII-art.
Winning
This is codegolf, so shortest code in bytes wins!

I recommend adding an example which is not analytically solvable, e.g. with f(x) = exp(x^2).

@flawr Sure, it has a solution however the error function is involved.

Sorry, that was perhaps the wrong expression, might "non-elementary antiderivative" be better suited? I mean functions like log(log(x)) or sqrt(1-x^4) which do have an integral, which is however not expressible in elementary functions.

@flawr No it is fine, the error function is not elementary, I just wanted to say there is a way to express the solution analytically but u(x) = 1/2 (-sqrt(π) x erfi(x)+sqrt(π) erfi(1) x+e^(x^2)-e x+x-1) is not exactly calculable.

Why iterate until 1e-6 and not iterate until 1e-30?

@RosLuP Well why don't iterate until 1e-1000? With single/double precision you get up the 1e-7/1e-16 relative error tolerance. So it is just a technical limit.

Mathematica, 52.5 bytes (= 75 * (1 - 30%))
+0.7 bytes per @flawr 's comment.
ListPlot[{#,u@#}&/@Subdivide@#4/.NDSolve[-u''@x==#&&u@0==#2&&u@1==#3,u,x]]&

This plots the output.
e.g.
ListPlot[ ... ]&[10 x, 0, 1, 15]

Explanation
NDSolve[-u''@x==#&&u@0==#2&&u@1==#3,u,x]

Solve for the function u.
Subdivide@#4

Subdivide the interval [0,1] into N (4th input) parts.
{#,u@#}&/@ ...

Map u to the output of Subdivide.
ListPlot[ ... ]

Plot the final result.
Non-graphing solution: 58 bytes
u/@Subdivide@#4/.NDSolve[-u''@x==#&&u@0==#2&&u@1==#3,u,x]&

This does not work for f(x) = exp(x^2)

Perhaps you might want to use NDSolve for the general case of non elementary solutions.

Matlab, 84, 81.2 79.1 bytes = 113 - 30%
function u=l(f,N,a,b);A=toeplitz([2,-1,(3:N)*0]);A([1,2,end-[1,0]])=eye(2);u=[a,f((1:N-2)/N)*(N-1)^2,b]/A;plot(u)

Note that in this example the I use row vectors, this means that the matrix A is transposed. f is taken as a function handle, a,b are the left/right side Dirichlet contraints.
function u=l(f,N,a,b);
A=toeplitz([2,-1,(3:N)*0]);       % use the "toeplitz" builtin to generate the matrix
A([1,2,end-[1,0]])=eye(2);        % adjust first and last column of matrix
u=[a,f((1:N-2)/N)*(N-1)^2,b]/A;   % build right hand side (as row vector) and right mu
plot(u)                           % plot the solution

For the example f = 10*x, u_L = 0 u_R = 1, N = 15 this results in:

R, 123.2 102.9 98.7 bytes (141-30%)
Edit: Saved a handful of bytes thanks to @Angs!
If someone wants to edit the pictures feel free to do so. This is basically an R adaptation of both the matlab and python versions posted.
function(f,a,b,N){n=N-1;x=1:N/n;A=toeplitz(c(2,-1,rep(0,N-2)));A[1,1:2]=1:0;A[N,n:N]=0:1;y=n^-2*sapply(x,f);y[1]=a;y[N]=b;plot(x,solve(A,y))}

Ungolfed & explained:
u=function(f,a,b,N){
    n=N-1;                                              # Alias for N-1
    x=0:n/n;                                            # Generate the x-axis
    A=toeplitz(c(2,-1,rep(0,N-2)));                     # Generate the A-matrix
    A[1,1:2]=1:0;                                       # Replace first row--
    A[N,n:N]=0:1;                                       # Replace last row
    y=n^-2*sapply(x,f)                                  # Generate h^2*f(x)
    y[1]=a;y[N]=b;                                      # Replace first and last elements with uL(a) and uR(b)
    plot(x,solve(A,y))                                  # Solve the matrix system A*x=y for x and plot against x
}

Example & test cases:
The named and ungolfed function can be called using:
u(function(x)-2,0,0,10)
u(function(x)x*10,0,1,15)
u(function(x)sin(2*pi*x),1,1,20)
u(function(x)x^2,0,0,30)

Note that the f argument is an R-function.
To run the golfed version simply use (function(...){...})(args)

I think you can drop the is.numeric(f) check if you declare f as function, it is no requirement to pass it directly in the function call to the solver.

Ah I see, I did not know there is a difference between those two. Well, if it shorter you can modify your solver to accept f as a function so you don't have to check for the case it is a constant (function).

@Billywob there's no need for f to ever be numeric. f = (function(x)-2) works for the first example, so there's never a need to rep.

You can use x<-0:10/10;f<-function(x){-2};10^-2*sapply(x,f) if  f(x) isn't quaranteed to be vectorized or just 10^-2*f(x) if f is vectorized (laplace(Vectorize(function(x)2),0,0,10)

Don't use eval, give f as a proper function.

So y=(N-1)^-2*f(x); works just fine, vectorization of f is the caller's responsibility.

@Angs Thanks, I updated the answer but I don't think vectorization should be the caller's responsibility. Besides, it's only a 4.9 byte difference.

Haskell, 195 168 bytes
import Numeric.LinearAlgebra
p f s e n|m<-[0..]!!n=((n><n)(([1,0]:([3..n]>>[[-1,2,-1]])++[[0,1]])>>=(++(0<$[3..n]))))<\>(col$s:map((/(m-1)^2).f.(/(m-1)))[1..m-2]++[e])

The readability took quite a hit. Ungolfed:
laplace f start end _N = linearSolveLS _M y
  where
  n = fromIntegral _N
  _M = (_N><_N) --construct n×n matrix from list
        ( ( [1,0]           --make a list of [1,0]
          : ([3.._N]>>[[-1,2,-1]]) --         (n-2)×[-1,2,-1]
          ++ [[0,1]])       --               [0,1]
        >>= (++(0<$[3.._N])) --append (n-2) zeroes and concat
        )                   --(m><n) discards the extra zeroes at the end
  h  = 1/(n-1) :: Double
  y  = asColumn . fromList $ start : map ((*h^2).f.(*h)) [1..n-2] ++ [end]

TODO: Printing in 83 71 bytes.
Lemme see:
import Graphics.Rendering.Chart.Easy
import Graphics.Rendering.Chart.Backend.Cairo

D'oh!

I dont know much about Haskell, but perhaps the solution without matrix algebra might be shorter, I added a second sample implementation.

@KarlNapf doesn't come very close This is only semi-golfed but it has to use a lot of verbose built-in functions. With matrix algebra most of the code is building the matrix (64 bytes) and the import (29 bytes). The residual and jacobi take quite a lot space.

Well, too bad but it was worth a try.

Axiom, 579 460 bytes
l(w,y)==(r:=0;for i in 1..y|index?(i,w)repeat r:=i;r)
g(z:EQ EXPR INT,y:BasicOperator,a0:Float,a1:Float,a2:Float):Float==(r:=digits();digits(r+30);q:=seriesSolve(z,y,x=0,[a,b])::UTS(EXPR INT,x,0);w:=eval(q,0);s:=l(w,r+30);o:=solve([w.s=a0,eval(q,1).s=a1]::List(EQ POLY Float),[a,b]);v:=eval(eval(eval(q,a2).s,o.1.1),o.1.2);digits(r);v)
m(z:EXPR INT,a0:Float,a1:Float,n:INT):List Float==(n:=n-1;y:=operator 'y;r:=[g(D(y x,x,2)=-z,y,a0,a1,i/n)for i in 0..n];r)

ungolf it and test
Len(w,y)==(r:=0;for i in 1..y|index?(i,w)repeat r:=i;r)

-- g(z,a0,a1,a2)
-- Numeric solve z as f(y''(x),y'(x),y(x))=g(x) with ini conditions y(0)=a0   y(1)=a1 in x=a2
NSolve2order(z:EQ EXPR INT,y:BasicOperator,a0:Float,a1:Float,a2:Float):Float==
      r:=digits();digits(r+30)
      q:=seriesSolve(z,y,x=0,[a,b])::UTS(EXPR INT,x,0)
      w:=eval(q,0);s:=Len(w,r+30)
      o:=solve([w.s=a0,eval(q,1).s=a1]::List(EQ POLY Float),[a,b])
      v:=eval(eval(eval(q,a2).s,o.1.1),o.1.2);digits(r)
      v

InNpoints(z:EXPR INT,a0:Float,a1:Float,n:INT):List Float==(n:=n-1;y:=operator 'y;r:=[NSolve2order(D(y x,x,2)=-z,y,a0,a1,i/n)for i in 0..n];r)

the function for the question is m(,,,)
the above code is put in the file  "file.input"
and load in Axiom. The result depends from the digits() function.
if some one think it is not golfed => he or she can show how to do it...
thanks
PS
it seems the 6 numbers afther the . for e^(x^2) are not ok here or in the examples
but here i increase the digits but numbers not change... for me it means that
numbers in example are wrong. Why all other has not showed their numbers?
for sin(2*%pi*x) there are problems too
"Here the exact solution is u = (sin(2*π*x))/(4*π^2)+1"
i copyed the exact solution for x=1/19:
              (sin(2*π/19))/(4*π^2)+1

in WolframAlpha
https://www.wolframalpha.com/input/?i=(sin(2%CF%80%2F19))%2F(4%CF%80%5E2)%2B1
it result
1.008224733636964333380661957738992274267070440829381577926...
1.0083001
  1234
1.00822473

1.0083001 proposed as result
is different in the 4th digit from the real result 1.00822473...
(and not 6th)
-- in interactive mode
(?) -> )read  file
(10) -> digits(9)
   (10)  10
                                                        Type: PositiveInteger
(11) -> m(-2,0,0,10)
   (11)
   [0.0, - 0.0987654321, - 0.172839506, - 0.222222222, - 0.24691358,
    - 0.24691358, - 0.222222222, - 0.172839506, - 0.098765432, 0.0]
                                                             Type: List Float
(12) -> m(10*x,0,1,15)
   (12)
   [0.0, 0.189868805, 0.376093294, 0.555029155, 0.72303207, 0.876457726,
    1.01166181, 1.125, 1.21282799, 1.27150146, 1.29737609, 1.28680758,
    1.2361516, 1.14176385, 1.0]
                                                             Type: List Float
(13) -> m(sin(2*%pi*x),1,1,20)
   (13)
   [1.0, 1.00822473, 1.01555819, 1.02120567, 1.0245552, 1.02524378, 1.02319681,
    1.0186361, 1.01205589, 1.00416923, 0.99583077, 0.987944112, 0.981363896,
    0.976803191, 0.97475622, 0.975444804, 0.978794326, 0.98444181, 0.991775266,
    1.0]
                                                         Type: List Float
(14) -> m(exp(x^2),0,0,30)
   (14)
   [0.0, 0.0202160702, 0.0392414284, 0.0570718181, 0.0737001105, 0.0891162547,
    0.103307204, 0.116256821, 0.127945761, 0.138351328, 0.147447305,
    0.155203757, 0.161586801, 0.166558343, 0.170075777, 0.172091643,
    0.172553238, 0.171402177, 0.168573899, 0.163997099, 0.157593103,
    0.149275146, 0.13894757, 0.126504908, 0.111830857, 0.0947971117,
    0.0752620441, 0.0530692118, 0.0280456602, - 0.293873588 E -38]
                                                             Type: List Float

The numerical solution differs from the exact solution because the FDM here is only second order, that means only polynomials up to order 2 can be represented exactly. So only the f=-2 example has a matching analytical and numerical solution.

here the numeric solution seems ok if i change digits to 80 or 70      -> g(sin(2*%pi*x),1,1,1/19)
  1.0082247336 3696433338 0661957738 9922742670 7044082938 1577926908 950765832 the other number
  1.0082247336 3696433338 0661957738 9922742670 7044082938 1577926...

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/


text:
Encode the backwards alphabet cipher
Given a string of text that contains lowercase letters, encode it as follows: (I will be using abcdef)

First, encode the alphabet cipher, but this time, 0-indexed. 000102030405
Reverse it. 504030201000
Loop through the string.

If the next two digits together are 25 or smaller, encode those two numbers. 5 04 03 02 01 00 0
Otherwise, encode one number. f e d c b a a

Join. fedcbaa

Test cases
abcdef                          fedcbaa
abcdefghijklmnopqrstuvwxyz      fyxwvucjsrqponmlktihgfedcbaa
helloworld                      dbromylloha
ppcg                            gcfpb
codegolf                        fboqedema
programmingpuzzlesandcodegolf   fboqedemddkiobpzuzqdscmkhqerpb

Encoder (not golfed)
Remember, this is code-golf, so the code with the fewest bytes wins.

I get different answers for some of the test cases.  For example, codegolf becomes 0214030406141105, reversing to 5011416040304120, split as 5,01,14,16,04,03,04,12,0 turning into fboqedema instead of fbobgedema as you have.

@GabrielBenamy Fixed. Thank you for telling me.

@xigoi cc actually encodes to uu.

@OliverNi Sorry, I forgot about the leading zeros. An actual example of why this isn't reversible is that both qx and qcd encode to dcgb.

@xigoi Ah yep, you're right. Not a great challenge tbh, but i wrote it a long time ago so

JavaScript, 126 125 bytes
s=>[...s.replace(/./g,c=>(parseInt(c,36)+90+'').slice(1))].reverse().join``.replace(/2[0-5]|[01]?./g,c=>(+c+10).toString(36))

Try it online!

Perl, 73 + 2 = 75 bytes
Run with the -lp flag
s/./sprintf"%02d",-97+ord$&/eg;$_=reverse;s/2[0-5]|[01]?[0-9]/chr$&+97/eg

Haskell, 107 bytes
g.reverse.(>>=tail.show.(+3).fromEnum)
g(a:b:c)|r<-read[a,b],r<26=['a'..]!!r:g c
g(a:b)=[a..]!!49:g b
g e=e

Try it online!

05AB1E, 31 26 bytes
-5 bytes after taking a look at Lynn's Haskell answer.
Ç3+€¦JR[Ð2£₂‹>DŠ£Aè?.$DõQ#

Try it online!
Ç                     # codepoints of the input
 3+                   # add 3 to each (a->100, b->101, ...)
   €¦                 # remove the leading "1" from each number/string
     J                # join into a single string
      R               # and reverse the string
                                                                          STACK
[                     # infinite loop
 Ð                    # push 2 copies of the current remaining string s   s, s, s
  2£                  # take the first two chars of s                     s[:2], s, s
    ₂‹                # are they (as a number) less than 26 (0 or 1)      s[:2]<26, s, s
      >D              # add 1 and duplicate the result                    (s[:2]<26)+1, (s[:2]<26)+1, s, s
        Š             # rotate the top three items on the stack           (s[:2]<26)+1, s, (s[:2]<26)+1, s
         £            # take the first or two first characters from s     s[:(s[:2]<26)+1], (s[:2]<26)+1, s
          Aè          # index with those into the alphabet
            ?         # and print the result without a trailing newline
             .$       # remove the characters from s                      s[(s[:2]<26)+1:]
               DõQ#   # if s is now empty, exit the loop