text:
Domain Name Appraisal
Domain name trading is big business.  One of the most useful tools for domain name trading is an automatic appraisal tool, so that you can easily estimate how much a given domain is worth.  Unfortunately, many automatic appraisal services require a membership/subscription to use.  In this challenge, you will write a simple appraisal tool that can roughly estimate the values of .com domains.
Input / Output
As input, your program should take a list of domain names, one per line.  Each domain name will match the regex ^[a-z0-9][a-z0-9-]*[a-z0-9]$, meaning that it is composed of lowercase letters, digits, and hyphens.  Each domain is at least two characters long and neither begins nor ends with a hyphen.  The .com is omitted from each domain, since it is implied.
As an alternative form of input, you can choose to accept a domain name as an array of integers, instead of a string of characters, as long as you specify your desired character-to-integer conversion.
Your program should output a list of integers, one per line, which gives the appraised prices of the corresponding domains.
Internet and Additional Files
Your program may have access to additional files, as long as you provide these files as part of your answer.  Your program is also allowed to access a dictionary file (a list of valid words, which you don't have to provide).
(Edit) I have decided to expand this challenge to allow your program to access the internet.  There are a couple restrictions, being that your program cannot look up the prices (or price histories) of any domains, and that it only uses pre-existing services (the latter to cover up some loopholes).
The only limit on total size is the answer size limit imposed by SE.
Example input
These are some recently-sold domains.  Disclaimer: Although none of these sites seem malicious, I do not know who controls them and thus advise against visiting them.
6d3
buyspydrones
arcader
counselar
ubme
7483688
buy-bikes
learningmusicproduction

Example Output
These numbers are real.
635
31
2000
1
2001
5
160
1

Scoring
Scoring will be based on "difference of logarithms." For example, if a domain sold for $300 and your program appraised it at $500, your score for that domain is abs(ln(500)-ln(300)) = 0.5108. No domain will have a price less than $1. Your overall score is your average score for the set of domains, with lower scores better.
To get an idea what scores you should expect, simply guessing a constant 36 for the training data below results in a score of about 1.6883. A successful algorithm has a score less than this.
I chose to use logarithms because the values span several orders of magnitude, and the data will be filled with outliers.  The use of absolute difference instead of difference squared will help reduce the effect of outliers in scoring. (Also, note that I am using the natural logarithm, not base 2 or base 10.)
Data Source
I have skimmed a list of over 1,400 recently sold .com domains from Flippa, a domain auction website.  This data will make up the training data set.  After the submission period is over, I will wait an additional month to create a test data set, with which the submissions will be scored.  I might also choose to collect data from other sources to increase the size of the training/test sets.
The training data is available at the following gist.  (Disclaimer: Although I have used some simple filtering to remove some blatantly NSFW domains, several might still be contained in this list. Also, I advise against visiting any domain you don't recognize.)  The numbers on the right-hand side are the true prices.  https://gist.github.com/PhiNotPi/46ca47247fe85f82767c82c820d730b5
Here is a graph of the price distribution of the training data set.  The x-axis the the natural log of price, with y-axis being count.  Each bar has a width of 0.5.  The spikes on the left correspond to $1 and $6 since the source website requires bids to increment at least $5.  The test data may have a slightly different distribution.

Here is a link to the same graph with a bar width of 0.2.  In that graph you can see spikes at $11 and $16.

Just a heads up, using the most common digraphs to score a domain works abysmally! R² ≅ 0

Someone obviously needs to do a neural network answer for this.

Can the program link to the internet (say, query google)?  Explicitly not for the purpose of looking up prices of course, but for collecting data to use as a characteristic.

@Joe Sorry I haven't had a chance to respond, but I have decided to allow internet access.

Perl, 1.38605
I figured I should go ahead and post my own submission, in the hope that it spurs competition.  Its score of 1.38605 means that it is typically off by a factor of 3.999 (that was my stopping point).  I didn't use any machine learning libraries, just straight up Perl.  It does require access to a dictionary; I used the one from here.
Please feel free to use some of the numbers/statistics from my program in your own.
use strict;

my %dict;
my $dictname = "dict.txt";
open(my $dfh, '<', $dictname);
while (my $row = <$dfh>) {
  chomp $row;
  $dict{lc $row} = 1;
}

my $domain = <>;
chomp($domain);

my $guess = 1;

if($domain =~ /^[a-z]*$/){
    my @bylength = (200000,20001,401,45,45,41,26,26,26,26,26,24);
  if(length($domain) < ~~@bylength+2){
    $guess *= $bylength[length($domain)-2];
  } else {
    $guess *= 18;
  }
} elsif ($domain =~ /^[0-9]*$/){
  my @bylength = (300000,30001,6000,605,50);
  if(length($domain) < ~~@bylength+2){
    $guess *= $bylength[length($domain)-2];
  } else {
    $guess *= 7;
  }
} elsif ($domain =~ /^[a-z0-9]*$/){
  my @bylength = (52300,523,28);
  if(length($domain) < ~~@bylength+2){
    $guess *= $bylength[length($domain)-2];
  } else {
    $guess *= 23;
  }
} else {
  my @bylength = (50000,500,42,32,32,31);
  if(length($domain) < ~~@bylength+2){
    $guess *= $bylength[length($domain)-2];
  } else {
    $guess *= 12;
  }
}

my $wordfact = 1;

my $leftword = 0;
for(my $i = 1; $i <= length($domain); $i++){
  my $word = substr $domain, 0, $i;
  if(exists($dict{$word})){
    $leftword = $i;
  }
}

$wordfact *= ($leftword/length($domain))**2 * 0.8 + ($leftword/length($domain)) * -0.1 + 0.9;

if($leftword/length($domain) >= 0.8){
  $wordfact *= 2.4;
}

my $rightword = 0;
for(my $i = 1; $i <= length($domain); $i++){
  my $word = substr $domain, length($domain)-$i, $i;
  if(exists($dict{$word})){
    $rightword = $i;
  }
}

$wordfact *= ($rightword/length($domain))**2 * 0.9 + ($rightword/length($domain)) * -0.2 + 1;

$guess *= $wordfact;

my $charfact = 1;
my %charfacts = (
  i => 1.12, #500
  l => 0.84,
  s => 1.09,
  a => 0.94,
  r => 1.03,
  o => 0.97,
  c => 1.22, #400
  d => 0.88,
  u => 1.07,
  t => 0.95,
  e => 1.08,
  m => 0.91, #300
  p => 1.08,
  y => 0.92,
  g => 0.97,
  ne => 0.56, #100
  n => 1.13,
  z => 0.67,
  re => 1.30,
  es => 0.75,
);
while(my ($key,$value) = each %charfacts){
  if($domain =~ /$key/){
    $charfact *= $value;
  }
}
$guess *= $charfact;

$guess = int($guess + 0.5);
if($guess <= 0){
  $guess = 1;
}

print $guess;

Here's a graph made by my scoring program, showing a scatter plot of appraisal over actual price and a histogram of the errors.  In the scatter plot .:oO@ mean 10, 20, 30, 40, 50 domains at that point, respectively. In the histogram each O represents 16 domains.
The scale is set at 1 character width = e^(1/3).

There are three main steps to this program.  The results from each step are multiplied together.

Categorization by character class and length.  It determines if the domain is all letters, all numbers, letters and numbers, or if it contains a hyphen.  It then gives a numerical value determined by the domain's length. I found that there is a strange dip in value around length 5. I suspect this is due to sampling: shorter domains are valuable due to their length (even if the letters are nonsense), while most longer domains tend to be words/phrases.  I order to prevent overfitting, I put a restriction in that domains cannot be penalized for being shorter (so length 5 is at least as good as length 6).
Evaluation of word content.  I use the dictionary to determine the lengths of the left-hand and right-hand words in a domain name.  For example, myawesomesite -> my & site -> 2 & 4.  Then, I try to do some fitting based on what proportion of the domain name is made up by those words.  Low values typically indicate that the domain does not contain a word, contains a pluralized/modified word not in the dictionary, contains a word surrounded by other characters (internal words are not detected, although I tried that with no improvement), or contains a several-word phrase.  High values indicate that it is a single word or a likely a two word phrase.
Evaluation of character content.  I looked for substrings that were contained in lot of domains and which appeared to affect the values of the domain.  I believe this is caused by certain types of words being more popular/more attractive, for various reasons. For example, the letter i appeared in about half of the domains (741 of them), and bumps up domain value by about 12% on average.  That's not overfitting; there's something real there, that I don't fully understand.  The letter l appears in 514 domains and has a factor of 0.84.  Some of the less common letters/digraphs, like ne which appeared 125 times and has a really low factor of 0.56, might be overfitting.

In order to improve upon this program, I would probably need to use machine learning of some kind.  Also, I could look for relationships between length, word content, and character content to find better ways of combining those separate results into the overall appraisal value.


text:
Was it Really Canada Day?
July 1st is Canada day (yay Canada)! Or is it?  It seems that the Wikipedia page for this day has a lot of Canada related content, but is there another day which is more Canadian?
Your task is to write a program or function which takes a date (month and day) as input and returns or outputs the number of mentions of "Canada" on the Wikipedia page for the inputed date.
Some rules:

Dates may be input in any reasonable format of your choice
Your submission must pull data from the url en.wikipedia.org/wiki/Month_Day.
Only "Canada" must be searched for and counted included substrings, and only in title case. "Canadian" does not count, however "Canada's" does count. As long as the exact, case-senstitive text "Canada" exists within a string, it is a match
Contents of the page are considered anything within the corresponding .html file (i.e. what shows up if you download as page as a .html and open it in Notepad)
Result may be output to STDOUT, returned, or displayed in any other reasonable manner

Test Cases:
July 1 => 34
May 14 => 1
Oct 31 => 2
July 4 => 2

This is code golf, so shortest submission wins
(As an unrewarded bonus, I'm interested to see what the day with the highest count is)

Can the Wikipedia API be used?

I don't know much about it, so I'm hesitant to say yes in case there is a trivial function to it.  Use your best judgement and if it makes it too easy please abstain

So references to Canadaville, Canadair, Canadarm, Canadaga, Canadarago, Canaday, Canadaspis, et al. count?

@msh210, Yep, that they do

Everyone is using enwp.org in here

July 1 is the day with the highest count! Wrote a quick program for it, though it isn't golfed.

@MatthewRoh, yes, but that redirects to the required url, so I'm allowing it

Pyth, 31 bytes
/jk'+"http://enwp.org/"z"Canada

Does not work on the online implementation, the server disables Internet access. I wanted to use http://wki.pe/July_1 but sadly it's a client-side redirect so it fetches the wrong page. The input format is July_1.
The code is basically just:
"".join(open("http://enwp.org/"+input())).count("Canada")

Bash, 43 42 40 bytes
curl -L enwp.org/$@|grep -o Canada|wc -l

Uses curl, grep, and wc to count occurrences of "Canada" in specified webpage. Like the other answers, input is given in the format July_1. This is my first time posting on the Code Golf SE and I'm not quite familiar with all of the rules. Any feedback would be most welcome.
Didn't realize that output to STDERR is traditionally ignored. Thanks for the 3 bytes, Dennis!

But wouldn't curl -sL still be shorter than wget -qO-?

Output to STDERR is ignored by default, so you can use curl without -s (or wget without -q).

@Dennis Thanks! I didn't know that STDERR is ignored. Much appreciated.

@kundor That's a good point. For some reason, combining the two flags never occurred to me. Still, since output to STDERR is ignored by default, it'd be shorter to omit the -s entirely.

Perl 5, 39 bytes
38 bytes, plus 1 for -pe instead of -e
$_=()=`curl -L enwp.org/$_`=~/Canada/g

Takes input like July_1.
Thanks to busukxuan for saving me seven bytes.

I'm not familiar with curl, but is it possible to save the six bytes of "http://"?

@busukxuan, yep, many thanks.

Python 3.5, 117 111 98 90 bytes
(-8 bytes (98 -> 90) thanks to alexwlchan)
from urllib.request import*
lambda i:urlopen('http://enwp.org/'+i).read().count(b"Canada")

Simply uses Python's built-in "urllib" library to fetch HTML data and then counts the occurrences of the word "Canada" in that data. Will try and golf more over time where and when I can. Call it by renaming the lambda function to anything and then calling that name like a normal function wrapped in print(). For instance, if the function were named H, then you would call it like print(H(Month_Day)).

I think you can save eight characters by replacing .decode().count("Canada") with .count(b"Canada").

@alexwlchan Yes, you are right. Thanks! :)

Surely this would be shorter in Python 2, since the urllib.urlopen function isn't in a subpackage (from urllib import* versus from urllib.request import*), and the b"Canada" could be replaced with "Canada" since Python 2's strings are bytes by default. I count 81 bytes in Python 2, and it works according to my testing.

C#, 85 bytes
return Regex.Matches(new WebClient().DownloadString("http://enwp.org/"+d),"Canada").Count;

Takes input d like July_1.
And July_1 is truly Canada Day, having the most references. With February_1 and April_23 sharing 2nd place with 18 "Canada"s each.
Find "Canada" day (in parallel), 207 bytes:
return Enumerable.Range(0,366).Select(i=>new DateTime(8,1,1).AddDays(i).ToString("MMMM_d")).AsParallel().OrderBy(d=>Regex.Matches(new WebClient().DownloadString("http://enwp.org/"+d),"Canada").Count).Last();

(Year 8 is the leap year with the shortest representation). Potentially inefficient, in that the OrderBy probably generates >366 web calls, but just going for shorter and appears to complete in not much more time.

PowerShell, 52 bytes
((iwr enwp.org/$($args[0]))-csplit"Canada").length-1

Input as July_1.
iwr is short for Invoke-WebRequest.
$($args[0]) is first command line argument. Start script as OhCanada.ps1 July_1.
-csplit is case sensitive split.

Mathematica, 60 bytes
Import["http://enwp.org/"<>#,"Source"]~StringCount~"Canada"&

Anonymous function. Similarly to the Perl 5 solution, takes input like July_1.

Just to close the loop, this use of the API is totally fine

R, 99 96 bytes
x=function(d){p=readLines(paste0("http://enwp.org/",d));sum(nchar(p)-nchar(gsub("Canada","",p)))/6}
d=scan(,"");p=readLines(paste0("http://enwp.org/",d));sum(nchar(p)-nchar(gsub("Canada","",p)))/6

This takes input d in the form "July_1" and returns the count of Canadas. It counts the words by counting the number of characters on the page, then removes the word Canada from the page and counts the characters again. The number of times Canada shows up is the difference in these counts divided by the number of letters in Canada, 6.
edit: I appreciate the tip below about replacing my function with scan.

I think you can drop the x=function(d){ and replace with d=scan(,'') making it program instead of function and saving some bytes.

Thanks! That saved three bytes. I haven't used scan before.

ES6, 89 bytes
d=>fetch('http://enwp.org/'+d).then(r=>r.text().then(t=>alert(t.split`Canada`.length-1)))

Sadly Unwrapping all the promises penalises the size :/

Nice answer, welcome to the site!

Couple comments. You can apply the same "input is in the format July_1" trick as the rest of the questions to save a few bytes. You also have an error using split().length(), which will give you a response greater than the goal.

Agree with @IvanSanchez on the input format and needing a -1 after the .length, but you can save some bytes by omitting the https: part of the URL, and use split'Canada' (but with backticks!) instead of split('Canada') to save a couple more!

Wow had no idea about backticks! I have made the changes mentioned.

Firefox allows you to drop the // after http.

PHP, 65 bytes
echo substr_count(file_get_contents('http://enwp.org'),'Canada');

Clojure, 71 bytes
#(count(re-seq #"Canada"(slurp(str"https://en.wikipedia.org/wiki/"%))))

Yeah, it would be nice to use http://enwp.org but I guess slurp does not handle redirects(?).  Anonymous function which take day in the format "July_1".

Ruby + curl, 44 bytes
p`curl -L enwp.org/#$_`.scan(/Canada/).size

ruby -n + 43 bytes. Takes input like July_1.

source: Stack Exchange

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

sort: votes


text:
Implement Takewhile
Introduction and Credit
Today without a fancy prelude: Please implement takewhile.
A variation of this (on a non-trivial data structure) was an assignment at my university functional programming course. This assignment is now closed and has been discussed in class and I have my professor's permission to post it here (I asked explicitly).
Specification
Input
The input will be a list (or your language's equivalent concept) of positive integers.
Output
The output should be a list (or your language's equivalent concept) of positive integers.
What to do?
Your task is to implement takewhile (language built-ins are allowed) with the predicate that the number under consideration is even (to focus on takewhile).
So you iterate over the list from start to end and while the condition (is even) holds, you copy to the output-list and as soon as you hit an element that doesn't make the condition true, you abort the operation and output (a step-by-step example is below). This higher-order functionality is also called takeWhile (takewhile).
Potential corner cases
The order of the output list compared to the input list may not be changed, e.g. [14,42,2] may not become [42,14].
The empty list is a valid in- and output.
Who wins?
This is code-golf so the shortest answer in bytes wins!
Standard rules apply of course.
Test Vectors
[14, 42, 2324, 97090, 4080622, 171480372] -> [14, 42, 2324, 97090, 4080622, 171480372]
[42, 14, 42, 2324] -> [42, 14, 42, 2324]
[7,14,42] -> []
[] -> []
[171480372, 13, 14, 42] -> [171480372]
[42, 14, 42, 43, 41, 4080622, 171480372] -> [42, 14, 42]

Step-by-Step Example
Example Input: [42, 14, 42, 43, 41, 4080622, 171480372]

Consider first element: 42
42 is even (21*2)
Put 42 into output list, output list is now [42]

Consider second element: 14
14 is even (7*2)
Put 14 into output list, output list is now [42,14]

Consider third element: 42
42 is even (21*2)
Put 42 into output list, output list is now [42,14,42]

Consider fourth element: 43
43 is not even (2*21+1)
Drop 43 and return the current output list

return [42,14,42]

Is it OK if I return an iterator, rather than a list?

@DrGreenEggsandIronMan I'm guessing your function has to be able to take its output as its input, guaranteeing they are in the same format.

@DrGreenEggsandIronMan, I don't think that returning a sublist should be exploited here in the output format. (It's still up to you if you exploit this in your code though). Mbomb's criterion looks most appropriate and compatible with the current challenge so it will be "your output should be a valid input at the very least".

Mathematica, 18 bytes
#~TakeWhile~EvenQ&

Another glorious built-in that is beaten by a factor of 3 by golfing languages without the built-in...

How many built-ins does Mathematica have? Seems as if it has one for almost anything.

@Emigna I haven't counted, but Rule #110 of the internet is, "If it exists, there's a Mathematica built-in for it."

@MartinEnder Too bad that Rule #110.5 of the internet is, "If it involves strings in any way whatsoever, then it is not considered to exist for the purposes of Rule #110."

@LegionMammal978 The workaround is to make strings heads of expressions :)

Haskell, 13 bytes
fst.span even

span splits the input list into a pair of lists just before the first element where the predicate (-> even) is false. fst takes the first element of the pair.
Alternative version, 13 bytes:
fst.break odd

break is the opposite of span, i.e. it splits the list at the first element where the predicate is true.
Of course there's also
takeWhile even

but that's 14 bytes.

MATL, 6 bytes
toYs~)

Try it online!
Explanation
t    % Input array implicitly. Duplicate
o    % Parity of each entry. Gives 0 for even entries, 1 for odd
Ys   % Cumulative sum
~    % Logical negate. Gives true for the first run of even entries, and then false
)    % Use this as logical index into the original array. Implicitly display

Is this normal, that the code says "toys" with a smile there?

@SEJPM to~Y<) also works, but I like this one better :-)

Hexagony, 19
2.}<@>%?<{>$"/\M!8;

Readable:
  2 . }
 < @ > %
? < { > $
 " / \ M
  ! 8 ;

Try it online!
This can probably be golfed by a byte or two, but that might require some truly ingenious layout, that might be more easily found via brute force (even if it might take rather long to find it).
High level explanation
The program mostly follows this pseudocode:
while (read number is not zero)
{
    if (number is even)
        print number;
}

Which abuses how Hexagony tries to read a number once STDIN is empty (it returns a zero). Big thanks to Martin for help with coming up with this approach.
Full Explanation
I still haven't fiddled around with Mono to get Timwi's fantastic esoteric IDE running, so I've leant on Martin to provide me with some helpful pretty pictures!
First, a little primer on basic control flow in Hexagony. The first instruction pointer (IP), which is the only one used in this program, starts at the top left of the hexagonal source code, and begins moving towards the right. Whenever the IP leaves the edge of the hexagon, it moves side_length - 1 rows towards the middle of the hexagon. Since this program uses a side length three hexagon, the IP will always be moving two rows when this happens. The only exception is if it moves off of the middle row, where it conditionally moves towards the top or bottom of the hexagon, depending on the value of the current memory edge.
Now a bit about conditionals. The only conditionals in Hexagony for control flow are >, < and the middle edge of the hexagon. These all follow a constant rule: if the value on the current memory edge is zero or negative control flow moves left and if is positive the control flows right. The greater than and less than brackets redirect the IP at sixty degree angles, while the edge of the hexagon controls to which row the IP jumps.
Hexagony also has a special memory model, where all data is stored on the edges of an infinite hexagonal grid. This program only uses three edges: one to store a two, one for the currently read number, and one for the number modulo two. It looks something like:
Mod  \ / Input
      |
      2

I'm not going to carefully explain where we are in memory at each point during the explanation of the program, so come back here if you get confused by where we are in memory.
With all of that out of the way, the actual explanation can begin. First, we populate the "2" edge in memory with a 2, then we execute a no-op and move the memory pointer to the right (2.}).
Next, we begin the main program loop. We read the first number from STDIN and then we hit a conditional (?<). If there are no numbers left in STDIN, this reads a zero into the current memory edge, so we turn left onto the @, which ends the program. Otherwise, we bounce off a mirror, move the memory pointer backwards and to the left, wrap around the hexagon to calculate the remainder of dividing the input by 2 and then hit another conditional (/"%>).

If the remainder was one (i.e. the number was odd), we turn right following the blue path above starting by executing the no-op again, then we wrap around to the bottom of the hexagon, multiply the current edge by 10 and then add eight, bounce off a couple mirrors, do the same multiplication and addition again, getting 188 on the current edge, wrapping back around to the top of the hexagon, executing the no-op again, and finally ending the program (.8/\8.@). This convoluted result was a happy accident, I originally had written a much simpler bit of logic, but noticed that I could remove it in favour of the no-op, which I thought was more in the spirit of Hexagony.

If the remainder was zero we instead turn left following the red path, above. This causes us to move the memory pointer to the left, and then print the value there (the input value) as a number. The mirror we encounter acts as a no-op because of the direction we are moving ({/!). Then we hit the edge of the hexagon which acts a conditional with only one outcome, as the input value from before was already tested to be positive, so we always move towards the right (if you imagine yourself facing in the direction of the IP). We then multiple the input by 10 and add two, only to change direction, wrap around and overwite the new value with the ascii value of the capital letter M, 77. Then we hit some mirrors, and exit over the edge of the middle of the hexagon with a trampoline (2<M\>$). Since 77 is positive, we move right towards the bottom of the hexagon and because of the trampoline skip the first instruction (!). We then multiply the current memory edge by 10 and add 8, getting 778. We then output this value mod 256 (10) as an ASCII character, which happens to be newline. Finally we exit the hexagon and wrap back around to the first ? which overrides the 778 with the next input value.

Readable yeah right

ed, 13
/[13579]$/,$d

Because real programmers use The Standard Text Editor.
Takes input as one integer on each line; outputs in the same format.
This simply finds the first odd number (number ending in an odd digit) and deletes from that line until the end of the file.

uhhhhh. so that's what that program is for.

Pyth, 13 9 7 bytes
uPWs%R2

Credits to @FryAmTheEggman for 2 (quite tricky) bytes!
Explanation:
u       Q    keep applying to input until invariant:
 PW          drop last element if...
   s%R2G     ...any one is odd, G is the argument originally given the value of input

Test it here.

This is not quite a correct variable introduction description. There should be two Gs introduced, one for the condition s%R2G and one as the argument to the function P.

Jelly, 5 bytes
Ḃœp⁸Ḣ

Try it online! or verify all test cases.
How it works
Ḃœp⁸Ḣ  Main link. Argument: A (array)

Ḃ      Bit; yield 1 for odd integers, 0 for even ones.
   ⁸   Yield A.
 œp    Partition A, splitting at 1's in the bit array.
       This yields a 2D array of runs of even integers.
    Ḣ  Head; extract the first chunk.

Python 2, 43 42 bytes
def f(x):
 while"1'"in`map(bin,x)`:x.pop()

The function modifies its argument in place.
Thanks to @xnor for golfing off a byte in a really clever way!
Test it on Ideone.

This is crazy, but I think you can check for an odd element as "1'"in`map(bin,x)`  for Python 2.

That's brilliant. Thanks!

Clojure, 21 bytes
#(take-while even? %)

Clojure is kinda nearly competing at last! (thanks to the task being a built-in) See it online https://ideone.com/BEKmez

Python, 45 44 bytes
f=lambda x:x and~x[0]%2*x and x[:1]+f(x[1:])

Test it on Ideone.

Aww man.. And there goes any chance I thought I had at winning a bounty

Only pure code-golf questions with no restrictions posted before July 22, 2015 are eligible.

@DrGreenEggsandIronMan Mine has been shorter than yours the entire time. I posted mine first. :P

Outgolfed by Dennis, who would've thought :)

@mbomb007 sure about that?

@DrGreenEggsandIronMan Not a list. :P The question says "list"

Honestly though, my secondary answer that prints would tie Dennis's answer, if that was allowed. So until Dennis shaves off one more byte, I'm an honorary Dennis-level golfer. :D

Brainf***, 263 bytes
I took a little snippet from here
>>>>>>,[>>>>>>,]>++++[<++++++++>-]>>>>>+>>>>>>>++++[<++++++++>-]<<<<<<<[<<<<<<]>>>>>>[[>>>>>>>++++[<-------->-]<]<<<<<<[->>>+<<<]>>>[-<+<<+>>>]<>>+>+<<<[-[->]<]+>>>[>]<[-<]<[-]<-[<[<<<<<<]>>>>>>.>>>>>>[>[-]++++[<++++++++>-]<.>>>>>>]>++++[-<++++++++>]<.[-]]>>>>>>]

I'd give an explanation but even I don't have a clue how this works anymore.
Expects input as space-seperated numbers (eg 2 432 1)

Takewhile in BF ._. +1

You can probably golf the chains of + and > using some logic?

@EᴀsᴛᴇʀʟʏIʀᴋ quite a few of the chains are already golfed (otherwise there would be a lot of rows of 32 '+'s), and I could probably make some of the >s more efficient but I don't understand them enough now

That's why you should comment your code as you write it in Notepad. :P

05AB1E, 8 7 bytes
[DÉO_#¨

Explanation
[        # infinite loop start
 DÉO     # count odd numbers
    _    # push negative bool (turning 0->1, X->0)
     #   # if true (no odd numbers exist), break out of loop and implicitly print
      ¨  # else, remove last element from list

Try it online
Previous 8 byte solution
vyÈiyˆëq

Explanation
v         # for each y in input
 yÈi      # if y is even
    yˆ    # push y to global array
      ëq  # else terminate program
          # implicitly print global array

Try it online

Labyrinth, 14 bytes
?:
"`#
"@%
\!;

Input and output are linefeed-separated lists (although in principle, the input could use any non-digit separator).
Try it online!
This is probably the most compact Labyrinth program I've ever written.
Interestingly, takewhile(odd) is lot simpler:
?:#
" %
\!/

Explanation
The usual Labyrinth primer:

The memory model is a stack (there's actually two, but we'll only need one for this program), which holds arbitrary-precision integers and initially holds an (implicit) infinite number of zeros.
There are no control flow instructions. Instead, the movement of the instruction pointer (IP) is determinated by the layout of the code (spaces are considered "walls" and cannot be traversed by the IP). Normally, the code is supposed to resemble a maze, where the IP follows straight corridors and bends, but whenever it reaches a junction, this acts as a conditional where the IP's new direction is determined based on the current state. The rules for choosing a direction boil down to this: if the top of the stack is zero, the IP keeps moving forward; if the top is positive, the IP turns right; if the top is negative the IP turns left. If one of these directions is blocked by a wall, the IP takes the opposite direction instead. This means that programs without clear corridors are usually incredibly tough to work with, because every single command would act as a junction. The fact that this worked out in this case is a bit of a miracle.
The IP starts at the first non-space character in reading order (? in this case), moving east.

The main flow through the program is a single loop around the perimeter:
>v
^>v
^@v
^<<

As it happens, we know that the top of the stack is zero after ! and " so that the IP is guaranteed not to turn towards the centre. ` and % on the other hand are used as conditionals where the IP might move towards the centre such that @ terminates the program, or it might keep moving around the perimeter.
Let's look at the code in the loop:
?   Read decimal integer N from STDIN, or 0 at EOF.
:   Duplicate. Since this is just a corner, the IP always turns south.
`   Negate the copy of the input (i.e. multiply by 1). At EOF, the result
    is still zero and the IP keeps moving south into the @. Otherwise, the
    top of the stack is now negative, and the IP turns east.
#   Push the stack depth (i.e. 2). Again, this is a corner, and the IP
    is forced to turn south.
%   Computer (-N % 2), which is identical to (N % 2) to determine the
    parity of the input. If input was odd, this gives 1, and the IP turns
    west into the @. Otherwise, the result is 0 and the IP keeps moving
    south, continuing the loop.
;   Discard the 0. This is a corner, so the IP is forced to turn west.
!   Print (and discard) N. The top of the stack is now one of the implicit
    zeros at the bottom, so the IP keeps moving west.
\   Print a linefeed. The IP is forced to turn north in the corner.
""  Two no-ops. The top of the stack is still zero, so the IP keeps moving north.

And then the loop starts over.
That raises the question why takewhile(odd) is so much simpler. There's two reasons:

Since EOF is returned as 0 (which is even), we don't need a separate EOF check. The list would be cut off at that point anyway.
Now we want to terminate when N % 2 is 0 (as opposed to 1), which means instead of conditional control flow we can simply divide the other copy N by N % 2: if the input is odd, that just leaves N and we even got rid of the N % 2 (so we don't need ;), but if the input is even, that simply terminates the program with a (silent) division-by-zero error.

Hence, the other code is a simple loop that doesn't allow for any branching at all.

R, 25 bytes
x=scan()
x[!cumsum(x%%2)]

Or equivalently
(y=scan())[!cumsum(y%%2)]

this is elegant.

Pyth, 7 bytes
<x%R2Q1

Try it here!
What I attempted to do in Pyke but index is broken in that atm

Racket, 22 bytes
(λ(n)(takef n even?))

The λ character is counted as 2 bytes.
I haven't seen Racket used before in any of the code golfing answers I've seen, so I had to do it at least once!

I used to golf in Racket, hooray for Racket!

Perl 5 + Perligata, 173 bytes
145 bytes, plus 28 for -MLingua::Romana::Perligata
Use as perl -MLingua::Romana::Perligata foo.pl; input (from stdin) and output (to stdout) are underscore-separated strings of decimal integers. Tested on Strawberry 5.20.2 with version 0.6 of Perligata, released two days ago; I don't know whether it works with Perligata version 0.50.
huic vestibulo perlegementum da.his _ scindementa da.per in his fac sic
si recidementum hoc tum II fac sic I exi cis
hoc tum _ egresso scribe
cis

Obviously this is clear as a bell. In case it's not, run it with -MLingua::Romana::Perligata=converte instead of -MLingua::Romana::Perligata, and perl will, instead of running the script, output a translation into regular Perl:
 $_ = Lingua::Romana::Perligata::getline (*STDIN );
 @_ = split ( '_');
for $_ (@_) {if ( ($_ % 2)) {exit ( 1)}
;
print (STDOUT $_, '_')}

For a token-by-token analysis, use -MLingua::Romana::Perligata=discribe.

Golfing notes:

It seems from the documentation that ultimus si recidementum hoc tum II fac. would work instead of si recidementum hoc tum II fac sic ultimus cis, saving 7 bytes. But it doesn't (it gives a "iussa absentia" error).
Undocumented (but unsurprising), you don't need a space after ..
(Also unsurprising,) scinde doesn't need a second argument, and uses hoc. Alas, exi needs an argument.
Instead of huic vestibulo perlegementum da, I tried -pMLingua::Romana::Perligata, but couldn't get it to work.

Just for kicks (although this whole answer was just for kicks):

After cleaning it up to Huic vestibulo perlegementum da. His lacunam scindementa da. Per in his fac sic si recidementum hoc tum II fac sic I exi cis. Hoc tum lacunam egresso scribe cis., Google Translate gives This court perlegementum grant. His gap scindementa grant. 2 By that time, do so in the following 1, Go out and do so if recidementum on this side. This was the gap as soon as write on this side..

what is this witchery

Perl 6, 14 bytes
{|$_,1...^*%2}

Try it online!
Finally, a use for a neat trick I found involving .... This is an anonymous code block that basically filters the list until it reaches an element that succeeds in the condition *%2 i.e. odd. Then we return the list excluding the last element. Since an element has to pass the condition at some point, otherwise it attempts to extrapolate off the end of the list, we append a 1 to the input list.
Note this isn't the intended use for the sequence operator ..., which is usually used to create sequences based off several parameters. We're using the behaviour that the end condition is checked against the starting elements as well, and will stop even before any new elements are generated.
Explanation:
{            }  # Anonymous code block
 |$_,1          # Using the input list appended with 1
      ...       # Take up to
          *%2   # The element that is odd
         ^      # And exclude the last element

:P i think a lot of people know about the trick

@ASCII-only Really? I haven't seen it before in the wild, if you could point me to any solutions that use ... to filter a list like this, I'd be very interested to see them

it's not really filtering though, i thought it's just the conventional use of creating a range until a predicate is satisfied?

well, the other conventional use

i mean, i guess the "checked against the starting elements" usually isn't taken advantage of

Brachylog, 19 16 bytes

hH:2%0,?b&~b.hH;[].

s.:Mc?,.:{:2%0}a

Explanation
s.                 Output is an ordered subset of Input
  :Mc?,            The concatenation of Output with a list M is Input
       .:{:2%0}a   All elements of Output are even

Today I learnt a neat trick (which was used in the 19  bytes answer): ~b.hH is shorter than  :[H]rc. to append an element at the beginning of a list. The first one means "Output is the result with an extra item at the beginning, and the first item of the Output is H", whereas the other one is straightforwardly "Output is the concatenation of [[H], Result]".

Retina, 17 bytes
 ?\d*[13579]\b.*

The trailing linefeed is significant. Input and output are space-separated lists.
Try it online!
This is a simple regex substitution, it matches the first odd number (i.e. a number ending in an odd digit), and if possible the space preceding it as well as everything after it and replaces it with an empty string, i.e. all elements from there onward are removed from the input.
As Leaky Nun points out, taking the list in binary, we can save 6 bytes, but it seems a bit cheaty, so I'll probably continue counting the decimal version:
 ?\d*1\b.*

You can take the list in binary?

Dyalog APL, 11 bytes
{⍵/⍨∧\~2|⍵}

2| division remainder from dividing with 2
~ negate
∧\ AND-scan (turns off from first 0)
/⍨ select where

J, 10 bytes
{.~2&|i.1:

Explanation
{.~2&|i.1:  Input: s
   2&|      Take each value in s mod 2
      i.1:  Find the index of the first 1
{.~         Take that many values from s and return

1{.2&|<;._2] is interesting (although longer)

Use $ instead of {.

CJam, 11 bytes
Thanks to @Dennis for two corrections and one byte off!
{1+_2f%1#<}

This is a code block (equivalent to a function; allowed by default) that expects the input array on the stack, and leaves the output array on the stack.
Try it online!
Explanation
{         }    e# define code block
 1+            e# attach 1 at the end of the array
   _           e# duplicate
    2f%        e# modulo 2 of each entry
       1#      e# find index of first occurrence of 1
         <     e# slice before

JavaScript (Firefox 30-57), 30 bytes
a=>[for(x of a)if(!(a|=x&1))x]

Python, 41 bytes
lambda l:l[:[x%2for x in l+[1]].index(1)]

Truncates l up to the index of the first occurrence of an odd number. The index is found by looking for a 1 in the values modulo 2. To guard against no odd number being found, a 1 is put on the end.

C#, 50 bytes
int[]f(int[]a)=>(a.TakeWhile(x=>x%2<1).ToArray());

You can use a lambda directly. It is valid as far as I know. a=>a.TakeWhile(x=>x%2<1);

JavaScript, 27 25 bytes
a=>a.filter(v=>a=a&&~v%2)

The filer expression repeatedly assigns to a and uses the value of a as a filter predicate. a holds either the initial array value (always truthy) or the boolean of whether only even values have been seen. When a turns false (i.e., an odd number appears), then subsequent runs of the a = a && ... logical AND operation short cirucits, and we use false for the rest of the run.
The bitwise NOT ~v turns even numbers to odd and vice versa, so ~v%2 returns a truthy value for even input and falsy values for odd input.

SML, 44 bytes

an assignment at my university functional programming course

Yay, functional programming! So as an assignment solution, this would probably look like this:
(* 'a takeWhile : ('a -> bool) -> 'a list -> 'a list *)
fun takeWhile p nil     = nil
  | takeWhile p (x::xr) = if p x then x :: takeWhile p xr else nil

(* takeWhileEven : int list -> int list *)
val takeWhileEven = takeWhile (fn x => x mod 2 = 0)

which can be golfed to
fun t[]=[]|t($ :: &)=if$mod 2=0then$ ::t&else[]

However using foldr is 3 bytes shorter:
foldr(fn($,r)=>if$mod 2=0then$ ::r else[])[]

32-bit x86 machine code, 14 bytes
In hex:
31C9FCADD1E87203E0F941F7D9C3

The list of integers in machine code is something like C's "int a[]". Since the list contains positive integers let's assume the list is zero-terminated, i.e. the value zero marks the end of the array. It's also makes no sense to copy values to another buffer inside this function, that's what strncpy() is for.
The pointer to an array is passed via ESI register. Returns the number of elements comprising the resulting list in ECX.
Disassembly:
31 c9     xor    ecx,ecx  ;ECX=0
fc        cld
_loop:
ad        lodsd           ;Fetch a number to EAX
d1 e8     shr    eax,1    ;EAX=>>1
72 03     jc _end         ;If CF is set then the number is odd, break
e0 f9     loopne _loop    ;--ECX; if(CF==0&&ZF==0)continue
41        inc    ecx      ;Should not include the terminating 0 into the count
_end:
f7 d9     neg    ecx      ;Counting from 0 downward, so ECX=-ECX
c3        ret

V, 13 bytes
íä*[13579]¾.*

Try it online!
Explanation:
í              "search for, on every line
 ä*            "Any number of digits
   [13579]     "Followed by an odd digit
          ¾    "Then the end of a word,
           .*  "Followed by anything
               "(implicit) and replace it with nothing.

Conveniently, the same code works to verify all test-cases simultaneously.

Pyke, 8 bytes
0+2L%fhO

Interpreter fixed, use other links
Uses Dennis' method except my split_at function includes the change - probably a bug
Or with bugfix, 7 bytes
2L%1R@<

Try it here!
2L%     -   map(%2, input)
   1R@  -  ^.index(1)
      < - input[:^]

Or after 2nd bugfix, 6 bytes
2L%fhO

Try it here!
Explanation:
2L%    -   map(%2, input)
   f   -  split_at(input, ^)
    hO - ^[0][:-1]

Ruby, 25 bytes
->a{a.take_while &:even?}

I think I lose...

Can you do ->a{a.take_while &:even?} or at least ->a{a.take_while(&:even?)}?

@MartinEnder Thank you. I was looking for something like that, but I guess I am not well versed in ruby golfing syntax.

Python 3, 59 bytes
def f(l):
 L=[]
 for x in l:
  if x%2:break
  L+=x,
 return L

Can surely probably be golfed more.
Thanks to everyone who commented :D

x%2<1 and x%2>0 are shorter

just use x%2 - 0 is false. You can flip the condition to use it for the other one too.

@mbomb007 I'd just flip the condition: []if x%2 else[x]

wait a minute, why do you even need a condition after the break

And with the condition gone, adding a tuple works and is one character shorter: L+=x,

If you replace the if with if not, you can save 7-4=3 bytes (if not x%2>0:L+=x)

if x%2>0: is equivalent with if x%2:

JavaScript, 40 bytes
a=>[...a,1].slice(0,a.findIndex(n=>n%2))
How it works
1) Take input array a and add a 1 to the end
2) Find the index of the first odd integer in the array
3) Return a subset of the array from index 0 (inclusive) to the odd integer's index (exclusive)

Forth, 114 bytes
Forth doesn't really have lists. The parameters must be pushed onto the stack in reverse order, as is typical in Forth. The result will be left on the stack in the same order. This doesn't work on Ideone for some reason, but it works on repl. The new line is required to remove ambiguity of some sort?
: D DEPTH ;
: f D IF 1 D 1 DO D 1- ROLL LOOP D 0 DO I PICK 2 MOD IF D I LEAVE THEN LOOP
DO I ROLL DROP LOOP THEN ;

Try it online
Ungolfed, with comments:
: f DEPTH IF                                ( if stack not empty )
        1 DEPTH 1 DO DEPTH 1- ROLL LOOP     ( put 1 on bottom of stack )
        DEPTH 0 DO                          ( loop over entire stack )
            I PICK 2 MOD IF                 ( if stack[i] is odd )
                DEPTH I LEAVE               ( put range and exit loop )
            THEN
        LOOP
        DO I ROLL                           ( roll eyes )
            DROP
        LOOP                                ( iterate that range and remove )
    THEN
;

This program (my previous attempt) prints the results until it hits an odd number. Everything remaining (not taken) will be left on the stack.
: f DEPTH IF BEGIN DUP 2 MOD DUP 1- IF SWAP . THEN UNTIL THEN ;

Fails if only even integers

After finishing this, I realized my breakfast was cold. :(

Too often I find my dinner cold after golfing code at the table. Perhaps Factor will let you be more productive and golfier at the same time? :D

@c I do my code development for PPCG with online IDEs. But I use Forth because I already know it, it's just difficult to manage a stack in my head. I originally learned Forth because a Minecraft mod added redstone computers that ran a version of Forth entitled MineOS.

GolfScript, 11 bytes
This is a full GolfScript program that reads a stringified GolfScript array literal (e.g. [28 14 7 0]) and prints out the same array with the first odd element and everything after it removed:
~1\{~&.},p;

Try it online.
(Also: Extended version with test harness.)
De-golfed version with comments:
~     # evaluate input
1\    # push the number 1 onto the stack and move it under then input array
{     # start of loop body
  ~   #  bitwise negate the input number (making odd numbers even and vice versa)
  &   #  take bitwise AND of input and the saved number (0 or 1) on stack
  .   #  duplicate result; filter loop will pop off the duplicate
},    # run loop above over input array, select elements for which it returns true
p     # stringify and print filtered array
;     # pop the number 0/1 off the stack

This solution is based on the GolfScript { }, filter operator, which runs the contents of the code block on each element of an array, and selects the elements of the array for which the code in the block returns a true (i.e. non-zero) value on top of the stack.
Thus, for example, {1&}, would select all odd numbers in an array, and {~1&}, would select all even numbers.  The challenge, then, is to make a filter that selects even numbers until it finds the first odd one, and thereafter selects no numbers at all.
The solution I used is to replace the constant bit-mask 1 (used to extract the lowest bit of each input number) with a variable on the stack that stores the result (0 or 1) of the previous filter loop iteration (and is initialized to 1 before the loop).  Thus, as soon as the filter returns 0 once, the bitmask also gets set to 0, preventing the filter from ever returning 1 again.

Befunge, 35 Bytes
This code handles numbers between 0 and 65535
1&:v
v-1_@#:@#<
>\:&:2%|
 \+1p4\< ^

Input format :
number_of_values    values(separated by a space)

Here is a version that displays the values at the end of the process :
1&:v>::   v                >00g1+:4g.v
v-1_^#:>#<>$$\$1-:10p000p0-| -g01p00:<
>\:&:2%|                   @
 \+1p4\< ^

You may test the code here, but you will have to add a trailing line with trailing spaces, as this interpret specifies :

« The code torus is only as large as the initial program. Insert more
lines or trailing space if data will be put beyond the end of code.»

I don't know if this is acceptable, as I didn't count this trailing in the byte count

nb: it seems that because I'm storing number in the code, the interpreter won't let this program run twice in the correct way. You'll have to reload it.

How does this work:

The interpreter follows the arrows and skip an instruction when crossing '#'
Grey dots are test, and the red line removes unneeded variables from the stack
Using the here in the above interpreter, the saved values are displayed in the code using their representations (I don't know the format).
Yes, Befunge is a quite reflective language

Vyxal, 7 bytes
⁽₂Ḋ¾wJh

Try it Online!
Explained
⁽₂Ḋ¾wJh
⁽       # 1-element lambda
 ₂      # check if even
  Ḋ     # group if true
   ¾wJ  # add empty list to end
      h # get head of the list

Factor, 24 bytes
[ [ even? ] take-while ]

Attempt This Online!

jq, 20 bytes
.[:map(.%2)[[1]][0]]

Try it online!
Explanation:
   map(.%2)            Maps the array items to their remainders when divided by 2
           [[1]]       Returns an array of indices where those items equal 1 (odds)
                [0]    Returns the first item of that array of indices
.[:                ]   Returns the original array up until that index

tinylisp 2, 6 bytes
(p ] e

Try it at Replit. Example session:
tl2> (p ] e
(() remaining-args (eval (concat (q (] e)) (quote-each remaining-args))))
tl2> (def take-while-even _)
take-while-even
tl2> (take-while-even (list 2 4 6 7 8))
(2 4 6)

Explanation
Uses (abbreviated aliases for) the library functions take-while and even?:
(p ] e)
(p    )  ; Partially apply
   ]     ; the take-while function
     e   ; to the even? function

Without using the library's take-while function, I found a rather elegant solution using foldr which is 26 bytes:
(p {(\(N A)(?(e N)(c N A)(

That is, partially apply the { (foldr) function to the following argument:
(\(N A)(?(e N)(c N A)()))
(\                      ) ; Lambda function
  (N A)                   ; that takes a number N and a list A:
       (?              )  ;  If
         (e N)            ;  N is even
              (c N A)     ;  cons N to A
                     ()   ;  Else return empty list

So we end up with a function that takes a list and right-folds it on the above function, with a default starting accumulator value of nil (empty list). This starts from the right end of the list, collecting values as long as they are even, but whenever it encounters an odd value it discards all previous values and starts over.

Rust, 25 bytes
|x|x.take_while(|x|x%2<1)

K, 12 bytes
{x@&~|\2!'x}

Explanation
{           } Function definition.
         'x   For each item in the input list...
       2!     Modulo it with 2 (e.g. 1%2, 5%2, 2%2, etc.) to get a list of booleans.
     |\       Fold | over the list to figure out where the odd numbers begin.
    ~         Flip the values it to get the beginning even numbers (until they turn odd).
   &          Get the indices.
 x@           Index the original list.

Python 2, 59 57 56 bytes
def f(L,E=[]):
 while L and~L[0]%2:E+=L.pop(0),
 print E

Try it online
If printing rather than returning a list is allowed, 44 bytes:
L=input()
while L and~L[0]%2:print L.pop(0)

And shorter by xnor, 34 bytes, exits with an error on encountering an odd number:
for x in input():
    0>>x%-2;print x

If you replace E=[] with *E, [L.pop(0)] with L.pop(0), and add parens to print, you can get 55 bytes with Python 3.5.

Nevermind. That returns tuples, which wouldn't work as input.

Actually, += allows extending lists with tuples for some reason, so E+=L.pop(0), still works.

With printing output, you can do much shorter with terminating with error: for x in input():0>>x%-2;print x

@Dennis And *E creates a tuple, so E+=L.pop(0), is extending a tuple, not a list.

@xnor I had to add a newline or it wouldn't compile (the printing one)

Minkolang 0.15, 12 bytes
nd2%,5&xr$N.

Try it here!
Explanation
nd              Take number from input and duplicate
  2%            Modulo 2
    ,           Logical NOT
     5&         Pop top of stack and jump 5 spaces if truthy
       x        Dump top element
        r       Reverse stack
         $N.    Output whole stack as numbers and stop.

Minkolang's codebox is toroidal, so if the instruction pointer does not stop, then it loops around to the beginning again. Trying to take a number after all input has been exhausted pushes -1, which is very conveniently odd.

Python, 43 bytes
lambda l:[x for x in l if l.__imul__(~x%2)]

Calling l.__imul__(n) does l*=n. For n=~x%2, it empties the list when x is even and otherwise leaves it unchanged. The list comprehension iterates and collect elements until it hits an odd number, which stops the iteration by emptying the list. Moreover, because it outputs the now-empty list, the if fails and the current odd value is not included.

Julia 0.6, 24 bytes
!x=1∈x%2?!x[1:end-1]:x

Try it online!

Lua, 67 Bytes
Simply iterate on each elements of the input using a repeat..until loop. The first iteration will use i=0, which isn't the first element of the input as Lua's tables are 1-indexed, resulting in r[0]=nil which won't do anything as r[0] is already nil.
function f(t)r={}i=0repeat r[i]=t[i]i=i+1until t[i]%2<1return r end

C, 73 69 63 60 54 45 42
This requires a NULL-terminated array of strings as input.
It modifies the parameter by chopping the list down to only even entries.
f(char**v){for(;*v&&~atoi(*v++)&1;);*v=0;}

If printing is allowed (45 bytes, doesn't modify parameter):
f(char**v){for(;*v&&~atoi(*v)&1;puts(*v++));}

Here is the previous complete program version (63 bytes):
i;main(int c,char**v){for(;(++i<c)-(atoi(v[i])&1);puts(v[i]));}

Takes input as program arguments.

@cat - GCC complains when I don't have the int c,char**v. How do you get around that?

Ehh, never mind, I can't get what I was after. Tips for golfing in C

36 bytes w/ clang, and fixed the last odd number being included in the list. In any other compiler you'd need to declare f(int**v){...} for +3 bytes (note that v doesn't need to be of type char** because you only need it to be a pointer to pointer to something)

Perl, 21 bytes
20 bytes code + 1 bytes command line (-p)
s/ ?\d*[13579]\b.*//

Usage example:
echo "20 4 6 5 3 4" | perl -pe "s/ ?\d*[13579]\b.*//"

PowerShell 26 bytes
process{if($_%2){break}$_}

Explanation
process{if($_%2){break}$_}
process{                 } # runs the script block once per item in the passed parameter
        if($_%2){break}    # if odd, break out of process{}
                       $_  # implicit output

Testing (save as evenodd.ps1):
PS> 42,14,42,2324 | .\evenodd.ps1
42
14
42
2324
PS> 7,14,42 | .\evenodd.ps1
PS> 171480372,13,14,42 | .\evenodd.ps1
171480372

Common Lisp, 44 bytes
 (loop as x in(read)while(evenp x)collect x)

Try it online!

Husk, 3 bytes
↑¦2

Try it online!
After my adventures with using drop-while to set a default input value with Husk's type inference system, I jumped at the opportunity to use take-while for something normal.
↑      The largest prefix of
       the input
 ¦     in which each element is divisible by
  2    two.

Java (JDK), 58 bytes
a->a.stream().mapToInt(i->i).takeWhile(i->i%2<1).toArray()

Try it online!
Takes a List<Integer> and outputs an int[].

Ruby, 25 bytes
->a{a.take_while &:even?}

Attempt This Online!

J-uby, 18 bytes
:take_while+:even?

Attempt This Online!

Fig, \$3\log_{256}(96)\approx\$ 2.469 bytes
t@E

Try it online!
Builtin. Can't have a functional language without one.
t@E
t@  # Take while
  E # Even

Nim, 87 bytes
proc t(a:seq[int]):seq[int]=
  var i=0;while i<a.len and a[i]mod 2==0:inc i
  a[0..i-1]

Attempt This Online!

ARM Thumb-2 machine code, 12 bytes
00000000: 04 c8 52 ea c2 72 04 c1 fa d5 70 47              ..R..r....pG

Assembly:
    .syntax unified
    .arch armv7-a
    .thumb
    .globl takewhile
    .thumb_func
    // input: int *, r0
    // output: int *, r1
    // lists are terminated with a negative number
takewhile:
.Lloop:
    // Load number into r2, increment r0
    ldmia   r0!, {r2}
    //  1. shift the LSB of r0 into the MSB
    //  2. Logical OR
    //  3. Set flags on the result
    // On either a terminator or an odd number, the MSB
    // will be set, which sets the N flag. Additionally,
    // this will terminate the list when stored.
    //    r2 = r2 | (r2 << 31);
    //    NF = r2 & 0x80000000;
    orrs.w  r2, r2, r2, lsl #31
    // Store r2 into r1, increment r1
    stmia   r1!, {r2}
    // Loop if MSB was not set (N flag not set)
    bpl     .Lloop
    // Return
    bx      lr

This function requires and outputs an array of positive int32_ts terminated with any negative int32_t. It follows standard C calling convention:
#include <stdint.h>
#include <stdio.h>
void takewhile(const int32_t *input /* r0 */, int32_t *output /* r1 */);

int main(void)
{
    const int32_t input[5] = { 171480372, 13, 14, 42, -1 };
    int32_t output[5];
    takewhile(input, output);
    for (int i = 0; output[i] >= 0; i++) {
        printf("%d, ", output[i]);
    }
    putchar('\n');
}

This takes advantage of the "numbers are positive" condition, and how ARM lets me set the condition codes for free.
I repeatedly logical OR the lowest bit of the values with the highest bit, and test the result. If the result is negative, one of the following is true:

The end of the list was reached (the upper bit was already set)
The number was odd (the lowest bit was set, which when shifted sets the upper bit).

With the example above, the outputted values will be this:
{ 171480372, /* -2147483635 */ 13 | 0x80000000 }

Go, 78 64 bytes
func(s[]int,c func(int)){for _,x:=range s{if x%2>0{break}
c(x)}}

Attempt This Online!

-14 bytes by @Steffan

Go, generic with predicate, 96 bytes
func f[T any](s[]T,b func(T)bool)(o[]T){for i:=0;i<len(s)&&b(s[i]);i++{o=append(o,s[i])}
return}

Attempt This Online!

76 bytes

I think it's allowed to output a list via calling a function, so in that case, 64

Prolog (SWI), 59 bytes
[]+[].
[H|_]+[]:-1is H mod 2.
[H|T]+[H|R]:-0is H mod 2,T+R.

Try it online!

Thunno X, \$ 11 \log_{256}(96) \approx \$ 9.05 bytes
lX{D2%)xsTX

Explanation
lX{D2%)xsTX  # Implicit input
lX           # Store [] in x
  {          # Loop through the input list:
   D         #   Duplicate
    2%)      #   If it's odd, break
       xsT   #   Otherwise, append to x
          X  #   And store the result in x
             # The X flag pushes x at the end
             # Implicit output

Screenshot

PARI/GP, 23 bytes
a->i=0;[t|t<-a,!i+=t%2]

Attempt This Online!

Japt -g, 3 2 bytes
ôu

Try it here

Fails if the first is odd and the second is even. Working version is ô%2

Or, better yet, @noodleman: just ôu

Ly, 16 bytes
&nr[:2%[;]pu9`o]

Try it online!
Pretty brute force, but it's relatively short too. :)
&nr              - Read in list of numbers, reverse stack
   [           ] - Loop until the stack is empty
    :2%          - Dup next number, compute 1|0 if odd/even
       [;]       - If odd, exit the program
          p      - Delete if/then boolean
           u     - Print the number, since it's even
            9`o  - Push 10 (LF) and print as character

ReRegex, 24 bytes
,?\d*[13579]\b.*//#input

Try it online!
Takes input as a line of comma deliminated Integers. Matches any odd number, and replaces it and the rest of the line with nothing.

Thunno 2, 5 bytes
(ɗS;ṫ

Attempt This Online!
Explanation
(ɗS;ṫ  # Implicit input
(  ;   # while loop
 ɗS    # (condition) at least one odd number in the list
    ṫ  # (body) remove the last item
       # Implicit output

Nekomata, 5 bytes
Ö∫¬∑T

Attempt This Online!
Ö∫¬∑T
Ö       Modulo 2
 ∫      Cumulative sum
  ¬     Logical NOT
   ∑    Sum
    T   Take; get the prefix with the given length

Nekomata, 5 bytes
pᵖ½al

Attempt This Online!
pᵖ½al
p       Non-deterministically choose a prefix
 ᵖ½     Check that all elements are even
   al   Get the last possible value

Uiua, 7 bytes
▽\×¬◿2.

Try it!
▽\×¬◿2.
      .  # duplicate
    ◿2   # modulo two
   ¬     # not
 \×      # scan by multiplication
▽        # keep input elements indicated by mask

K (ngn/k), 7 bytes
(|\2!)_

Try it online!

(...)_ set up a weed-out; drop elements from the (implicit) right argument where the code in (...) returns a positive integer (for each item of the input)
|\2! do a max-scan on the input mod'ed by 2

Factor, 55 bytes
[ dup [ odd? ] find drop over length over swap ? head ]

Using the following substitution regexes, the test cases from the question can be turned into a Factor test suite.
s/\[((?:\d*(?: )?)*)\]\s+->\s+\[((?:\d*(?: )?)*)\]/{ { $2 } } [ { $1 } take-while-even ] unit-test/g
s/,//g

takewhile-even.factor
USING: kernel math sequences ;
IN: takewhile-even

: take-while-even ( seq -- newseq )
  dup [ odd? ] find drop over length over swap ? head ;

takewhile-even-tests.factor
USING: tools.test takewhile-even ;
IN: takewhile-even.tests

{ { 14 42 2324 97090 4080622 171480372 } } [ { 14 42 2324 97090 4080622 171480372 } take-while-even ] unit-test
{ { 42 14 42 2324 } } [ { 42 14 42 2324 } take-while-even ] unit-test
{ {  } } [ { 7 14 42 } take-while-even ] unit-test
{ {  } } [ {  } take-while-even ] unit-test
{ { 171480372 } } [ { 171480372 13 14 42 } take-while-even ] unit-test
{ { 42 14 42 } } [ { 42 14 42 43 41 4080622 171480372 } take-while-even ] unit-test

Run them with "takewhile-even" test.

Perl 5.10, 36 bytes
Different way of doing it when compared to the other Perl answers which are based on regexes. 35 bytes + 1 byte for -a flag.
for(@F){$_%2?last:push@a,$_}say"@a"

Try it here!

Java, 98 bytes
int[]f(int[]t){int i=0;for(;i<t.length&&t[i]%2<1;i++);return java.util.Arrays.copyOfRange(t,0,i);}

Ideone it!

Python, 55
t=lambda A,i=0:i<len(A)and~A[i]%2and[A[i]]+t(A,i+1)or[]

The following one is a generator, so it doesn't return a list, 49 bytes:
def t(A):
 for a in A:
  if a%2:break
  else:yield a

# usage: list(t([2, 3, 4]))

"The output should be a list"

@mbomb007: thanks for reformating, looks better now

Perl, 29 + 1 (for -p) = 30 bytes
s/(\d+)/($1)[$o or$o=$1%2]/eg

Use like perl -p myfile.pl, where myfile.pl contains the above code, or just perl -pn 's/(\d+)/($1)[$o or$o=$1%2]/eg'. Takes input from standard input.

s/-pn/-pe/. Also, I haven't tested, but I imagine you can omit the parens from the first argument to s and use $& instead of $1.

JavaScript, 29 bytes
a=>a.filter(e=>!(s|=e%2),s=0)
or
a=>a.filter(e=>s&=!(e%2),s=1)
How it works (1st version)
1) Take input array a and return the result of calling filter on it. This will keep every element for which the function we pass into filter returns a truthy value.
2) Abuse the second parameter to filter (normally used to set the this value to the function, but we don't use this in the program) to initialize s to 0.
3) For the filter function, set s to s | (e % 2), which will evaluate s to 0 iff s was 0 before and the element e is even. So, s will be 0 up until the first odd value, after which it will never be 0 again. Then simply return the negation of s, keeping the first run of even values (!0 === true) and discarding the rest.

TSQL 67 bytes
DECLARE @ table(i INT identity, n INT)
INSERT @ values(14),(42),(2324),(97090),(4080622),(1),(171480372)

SELECT n FROM(SELECT n,sum(n%2)over(order by i)z FROM @)x WHERE z=0

Fiddle

PHP, 57 55 bytes
function f($i){foreach($i as $n){if($n&1)die;echo $n;}}

Ungolfed:
function f($i){
    foreach($i as $n){
        if($n & 1) die;
        echo $n;
    }
}

The function takes an array $i as an input parameter.
$n & 1 will return 1 if $n is odd and 0 is $n is even.

Python 3, 72 bytes
It's a bit of a boring answer, but itertools has a function for this...
from itertools import*
lambda x:[i for i in takewhile(lambda y:y%2+1,x)]

An anonymous function that takes input of the list x via argument and returns a list.
Try it on Ideone

><>, 70 bytes
Takes input as any number of decimal integers separated by a single character (anything but a digit), and prints out the list newline-separated.
v;oan;?<
0!2&::&\%
&>i:0(?^'0'-::0($9)+?v&a*+&!
>^   oan&0~&;?%2&::&~<

Try it online!

Javascript (using external library - Enumerable) (42 bytes)
n=>_.From(n).TakeWhile(y=>y%2<1).ToArray()

Code explanation: Library built in implementation...

Tcl, 44 bytes
proc T L {lmap e $L {if $e%2 {break}
set e}}

Try it online!

Tcl, 64 bytes
proc T L {set M {}
lmap e $L {if $e%2 break
lappend M $e}
set M}

Try it online!

Funky, 44 bytes
t=>{z={}fori=0;(!t[i]&1)*i<#t;i++z[i]=t[i]z}

Try it online!

GNU sed, 20 bytes
s/[^ ]*[13579]\b.*//

Try it online!
Input and output are space-separated numbers.
Alternate solution, 22 bytes (20 + -n)
s/[24680]$/&/p;t;q;:

Try it online! Uses newlines instead of spaces this time.

tinylisp repl, 61 bytes
(load library)(d E(q((L)(i(i L(even?(h L))L)(c(h L)(E(t L)))(

Defines a function E (short for "take while Even"). Try it online!
Ungolfed
(load library)
(def takewhile-even
 (lambda (ls)
  (if
   (if ls (even? (head ls)) ls)
   (cons (head ls) (takewhile-even (tail ls)))
   nil))))

Recurse through the list, using cons to build the result list. If the list is empty or if even? returns false, return empty list.
Note #1: Your functional programming professor would not like this function. It's not tail-recursive, so it will hit the recursion limit for long lists. Tail-recursive version is 73 bytes:
(load library)(d E(q((L A)(i(i L(even?(h L))L)(E(t L)(c(h L)A))(reverse A

or ungolfed:
(load library)
(def takewhile-even
 (lambda (ls accum)
  (if
   (if ls (even? (head ls)) ls)
   (takewhile-even
    (tail ls)
    (cons (head ls) accum))
   (reverse accum))))

Note #2: The specification of "take while even" actually costs bytes in tinylisp: even? isn't built-in, so we have to load the library (which is expensive) or reimplement the function (which is worse). Generic takewhile with the predicate as a second argument is only 46 bytes:
(d T(q((L P)(i(i L(P(h L))L)(c(h L)(T(t L)P))(

or ungolfed:
(load library)
(def takewhile
 (lambda (ls predicate)
  (if
   (if ls (predicate (head ls)) ls)
   (takewhile (tail ls) predicate)
   nil)))

(I think I may have my next standard library function here...)

Java 8, 79 71 bytes
l->{int i=0;for(int n:l){if(n%2>0)return l.subList(0,i);i++;}return l;}

Explanation:
Try it here.
l->{             // Method with ArrayList<Integer> as parameter and List as return-type
  int i=0;       //  Index-integer
  for(int n:l){  //  Loop over the input-List
    if(n%2>0)    //   If the current item is odd:
      return l.subList(0,i);
                 //    Return a sub-List from 0 through index `i` (exclusive)
    i++;         //   At the end of every iteration: increase index `i` by 1
  }              //  End of loop
  return l;      //  If the input-List was empty or contained no odd values, return itself
}                // End of method

Perl 5, 18 + 1 (for a) = 19 bytes
Uses -aE instead of -ae.
$_%2?die:say for@F

Stax, 9 bytes
{O{|e*cf}

This is a block (equivalent to a function) that takes a list and returns a list on the top of the stack. The link below attaches some footers to output the list.
Run and debug online!
Explanation
{O{|e*cf}
{       }    Define a block
 O           Put 1 under top of stack, used as an accumulator
  {    f     Filter array with accumulator
   |e        True if array element is even, false if odd
     *c      `And` with accumulator

Does packing not save any bytes?

Packed content cannot be directly copied to a program as a block that can be called.

Add++, 14 bytes
L*,bU1€+2↑%1€_

Try it online!
How it works
L*,		; Declare 'lambda 1' that returns the stack
		; Example argument:		[[12 14 16 17 18 20]]
	bU	; Unpack;		STACK = [12 14 16 17 18 20]
	1€+	; Increment each;	STACK = [13 15 17 18 19 21]
	2↑%	; Takewhile odd;	STACK = [13 15 17]
	1€_	; Decrement each;	STACK = [12 14 16]

Why the downvote? Is there anything wrong with this answer?

I don't see anything wrong with it, so I've upvoted to neutralize the unexplained downvote.

Javascript (ES2015) , 42 Bytes
I wasn't sure if the expected implementation was of the actual higher order function or the special case of getting a list of all even numbers, so i did both. Byte count is for longest of the two (higher order)
Even numbers (39 bytes)
l=>(o=[],l.every(v=>~v%2&&o.push(v)),o)

Higher order function:
f=>l=>(o=[],l.every(v=>f(v)&&o.push(v)),o)

higher order function called using curry style syntax
f(predicate)(list) => list

Arturo, 45 36 20 bytes
$=>[collect&=>even?]

Try it

Julia 0.6, 22 bytes
!x=x[cumprod(@.x%2<1)]

Try it online!
also works in julia 1.x
there is Iterators.takewhile but it is way too long

C (GCC), 43 bytes
i;f(a,n)int*a;{for(;i<n&&~a[i]%2;i++);a=i;}

Attempt This Online!
I/O format: Takes a list and its length, returns the length to which the input list needs chopped. Tricks: ~a[i]%2 checks if a[i] is even, a=i; loads i to rax with -O0, hence avoiding a return. Also uses K&R function declaration and implicit int.

Perl 5 -p, 9+1 = 10 bytes
(Scored under the system in place at the time of the question.)
$_%2&&die

Try it online!
Input and output both have the entries line separated.

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

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


text:
Antiprime Champions
Consider the following table for the function d(n), which calculates the number of factors that n is divisible by without a remainder:
n    | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ...
d(n) | 1 | 2 | 2 | 3 | 2 | 4 | 2 | 4 | 3 | 4  | 2  | 6  | ...

Going from left to right, it is possible to determine the "champion" of the current subsequence:

The first champion in the sequence [1] is n = 1 with d(1) = 1.
The second champion in the next sequence, [1, 2] is n = 2 with d(2) = 2.
The sequence [1, 2, 3] has no new champions, because d(3) = d(2) = 2, and 2 earned the title first.
The third champion appears the sequence [1, 2, 3, 4]: d(4) = 3, which is greater than the previous champion with d(2) = 2.
The next champion is 6 in [1, 2, 3, 4, 5, 6] with d(6) = 4.
The next champion is 12 with d(12) = 6.

The champions can be denoted in the table:
n    | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ...
d(n) | 1 | 2 | 2 | 3 | 2 | 4 | 2 | 4 | 3 | 4  | 2  | 6  | ...
       x   x       x       x                         x

You task is the following: Write a program that given an integer n, print all champions in the range [1, n] (n inclusive). The output format does not matter (test cases below display array format). Standard code golf rules and scoring applies.
Test cases
1 -> [1]
2 -> [1, 2]
3 -> [1, 2]
4 -> [1, 2, 4]
5 -> [1, 2, 4]
6 -> [1, 2, 4, 6]
7 -> [1, 2, 4, 6]
8 -> [1, 2, 4, 6]
9 -> [1, 2, 4, 6]
10 -> [1, 2, 4, 6]
11 -> [1, 2, 4, 6]
12 -> [1, 2, 4, 6, 12]
24 -> [1, 2, 4, 6, 12, 24]
36 -> [1, 2, 4, 6, 12, 24, 36]

Hint: The output should always be a prefix of the List of Highly Composite Numbers.

Obligatory OEIS

Hello, and welcome to PPCG! This is a good challenge, except uoi don't define what a "champion" is.

@NoOneIsHere - The OP does implicitly. "d(3) = d(2) = 2, and 2 earned the title first." and "d(4) = 3, which is greater than the previous champion with d(2) = 2", so a champion must be the next greater d(n) for greater n. (If d(n) > d(n-x) where x > 0, it is a champion)

@owacoder: Sorry, I didn't see that.

This is inspired by the new Numberphile video, isn't it?

I am telling you the name is going to stick!

@LegionMammal978 Yes, nice spot!

Well somebody watched a numberphile video recently ;)

Jelly, 10 bytes
0rÆDL€»\IT

Try it online!

05AB1E, 16 15 bytes
0U>GNÑg©X›i®UN,

Explanation
0U               # initialize the record as 0
  >G             # for each number in 1 to N
    NÑg©         # get number of divisors
        X›i      # if number of divisors is a new record
           ®U    # save new record
             N,  # print the new record holder on a new line

Try it online

MATL, 14 13 bytes
0i:t!\~sY>hdf

Try it online!
Explanation
0      % Push 0
i:     % Take input n. Push [1 2 ... n]
t!\    % 2D array of all combinations of modulo between elements of [1 2 ... n]
~s     % Sum of zeros of each column. Gives number of divisors for [1 2 ... n]
Y>     % Cumulative maximum
h      % Concatenate with 0
d      % Consecutive differences
f      % Indices of nonzero elements. Implicitly display

Woah! I did not know you could create a 2d matrix like that! That's really cool! Also, you could take 2 bytes off by just pushing a one, instead of joining it, since output format doesn't matter. http://matl.tryitonline.net/#code=OnQhXH5zWT5kZlEx&input=MzY

@DrGreenEggsandIronMan Yes, I use broadcasting all the time :-) As for the format, I assume the numbers have to be at least sorted

Well, OP said The output format does not matter (test cases below display array format). but I suppose it's up to you.