text:
Guess how to pronounce German words
Introduction
Unlike English, German is considered to have quite a phonemic writing system. That means that the correspondence between spelling and pronunciation is close. Given any word you aren't familiar with, you would still know how to pronounce it because of the spelling system. This means a computer should be able to do it too right?
Challenge
Write a program or function that takes as input a string representing a German word, and prints or returns its pronunciation in the International Phonetic Alphabet (IPA).
I am of course not going to make you learn German or the full IPA. This one Wikipedia section provides almost all the German to IPA rules you need, and I've coded an ungolfed C# reference implementation.
Also provided in that link is a list of 400 common German words and their IPA pronunciation (needed for validation). Taking an example from that list, if the input is solltest, the correct output is ˈzɔltəst.
The reference implementation adds two helpful rules not mentioned in the Wikipedia section: It assumes word stress is on first syllable (very likely in German), and uses a better heuristic for determining when the letter "e" represents the schwa sound /ə/. It also implements special processing for prefixes, but that didn't improve results as much as I thought it would.
Details
To be considered a valid entry, your program must meet the following requirements:

Your IPA output must be an exact match for at least 300 of the 400 words in the reference word list (the reference implementation gets 333 correct)
Your program must make a guess for any plausibly German word. So we have a technical requirement, this will mean that for any input that matches the regex [a-zA-ZäÄöÖüÜ][a-zäöüß]* and has at least one vowel (aeiouyäöü), you must produce non-whitespace-only output and not error out.
The program must be deterministic (always produce the same output given the same input)
Otherwise, standard loopholes are forbidden (especially the one about fetching off-site resources)

Miscellaneous things you are allowed to do:

Have leading and trailing whitespace in your output if you must
Use any pre-existing character encoding in the output (I can't imagine anything other than Unicode working well, but if you can, congrats)
Assume the input is in some normalized form like Unicode normalization forms NFD, NFC, etc. For example, is ä written as a single character or a base character + a combining character?
Use standard input and output methods

Scoring & IPA Characters
Scoring is in bytes. Be warned that the German characters and the IPA characters are 2 bytes in UTF-8. Also, the IPA character U+0327 COMBINING INVERTED BREVE BELOW ( ̯) is a Unicode combining character and is a 2 byte UTF-8 character on its own. That means something like ɐ̯ would count as 4 bytes in UTF-8. For the curious, this symbol means the vowel does not form the syllable nucleus (the previous one does instead).
Also, beware of these IPA characters that in some fonts look like other ASCII characters: ɡ, ɪ, ʏ, ː (marks a long vowel), ˈ (marks which syllable has the stress in a multisyllable word).
How the reference word list was created
This section is extra info not needed for the challenge.
The word list was grabbed from this Wiktionary word frequency list, removing repeats because of casing difference and two words that didn't have German entries in the English Wiktionary (oh & hey). The IPA was from looking at both the English and German Wiktionaries. Where multiple pronunciations were offered, I chose the more formal and standard one. If this wasn't clear, I chose the one that most fit the general rules.
I also had to standardize how the letter "r" is pronounced. It is heavily dependent on the region how this letter pronounced, and Wiktionary was not at all consistent in which one it chose. I felt it tended towards the following: "r" is pronounced /ɐ̯/ when followed by a long vowel and a vowel does not follow, otherwise, it is ʁ. So, I changed all of them to follow that rule, except for the ver- and er- prefixes that were quite consistently /(f)ɛɐ̯/. Similarly, I standardized "eu" as /ɔʏ̯/.

Mathematica has a built-in for this (#~WordData~"PhoneticForm"&), but it works only for English words.

@JungHwanMin I read your comment as follows: Immediate heart attack, sigh of relief.

How should I know "gestern" is pronounced "GHES-tern" instead of "ge-SHTERN"? "bester" as "BEST-er" not "be-SHTER"?

@LeakyNun There's no 100% algorithm for this, but your implementation only needs to get 75%. My reference implementation also gets those words wrong.

@LeakyNun Well, your program will also be able to deal with German dialects, so it is more powerful.

Do we need to take 'ẞ' as well as 'ß'?

@Xenon No, i purposely left that character out of the requirements. I did however, just edit the requirement regex to be a bit more lax - I don't expect people to have to support random uppercase in the middle of a word, just at the start. Also, no need to support 'ß' at start of word.

@P.Siehr which German dialect pronounces the second syllable of "gestern" or "bester"?

@LeifWillerts A lot of German dialects contain the softening/flattening of hard sounds, like 'st' (as in the english word "best") to 'sch' (as in the english word "english"), or a hard 't' to a soft 'd' sound.  Examples are Schwäbisch (Swabian), kurpfälzisch (dialect of Electoral Palatinate (?)),  and probably sächsisch (Saxon), bayrisch (Bavarian). [Hard to tell how word x is spoken in dialect z, if you don't speak it.] About the pronounciation of first or second syllable: I'd say, that you still pronounce the first syllable, and the word just sounds different:  ge-stern  to ge-schtern.

The problem of "st" can be solved by: If "st" is at the beginning of the word it is prounced soft [∫t]. Examples: Stadt (city), Stuhl (chair), Stuttgart. If it is in the middle of the word, it is pronounced hard [st]. Examples: gestern (yesterday), bester (best), hast ([you] have), Hast (haste).  (Same goes for "sp" at beginning and end.)    I can't think of words breaking these rules.

@PhilippSiehr It seems to be more about the beginning of the syllable: Hauptstadt, Gestirn, Gestalt, Versteck, Besteck...

@PhilippSiehr negative for Saxon

@ChristianSievers More correctly, it’s the beginning of a morpheme.

@PhilippSiehr CC previous comment. A word that violates your rule (but admittedly is a proper noun) is Konstanz (pronounced with [∫t]). Also, overwhelming but not complete negative for Bavarian for the words you mention (only very small areas very near to the Allgäu may). Erst, however, is pronounced with [∫t] in Bavarian pretty consistently (to provide a different example)

PHP, 3311 2988 2916 2845 2759 2671 2667 2509 2484 bytes, passing 301/400

<?$f=fopen(__FILE__,r);fseek($f,__COMPILER_HALT_OFFSET__);eval(strtr(stream_get_contents($f),[F=>'=>',M=>'==','&'=>'&&',H=>'function ',A_=>'array',G=>'if',4=>'for','|'=>'||','~'=>'))','%'=>str,7=>'=$',8=>'[]',9=>'!$','@'=>'count(','#'=>';$',5=>'return ',3=>':(']));__halt_compiler();define(J,[ieh,ah,aa,Ah,eh,ee,ie,ih,oh,oo,Oh,uh,Uh,au,eu,Au,ei,ai,ey,ay,a,e,i,o,u,A,O,U,y])#b7e=8;Hv($a){5in_A_($a,J);}Hn($a){5!v($a);}Hpronounce($w){global$b,$e#w=%tr(%tolower(%tr($w,[ßF1,ÄF2,äF2,ÖF0,öF0,ÜF6,üF6]~,[1FS,2FA,0FO,6FU])#W=8#L7w;while($L)4each(A__merge([tzsch,dsch,tsch,zsch,sch,chs,ch,ck,dt,ng,nk,pf,ph,qu,ss,th,tz,b,c,d,f,g,h,j,k,l,m,n,p,r,s,S,t,v,w,x,z],J)as$c){$l=%len($c);G(sub%($L,0,$l)M$c){$W87c#L=sub%($L,$l);break;}}$s=8#l=@$W);4($o7t7i=0#i<$l#i++){$c7W[$i]#p7i?$W[$i-1]:0#n7iM$l-1?0:$W[$i+1];G(9n|!(n($c)&$cM$n&n($W[$i+2]~)$s[$o]87c;G($p&((9n&v($c)&n($p~|(n($n)&v($W[$i+2]~~$s[++$o]=8;}$s[@$s)-1]|A__pop($s);4each($s as$z){$b87t#t+=@$z)#e87t;}$o=[sieFziQ,duFduQ,'die'FdiQ,derFdeQT,zuFtsuQ,wirFviQT,mirFmiQT,denFdeQn,dassFdas,erFeQT,soFzoQ,warFvaQT,fürFfyQT,jaFjaQ,wieFviQ,dirFdiQT,nurFnuQT,demFdeQm,ihnFiQn,auchFaUBx,ihrFiQT,daFdaQ,schonFʃoQn,wennFvEn,malFmaQl,gutFguQt,nachFnaQx,willFvIl,mussFmUs,habFhaQp,vorFfoQT,ihmFmiQm,tunFtuQn][$w]?:'';G($o)goto x#P7B7S7V7Z=0;@$s)>1&$o=[verFfET,daFda,geFgC][join($s[0])]#o&$P=1&A__shGt($s);(($P|@$s)M2)&$o.=W)|(@$s)>2&$d=1&$h=(int)@$s)/2)#w=A__merge(...$s);4each($w as$l){G(0<$S--)continue#n7w[$B+1]#p7w[$B-1]#f=''#Z+=in_A_($B,$b)#f7lMd&9n?t3$lMb&(9n|$nMt)?p3$lMg&(9n|$nMt)?((9n&$pMi)?K:k)3$lMc?(($nMA|$nMe|$nMi)?ts:k)3$lMch?(($pMa|$pMo|$pMu)?x:K)3$lMchs|$lMx?ks3$lMck?k3$lMdsch?dZ3$lMdt|$lMth?t3$lMph|$lMv?f39f&$lMg?g3$lMh?(v($n)?h:'')3$lMng?N3$lMnk?Nk3$lMqu?kv3$lMr?((!v($n)&9nMt)?T:R)3$lMsch?S3$lMss|$lMS?s3$lMtsch|$lMtzsch|$lMzsch?tS3$lMtz|$lMz?ts3$lMw?v3$lMs?(9p&($nMp|$nMt~?S3v($n)?z:s):$f~~~~~~~~~~)#U=0;G(v($l~{G(%len($l)>1)($f=[auFaUB,euFcYB,eiFaIB][$l])|$U=1;else{G(n($n)&((9w[$B+2]&$n!=n)|v($w[$B+2]~)$U=1;G($lMe){$U=9n?:$U;G(9w[$B+2]){G($nMr)($f=A)&$U=9S=1;G($nMm|$nMl)$f=C;}}elseG($nMch)$U=0;G(in_A_($B,$e~$U=0;}$f=($U|9Z)&9f?($l[0]MO?D3$l[0]MU?y3$l[0]MA?E:$l[0]~).Q39f?($lMe?((9n|(9w[$B+2]&($nMn|$nMs~)?C:E)3$lMA?E3$lMi?I3$lMo?c3$lMu?U3($lMU|$lMy)?Y:$l~~~:$f)#V++;}$f7f?:$l;G($d&$ZM$h)$f.=W#o.7f#B++;}G(%pos($o,W)M=false&$V>1)$o=W.$o;4(#j++<%len($o);)G($o[$j]M$o[$j+1])$o=sub%($o,0,$j).sub%($o,$j+1);x:5%tr($o,[SFʃ,ZFʒ,KFç,gFɡ,NFŋ,QF'ː',WFˈ,TFɐ̯,BF'̯',RFʁ,AFɐ,EFɛ,OFœ,IFɪ,YFʏ,UFʊ,cFɔ,CFə,DFø]);}

Defines pronounce(string $word).
Usage:
assert(
    pronounce('darüber') == "daˈʁyːbɐ"
);

One note: 3 prefixes and 33 words are hard-coded, and some of the code is mildly optimized towards the testing list.
Testing code is here, though it does depend on this file.
To test:
php test.php all

Powered by the tears of ternary statements.
EDIT 7: Squeezed off ~170 bytes by writing a preprocessor into the program. As a consequence, the actual program (everything after __halt_compiler();) is kinda hard to read. If you want the unprocessed program, switch eval with print in the third statement.

This is actually 2667 bytes, not 2671 (assuming UTF-8)


text:
Generate triangular signal
Task:
Given sample index, x, calculate sample value f(x) of triangular wave, with period of 4 samples and amplitude 1. Offset can be negative and sample value could be either {0, 1, -1}.
Test cases:
   -5 -> -1
   -4 -> 0
   -3 -> 1
   -2 -> 0
   -1 -> -1
    0 -> 0
    1 -> 1
    2 -> 0
    3 -> -1
    4 -> 0
    5 -> 1

Personally I know two approaches in C - the first is using lookup table, the second is using conditional instructions. For brownie points, could you impress me with a pure "math" approach? (I mean a pure functional approach, e.g. not using conditional instructions or using memory for LUT.) But this is not an restriction. If you can't, or your language does not support it - just post any solution

What do you mean by "offset can be negative"? Also this is basically just a trigonometric function, so I'd be surprised if it isn't a dupe of something.

@JungHwanMin This has much more relaxed rules, so it's not really a dupe (though it asks for the same thing).

@Mego alright. Retracting my vote.

Related: https://codegolf.stackexchange.com/q/5522/60043

Can the wave be out of phase relative to the example?

How-to Guide: http://stackoverflow.com/questions/1073606/is-there-a-one-line-function-that-generates-a-triangle-wave

Mathematica, 8 bytes
Im[I^#]&

Explanation
Im[I^#]&
   I^#    (* Raise the imaginary unit to the input power *)
Im[   ]   (* Take the imaginary part *)

Ohh, beautiful approach. How did I not see this? :D

cant see algo how to generate imaginary unit in C.. =( im assembler man ^^ using builtins in exotic languages is not in my favor ) however is an answer..

TI-Basic, 7 5 4 bytes
sin(90Ans

(Degree mode)
-1 byte from @immibis from my old answer.

Old answer
imag(i^Ans

Pure-math approach on a calculator. :)
Just for fun, here's another pure-math (ish) solution for 9 bytes (In radian mode), or 8 bytes (Degree mode)
2/πsin-1sin(πAns/2 # Radians
90-1sin-1sin(90Ans # Degrees

yeah, but you just forget an imag() implementation.. but usin others code is fine, though.. good answer :)

@xakepp35 I don't understand. imag() is a valid function on TI-BASIC.

What's wrong with sin(90Ans? Why do you need the extra 90-1sin-1?

@immibis The 90^-1sin^-1 makes it a triangle wave for all values, but sin(90Ans works for what the question asks.

Python 2, 20 bytes
lambda n:n%2-n%4/3*2

Try it online!
I'm running a brute-force search for shorter arithmetic or bitwise expressions, I'll see if anything turns up. This one I hand-found.

Brute force expression search? Nice!

Julia 0.5, 12 bytes
!n=(2-n&3)%2

I like this approach because it's unlikely to be the shortest in any other language.
Try it online!
How it works
Julia's operator precedence is a bit unusual: unlike most other languages, bitwise operators have the same precedence as their arithmetic counterparts, so & (bitwise multiplication) has the same precedence as *.
First, n&3 takes the input modulo 4, with positive sign.
The result – 0, 1, 2, or 3 – is then subtracted from 2, yielding 2, 1, 0, or -1.
Finally, we take the signed remainder of the division by 2, returning 0, 1, 0, or -1.

Jelly, 3 bytes
ı*Ċ

Try it online!
How it works
ı*Ċ  Main link. Argument: n

ı*   Elevate i, the imaginary unit, to the n-th power.
  Ċ  Take the imaginary part of the result.

dc, 13
Not sure if you count the modulo % operator as "pure math":
?1+d*v4%1-2%p

Try it online.  Note that dc uses _ instead of - to indicate negative numbers.
Explanation
?              # read input
 1+            # add 1
   d*v         # duplicate, multiply, square root (poor-mans abs())
      4%       # mod 4
        1-     # subtract 1
          2%   # mod 2
            p  # print

Note that dc's % mod operator is the standard "CPU" version that maps negative values to negative values.

Can you just do abs((x+1)%4)-1 instead?

brainfuck, 136 bytes
>,>++++<[>->+<[>]>[<+>-]<<[<]>-]>>>>-[>+<-----]>--[-<+>>>+>>>+>>>+<<<<<<<<]<->>>>>>->--[>+<++++++]>++<<<<<<<<<<[[->>>+<<<]>>>-]>[.[-]]>.

Try it online!
There's probably a more trivial answer, but this essentially uses a table of values. Although brainfuck takes input as ASCII characters with positive values from 0 to 127, it still works as if it were able to accept negative values (to test, replace the , with n amount of - characters).
How it works
>,                                   take input (X)
>++++<                               take second input for modulo (4)
[>->+<[>]>[<+>-]<<[<]>-]             calculate X mod 4
>>>>-[>+<-----]>--                   create initial '1' character
[-<+>>>+>>>+>>>+<<<<<<<<]            duplicate '1' four times as 1,1,1,1
<->>>>>>->--[>+<++++++]>++<<<<<<<<<< change 1,1,1,1 to 0,1,0,-1
[[->>>+<<<]>>>-]>[.[-]]>.            move to the right X%4 * 3 times, then print the following two characters ( 0, 1, 0,-1)

Python, 26 24 21 bytes
lambda x:(1j**x).imag

-2 bytes thanks to ValueInk for realizing that the mathematical method is actually longer than the trivial approach :P
-3 bytes thanks to Dennis for pointing out that I don't need the int(...), thus making this shorter :)

lambda x:[0,1,0,-1][x%4] is actually shorter than your int-coerced answer lol

@ValueInk Oh...um this is embarrasing lol

Why would you use int() in the first place though?

@Dennis Because .imag gives a floating-point value and I'm not sure if that's allowed by the specs. It doesn't matter now :)

If floats aren't allowed, JavaScript will not be able to compete.

@Dennis Oh. Okay. Thanks :)

Mathematica, 18 bytes
#~JacobiSymbol~46&

This doesn't quite work: inputs 9 and 11 both give 1 as output, for example. The period of this function is 184, not 4.

However, JacobiSymbol[-4,#]& does work, and just costs one more byte. Nice idea!

again cant see an algrithm( just builtines written by others and couple of short code.. ah, all as usual. fine answer though

Python, 20 bytes
lambda n:n%2*(2-n%4)

An unnamed function which returns the result.
Try it online!

Pari/GP, 12 bytes
n->imag(I^n)

Try it online!

PHP, 20 bytes
<?=2<=>($argn&3?:2);

Haskell, 19 bytes
Port of Dennis's Julia solution, just because he said it wouldn't be shortest in any other language. (Someone might still prove me wrong that it's shortest in Haskell.)
f n=rem(2-n`mod`4)2

Try it online!
Haskell has two different remainder functions, one (rem) works like the Julia one, while the other (mod) gives a positive result even when the first argument is negative, and so is suitable for translating &3. (Haskell's actual &, called .&., alas requires an import Data.Bits.)

As far as I can tell, a port of Dennis's Julia solution is optimal for JavaScript too (14 bytes). Shows that even Dennis is fallible!

Octave, 22 bytes
@(x)round(sin(x*pi/2))

Try it online!

Ruby, 20 bytes
Simple and clean.
->x{[0,1,0,-1][x%4]}

C99, 27 bytes
Assuming you want the wave to be centered at the origin:
f(n){return cpow(1i,n)/1i;}

otherwise f(n){return cpow(1i,n);} will do. I originally had a cimag in there, but apparently trying to return an int from a _Complex int yields the real part, so I used that. It makes sense, but it'snnothing I would have predicted. Behavior is the same in gcc and clang

cpow is undefined xD

some #includes omitted, does not compile)))))

but +1 just for C

@xakepp35 That's actually not the fault of the includes, it's a linker problem. Compile with -std=c99 -lm and it should work. It works fine for me with both gcc and clang without any includes. Well, by fine I mean there are no errors, but a large number of warnings.

05AB1E, 5 bytes
4%<Ä<

Try it online!

The output is reversed, but from what I understood this is allowed:
+1 byte to multiply output by -1 using (.
   -5 -> 1
   -4 -> 0
   -3 -> -1
   -2 -> 0
   -1 -> 1
    0 -> 0
    1 -> -1
    2 -> 0
    3 -> 1
    4 -> 0
    5 -> -1

4%    # Amplitude of 4...
  <   # Period of 1...
   Ä  # Absolute value...
    < # Period of 1 centered at 0...

what I understood this is allowed

test cases are not passed ;-)

but +1 nice try

Pyth - 7 bytes (possibly 6)
ta2%tQ4

Try it
If the phase of the wave isn't important, 6 bytes:
ta2%Q4

Try it
Explanation:
ta2%tQ4
     Q    # The input
    t     # Subtract 1 to get the phase right (might not be necessary)
   %  4   # Take mod 4
 a2       # Absolute value of the result - 2
t         # Subtract 1 so the result is in [-1,0,1]

AWK, 26 bytes
{$0=(sqrt(($0%4)^2)-2)%2}1

Try it online!
This is an alternate approach using trig functions without the modulus operator.
{$0=int(sin($0*atan2(0,-1)/2))}1

Try it online !

Javascript ES6, 18 17 bytes
n=>n&1&&(++n&2)-1

Firstly, check if the input is even or odd and return 0 for all even values. For all odd inputs, increment and bitwise with 0b10 to remove any bits that don't interest us, then return the answer with an offset.

const f = n=>n&1&&(++n&2)-1;

for (let i = -5; i < 6; i++) {
  document.body.appendChild(document.createElement('pre')).innerHTML = `f(${i}) => ${f(i)}`;
}

Save a byte by replacing ? :0 with &&

@SteveBennett Thanks, great idea!

JavaScript, 15 bytes
n=>n&3&&2-(n&3)

Bitwise and 3 is equivalent to modulo 4 except without the weird rule on JavaScript's modulos of negative numbers. I did polynomial regression on the first four points at first but then realized I was being dumb because (1, 1), (2, 0), and (3, -1) is just 2-n.

a=n=>n&1&&2-(n&3);
console.log([a(-5), a(-4), a(-3), a(-2), a(-1), a(0), a(1), a(2), a(3), a(4), a(5)])

very well! +1 for the answer

R, 19 bytes
function(n)Im(1i^n)

Try it online!
A port of JungHwan Min's Mathematica answer.

source: Stack Exchange

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

sort: votes


text:
X marks the spot – a print job
Given two numbers, print a page with an "X" in the specified location (±10%).
The numbers must be either percentages or fractions of the page's print area dimensions, e.g. [25,75] or ["15%","0%"] or [0.33,1]. You do not have to consider margins. Just remember to state which number is width, and which is height, and which corner is the origin.
You may of course assume that a printer is connected, and any virtual printer counts too. In fact, you may want to set a PDF printer as your default printer before beginning this challenge.
You may create a printable file (e.g. a PDF) and send that to a virtual printer, which in turn creates your result PDF, but you may not directly create the final PDF. This has to be a proper print job.
If possible, please include a photo, scan, or screenshot of the result, or link to an online document. Note that Imgur accepts PDFs.
You will of course get more upvotes if you actually place an X rather than outputting newlines and spaces with an assumed font and paper size.
Example
For input height 75% and width 25%, from top left, print the following document:

Are we allowed to read the image file from anywhere?

@BetaDecay What image file?

The image in your question: https://i.stack.imgur.com/rfZeO.png

@BetaDecay You are supposed to generate a document, not read an image.

What paper size should we use/assume, or does it matter?

@StephenS Doesn't matter. Brownie points for handling any (given?) size.

What is the vertical position for continuous form paper? My printer is loaded with an 80ft‑roll, but there is no means for inspecting the remaining paper length beforehand (only an error occurs once the printer runs out of paper). Is the vertical length just one, i. e. one line? (= likely to succeed in its entirety)

@KaiBurghardt I believe there'll always be a logical page size.

MacOS Bash + OfficeJet Pro 8600, 46
(yes ''|sed $[$2*3/5]q;printf %$[$1*4/5]sX)|lp

Origin is the top-left corner.
I did a test print to check the character dimensions of what gets printed by lp to my printer - it appears to be 82w x 64h, so (integer) multiplying percentages by 3/5 and 4/5 respectively gets within the 10% tolerance.
Result, with command-line input of 25 75:

Whoa, must be the first physical object submission on PPCG.

@Adám nope - I had some on my printer question too :)

@Adám what about this?

APL (Dyalog) on Windows, 36 35 bytes
Anonymous function taking (Y,X) in percent from top left as argument
{'X.'⎕WC'Text'(2↓'X'⎕WC'Printer')⍵}

We begin with a list of three elements:
{ an anonymous function (all variables are local)
 ⍵ the argument, e.g. 75 25
 ( to the right of
  'X'⎕WC'Printer' Windows Create a Printer object named X, returning '#.X'
  2↓ drop two characters to get just 'X'
 ) to the right of
 'Text' what we will add
 'X.'⎕WC Windows Create a (type, content, position) object in the object X, returning '#.X'
} end of function (since X is local, it is destroyed when the function terminates, signalling to Windows that we are done with the print job, which causes Windows to print it)

Java 8, 210 209 bytes
-1 byte: changed to currying syntax
import java.awt.print.*;
x->y->{PrinterJob j=PrinterJob.getPrinterJob();j.setPrintable((g,p,i)->{g.drawString("X",(int)(p.getWidth()*x),(int)(p.getHeight()*y));return i;});try{j.print();}catch(Exception e){}};

Takes input as floating-point version of percent: 0.25, 0.75.
If paper size can be assumed as 8.5x11in (72dpi), 184 bytes
import java.awt.print.*;
x->y->{PrinterJob j=PrinterJob.getPrinterJob();j.setPrintable((g,p,i)->{g.drawString("X",x*612/100,y*792/100);return i;});try{j.print();}catch(Exception e){}};

Uses default values for printing to PDF. Now takes input as integer version of percent: 25, 75.
If a Windows OS can also be assumed, 177 bytes
import sun.awt.windows.*;
x->y->{WPrinterJob j=new WPrinterJob();j.setPrintable((g,p,i)->{g.drawString("X",x*612/100,y*792/100);return i;});try{j.print();}catch(Exception e){}};

Same inputs as above: 25, 75.
Usage
import java.awt.print.*;
...
Function<Double, Consumer<Double>> f =
x->y->{PrinterJob j=PrinterJob.getPrinterJob();j.setPrintable((g,p,i)->{g.drawString("X",(int)(p.getWidth()*x),(int)(p.getHeight()*y));return i;});try{j.print();}catch(Exception e){}};
...
f.apply(.25).accept(.75);

Test Case
For input of 0.25, 0.75:

(I don't have a physical printer, but this should still work without issue)

Very impressive. Why do you need catch(Exception e){}?

@Adám Because PrinterJob.print() throws a PrinterException and I didn't see any way to get around it.

C#, 259 202 201 bytes
namespace System.Drawing.Printing{w=>h=>{var p=new PrintDocument();p.PrintPage+=(s,e)=>e.Graphics.DrawString("X",new Font("Onyx",9),Brushes.Red,e.PageBounds.Width*w,e.PageBounds.Height*h);p.Print();};}

Onyx is a font installed on my Windows 10 machine by default where 4 seems to be the shortest font name. I tested that by running the following in C# and then inspecting blah in the debugger.
var blah = FontFamily.Families.GroupBy(o => o.Name.Length)
                              .OrderBy(g => g.Key);

Full/formatted version:
namespace System.Drawing.Printing
{
    class P
    {
        static void Main(string[] args)
        {
            Func<float, Action<float>> f = w => h =>
            {
                var p = new PrintDocument();
                p.PrintPage += (s, e) =>
                    e.Graphics.DrawString("X", new Font("Onyx", 9), Brushes.Red,
                                          e.PageBounds.Width * w, e.PageBounds.Height * h);
                p.Print();
            };

            f(0.25f)(0.75f);
        }
    }
}

Test case (0.25, 0.75):

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


text:
GottaFix for WannaCrypt?
Warning
The answers to this challenge test for a specific version of the patch that helps stop WannaCrypt/WannaCry attacks. Depending on your operating system, you may have a different patch. The best way to protect yourself is to make sure your PC is fully up to date and be careful when opening attachments and web links.

Introduction
I like to think programmers are inherently good people, even if some aren't so nice, so lets help people make sure they are protected with the MS17-010 patch.
Challenge
Your challenge is to write a full program or function that returns a truthy or falsey value depending on if the MS17-010 patch is installed on the current operating system.
Input and Output
Input: No input required
Output: A truthy or falsey value (Indicate which is used for each case).
An error/exception can be considered a falsey value.
Rules

Your code should run (and output correctly) on at least one windows operating system for which the patch is available, but doesn't have to run on every operating system (Please state any limitations).
Standard loopholes apply
This is code-golf, so the submission with the least amount of bytes wins!

Hmm, one question.. Regarding the truthy/falsey values, is an error allowed as falsey value, and truthy as an actual return, or isn't this allowed?

@KevinCruijssen even if it was, your answer fails the "only one truthy value" ;-)

I don't think it's listed in the "allowed IO methods" meta-question, but feel to add it there to see if it gains traction.

@KevinCruijssen I'm happy to consider an error as a falsely value. I think it's a clear indicator that the patch is not installed.

Nice. My suggestion to list this in the general IO rules still applies, though.

If users missed this patch but installed a later one they will still be protected so this could give a false negative for some users.

I'd be interested in seeing some answers that actually test for the presence of the vulnerability rather than the presence of the patch. I'm not sure how easy it is to exploit/trigger and if it could be done in a short code snippet.

@MichealJohnson not sure it's wise to encourage people to post code demonstrating how to exploit the vulnerability.

Is the infection of the host pc a valid falsey value? It would obviously get the point across

I thought this was going to be a question AboutJoining WordsTogether LikeThis.

Can we use the vulnerability to show the answer ?

@Hybris95 No, the challenge is to test if the specific patch is installed, the vulnerability could have been fixed in a different patch.

@IanMiller I'd not use some codegolf thingy to do serious stuff in real life...

PowerShell 2.0, 24 20 16 bytes
hotfix KB4012212

-4 bytes thanks to @whatever by removing  -id.
-4 bytes thanks to @DankoDurbić by changing get-hotfix to hotfix.
KB4012212 is the patch for Windows 7. This can be replaced with any KB-code from the linked page of the patch.
Will return the Source, Description, HotFixID, InstalledBy and InstalledOn information when it's installed as truthy value, and will give an error if it's unable to find it as falsey value.
Here is an example of both a truthy and falsey output (so KB4012212 is installed on my machine, but KB4012215 is not):

an answer on PPCG that's actually useful for practical purposes? I'm impressed.

You don't need to specify the id Get-HotFix KB4012212 will work too. (Tested with PSv4 only). But I agree with Jan Dvorak, I don't think the output confirms to the challenge.

@JanDvorak see comment on question, happy to allow an error as a false value as I think it's a clear indicator the patch isn't installed.

this command just froze my powershell :(

@lllamnyp are you sure it really froze permanently? It can take quite some time...

On Win10 it fails (obviously) in ~ 3 seconds

Doesn't work if you are already on the next or later monthly roll-up, because those replace each other.

@Sumyrda the challenge is to check for this specific patch, it doesn't have to check for replacement patches.

@Notts90 Yes, the comment is meant as a hint for people who try the code and get a false negative.

Just hotfix KB4012212 is enough. In Powershell you don't need to write get-.

@DankoDurbić, you have to if there happens to be another command matching the command without Get-, but in this particular case it works :-)

does anyone know if this works for Petya too?

Batch / Windows CMD, 31 29 28 23 bytes
wmic qfe|find "4012212"

-1 byte thanks to @SteveFest by changing findstr 4012212 to find "4012212".
-5 bytes thanks to @BassdropCumberwubwubwub by removing  list.
Explanation:
wmic          Windows Management Instrumentation Command-line
qfe           Quick Fix Engineering
|find "..."   Looks for the string in the complete output

Outputs some patch info if it's installed, or nothing otherwise.
In the screenshot below, patch 4012212 is installed, and 4012215 is not.

this will get problematic once 40M updates rolls around

use find instead of findstr, it saves 3 bytes

Doesn't work if you are already on the next or later monthly roll-up, because those replace each other.

@Sumyrda the challenge is to check for this specific patch, it doesn't have to check for replacement patches.

find "4012212" also works for -1 byte, wmic qfe|find "4012212" seems to work too but maybe i'm missing something there?

Bash + Cygwin (Or WSL), 21 bytes
This answer is mostly stolen from Kevin's answer. So throw an upvote that way also if you think this deserves one.
wmic qfe|grep 4012212

Cygwin has access to the Windows commands in addition to coreutils. We are able to use coreutils's grep instead of Windows's find so we don't need to use quotes. 2 bytes are saved because of this.

Oh well yeah that's shorter than mine ; I didn't pick the good MS user to steal from !

Someone edited this to include "Or WSL" which I guess is true but you'd have to modify the path first.

Powershell 5.1, 245 212 207 bytes
$S=New-Object -ComObject Microsoft.Update.Session;$T=$S.CreateUpdateSearcher();$H=$T.GetTotalHistoryCount();$p=0;$T.QueryHistory(0,$H)|ForEach-Object -Process{if($_.Title -like"*KB4013429*"){$p=1;}};echo $p;

-33 bytes thanks to @KevinCruijssen removing white space and replacing true and false with 1 and 0.
-5 bytes thanks to @KevinCruijssen shortening variable names
Obviously not going to win any prizes, but this powershell script will check the Microsoft Update history log for KB4013429 (one of the patches listed on the link) it can be replaced with any of the patches. Thought I'd post it because it's a little more reliable if the patch has been replaced with a later one.

Hi, welcome to PPCG! :) Since this question is tagged code-golf, the idea is to complete the challenge in as few bytes as possible. I know your answer probably won't win anyway, and you've used a more complete method than I did, but you can still golf your current answer by removing unnecessary whitespaces, and use 1/0 instead of of true/false. Like this: $S=New-Object -ComObject Microsoft.Update.Session;$Se=$S.CreateUpdateSearcher();$Hc=$Se.GetTotalHistoryCount();$p=0;$Se.QueryHistory(0,$Hc)|ForEach-Object -Process{if($_.Title -like"*KB4013429*"){$p=1;}};echo $p; (212 bytes)

Oh, and another thing you can golf which I only notice now: It's best to always use single-character variable/method/class names. So you can change the Hc to H and the Se to T (or another single letter besides H or S which you've already used) to save another 5 bytes. :)

Can't you pass  $H  directly instead of storing in? Also %{ } and ?{ } instead of ForEach-Object and if. Pretty sure you can just output to the pipeline rather than the echo since you should only have one result match and I think that would count as truthy based on the OP

C#, 178 143 141 134 bytes
_=>new System.Management.ManagementObjectSearcher("SELECT * FROM Win32_QuickFixEngineering WHERE HotFixID='KB3150513'").Get().Count>0;

Compiles to a Func<int, bool> where the input is unused.
Saved 35 bytes with the help of @Ryan
Saved 2 bytes thanks to @KevinCruijssen
Saved 7 bytes thanks to @ErikKarlsson
Formatted version:
System.Func<int, bool> f = _ =>
    new System.Management.ManagementObjectSearcher("SELECT * FROM Win32_QuickFixEngineering WHERE HotFixID = 'KB3150513'")
                         .Get().Count > 0;

isn't if(h["HotFixID"]=="KB4012212")return 1>0;return 1<0; the same as return h["HotFixID"]=="KB4012212"?

@JulianWolf No because the latter would only check the first item that comes back whereas the former checks on each iteration.

Ah, right. I miscounted parentheses and though the foreach had ended.

Why not return 1 or 0, not true or false?

@programmer5000 The only truthy/falsey values in C# are bools.

Could you add a where clause in the ManagementObjectSearcher query and add a count on the end of the .get()? Like this: _=>{if (new System.Management.ManagementObjectSearcher("SELECT HotFixID FROM Win32_QuickFixEngineering WHERE HotFixID = 'KB3150513'").Get().Count > 0)return 1>0;return 1<0;};. To save 4 bytes

@Ryan Turns out you can, don't know why I didn't think of that haha. Also means I can now use an implicit return to save even more bytes.

+1 For not being in a shell scripting language.

Could replace .Get().Count>0 with .Get().Any()?

@aloisdg Only with the penalty of adding using System.Linq; to the byte count.

@TheLethalCoder I dont count it since some C# script env include it by default. I dont know if we have a rule for that.

@aloisdg If it needs it to run, it should be included and this is a "normal" C# program so it needs it. That said C# interactive and possibly some other things, like Linqpad?, include it by default without you knowing they're included so you don't need to add it into the byte count for those.

I'm not sure, but since the SELECT statements looks like a regular SQL-query to me, can't you remove the spaces at WHERE HotFixID='KB3150513' for -2 bytes?

@KevinCruijssen Sure can!

Erik Karlsson (who doesn't have enough rep to comment) suggested in an edit to save 7 bytes by replacing SELECT HotFixID with SELECT *.

Cygwin, 31 bytes
Just to play the rebel
grep KB4012212 "$WINDIR"/*e.log

the return code will be 0 if the patch has been applied, or 1 if it hasn't.
Tested under Windows 7 with Cygwin 2.6.0

Will this work if you remove the KB?

@TheLethalCoder I'm not sure, and I don't think I can find out. My answer is derived from ryan's and we both search text in the huge WindowsUpdate.log which contains much more than the KB names, I wouldn't bet the number can't appear in another context

Fair enough I didn't know enough about what yours was doing hence the question not a suggestion :)

This should work if you remove KB since it's rather unlikely that 4012212 will be there in anything except the path. You could also save 1 byte if you remove just the K because you're not going to find B4012212 randomly without the path.

@Sirens I'm not confident about testing the number only, I would be afraid to match 1) number of bytes transferred, 2) updates, report events and jobs UIDs or 3) hex error (and others) codes. Removing only the K first seems reasonable, but then B... becomes a valid hex representation, making collision with UIDs and hex codes possible

Wouldn't this also report yes on a failed install?

@FelixDombek I've checked my log and did not found any error on package installation that would mention their name (although I found a few errors while retrieving updates or testing applicability). I wouldn't be surprised if you were right, but I don't know how to reproduce an error that would (dis?)prove it

PowerShell v4, 64 bytes
HotFix|? HotFixID -m "401(221[2-7])|(2598)|(2606)|(3198)|(3429)"

Checks for all KB refs using a RegEx (now you have two problems)

Welcome to the site! Nice first answer!

Batch/Command Prompt, 27 25 bytes
systeminfo|find "4012212"

If KB4012212 is found output that, otherwise nothing is outputted.
Thanks to @Kevin for saving 2 bytes :)

I think you can remove the spaces around the pipe: systeminfo|find "4012212" for -2 bytes.

Powershell 2.0, 142 bytes

Returns 0 for "false", not patched" < 0 for "true", patched.

Below contains all KB's from March, but needs expanded with April, May KB's as each supersedes all previous.
(Get-HotFix | where HotFixID -match "4012598","4012216","4012213","4012217","4012214","4012215","4012212","4013429","4012606","4013198").Count

I'm not sure, but I think you can change (Get-HotFix | where to (HotFix|where (spaces removed, and Get- removed.

Powershell 5.1 134 Bytes
Same as Mark Pippin's but changed the Get-Hotfix to Hotfix and where to ? saving 8 bytes
(HotFix | ? HotFixID -match
 "4012598","4012216","4012213","4012217","4012214","4012215","4012212","4013429","4012606","4013198").Count

I can't get it lower in byte-count than Kevin's answer

You can remove the spaces around the pipe: (HotFix|? HotFixID ... for -2 bytes.

DISM, 40 bytes
dism/online /get-packages|find "4012212"

Explanation:
dism             Deployment Image Servicing and Management command-line
/online          Look at current running PC's Operating System
/get-packages    Display some basic information about all packages in the image
|find "..."      Looks for the string in the complete output

Outputs the package identity if it's installed, or nothing otherwise.
In the screenshot below, patch 4012212 is installed, and 4012215 is not.


text:
Infinitely Print Zeno's Dichotomy Paradox (1/(2^n))
Wikipedia: Zeno's Dichotomy Paradox

An infinite number of mathematicians walk into a bar. The first one orders a beer. The second one orders half a beer. The third one orders a fourth of a beer. The bartender stops them, pours two beers and says, "You're all a bunch of idiots."
Reddit

Print the following series for as long as the program runs, with the denominator of each item being multiplied by two each time:
1 + 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ...
As n approaches infinity, the sum of this sequence approaches 2.
Rules
No, you may not print 2.
You may not print 1/1 as the first item.
You may remove spaces 1+1/2+... or add spaces 1 + 1 / 2 + ... as you need.
You may use newlines instead of spaces as a delimiter due to popular demand.
You may append a . plus a constant number of 0s to the denominator if need be.
"Infinitely" means no unnecessary delays, and for as long as possible limited by the current (variable) system's specs, but not limited by your current language.
Standard loopholes apply.
This is code-golf, so shortest answer in bytes wins.

Regarding the joke, I like the "You guys should know your limits" version better.

Is it just me, or is that a parabola right there?

@StephenS Yes, I saw them too, but this one is much clearer and bigger.

What is meant by "limited by your current language."? Does that mean that any language which contains no reference to something like "Integer.MAX_VALUE" can be treated as having no max int value? Or does your "current language" include information in all compilers for said language?

@Shufflepants your program shouldn't break at a certain point based on its language. I.e., in Java, you have to use BigInteger and not int.

@Adám: yep! If the lengths of the denominators weren't changing, then the visual pattern of +1/s would just form a diagonal line. However, the lengths of the denominators is changing linearly (up to rounding): the number of digits of 2^n is about n log(2)/log(10). That linear change translates into a linear change in the relative position of each +1/ with respect to the preceding one, which is the same as a quadratic change in the absolute position.

@StephenS What about C? Making it go "infinitely" there is a significantly more complicated challenge than it is in languages with a built-in BigInteger; to answer in C, we'd have to either write our on BigInteger or do all the multiplications in the string -- neither of which is easy or short.

@QPaysTaxes then you are non-competing - but if multiple people want to post competing C answers, you can compete against each other :)

Can the output have trailing zeros? 1 + 1/2.0000 + 1/4.0000 ...

@EngineerToast is the number of trailing zeroes consistent across outputs (i.e. 1+1/2.0+1/4.0+1/8.0) or does it increase for each output (i.e. 1+1/2.0+1/4.00+1/8.000)? First would be OK, second would not.

05AB1E, 10 9 bytes
Saved 1 byte thanks to Erik the Outgolfer
[No…+1/J?

Try it online!
Explanation
[           # loop over N infinitely [0 ...]
 No         # calculate 2^N
   …+1/J    # join with the string "+1/"
        ?   # print without newline

You can golf this: [No?…+1/?

@EriktheOutgolfer: True! I knew that interpolation looked wasteful :P

Technically you should be using « instead of J but this works too.

@EriktheOutgolfer 'should use' isn't in a golfer's dictionary.

Python 2, 30 bytes
-5 thanks to Erik the Outgolfer
i=1
while 1:print i,'+1/';i*=2

Try it online!

C (gcc), 60 bytes
f(){for(long long n=1;n;n*=2)printf(&"+1/%llu"[n^1?0:3],n);}

Goes up the the unsigned 64bit limit.
Try it online!
This one goes on forever; (it's as small as it's going to get)
C (tcc), 312 264 255 251 233 231 208 204 195 190 188 170 bytes
l=4;c;main(i){for(char*t="*\b1+";puts(i=t),*++t=48;l=asprintf(&t,"1/%s",t+=*++t<49))for(t+=l-2;--t>i;)*t>52?*t=*t*2%58+c,c=*--t>52,*t=*t%48*2%10+49:(*t=*t*2-48+c+(c=0));}

Try it online!
Here's the not so golfed version;
c;l=4;main(i){
    for(char*t="*\b1+";puts(i=t),*++t=48;l=asprintf(&t,"1/%s",t+=*++t<49))
        for(t+=l-2;--t>i;)
            *t>52?*t=*t*2%58+c,c=*--t>52,*t=*t%48*2%10+49:(*t=*t*2-48+c+(c=0));
}

APL (Dyalog Unicode), 15 bytes
More fun if ⎕FR (Floating-point Representation) is 1287 (128 bit decimal) and ⎕PP (Print Precision) is 34.
{∇2×⊃⎕←⍵'+1/'}1

Try it online!
{…}1 apply the following function on the number 1:
 ⎕←⍵'+1/' print the argument and the the string
 ⊃ pick the first one (i.e. the argument)
 2× double that
 ∇ tail call recursion on that (optimised, so it can be infinitely repeated)

Jelly, 12 bytes
‘;“+1/”ȮḢḤ’ß

Try it online!

Pyth, 10 bytes
.V0^2b"+1/

Try it online!

Bash, 33 bytes
echo 1;yes|awk '{print"+1/"2^NR}'

Try it online!
Change print for printf and echo for printf to avoid newline

printf 1 also avoids the newline, no?

On my Awk (GNU Awk 4.2.1), I get repeated +1/inf from the 1024th term onwards.  :-(

dc, 19 18 bytes
1[rdp+[+1/]Prdx]dx

Explanation
We push 1 and [rdp+[+1/]Prdx] onto the stack.  We then duplicate and execute [rdp+[+1/]Prdx].  The first thing it does is to rotate the stack (r) so that the value is on top.  dp+ prints the value and adds itself (to multiply by 2).  [+1/]P prints the invariant +1/, then we rotate the arguments so the saved macro definition is at the top, duplicate it and start again.
Notes
GNU dc will normally wrap at 70 columns.  To override that and get an infinite line, add DC_LINE_LENGTH=0 to your environment variables.
Output (partial)
1
+1/2
+1/4
+1/8
+1/16
+1/32
+1/64
+1/128
+1/256
+1/512
+1/1024
+1/2048
+1/4096
+1/8192
+1/16384
+1/32768
+1/65536
+1/131072
+1/262144
+1/524288
+1/1048576
+1/2097152
+1/4194304
+1/8388608

...
+1/1042962419883256876169444192465601618458351817556959360325703910069443225478828393565899456512
+1/2085924839766513752338888384931203236916703635113918720651407820138886450957656787131798913024
+1/4171849679533027504677776769862406473833407270227837441302815640277772901915313574263597826048
+1/8343699359066055009355553539724812947666814540455674882605631280555545803830627148527195652096
+1/16687398718132110018711107079449625895333629080911349765211262561111091607661254297054391304192
+1/33374797436264220037422214158899251790667258161822699530422525122222183215322508594108782608384

...
[encoded data, 45163 characters]

...

i was 15 minutes late T_T, use dp instead of ddn to save a byte

I used dn to avoid introducing a newline, but did consider p (at the cost of uglier output).  Actually, on reflection, it's not so ugly, after all.

JavaScript (ES6), 36 34 bytes
for(a=1;;a*=2)console.log(a+'+1/')

Try it online!
Inspired by Jake Taylor's answer.
Note that this is limited by language since a is a floating-point variable, not an integer.
-2 bytes thanks to @Stefnotch.

You can save 2 bytes by leaving out the brackets after console.log. for(a=.5;;)console.log\${a*=2}+1/``   Though, your solution is limited by the language, because a is a float, not a big integer. (The challenge says that it should not be limited by the language, but rather by the system's specs.)

@Stefnotch That doesn't work unfortunately, because tagged templates with interpolation pass more than a single argument. I added the note about limitedness though, thank you.

Oh, sorry for not testing my code. Well, this code does shave off 2 bytes: for(a=1;;a*=2)console.log(a+"+1/")

@Stefnotch Oh, and it's a lot simpler, too :) Thank you.

GolfScript, 19 bytes
1{.'+1/'+puts.+.}do

Try it online!

CJam, 14 bytes
1{_o"+1/"o2*}h

Try it online!

><>, 14 bytes
1:n"/1+"ooo2*!

Try it online!

Ruby, 27 25 bytes
a=1;a*=2while$><<a<<'+1/'

Try it online!

R, 35 34 bytes
cat(i<-1);repeat cat("+1/",i<-i*2)

Spacing is a bit werid but I understand that's ok.

You can use repeat instead of while(T): cat(i<-1);repeat cat("+1/",i<-i*2) for 1 byte less.

Pyth, 10 bytes
#h~hyZ"+1/

Z starts out as zero. ~hyZ post-assigns the value of 2*Z+1 to Z. Thus, Z becomes 0, 1, 3, 7, 15, ... over successive iterations. h then prints out the value one greater. # runs the infinite loop, and "+1/ gets the  formatting right.

Vim, 22, 21 bytes/keystrokes
qqyiwA+1/<esc>p@"<C-a>@qqxX@q

While testing this, you might run into issues with the current register values. To fix this, run
:let @q=''
:let @"=''

before running this, or by launching vim with
vim -u NONE -i NONE

absolutely beautiful.

AWK, 3732 bytes
BEGIN{for(;;)printf 2^i++"+1/"}

Try it online!
Could remove the BEGIN and save 5 bytes if input were allowed.
Using exponents definitely cheaper byte-wise than multiplication.  :)
Hopefully 2^1023 is close enough to infinity (on my work computer).  Unfortunately the TIO link truncates earlier than that (around 921). But 17726622920963562283492833353875882150307419319860869157979152909707315649514250439943889552308992750523075148942386782770807567185698815677056677116184170553481231217950104164393978236130449019315710017470734562946173533283208371259654747728689409291887821024109648618981425152 does seem pretty close to infinity. :)

PHP, 32 Bytes
for(;;)echo bcpow(2,$i++)."+1/";

Online Version
-6 Bytes if values like 9.2233720368548E+18 are allowed

for(;;)echo 2**$i++."+1/";

Try it online!

Powershell, 34 bytes
for([bigint]$i=1;;$i*=2){"$i+1/"}

Try it online!

Go, 102 100 bytes
Go can be almost as bad as Java, apparently.
import(."fmt"
."math/big")
func main(){n:=NewInt(1);for{Print(n.String()+"+1/");n.Mul(n,NewInt(2))}}

Try it online! (Would be a good idea to avoid running any of these locally. :P)

No, not as bad as Java: Go is 5 bytes shorter :P

Java, 107 102 bytes
()->{for(java.math.BigInteger z=null,o=z.ONE,n=o;;n=n.add(n))System.out.print(n.max(o)==o?1:"+1/"+n);}

z=null exists to shorten the o=java.math.BigInteger.ONE into z=null,o=z.ONE, saving 12 bytes. z.ONE will not throw a NullPointerException because we access a static member and not an instance one.
Using int shortens the code, but fails to comply after 32 iterations.
Saves

107 -> 102 bytes: n.compareTo(o)>0 turned into n.max(o)==o, thanks to an idea given by @Shufflepants

This looks like one of the only entries that attempts to meet the rule: ""Infinitely" means no unnecessary delays, and for as long as possible limited by the current (variable) system's specs, but not limited by your current language." but it still doesn't do that because BigInteger still has a max value of 2^(Integer.MAX_VALUE).

@Shufflepants Where is that limit written? Nowhere ("may support values outside of that range"), so it's not a limitation of the language, but a limitation of the JVM, which then is the system. Also, "works on my computer", so good enough for codegolf ;)

If the implementation of a language or the JVM is considered part of the system and not the language, then you might as well use int instead of BigInteger.

No, because int and all other primitive types are limited at the language level. Also, the BigInteger doc explicitly says that a limit is optional, not mandatory (and that the default JVM implementation uses that limit).

This function "BigInteger max(BigInteger val)" exists in the specification too, which implies, that while the limit need not be what the current implementation limit is, it implies in the specification that there must be some finite limit.

That method means "take the biggest of the two numbers this and val". It's equivalent to return this > val : this : val;. So I honestly fail to see what you mean, sorry. I can't say anything more than what I quoted: a limit is optional :(

Sorry, got ahead of myself and misread it. Thought it was akin to Integer.MAX_VALUE but for BigInteger.

No problem. Thanks on making me double-check my code, I prefer a 100% compliant code when possible :)

@Shufflepants There, you got me golfing more when showing me the max method ;)

JavaScript (ES6), 45 43 42 bytes
Saved 2 bytes, thanks @DanielM !
Saved 1 byte, thanks @eush77 for pointing it out.
 =console.log;a=1;(1);for(;;)_(+1/${a*=2})
 =console.log;(a=1);for(;;)_(+1/${a*=2})
_=console.log;for(_(a=1);;)_(`+1/${a*=2}`)

My first go at Codegolf, go easy!

I was going to edit a snippet in for you, but then I broke my browser and remembered this is an infinite loop question xD

Yeah, had to restart my dev tools a couple times doing this!

The a=1 can go in the first part of the for, for(a=1;;) saving you a byte in extra semicolon.

_(a=1), work's with DanielM's suggestion too

@eush77 That doesn't create the right output imo. It will always have a trailing +1/, not a fraction.

@JakeTaylor You see, but it's infinite! It doesn't matter because every 1/ is followed by a number, it just happens to be printed on a next iteration of a loop. Given infinite amount of time, the output will be the same.

True, but it still feels incorrect, imo. I'll settle for 43 bytes.

@JakeTaylor I posted my solution separately.

@JakeTaylor I don't think you actually implemented DanielM's proposal though, with both DanielM's and  Felipe's I think it should be _=console.log;for(_(a=1);;)_(\+1/${a*=2}`)` (-1 byte)

Ah, yes. I'll edit again.

C#,  ̶6̶8̶ 154 bytes
void A(int b=1){System.Console.Write($"1{(b>1?"/"+b:"")}+");A(b*2);}

Here is a version not constrained by int
using System.Numerics;BigInteger b=new BigInteger(1);void A(){System.Console.Write($"1{(b>1?"/"+b:"")}+");b=BigInteger.Multiply(new BigInteger(2),b);A();}

Stops working very quickly once the denominator hits int.MaxValue

@Rob what should the behavior be?

Here's an example: https://codegolf.stackexchange.com/questions/120796/infinitely-print-zenos-dichotomy-paradox-1-2n/120863#120863

Okay thanx, the new version should be sufficient.

As-is, nothing is actually printed because there's no call to A(); outside of the recursive call in the function. Also, BigIntegers have implicit conversions from primitive numeric types and built-in operators. So you can shave a lot (54 bytes?) off by changing the initial declaration to just BigInteger b=1; and shortening the multiplication to b*=2;

Befunge 93: 14 bytes
1:.2*"/1+",,,#

Doesn't seem to be working on TIO. Is it written for some specific implementation?

@eush77 Looks like TIO expects a fixed 80 char width grid, causing the "#" to skip empty space instead of the next instruction. I usually test here, where the torus is  adjusted to the size of the actual code.

Jelly, 11 bytes
o©1“+1/”Ḥɼß

Try it online!
How it works
Jelly's parsing rules are very complicated and depend on the arities of the link. Usually, links are composed of collections of:

Dyad-nilad pairs (arities 2, 0) such as ÷4 (divide by 4)
Nilad-dyad pairs (arities 0, 2) such as 3< (greater than 3)
Monads (arity 1) such as L (length)
Dyad-monad and monad-dyads (arities 2, 1 and 1, 2) such as +H or H+ (both \$n + \frac n2\$)

However, sometimes (very rarely), the arity patterns don't make sense. This is referred to an "unparseable" link. One such example is
4 H 5 Ḥ

Try it online!
The arities here are 0, 1, 0, 1, and the second nilad doesn't fit into any of the patterns. In this case, 5 is called an "unparseable nilad", and it causes the program to output the previous value (4H, or 2) and discard it, using the 5 as the new link value. This causes the program about to output 210 (4H outputs 2 and 5Ḥ outputs 10 at the end of the program)
The arities of the program above are 2, 0, 0, 0, 1. The pattern 0, 0, 0 is unparseable, meaning that the third and fourth links (“+1/” and Ḥɼ) are unparseable nilads
o©1“+1/”Ḥɼß - Main link f(n). Initially n = 0
o 1         - Replace 0 with 1
 ©          - Save this value into the register
   “+1/”    - Unparseable nilad; Output 1 and use "+1/" as the argument
        Ḥɼ  - Unparseable nilad; Output "+1/" and use the below result as the argument:
         ɼ  -   Run the previous command on the register, then save the result back into the register:
        Ḥ   -     Unhalve; Yield 2n
          ß - Recurse, yielding f(2n)

QBIC, 18 bytes
?1{q=q*2?@+1/`';`q

Prints each term on a new line.
Explanation:
?1       Prints 1
{        Infinite loop
q=q*2    Doubles q, starts at 1*2=2
?@+1/`  Prints the string +1/
  ';`      without tabs, newlines or other terminators (code literal, ; is a QBIC function)
q        Also prints q
         The infinite loop is auto-closed by QBIC at EOF.

We can save a byte with a more liberal output format:
{?q,A,┘q=q*2#+1/

Aceto, 20 bytes
 pL*
pd12<
p"M"
1+1/

Prints the sequence without any spaces. When run, you won't see anything for a little while, because of buffering, run with -F to immediately see everything.

Pushes and prints a 1, then stores "+1/" in quick storage (the register).
Pushes a 1.
Multiplies by two, loads from the register, prints, duplicates, and prints.
GOTO 3.

Mathematica, 25 bytes
1//.n_:>(n~Print~"+";n/2)

Don't we have to print the +s as well as the numbers?

@GregMartin Fixed...

Haskell - 66 62 60 51 49 chars
import Data.List
main=print$intercalate" + 1/"$map(show.(2^))[0..]

This prints the string constructed by printing the string representations of the powers of two starting from 1, separated by the string " + 1/".
The code itself is 49 bytes, the import and newline push it up to 66
Edit: (62)
Shaved 4 bytes by cutting out the import and defining intercalate with a much shorter name
f(x:xs)s=x++s++xs`f`s
main=print$map(show.(2^))[0..]`f`" + 1/"

Edit 2: (60)
Shaved 2 more characters by realizing I didn't need to use the (x:xs) list convention:
f(x:y)s=x++s++y`f`s
main=print$map(show.(2^))[0..]`f`" + 1/"

Edit 3: (51)
Reimplemented the definition of f and the map as the body of a fold to save 9 more characters
main=print$foldr((++).(++" + 1/").show.(2^))""[0..]

Edit 4: (49)
As was pointed out by Laokoni, I can remove the spaces to cut down 2 more bytes off the total:
main=print$foldr((++).(++"+1/").show.(2^))""[0..]

The challenge states that spaces in the output are optional, so you can save another two bytes.

Also noticed that the most recent version is the same number of bytes as the original would be if "intercalate" was in the Haskell base library.

Braingolf, 41 37 bytes
Saved 4 bytes because I realised I don't need the spaces, always read the spec thoroughly kids
1!_V"+/">!@R.[<!_>2*v<!@>R!_v!@R<1+>]

Try it online!
Can probably be golfed better, but it works.

Lua 5.1 + BC, 50 bytes
Now works with arbitrary long integers.
I don't usually golf in Lua, so any tips are welcome
i=1::a::print(i,'+1/')i=require"bc".mul(i,2)goto a

You can omit some newlines to save bytes.

You can use while 1 do instead.

@LeakyNun that will output garbage in the output when overflow happens

But then your answer does not print infinitely...

@LeakyNun original spec said thar language limitation could end the execution as well, i'll check

@FelipeNardiBatista That's current spec not original spec.

@EriktheOutgolfer i didn't see the change, when internet is back i'll figure something out

To clarify: original spec (and now current again) is that infinity must be longer than a language limitation. You cannot be limited by your language, but you can be limited by your system.

internet is back, fixed it

Fourier, 20 bytes
1~io(43a1o47ai*2~io)

Try it online!
I think this may only work on Try it Online due to differences in how Python and Javascript handle large numbers.
Explanation Psuedocode:
i = 1
Print i
While i != 0
    Print "+1/"
    i = i * 2
    Print i
End While

Can you not move the Print i to the start of the While loop?

@Neil I could, but it wouldn't say any bytes

Oh, I see now, you're not actually printing i.

Ruby 46 bytes
i=1;loop{print (i<2?"#{i}":"1/#{i}")+"+";i*=2}

any improvement suggestions are welcome -))

F#, 39 bytes
let rec f x=printf"%A+1/"x;x*2I|>f
f 1I

Try it online!

Labyrinth, 25 bytes
)
:}!43.4
"     9
*{2.74.

Try it online!

GNU Make, 45 57 bytes
Using shell:
$(eval 1?=1)$(info $1+1/)$(call $0,$(shell expr $1 \* 2))

Using GMSL (a lot slower, calculates in unary), a complete makefile — 66 bytes:
include gmsl
P=$(info $1+/)$(call P,$(call double,$1))
$(call P,1)

Common Lisp, 42 bytes
(do((x 1(* x 2)))(())(format t"~a+"(/ x)))

Try it online (TIO will show you partial output)
Explanation
(do ... )          ;looping
((x 1(* x 2))      ;define x as 1 and then in new interation steps
                   ;as result of 2 * x
(())               ;no ending condition
(format t"~a+"...) ;print argument and "+"
(/ x)              ;divide 1 by x - output is like this: 1, 1/2, 1/4, ...

PHP, 29 bytes
for($a=.5;$a*=2;)echo"$a+1/";

Taxi, 916 bytes
2 is waiting at Starchild Numerology.'1' is waiting at Writer's Depot.Go to Writer's Depot:w 1 r 3 l 2 l.Pickup a passenger going to Post Office.Go to Post Office:n 1 r 2 r 1 l.Go to Starchild Numerology:s 1 r 1 l 1 l 2 l.Pickup a passenger going to Cyclone.Go to Cyclone:e 1 l 2 r.[r]Pickup a passenger going to Trunkers.Pickup a passenger going to Multiplication Station.Go to Trunkers:s 1 l.Go to Multiplication Station:e 1 r 4 l.Pickup a passenger going to Cyclone.Go to Cyclone:s 1 r 2 l 2 r.Pickup a passenger going to Multiplication Station.Pickup a passenger going to The Babelfishery.' + 1/' is waiting at Writer's Depot.Go to Writer's Depot:s.Pickup a passenger going to Post Office.Go to The Babelfishery:n 1 r 2 r 1 r.Pickup a passenger going to Post Office.Go to Fueler Up:n.Go to Post Office:s 1 r 1 l.Go to Trunkers:s 1 r 1 l.Pickup a passenger going to Cyclone.Go to Cyclone:w 2 r.Switch to plan "r".

Try it online! (TIO will output the first 893 terms (up to ~3.3×10²⁶⁸) before cutting it off.)
Ungolfed:
2 is waiting at Starchild Numerology.
'1' is waiting at Writer's Depot.
Go to Writer's Depot: west 1st right 3rd left 2nd left.
Pickup a passenger going to Post Office.
Go to Post Office: north 1st right 2nd right 1st left.
Go to Starchild Numerology: south 1st right 1st left 1st left 2nd left.
Pickup a passenger going to Cyclone.
Go to Cyclone: east 1st left 2nd right.
[r]
Pickup a passenger going to Trunkers.
Pickup a passenger going to Multiplication Station.
Go to Trunkers: south 1st left.
Go to Multiplication Station: east 1st right 4th left.
Pickup a passenger going to Cyclone.
Go to Cyclone: south 1st right 2nd left 2nd right.
Pickup a passenger going to Multiplication Station.
Pickup a passenger going to The Babelfishery.
' + 1/' is waiting at Writer's Depot.
Go to Writer's Depot: south.
Pickup a passenger going to Post Office.
Go to The Babelfishery: north 1st right 2nd right 1st right.
Pickup a passenger going to Post Office.
Go to Fueler Up: north.
Go to Post Office: south 1st right 1st left.
Go to Trunkers: south 1st right 1st left.
Pickup a passenger going to Cyclone.
Go to Cyclone: west 2nd right.
Switch to plan "r".

Explanation:
Pickup the string `1` and print it to stdout to get started.
Pickup the number `2` and duplicate it so we have one to keep around and one to print.
Abuse the truncation function to leave a `2` for later.
(It's en route and has a short name so it saves bytes which is really important in Taxi.)
Go multiply the running total by 2.
(The first time, it's just a `2` so it returns itself. After that, it's 2 times the running total.)
Pickup the string ` + 1/`.
Convert the multiplication result from a number to a string.
Get gas.
Print the string ` + 1/` and the string multiplication result to stdout.
Go pickup that `2` from Trunkers, copy it again, and go back to `[r]`.

The output has trailing zeros on every number: 1 + 1/2.000000 + 1/4.000000 + ... but, per a comment by OP, that's OK so long as it's the same number of zeros every time.

Cubix, 26 bytes
oruUroorp"/1+"1>O2uw"wo;;q

A fairly linear program.  Push characters /1+ onto the stack, push 1 onto the stack.  Start loop, output number, multiply it by 2, push it to the bottom, pop the multipliers, output the characters on the stack and loop.
Try it here
Maps to
      o r u
      U r o
      o r p
" / 1 + " 1 > O 2 u w "
w o ; ; q * . . . . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

Ruby, 24 bytes
a=1;a/=2r while$><<a<<?+

Try it online!
Heavily based on G B's answer. But rationals are fun :V

MSX-BASIC, 36 bytes
1?"1+":X=2
2?"1/";X;"+":X=X*2:GOTO2

It works up to 70368744177664, then it starts displaying the values in exponential notation due to the precision limitation of the language, then it overflows at 1e62.

Clojure, 59 bytes
#((fn[n](print(if(= 1M n)1(str 1\/ n))\+)(recur(* n 2)))1M)

A function that prints the fraction, doubles the denominator, then recurses.
(defn zenos-dichotomy-paradox []
  ; Create an anonymous function...
 ((fn [n]
    ; ... that prints the fraction (or just 1 if (= n 1))...
    (print
      (if (= 1M n) 1 (str 1 \/ n))
      \+)
    ; ..., doubles the denominator, then recurses infinitely.
    ; Will not SO since I'm using recur.
    (recur (* n 2)))
   ; Start the recursive function off with a 1. The M makes it a BigInteger so
   ;  I don't get an IntegerOverflow.
  1M))

Outputs
1 +1/2 +1/4 +1/8 +1/16 +1/32 +1/64 +1/128 +1/256 +1/512...

I can make the spacing more consistent at the cost of 2 bytes if necessary.
I tried to be clever and abuse Clojure's built in Ratio number type, but I got an overflow pretty quickly. 1/1 would have been automatically simplified to 1, getting rid of 1 as a special case. It would have been nice.

Husk, 9 bytes
J'+ms:1İ½

Try it online!
due to a lack of a 0 term, 1 is manually prepended.

MathGolf, 9 bytes
ïóoù+1/q∟

Try it online.
Explanation:
        ∟  # Do-while true without popping:
ï          #  Push the 0-based loop index
 ó         #  Pop and push 2 to the power this index
  o        #  Output it with trailing newline (without popping)
   ù+1/    #  Push string "+1/"
       q   #  Pop and push without trailing newline

Unfortunately MathGolf doesn't output implicitly even if it errors when we stop the infinite program, otherwise the o and q would have been unnecessary, because everything on the stack is joined and output implicitly at the end of a (properly terminating) MathGolf program.

Perl 5 -Mbigint, 26 bytes
print 2**$_++,'+1/'while 1

Try it online!
Using bigint means that this could go on forever without turning into a floating point exponential format, given enough time and RAM.  TIO gets to about 1/2922 before cutting off due to the 128 KiB output limit.

Factor, 33 bytes
1 [ dup "%u+" printf 2 / t ] loop

Try it online!

1 Push 1 to the stack.
[ ... t ] loop The shortest infinite loop available in Factor.
dup "%u+" printf Non-destructively write the prettyprinted form of an object with a "+" afterward.
2 / Divide by two. In Factor, / produces an exact ratio as long as its inputs are rational. Use /i for integer division or /f to force the result to be a float.

Zephyr, 52 bytes
set i to 1
while 1=1
print i,"+"
set i to i/2
repeat

Try it online!
Gotta love built-in rational numbers.
For +3 bytes, output with all spaces (no newlines): Try it online!

Stax, 7 bytes
â─$∩√Öu

Run and debug it
same idea as 05AB1E, but Stax has more convenient output here :)
Explanation
Wi^p"+1/
W        loop forever
 i^      increment counter
   p     print without newline
    "+1/ print "+1/" without newline

Mathematica, 45 bytes
Row@Flatten@Table[{1/2^t,"+"},{t,0,Infinity}]

This will not finish computing, and nothing will be printed.

Yes, I made it this way in order to get the result in a row. If you want to see a result just test for a finite number. Do you have any other ideas of how to print in a row?

You can use newlines as delimiters

cQuents, 13 bytes
|+1/=1:2^($-1

Try it online!
Explanation
|+1/            Set sequence join to "+1/"
    =1          Set first item in sequence to 1
      :         Mode : (sequence)
       2^($-1   Each item in the sequence equals 2 to the power of the index (1-based) of the current item minus 1
             )  Implicit closing parenthesis

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


text:
Does the sum of 2 numbers in the list equal the desired sum?
The Task
This is my first challenge so apologies if it is very simple!  In this challenge, your task is to write a program or function which takes in a list of integers and a desired sum and outputs a truthy or falsey value based on whether the list contains two numbers that can be summed together to achieve the desired sum.
Input
The input must be acquired in a standard way for your language.  The list of integers can be any standard collection type for your language but cannot be a hashed set, sorted set, or any highly functional collection type.  Don't assume the input is sorted, any valid integer type is acceptable.
The desired sum is also an integer and must be provided to your program as input.
Output
The output may be a function return, console log, writing to a file, etc...  Any valid Truthy or Falsey value is acceptable.
Additional Rules

The input list may or may not be sorted.
Duplicate values may occur in the list
The same item in the list may not be summed to itself to achieve the desired sum (Eg. [3,4,5] with desired sum 6 will expect False because 3 cannot be used twice)
Standard loopholes are not allowed.

Test Cases
INPUT                 OUTPUT
[3,4,5], 6            Falsey
[1,2,3,4,5,6],11      Truthy
[4,23,8174,42,-1],41  Truthy
[1,1,1,1,1,3],3       Falsey
[2,1,1,1,53,2],4      Truthy
[2,2,2,2],4           Truthy
[3],3                 Falsey
[],-43                Falsey

This is code-golf, so the shortest code in bytes wins!

at least two numbers or just two numbers?

@marmeladze Just 2 numbers.

Nice first challenge!

Can the sum integer be zero or negative?

Can we assume that the input least contains at least 2 elements?

@Arnauld No.  I should add those test cases.

Could we take in a length of the list and.or assume a certain sentinel value will not be in the input?

@RohanJhunjhunwala Any possible integer for desired sum and any possible integer within the list so no sentinel values.  Only two inputs, length is not provided.

@maple_shaft my language doesn't support a native list type, it can really only take in a null terminated string or a list of numbers with a sentinel,shouldn't this be the "native" list type?

Can we choose an empty output for falsey and 1 for truthy?

[3],6 should also be Falsey, which one solution might currently accept as truthy.

I think the other challenge should be closed as a duplicate of this one instead. I like this one better.

Brachylog, 3 bytes
⊇Ċ+

Try it online!
⊇Ċ+   input as STDIN, output as ARG1
      (prove that:)
⊇     the input is a superset of
 Ċ       a list of two elements
  +         which sums up to the output

@Fatalize For the love of God, I was having a dinner.

Jelly, 7 6 5 bytes
ŒcS€ċ

Try it online!
-1 byte by using the Unordered Pairs atom
ŒcS€ċ  Main Link; left argument is the array, right argument is the required sum
  S€   Take the sum of each...
Œc     ...unordered pair...
    ċ  Check if the sum array contains the right argument

-1 byte thanks to Erik!
4 bytes
Œc§i

This does the same thing but with a newer language feature of vectorize-at-depth-1 sum. Thanks Dennis! :D Credit to @Riolku for noticing this.

You can use ċ instead of ⁹e to outgolf MATL. The rules don't specify that the values must be consistent, only truthy/falsey.

@EriktheOutgolfer Oh thanks :D Outgolfed MATL and 05AB1E :)

Umm, your TIO doesn't contain any code? ;) And you forgot to change the 6 to <s>6</s> 5 based on your edit?

@KevinCruijssen Ehhh lol thanks, I failed at copy-pasting. And yes I forgot that, thanks! :D

05AB1E, 6 bytes
æ2ùOIå

Try it online!
Explanation
æ        # get powerset of first input
 2ù      # keep only those of size 2
   O     # sum each
    Iå   # check if 2nd input is in the list of sums

Python 2, 43 42 bytes
-1 byte thanks to mbomb007
lambda a,b:any(b-a.pop()in a for x in a*1)

Try it online!

Why do you need [:]?

@EriktheOutgolfer because I'm using a.pop() and iterating over a, without it it will iterate over the popped list, resulting in only half runs. a[:] is there just to make the code run len(a) times.

Oh so that's how you make a copy of a list. What code-golf teaches you...

Better TIO test suite. Also, can you use 1*a instead of a[:]?

@mbomb007 yep, now it has a perfect score :3

Is there a test case you could use that would give a different answer if you had a instead of a*1? Because right now, the results are the same.

@mbomb007 [0, 1, 2, 3, 4],1 or any case where the right numbers are in the first half if the list

Mathematica, 29 bytes
!FreeQ[Tr/@#~Subsets~{2},#2]&

MATL, 6 bytes
2XN!sm

Try it online!
Explanation
2XN   % Implicitly input an array. Combinations of elements taken 2 at a time
      % The result is a matrix where each row is a combination
!s    % Sum of each row
m     % Implicitly input a number. Ismember function. Implicitly display

JavaScript (ES6), 38 43 bytes
a=>n=>[...a].some(_=>a.includes(n-a.pop()))

Try It

f=
a=>n=>[...a].some(_=>a.includes(n-a.pop()))
o.innerText=`           f([3,4,5])(6) = ${f([3,4,5])(6)}
    f([1,2,3,4,5,6])(11) = ${f([1,2,3,4,5,6])(11)}
f([4,23,8174,42,-1])(41) = ${f([4,23,8174,42,-1])(41)}
     f([1,1,1,1,1,3])(3) = ${f([1,1,1,1,1,3])(3)}
    f([2,1,1,1,53,2])(4) = ${f([2,1,1,1,53,2])(4)}
         f([2,2,2,2])(4) = ${f([2,2,2,2])(4)}
               f([3])(3) = ${f([3])(3)}
              f([])(-43) = ${f([])(-43)}
     f([1,2,3,4,5,6])(3) = ${f([1,2,3,4,5,6])(3)}`
pre{font-size:14px;line-height:1.75}
<pre id=o>

Doesn't work for f([1,2,3,4,5,6])(3). Try using [...a].some instead?

Out of interest I tried porting Rod's Python answer, it also came out at 43 bytes.

@Neil, I was trying to figure out a shorter way, without using includes() but I couldn't see it.

Haskell, 39 37 36 bytes
(a:t)#n=n`elem`map(a+)t||t#n
_#n=1<0

Try it online! Example usage: [1,3,2,5] # 3. Returns True or False.

Alternative (also 36 bytes)
f(a:t)=map(a+)t++f t
f e=e
(.f).elem

I felt like using applicatives that you can get this in only 31 bytes but it fails a couple test cases for some reason: g x d=any(\x->x==d)$(+)<$>x<*>x

@maple_shaft Interesting idea, but it computes for each list element also the sum with itself, that's way some test cases fail. By the way it can be shortened to 22 bytes: x#d=elem d$(+)<$>x<*>x

C, 114 113 bytes
i,j,k="F";main(c,v)char**v;{for(--c;++i<c;)for(j=0;++j<c;)k=j^i&atoi(v[i])+atoi(v[j])==atoi(v[c])?"T":k;puts(k);}

Here's the output
C:\eng\golf>a.exe 3 4 5 6
F
C:\eng\golf>a.exe 1 2 3 4 5 6 11
T
C:\eng\golf>a.exe 4 23 8174 42 -1 41
T
C:\eng\golf>a.exe 1 1 1 1 1 3
F
C:\eng\golf>a.exe 2 1 1 1 53 2 4
T
C:\eng\golf>a.exe 2 2 2 2 4
T

Ruby, 59 53 37 bytes
inspiration comes from this answer
->a,b{a.map{|e|a.include?(b-e)}.any?}

will now look where can I chop a few bytes -))
HISTORY
#53 bytes
->a,b{a.combination(2).map{|e|e.reduce(&:+)==b}.any?}

#59 bytes
->a,b{a.combination(2).map{|e|e.reduce(&:+)}.any?{|x|x==b}}

PHP (>= 7.1), 53 51 50 46 Bytes
<?foreach($_GET[0]as$c)+$$c||${$_GET[1]-$c}=a;

sadly it's quite big but at least better than 2 loops. +a fails with a warning if the sum can be made => non empty output => truthy. Outputs nothing if the sum can not be made => falsey.
Thanks @user63956 !

You forget the <? and if the terminate in true cases should be printable the shortest status i Know is !0

@JörgHülsermann <? for $_GET? Fair enough. Why should I print something if I can use exit code golfing? If I wanted to print something die(a) would also work just fine.

Can you explain me how you will get the exit code when it not is printed with using the $_GET array as input? http://sandbox.onlinephpfunctions.com/code/537bbdd8b7f8a06f573b88d37b7b81327f673b0b

@JörgHülsermann Using CGI

Thank You I have never tried CGI and $_GET together before. I am sad that I could only one upvote

You can save a few bytes with variable variables instead of $q: $$c and ${$_GET[1]-$c}.

TAESGL, 8 bytes
Ş⇒AĨB-AĖ

Interpreter
Explanation
Ş⇒        Array.some with anonymous function on implicit input
  AĨ      first input includes
    B-    second input minus
      AĖ  first input popped

Clojure, 53 bytes
#(loop[[v & r]%](if v(or((set r)(- %2 v))(recur r))))

Uses destructuring to take the first and rest of the input list (and subsequent recur of rest), and returns the number "target - value1" if found in the set of remaining numbers (a "truthy"), nil otherwise.

Java 7, 138 bytes
boolean c(int[]a,int s){String r="";for(int l=a.length,i=0,j;i<l;i++)for(j=-1;++j<l;)if(i!=j)r+=(a[i]+a[j])+",";return r.contains(s+",");}

Explanation:
boolean c(int[]a,int s){             // Method with integer-array and integer parameters and boolean return-type
  String r="";                       // Temp String
  for(int l=a.length,i=0,j;i<l;i++)  //  Loop (1) over the input array
    for(j=-1;++j<l;)                 //   Inner loop (2) over the input array again
      if(i!=j)                       //    If the index of both loops aren't equal (so not the same item in the list)
        r+=(a[i]+a[j])+",";          //     Append the sum with a comma to the temp-String
                                     //   End of loop (2) (implicit / single-line body)
                                     //  End of loop (1) (implicit / single-line body)
  return r.contains(s+",");          //  Return whether the temp-String contains the given sum (+ comma)
}                                    // End of method

Test code:
Try it here.
class M{
  static boolean c(int[]a,int s){String r="";for(int l=a.length,i=0,j;i<l;i++)for(j=-1;++j<l;)if(i!=j)r+=(a[i]+a[j])+",";return r.contains(s+",");}

  public static void main(String[] a){
    System.out.println(c(new int[]{1,2,3,4,5,6},11));
    System.out.println(c(new int[]{4,23,8174,42,-1},41));
    System.out.println(c(new int[]{2,1,1,1,53,2},4));
    System.out.println(c(new int[]{2,2,2,2},4));
    System.out.println();
    System.out.println(c(new int[]{1,1,1,1,1,3},3));
    System.out.println(c(new int[]{3,4,5},6));
  }
}

Output:
true
true
true
true

false
false

Mathematica, 38 bytes
MemberQ[Total/@#~Permutations~{2},#2]&

input style [{1,2,3,4,5,6},11]

# is short for #1, and infix notations can shave a byte: MemberQ[Total/@#~Permutations~{2},#2]&

@JungHwan thanks. I'm new to this. Where is your answer?

R, 32 bytes
function(x,l)x%in%combn(l,2,sum)

Returns an anonymous function. combn returns all combinations of l taken m at a time, in this case 2, and then optionally applies a function, in this case sum. Returns an empty logical vector logical(0) for an empty first input, which I define for this problem as falsey, and TRUE or FALSE corresponding to the other elements otherwise.
Try it online!

Python 3, 41 bytes
f=lambda a,b,*c:a-b in c or c and f(a,*c)

Try it online!
Recursive aproach with flexible input and output. Returns an empty set as falsy.

This doesn't work for test case [], -43. Try it online

MATLAB, 28 bytes
@(a,b)any(pdist(a,@plus)==b)

This defines an anonymous function with inputs a: column vector (possibly empty); b: number.
The code also works in Octave except if the first input is empty, which causes an error. Try it online!
Explanation
pdist(a,@fun) applies function fun (in our case, addition) to each combination of two rows of the input matrix a (in our case, a column vector). The output is a column vector. any(...==b) gives true if any of the results equals the input number b.

Pyth - 9 bytes
/msd.cE2E

Try it
/msd.cE2E
    .cE2     # All subsets of length 2
 msd         # The sum of each subset
/       E    # Number of occurrences of the input number

Axiom, 90 92 bytes
f(a,k)==(for i in 1..#a-1 repeat for j in i+1..#a repeat(q:=a.i+a.j;q=k=>return true);false)

test
(42) -> f([3,4,5],6)
   (42)  false
                                                            Type: Boolean
(43) -> f([1,2,3,4,5,6],11)
   (43)  true
                                                            Type: Boolean
(44) -> f([4,23,8174,42,-1],11)
   (44)  false
                                                            Type: Boolean
(45) -> f([4,23,8174,42,-1],41)
   (45)  true
                                                            Type: Boolean
(46) -> f([2,23,8174,42,2],2)
   (46)  false

Python 2, 71 bytes
from itertools import*
lambda L,n:n in map(sum,list(combinations(L,2)))

Try it online
Yes, I know there is already a better solution posted.

C#, 96 90 bytes
using System.Linq;a=>n=>Enumerable.Range(0,a.Count).Any(i=>a.Skip(i+1).Any(j=>a[i]+j==n));

Compiles to a Func<List<int>, Func<int, bool>>. Formatted version:
Func<List<int>, Func<int, bool>> f = a => n =>
    Enumerable.Range(0, a.Count).Any(i => a.Skip(i + 1).Any(j => a[i] + j == n));

Old for loop version for 96 bytes:
a=>n=>{for(int i=0,j,l=a.Count;i<l;++i)for(j=i+1;j<l;)if(a[i]+a[j++]==n)return 1>0;return 1<0;};

C#, 103 102 bytes

Data

Input Int32[] l A list of Int32 to sum
Input Int32 r The result to check against
Output Boolean A result indicating if the sum can be performed

Golfed
(int[] l,int r)=>{for(int x=l.Length,y;--x>=0;)for(y=0;y<x;)if(l[x]+l[y++]==r)return 1>0;return 0>1;};

Ungolfed
( int[] l, int r ) => {
   for( int x = l.Length, y; --x >= 0; )
      for( y = 0; y < x; )
         if( l[ x ] + l[ y++ ] == r )
            return 1 > 0;

   return 0 > 1;
};

Ungolfed readable
Working on it...

Full code
using System;
using System.Collections.Generic;

namespace Namespace {
   class Program {
      static void Main( String[] args ) {
        Func<Int32[], Int32, Boolean> f = ( int[] l, int r ) => {
            for( int x = l.Length, y; --x >= 0; )
                for( y = 0; y < x; )
                    if( l[ x ] + l[ y++ ] == r )
                        return 1 > 0;

            return 0 > 1;
        };

        List<KeyValuePair<Int32[], Int32>>
            testCases = new List<KeyValuePair<Int32[], Int32>>() {
                new KeyValuePair<Int32[], Int32>( new Int32[] { 3, 4, 5 }, 6 ),
                new KeyValuePair<Int32[], Int32>( new Int32[] { 1, 2, 3, 4, 5, 6 }, 11 ),
                new KeyValuePair<Int32[], Int32>( new Int32[] { 4, 23, 8174, 42, -1 }, 41 ),
                new KeyValuePair<Int32[], Int32>( new Int32[] { 1, 1, 1, 1, 1, 3 }, 3 ),
                new KeyValuePair<Int32[], Int32>( new Int32[] { 2, 1, 1, 1, 53, 2 }, 4 ),
                new KeyValuePair<Int32[], Int32>( new Int32[] { 2, 2, 2, 2 }, 4 ),
                new KeyValuePair<Int32[], Int32>( new Int32[] { 3 }, 3 ),
                new KeyValuePair<Int32[], Int32>( new Int32[] {  }, -43 ),
            };

        foreach( var testCase in testCases ) {
            Console.WriteLine( $" Input: {testCase.Value}; {{ {String.Join(", ", testCase.Key)} }}\nOutput: {f( testCase.Key, testCase.Value )}\n" );
        }

         Console.ReadLine();
      }
   }
}

Releases

v1.1 -  -1 byte  - Thanks to TheLethalCoder suggestion.
v1.0 - 103 bytes - Initial solution.

Notes

None

(int[] l,int r)=> can just be (l,r)=>, however, you can also use currying to shave another byte off of that l=>r=>. Pass in a list instead of an array to save another byte by using Count instead of Length. You can set y = to zero and do a post increment in the array indexer instead.

Put that together for 90 bytes: l=>r=>{for(int x=l.Count,y;--x>=0;)for(y=0;y<x;)if(l[x]+l[y++]==r)return 1>0;return 0>1;};. Note that I haven't tested this put it looks correct. Now comes in at the same count as my Linq answer :)

Hey @TheLethalCoder, thanks for your suggestions, but some days ago I've got in a discussion with another member of CodeGolf and I have submitted myself to explicitly type the input types since then, hence the (int[] l,int r). Also, I refrain from using Lists and other classes that require usings -- although when I use them, I type the full name, i.e. System.Collections.Generic.List.

You don't need to explicitly type them but your choice. You can still save one byte by changing y=-1 to y=0 and post incrementing in the indexer instead of the loop condition.

If I'm thinking correctly, your suggestion is to change for( y =- 1; ++y < x; ) to for( y = 0; y++ < x; ), but that would cause IndexOutOfRangeException to be thrown, which, to be fixed, I had to change the for to for( y = 0; y < x; y++ ), which would result in the same byte count.

No change for(y=-1;++y<x;)if(l[x]+l[y]==r) to for(y=0;y<x;)if(l[x]+l[y++]==r).

AWK, 77 bytes
{for(s=i=0;++i<NF;)for(j=0;++j<NF;){if(i==j)continue
if($i+$j==$NF)s=1}$0=s}1

Try it online!
I could save 2 bytes by removing the i= in the for(s=i=0...), but then it would only work for one line of data.  Since this isn't the shortest answer, I thought I'd make a general solution :)
Input is whitespace separated numbers with the last value being the desired sum.

Jellyfish, 13 bytes
p
cd!i
i 2
 1

Try it online!
How it works
print(exists(i,from_base(1,permutations(i,2)))

where i are the inputs.