content
stringlengths 10
4.9M
|
---|
/**
* @author <a href="mailto:[email protected]">Matej Lazar</a>
*/
public class BuildExecutionConfigurationMock {
public static final String DEFAULT_SYSTEM_IMAGE_ID = "abcd1234";
public static BuildExecutionConfiguration mock() {
return BuildExecutionConfiguration.build(
1,
"condent-id",
1,
"mvn clean install",
"configuration name",
"https://pathToRepo.git",
"1111111",
"https://pathToOriginRepo.git",
false,
DEFAULT_SYSTEM_IMAGE_ID,
"image.repo.url/repo",
SystemImageType.DOCKER_IMAGE,
BuildType.MVN,
false,
null,
new HashMap<>(),
false,
null
);
}
} |
<gh_stars>0
use elvis::Colors as ElvisColors;
use wasm_bindgen::prelude::*;
/// `Colors` interface
#[wasm_bindgen]
#[derive(Clone, Copy)]
pub struct Colors(ElvisColors);
impl Default for Colors {
fn default() -> Colors {
Colors(ElvisColors::Black)
}
}
impl std::convert::Into<ElvisColors> for Colors {
fn into(self) -> ElvisColors {
self.0
}
}
#[wasm_bindgen]
impl Colors {
#[wasm_bindgen(js_name = "RGBA")]
pub fn rgba(r: i16, g: i16, b: i16, a: f32) -> Colors {
Colors(ElvisColors::ORGB(a, r, g, b))
}
#[wasm_bindgen(js_name = "Amber")]
pub fn amber() -> Colors {
Colors(ElvisColors::Amber)
}
#[wasm_bindgen(js_name = "AmberAccent")]
pub fn amber_accent() -> Colors {
Colors(ElvisColors::AmberAccent)
}
#[wasm_bindgen(js_name = "Black")]
pub fn black() -> Colors {
Colors(ElvisColors::Black)
}
#[wasm_bindgen(js_name = "Blue")]
pub fn blue() -> Colors {
Colors(ElvisColors::Blue)
}
#[wasm_bindgen(js_name = "BlueAccent")]
pub fn blue_accent() -> Colors {
Colors(ElvisColors::BlueAccent)
}
#[wasm_bindgen(js_name = "BlueGrey")]
pub fn blue_grey() -> Colors {
Colors(ElvisColors::BlueGrey)
}
#[wasm_bindgen(js_name = "Brown")]
pub fn brown() -> Colors {
Colors(ElvisColors::Brown)
}
#[wasm_bindgen(js_name = "Cyan")]
pub fn cyan() -> Colors {
Colors(ElvisColors::Cyan)
}
#[wasm_bindgen(js_name = "CyanAccent")]
pub fn cyan_accent() -> Colors {
Colors(ElvisColors::CyanAccent)
}
#[wasm_bindgen(js_name = "DeepOrange")]
pub fn deep_orange() -> Colors {
Colors(ElvisColors::DeepOrange)
}
#[wasm_bindgen(js_name = "DeepOrangeAccent")]
pub fn deep_orange_accent() -> Colors {
Colors(ElvisColors::DeepOrangeAccent)
}
#[wasm_bindgen(js_name = "DeepPurple")]
pub fn deep_purple() -> Colors {
Colors(ElvisColors::DeepPurple)
}
#[wasm_bindgen(js_name = "DeepPurpleAccent")]
pub fn deep_purple_accent() -> Colors {
Colors(ElvisColors::DeepPurpleAccent)
}
#[wasm_bindgen(js_name = "Green")]
pub fn green() -> Colors {
Colors(ElvisColors::Green)
}
#[wasm_bindgen(js_name = "GreenAccent")]
pub fn green_accent() -> Colors {
Colors(ElvisColors::GreenAccent)
}
#[wasm_bindgen(js_name = "Grey")]
pub fn grey() -> Colors {
Colors(ElvisColors::Grey)
}
#[wasm_bindgen(js_name = "Indigo")]
pub fn indigo() -> Colors {
Colors(ElvisColors::Indigo)
}
#[wasm_bindgen(js_name = "IndigoAccent")]
pub fn indigo_accent() -> Colors {
Colors(ElvisColors::IndigoAccent)
}
#[wasm_bindgen(js_name = "Inherit")]
pub fn inherit() -> Colors {
Colors(ElvisColors::Inherit)
}
#[wasm_bindgen(js_name = "LightBlue")]
pub fn light_blue() -> Colors {
Colors(ElvisColors::LightBlue)
}
#[wasm_bindgen(js_name = "LightBlueAccent")]
pub fn light_blue_accent() -> Colors {
Colors(ElvisColors::LightBlueAccent)
}
#[wasm_bindgen(js_name = "LightGreen")]
pub fn light_green() -> Colors {
Colors(ElvisColors::LightGreen)
}
#[wasm_bindgen(js_name = "LightGreenAccent")]
pub fn light_green_accent() -> Colors {
Colors(ElvisColors::LightGreenAccent)
}
#[wasm_bindgen(js_name = "Lime")]
pub fn lime() -> Colors {
Colors(ElvisColors::Lime)
}
#[wasm_bindgen(js_name = "LimeAccent")]
pub fn lime_accent() -> Colors {
Colors(ElvisColors::LimeAccent)
}
#[wasm_bindgen(js_name = "Orange")]
pub fn orange() -> Colors {
Colors(ElvisColors::Orange)
}
#[wasm_bindgen(js_name = "OrangeAccent")]
pub fn orange_accent() -> Colors {
Colors(ElvisColors::OrangeAccent)
}
#[wasm_bindgen(js_name = "Pink")]
pub fn pink() -> Colors {
Colors(ElvisColors::Pink)
}
#[wasm_bindgen(js_name = "PinkAccent")]
pub fn pink_accent() -> Colors {
Colors(ElvisColors::PinkAccent)
}
#[wasm_bindgen(js_name = "Purple")]
pub fn purple() -> Colors {
Colors(ElvisColors::Purple)
}
#[wasm_bindgen(js_name = "PurpleAccent")]
pub fn purple_accent() -> Colors {
Colors(ElvisColors::PurpleAccent)
}
#[wasm_bindgen(js_name = "Red")]
pub fn red() -> Colors {
Colors(ElvisColors::Red)
}
#[wasm_bindgen(js_name = "RedAccent")]
pub fn red_accent() -> Colors {
Colors(ElvisColors::RedAccent)
}
#[wasm_bindgen(js_name = "Teal")]
pub fn teal() -> Colors {
Colors(ElvisColors::Teal)
}
#[wasm_bindgen(js_name = "TealAccent")]
pub fn teal_accent() -> Colors {
Colors(ElvisColors::TealAccent)
}
#[wasm_bindgen(js_name = "Transparent")]
pub fn transparent() -> Colors {
Colors(ElvisColors::Transparent)
}
#[wasm_bindgen(js_name = "White")]
pub fn white() -> Colors {
Colors(ElvisColors::White)
}
#[wasm_bindgen(js_name = "Yellow")]
pub fn yellow() -> Colors {
Colors(ElvisColors::Yellow)
}
#[wasm_bindgen(js_name = "YellowAccent")]
pub fn yellow_accent() -> Colors {
Colors(ElvisColors::YellowAccent)
}
}
|
/**
* Method takes as parameters from GUI all possible search criteria.
* It then checks, which is valid or if both are, then
* sends a query-request to database-class instance accordingly.
* As it receives the search result, it then returns the list to GUI
* @param subject sought after subject (either physics, chemistry or biology)
* @param duration maximum desired duration of experiment
* @return a list of all experiments that match these criteria
*/
public List<Experiment> search(String subject, int duration) {
List<Experiment> fromDatabase = new ArrayList<>();
if (!subject.contains("empty") && duration !=0) {
fromDatabase = this.database.findByBoth(subject, duration);
} else if (!subject.contains("empty")) {
fromDatabase = this.database.findBySubject(subject);
} else if (duration !=0) {
fromDatabase = this.database.findByDuration(duration);
}
return fromDatabase;
} |
Photo by Goh Iromoto
In 1993, then-Finance Minister Glen Clark tabled a controversial BC Budget, featuring a wide range of tax changes. A one-point increase in the provincial sales tax was the largest measure, tempered by the introduction of a refundable sales tax credit. Most of the budget measures increased taxes on the wealthy and corporations. Up went the top marginal income tax rates for the top 8% of British Columbians, as did the general corporate income tax rate.
Among the measures tabled was a progressive increase in provincial property taxes (officially called the “school tax” but already de-coupled from actual education expenditures). On top of regular property tax, the budget proposed a surtax with brackets (like income tax) of 0.5% on homes valued over $500,000, rising to 1% over $700,000, and 1.5% on value over $900,000. The budget reckoned this progressive property surtax would only apply to about 25-30,000 “high-valued single residential dwellings” in the province, or about 2.5% of the total housing stock.
Unfortunately, the property tax proposal triggered a political firestorm, and was pulled off the table due to concerns about the potential harm to seniors living on fixed incomes—the “property rich but cash poor”—who would not able to afford higher property taxes.
In hindsight, the 1993 budget may well have been the most progressive tax shift in BC history. Stung by criticism of new taxes in general and the property tax in particular, the 1994 budget, tabled by a new Finance Minister, Elizabeth Cull, instead promised a three-year tax freeze. Until it lost power to the BC Liberals in 2001, the NDP government would never again attempt major reforms to the tax system.
More than two decades later, it is time to revisit the idea of progressive property taxation, in light of house price inflation that has fuelled a growing gap between homeowners and renters. Economists consider property taxes to be an efficient and effective form of taxation because people cannot move their property to another jurisdiction to avoid the tax. Property tax rates in Metro Vancouver are already low when compared to other Canadian cities.
Making the property tax progressive would be a step towards the progressive taxation of wealth (including financial assets), as recommended by French economist Thomas Piketty in Capital in the 21st Century. Progressive property taxes have precedents in Europe, including Denmark, Finland and Germany.
What would a progressive approach to property taxes look like in BC? Current practice is that property taxes are determined by the product of assessed housing value multiplied by a “mill rate” determined annually by municipal governments based on their expenditure needs. But the property tax rate itself is a flat percentage, unlike the income tax, with its multiple brackets.
The proposed surtax thresholds from the 1993 budget are from a different era. A modernized version proposed by SFU economist Rhys Kesselman calls for a property surtax of 0.5% on home values between $1 million and $1.5 million, 1% between $1.5 million and $2 million, and 1.5% between $2 million and $3 million, and 2% above $3 million. Kesselman’s proposal would allow homeowners to credit their previous year’s BC income tax against the surtax, thus aiming it squarely at non-resident owners and vacant properties.
Table: Annual property surtax based on Kesselman proposal
Home value Kesselman surtax $500 thousand $0 $1 million $0 $1.25 million $1,250 $1.75 million $5,000 $2 million $7,500 $5 million $62,500
This framework, however, could be more broadly aimed at taxing windfall gains from housing price escalation – these are more like lottery winnings than the proceeds of hard work. A progressive property tax on all properties, regardless of whether the owner resides in BC or not, would raise substantial revenues—about $1.7 billion per year—in support of an ambitious affordable/social housing construction plan, while tackling growing wealth inequality.
This is just one example, and many variations of this structure are possible: the threshold for the surtax need not start at $1 million of assessed value; there is no reason why brackets could not continue to increase above $3 million.
Implementation of this approach could occur through the provincial portion of the property tax, or alternatively it could be implemented at a regional or municipal level, if given legal authorization by the province. For example, only half of the property taxes collected by the City of Vancouver are for its own purposes, while 38% goes to the BC government, another 9% to Translink and 2% to Metro Vancouver regional government.
Another means of ensuring fairness would be to reform the current homeowner grant (HOG), which goes to all qualifying homeowners regardless of their income. The homeowner grant is costly to the provincial treasury – $814 million in 2014/15, representing about half of total provincial property tax revenues from homes. The homeowner grant currently provides a $570 reduction in provincial property taxes for properties under $1.2 million in market value, and is then phased out and eliminated for properties assessed at more than $1.31 million. The recent surge in Vancouver real estate prices pushed many new households over one or both thresholds. For seniors, there is an additional HOG amount, making the total grant $845.
A fairer approach would be to eliminate homeowner grants in favour of an income-tested credit/transfer program. Like the GST credit, Canada Child Benefit or Old Age Security, it could be designed to provide greater benefit to low-income households and then phase out gradually as income rises. Unlike the current HOG, renters would be included in this system, as they pay property taxes indirectly through their rent. (Sadly, the 1993 BC Budget also killed a “renters’ tax reduction”, an income tax credit for renters that used to be a complementary credit to the HOG).
BC already has multiple brackets for the Property Transfer Tax, but these only apply when a house is sold, and it’s an unpredictable revenue source. Progressive property taxation would bring benefits every year by making the property tax system more fair to renters, reducing wealth inequality and improving the overall equity of the tax system. Finally, it would raise substantial revenues in support of a much-needed major affordable housing build-out over the coming decades.
Topics: Housing & homelessness, Poverty, inequality & welfare, Taxes |
Carroll, Iowa: Where The Childhood Paper Route Is Alive And Well
toggle caption Noah Adams for NPR
This story began in 2012 while I was working on a story in Iowa. I was taking pictures on a foggy afternoon and saw a young girl on a blue bicycle, a newspaper bag slung across her shoulder. She stopped and held up a copy of The Daily Times Herald.
These days, most newspapers are delivered by fast-moving adults driving vans and trucks. I guess I didn't know that kids still had paper routes, anywhere.
Turns out, if you're a kid living near Carroll, Iowa, and you want to make some money and have an adventure, you're growing up in the right place.
Enlarge this image toggle caption Noah Adams for NPR Noah Adams for NPR
In Carroll, a town of 10,000 surrounded by farmland, factories and parks, the award-winning Daily Times Herald still relies on young people to get the news to local homes each day.
The family that owns and runs the paper believes the most important news they cover is about the town's young people — schools, sports, the arts — and it just makes sense to have them delivering those stories to the community.
Jaxson Kuhlmann delivers 36 to 38 papers daily on his figure-eight shaped route around the neighborhood. It never takes him longer than a half-hour, he says. At each stop, he walks up to the porch to make his delivery.
"Some people want it in their door, some people want it in their mailbox," Jaxson says. "There are some certain houses that you're like, 'People still live here?' You don't see them come out at all."
Eighty percent of The Daily Times Herald's papers are delivered by young people, most between the ages of 9 and 17, in Carroll and the surrounding towns. They're paid the same as adults: 10 to 12 cents a copy.
The paper is a surviving exception to a trend. Circulation managers at the two nearest big papers, The Des Moines Register and the Omaha World-Herald, said they employ very few kids.
One big thing that makes it work here is that the paper comes out only five days a week, and in the afternoon — after school. It's a local family-owned operation, with 16 pages and lots of color pictures. In 2013 it was named Iowa's "Newspaper of the Year."
Got Paper Route Photos? Did you deliver the paper as a kid? Do you have photos? Share them on Instagram with the hashtag #nprpaper. toggle caption @dhmath64/Instagram
Jaxson Kulhmann says he gets a check every two weeks for about $45. "I'm saving up for a trip to Washington, D.C. — it's a class trip," he says. "And, like, the church group [LCMS] — we're saving up to go to the National Youth Gathering in 2016 in Louisiana."
Doug Burns, the vice president for news and son of the paper's co-owner, carried a paper route for many years as a kid. But he has misgivings, he says, about the way it's going now.
"You see more parents around their kids, helping their kids with the route, rather than realizing that this was maybe the first opportunity for a young person to have independence," he says. "There was sort of a beautiful solitude in delivering papers in the era that I did it, that I think is probably missing from the experience today."
Jaxson Kuhlmann says he's not especially worried about his paper route — he's only ever three blocks away from home, and the streets do seem safe. But there is crime and violence in Carroll, and he reads about it on the front page, every day, as he walks between porches.
"There was a stabbing a couple weeks ago, where one man stabbed his girlfriend 'cause he got mad at her," he says. "And then drug dealers around here, and they try to get kids to do bad things and stuff like that. You don't see them very often, but when you do you just don't acknowledge them," he says.
One of the standard chores from years gone by — collecting payment by knocking on doors with your receipt book — is no longer a carrier responsibility. Now, it's all credit card billing.
Back in Jaxson's neighborhood, we reach the end of his route, less than a half-hour after we set off. He heads inside to wash the ink off his hands, so he can get back to his regular 11-year-old's afternoon. |
<gh_stars>0
package handlers
import (
"fmt"
log "github.com/sirupsen/logrus"
"github.com/w0rm1995/covid19_telegram_bot/models"
tb "gopkg.in/tucnak/telebot.v2"
)
// HandleGlobal **
func (b *Bot) HandleGlobal(m *tb.Message) {
current := models.CurrentCase{}
resp, err := current.GetCurrentCovid19()
if err != nil {
log.Infoln(err)
}
if !m.Private() {
return
}
b.Send(m.Sender, fmt.Sprintf(`TERINFEKSI: %v, SEMBUH: %v, MENINGGAL: %v`, resp.Confirmed.Value, resp.Recovered.Value, resp.Deaths.Value))
log.Infoln(m.Payload)
}
|
import json
import shutil
import glob
from os import makedirs
from os import listdir
from os.path import isdir
from os.path import basename
from datetime import datetime
class DBmanage:
def __init__(self):
self.databasePath = './database/'
self.subFolderPath = self.databasePath + self.getCrawlDate() + '/'
self.checkAndCreateDatabaseFolder()
def getDBPath(self):
return self.databasePath
def getSubFolderPath(self):
return self.subFolderPath
def checkAndCreateDatabaseFolder(self):
if not isdir(self.databasePath):
print('Database folder not exists!')
makedirs(self.databasePath)
print('Created database.')
def checkAndCreateSubFolder(self):
if not isdir(self.subFolderPath):
print('Sub-folder not exists!')
makedirs(self.subFolderPath)
print('Created subfolder at', self.subFolderPath)
def removeDatabase(self):
shutil.rmtree(self.databasePath)
print('Database removed.')
def saveResultFile(self, crawlResult, crawlResultFilePath):
self.checkAndCreateSubFolder()
with open(crawlResultFilePath, 'w', encoding='utf-8') as f:
json.dump(crawlResult, f, sort_keys=True,
indent=4, ensure_ascii=False)
print('Crawl result saved at:', crawlResultFilePath)
print()
def getCrawlDate(self):
return datetime.now().strftime('%Y%m%d')
def saveCrawledBoardResult(self, crawlResult):
boardName = crawlResult['boardName']
crawlResultFilePath = self.getBoardResultFilePath(boardName)
self.saveResultFile(crawlResult, crawlResultFilePath)
def getBoardResultFilePath(self, boardName):
crawlDate = self.getCrawlDate()
crawlResultText = 'boardResult' + crawlDate
crawlResultFileName = crawlResultText + '_' + boardName + '.json'
return self.subFolderPath + crawlResultFileName
def saveCrawledArticleResult(self, crawlResult):
boardName = crawlResult['boardName']
crawlResultFilePath = self.getArticleResultFilePath(boardName)
self.saveResultFile(crawlResult, crawlResultFilePath)
def getArticleResultFilePath(self, boardName):
crawlDate = self.getCrawlDate()
crawlResultText = 'articleResult' + crawlDate
crawlResultFileName = crawlResultText + '_' + boardName + '.json'
return self.subFolderPath + crawlResultFileName
def loadResultFile(self, path):
with open(path, encoding='utf8') as f:
result = json.load(f)
return result
def loadCrawledBoardResult(self, boardResultFilePath):
return self.loadResultFile(boardResultFilePath)
def loadCrawledArticleResult(self, articleResultFilePath):
return self.loadResultFile(articleResultFilePath)
def getLatestVersion(self):
return listdir(self.databasePath)[-1]
def getLatestSubFolder(self):
return self.databasePath + self.getLatestVersion() + '/'
def getAllLatestBoardResultPath(self):
latestSubFolder = self.getLatestSubFolder()
boardResultPattern = latestSubFolder + 'boardResult*.json'
allBoardResult = glob.glob(boardResultPattern)
return allBoardResult
def getAllLatestArticleResultPath(self):
latestSubFolder = self.getLatestSubFolder()
articleResultPattern = latestSubFolder + 'articleResult*.json'
allArticleResult = glob.glob(articleResultPattern)
return allArticleResult
def getLatestBoardResultPath(self, boardName):
latestSubFolder = self.getLatestSubFolder()
pattern = latestSubFolder + 'boardResult*' + boardName + '.json'
return glob.glob(pattern)[-1]
def getLatestArticleResultPath(self, boardName):
latestSubFolder = self.getLatestSubFolder()
pattern = latestSubFolder + 'articleResult*' + boardName + '.json'
return glob.glob(pattern)[-1]
def getLatestBoardLists(self):
print('=== Available boards in database ===')
print('( database version:', self.getLatestVersion(), ')')
allArticleResultPath = self.getAllLatestArticleResultPath()
for resultPath in allArticleResultPath:
fileName = basename(resultPath).replace('.json', '')
print(fileName.split('_', 1)[1])
|
Melbourne transport and planning expert Paul Mees has died following a 15-month battle with cancer.
Professor Mees, who taught at RMIT, was aged 52 and died on Wednesday in a Melbourne hospital.
Paul Mees. Credit:Michael Clayton-Jones
An international authority in his field, Professor Mees for more than two decades repeatedly embarrassed Victorian transport operators and authorities with his research and commentary on the state's road, rail and urban planning systems.
Most recently, he had questioned the Napthine government's proposed east-west tunnel, arguing there was little substantial research behind the $6-8 billion project.
A former industrial lawyer, Professor Mees was the president of the Public Transport Users Association from 1992 to 2001.
In 1998, he began teaching urban planning at Melbourne University - only to fall out with the university a decade later after it demoted him following a complaint against him by the state government.
The PTUA's president Tony Morton said on Wednesday night that Professor Mees had for many years "personified the transport debate in Victoria, and called successive governments to account for their neglect of public transport". |
/* SPDX-License-Identifier: MIT */
/*
* Copyright(c) 2021 Sanpe <<EMAIL>>
*/
#ifndef __CSKY_SETJMP_H__
#define __CSKY_SETJMP_H__
#define JMP_BUF_SP 0
#define JMP_BUF_L0 1
#define JMP_BUF_L1 2
#define JMP_BUF_L2 3
#define JMP_BUF_L3 4
#define JMP_BUF_L4 5
#define JMP_BUF_L5 6
#define JMP_BUF_GB 7
#define JMP_BUF_LR 8
#define JMP_BUF_MAX 9
#ifndef __ASSEMBLY__
#ifdef __cplusplus
extern "C" {
#endif
struct __jmp_buf {
unsigned long __jmp_buf[JMP_BUF_MAX];
};
typedef struct __jmp_buf jmp_buf[1];
int setjmp(jmp_buf);
void longjmp(jmp_buf, int);
#ifdef __cplusplus
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __CSKY_SETJMP_H__ */
|
export default function Custom404() {
return (
<div className="mt-16 lg:mt-4 md:h-(screen-60) flex justify-center items-center">
<div className="flex flex-col justify-center items-center max-w-3xl prose-sm lg:prose dark:prose-dark mx-12">
<img
className="w-24 lg:w-64 animate-wiggle hover:animate-spin"
src="/assets/logos/small.png"
/>
<h1>404: Not Found</h1>
<h2>The page you are looking for does not exist. </h2>
<p>
If it should, please use the
<span className="px-2 py-1 ml-2 text-gray-500 text-sm border border-gray-200 rounded-md hover:bg-gray-100 cursor-default">
Share Feedback
</span>{" "}
button at the top of this page to let us know
</p>
</div>
</div>
);
}
|
#include <stdio.h>
#include <algorithm>
using namespace std;
const int maxs = 1000050, maxss = maxs * 10, mm = 1e7, mm1 = 1e6, mm2 = 1e5;
long long n, K, ans = -1;
int num1[maxs], s1 = 0, num2[maxs], s2 = 0;
int hs = 0, he[maxss], ne[maxs], cnt[maxs];
long long st[maxs];
long long chg(int x, int y, long long z) { return (z * 10 + x) * 10 + y; }
void push(long long sta) {
int i, st0 = sta % maxss;
for (i = he[st0]; i; i = ne[i])
if (st[i] == sta) {
cnt[i]++;
return;
}
ne[++hs] = he[st0], he[st0] = hs, st[hs] = sta, cnt[hs]++;
}
int query(long long sta) {
int i, st0 = sta % maxss;
for (i = he[st0]; i; i = ne[i])
if (st[i] == sta) return cnt[i];
return 0;
}
void dfs(int x, int d) {
if (d >= 7) {
if (x) num1[s1++] = x;
if (x / mm1 || (x / 100000 && x / 100000 > x / 10000 % 10)) num2[s2++] = x;
return;
}
int i;
if (x < 10) {
for (i = 0; i <= 9; i++)
if (!x || i != x) dfs(x * 10 + i, d + 1);
} else if (x / 10 % 10 > x % 10)
for (i = x % 10 + 1; i <= 9; i++) dfs(x * 10 + i, d + 1);
else if (x / 10 % 10 < x % 10)
for (i = 0; i < x % 10; i++) dfs(x * 10 + i, d + 1);
}
int main() {
int i, j, k, i2;
bool z = 0;
scanf("%I64d%I64d", &n, &K);
dfs(0, 0);
for (i = 0; i < s2; i++)
push(chg(num2[i] / mm1, num2[i] / mm2 % 10, num2[i] % n));
for (i = 0; i < s1; i++)
if (!(num1[i] % n) && !--K) {
ans = num1[i];
break;
}
if (K) {
for (i = 0; i < s1; i++) {
long long rem = (n - (long long)num1[i] * mm % n) % n;
int tt = num1[i] % 10,
t = (!(num1[i] / 10) ? 0 : (num1[i] / 10 % 10 > tt ? 1 : -1));
for (j = 0; j < 10; j++) {
for (k = 0; k < 10; k++)
if ((t > 0 && tt < j && j > k) || (t < 0 && tt > j && j < k) ||
(!t && tt != j && j != k && (tt > j) != (j > k))) {
int ts = query(chg(j, k, rem));
if (K <= ts) {
z = 1;
break;
}
K -= ts;
}
if (z) break;
}
if (z) {
for (i2 = 0; i2 < s2; i2++)
if (num2[i2] / mm1 == j && num2[i2] / mm2 % 10 == k &&
num2[i2] % n == rem && !(--K)) {
ans = (long long)num1[i] * mm + num2[i2];
break;
}
break;
}
}
}
printf("%I64d\n", ans);
return 0;
}
|
// ReadUserByCredentials reads a user by username and password.
func (user *User) ReadUserByCredentials(db *sql.DB, uname string, upass string) (found bool) {
stmt, err := db.Prepare(`
select id, username, password
from user where username = ?`)
if err != nil {
panic(err)
}
defer stmt.Close()
var hashedPassword []byte
switch err := stmt.QueryRow(uname).Scan(&user.ID, &user.Username, &hashedPassword); {
case err == sql.ErrNoRows:
return false
case err != nil:
panic(err)
}
if err := bcrypt.CompareHashAndPassword(hashedPassword, []byte(upass)); err != nil {
return false
}
return true
} |
def decoding_checker(topology):
for key, decoder in topology['decoding'].items():
if key not in topology['outputs']:
raise ConfigException('Output "{}" of decoder does not exist.'.format(key))
if 'scheme' in decoder and decoder['scheme'] not in reg.decoders:
raise ConfigException('Decoder "{}" does not exist. '\
'Available decoders are {}'.format(decoder['scheme'], tuple(reg.decoders)))
if 'scheme' not in decoder:
continue
dec_base_inspection = inspect.getfullargspec(Decoder)
dec_child_args = inspect.getfullargspec(reg.decoders[decoder['scheme']]).kwonlydefaults
dec_args = {key : val for key, val in zip(reversed(dec_base_inspection[0]),\
reversed(dec_base_inspection[3]))}
if dec_child_args is not None:
dec_args = merge_dicts([dec_child_args, dec_args])
if 'params' in decoder:
for p_name, param in decoder['params'].items():
if p_name not in dec_args:
raise ConfigException('The parameter "{}" does not exist in decoder "{}". '\
'Available decoder arguments are {}.'\
.format(p_name, key, tuple(dec_args.keys())))
valid_types = [type(dec_args[p_name])] if type(dec_args[p_name]) is not float else [float, int]
if type(param) not in valid_types:
raise ConfigException('Wrong type of parameter "{}" in decoder "{}". Type {} '\
'should have been received.'.format(p_name, key, type(dec_args[p_name]).__name__)) |
The heritage industry: Britain in a climate of decline
the heritage industry britain in a climate of decline download pdf the heritage industry britain in a climate of the heritage industry britain in a climate of decline free reviews the william morris society in the us the v&a, the destruction of the country house and the selling history in an age of industrial decline heritage isolation and contact eleina u state v flores oururl transcript 1997 to 2009 from boom to bust: the politics of heritage in the 21 century liz farrelly visits independent museums, heritage, and the shape of museum studies world war two warships cafebr heritage pasts and heritage presents: temporality, meaning 'forty years of english heritage: the legacy of the mila 2 0 origins the fire askand zettle v handy manufacturing co pubbet asus k53u service manual hsandc manual modus renault ziram conservation and renovation of industrial heritage ste anne de beaupre shrine sivaji numerology and sun signs opalfs fiat 605 c manual birdz resource guide in: rural leisure and tourism scum orca soundings eleina write your own nonfiction xeneo palaeontology historical geology volume 12 firext reality centered learning louduk we wish to give thanks and credit to the following people l g v people managing the human service organization nolia wild places of southern africa firext rex of larkbarrow ziram journal of southern african studies researchgate coloring pages for exodus 31 pugcit reconceptualizing cultural heritage in the semiosphere what does the guidebook say? asu digital repository creating place identity through heritage interpretation |
Duke researchers say a protein in breast milk may be a key in preventing babies from contracting HIV from their infected mothers.
The protein Tenascin-C is produced by the body to aid in helping wounds heal. Doctors found after isolating the breast milk component that it neutralizes HIV transfer even as breast-fed babies are exposed multiple times daily.
Sallie Permar is a professor of pediatrics at Duke. She says their questions now center on moms with HIV.
"What is the function of this protein that's made in mothers who transmit the virus versus those who don't transmit the virus? And can we detect a specific amount that you have to have in breast milk in order to prevent transmission or a specific variant of this protein in order to effectively protect your infant?" Permar says.
Permar says the discovery could also be a direct benefit to all children who breastfeed
"One very unique property of this protein is it should be inherently safe, especially in infants, because it's already a component of breast milk," she says.
"And so providing additional amounts of this protein to infants should be safe, but we have hope that it could be developed for other modes of HIV transmission as well."
The study is detailed in the journal Proceedings of the National Academy of Sciences. |
<reponame>imjacobclark/Recify
{-# LANGUAGE OverloadedStrings #-}
module Types.RecentlyPlayed where
import qualified Data.ByteString.Lazy as L
import qualified Data.Vector as V
import Data.Aeson
import Data.Either
data Artist = Artist
{ id :: String
, href :: String
, artistName :: String
} deriving (Show)
data Track = Track
{ playedAt :: String
, externalUrls :: String
, name :: String
, artists :: [Artist]
, explicit :: Bool
} deriving (Show)
data Tracks = Tracks
{ tracks :: [Track]
} deriving (Show)
data RecentlyPlayed = RecentlyPlayed
{ recentlyPlayed :: Tracks
, next :: String
} deriving (Show)
instance FromJSON RecentlyPlayed where
parseJSON = withObject "items" $ \recentlyPlayed -> RecentlyPlayed
<$> recentlyPlayed .: "items"
<*> recentlyPlayed .: "next"
instance FromJSON Tracks where
parseJSON = withArray "items" $ \items -> Tracks
<$> mapM parseJSON (V.toList items)
instance FromJSON Track where
parseJSON = withObject "tracks" $ \tracks -> Track
<$> tracks .: "played_at"
<*> (tracks .: "track" >>= (.: "album") >>= (.: "external_urls") >>= (.: "spotify"))
<*> (tracks .: "track" >>= (.: "name"))
<*> (tracks .: "track" >>= (.: "artists"))
<*> (tracks .: "track" >>= (.: "explicit"))
instance FromJSON Artist where
parseJSON = withObject "artists" $ \artists -> Artist
<$> artists .: "id"
<*> artists .: "href"
<*> artists .: "name"
marshallRecentlyPlayedData :: L.ByteString -> Either String RecentlyPlayed
marshallRecentlyPlayedData = eitherDecode
|
<reponame>djz332/fieldkit
""" Identify and characterize domains.
"""
from __future__ import division
import numpy as np
import networkx
from fieldkit.mesh import Domain
def digitize(field, threshold):
""" Digitize a :py:class:`~fieldkit.mesh.Field`.
A scalar :py:class:`~fieldkit.mesh.Field` is converted
into a set of nodes using a `threshold` tolerance. Nodes
having `field >= threshold` are included in the digitized
domain, while other nodes are neglected.
Parameters
----------
field : :py:class:`~fieldkit.mesh.Field`
The field to digitize.
threshold : float
The threshold tolerance for digitizing the field.
Returns
-------
:py:class:`~fieldkit.mesh.Domain`
The domain corresponding to the nodes having
`field >= threshold`.
"""
flags = field.field >= threshold
nodes = field.mesh.indices[flags]
return Domain(field.mesh, nodes)
def find(domain):
""" Finds connected domains within a domain.
A domain is defined to be a connected region of lattice
points, subject to periodic boundary conditions.
Parameters
----------
domain : :py:class:`~fieldkit.mesh.Domain`
The set of nodes to seek connected domains in.
Returns
-------
tuple
A tuple of all :py:class:`~fieldkit.mesh.Domain` objects
identified within the `domain`. At most, there is only
one domain returned, but many can be identified if the points
in the `domain` are highly disconnected.
Notes
-----
The connected domains are determined using a graph-based approach,
which requires the `networkx` package. Performance is generally good,
but the algorithm may struggle for large numbers of nodes or domains.
"""
comps = networkx.connected_components(domain.graph)
return tuple([Domain(domain.mesh,list(c)) for c in comps])
def burn(domain):
""" Compute the burn number distribution and medial axis for a domain.
Implements the burning algorithm + medial axis protocol outlined by
Lindquist et al. [1]_ A burning algorithm ignites a "flame" from the
boundaries of the domain, and marches the flame front through. The medial
axis is defined by the locus of voxels where the flame front is extinguished
by an opposing front.
Parameters
----------
domain : :py:class:`~fieldkit.mesh.Domain`
The set of nodes (domain) to burn.
Returns
-------
burn_number : numpy.ndarray
The burn number for each voxel in the domain. A burn number of 0 means
a boundary, and all other vales indicate the iteration the burn reached
the voxel.
axis : numpy.ndarray
An `N`x3 tuple of integers giving the indexes of the mesh points identified
as the medial axis. These can be converted to coordinates using the
corresponding :py:class:`~fieldkit.mesh.Mesh` for `field`.
References
----------
.. [1] <NAME> et al. "Medial axis analysis of void structure in
three-dimensional tomographic images of porous media", J. Geophys. Res.
101 (B4), 8297--8310.
"""
BURN_SIGNAL = -1
burn_number = np.zeros(domain.mesh.shape, dtype=np.int32)
burn_number[domain.mask] = BURN_SIGNAL
medial_axis = np.zeros(domain.mesh.shape, dtype=bool)
# iterate through while some burn numbers have not been determined
k = 1
current_queue = tuple(domain.nodes)
next_queue = []
while np.any(burn_number == BURN_SIGNAL):
burn_vecs = {}
for pt in current_queue:
# only work on unchecked points
if burn_number[pt] != BURN_SIGNAL:
continue
# get neighboring points and burn vectors
neighs = domain.mesh.neighbors(pt, full=True)
burn_vecs[pt] = []
for n in neighs:
if burn_number[n] == k-1:
# this is minimum image on the mesh
dn = np.array(pt) - np.array(n)
dn -= domain.mesh.shape * np.round(dn.astype(float)/domain.mesh.shape).astype(int)
burn_vecs[pt].append(dn)
# this point gets burned if any vectors are coming into it
if len(burn_vecs[pt]) > 0:
burn_number[pt] = k
else:
next_queue.append(pt)
continue
# Fig. 2a: check for medial axis condition based on shared burning
if len(burn_vecs[pt]) > 1:
for i,vi in enumerate(burn_vecs[pt]):
for vj in burn_vecs[pt][i+1:]:
if np.all(vi + vj == 0):
medial_axis[pt] = True
# Fig. 2c: handle case where burn extinguishes between two voxels
if not medial_axis[pt]:
for v in burn_vecs[pt]:
# follow the burn vector to the next neighbor with pbcs (no self images)
n = tuple((pt + v) % domain.mesh.shape)
if n == pt:
continue
# look at burning of this neighbor if at same iteration
# if burn is also coming the opposite direction, then both are medial axis
if burn_number[n] == k and n in burn_vecs:
neg_v = tuple(-v)
for nv in burn_vecs[n]:
if neg_v == tuple(nv):
medial_axis[n] = True
medial_axis[pt] = True
break
# Fig. 2d: perpendicular hit
if not medial_axis[pt] and len(burn_vecs[pt]) > 1:
for i,vi in enumerate(burn_vecs[pt]):
for vj in burn_vecs[pt][i+1:]:
if np.dot(vi,vj) == 0:
v1 = tuple((pt + vi - vj) % domain.mesh.shape)
v2 = tuple((pt - vi + vj) % domain.mesh.shape)
if burn_number[v1] == k-1 and burn_number[v2] == k-1:
medial_axis[pt] = True
# advance to next iteration
current_queue = tuple(next_queue)
next_queue = []
k += 1
# extract domain of nodes corresponding to medial axis
axis = Domain(domain.mesh, domain.mesh.indices[medial_axis])
return burn_number, axis
def is_connected(domain):
""" Test if a :py:class:`~fieldkit.mesh.Domain` is connected.
Returns
-------
bool
`True` if the `domain` is a single connected component, and
`False` otherwise.
"""
return networkx.is_connected(domain.graph)
def is_percolated(domain, axis):
""" Test if a :py:class:`~fieldkit.mesh.Domain` is percolated.
A `domain` is defined to be percolated along an `axis` if there
exists a continuous path spanning the underlying mesh in the
direction of `axis`. In practice, this is checked by unwrapping
the graph corresponding to the `domain` and searching for a path
from any node on one edge of `axis` to its unwrapped image on the
other edge. A `domain` may accordingly be percolated in 1, 2, or
3 dimensions depending on the geometry, and each `axis` should
usually be checked sequentially.
Returns
-------
bool
`True` if the `domain` is percolated through the periodic
boundary in `axis`, and `False` otherwise.
"""
g = domain.buffered_graph(axis)
# test for percolation from any node along axis
percolate = False
for btm in g:
if btm[axis] == 0:
top = list(btm)
top[axis] = domain.mesh.shape[axis]
top = tuple(top)
try:
if networkx.has_path(g,btm,top):
percolate = True
break
except networkx.exception.NodeNotFound:
# it is OK to raise this exception.
# it just means the target node (top) is not in the domain.
pass
return percolate
def tortuosity(domain, axis):
r""" Compute the tortousity of a domain from the shortest path length.
The tortuosity :math:`\tau` is computed as
.. math::
\tau = \frac{L}{a}
where *L* is the shortest path length within `domain` that connects a
`node` at the lower edge of the mesh given by `axis` to its periodic
image, while *a* is the distance between periodic images projected
along `axis`. That is, the tortuosity is geometrically defined as
the path length traversed between images divided by the distance that
could be obtained in a Cartesian basis.
Parameters
----------
domain : :py:class:`~fieldkit.mesh.Domain`
The domain of nodes to look for paths through.
axis : int
The axis (0, 1, or 2) indicating the direction in which
to compute the tortuosity.
Returns
-------
tau : tuple
The tortuosity associated with various `nodes`
nodes : tuple
The list of `nodes` at the edge of `axis` from which the
tortuosity was computed.
"""
g = domain.buffered_graph(axis)
nodes = []
paths = []
for btm in g:
if btm[axis] == 0:
top = list(btm)
top[axis] = domain.mesh.shape[axis]
top = tuple(top)
try:
length = networkx.dijkstra_path_length(g, btm, top)
nodes.append(btm)
paths.append(length)
except networkx.exception.NetworkXNoPath:
pass
# project the appropriate lattice vector onto the direction of interest
ortho_latt = domain.mesh.lattice.to_orthorhombic()
L = ortho_latt.L[axis]
# tortuosity is path distance / normal distance between planes
tau = np.asarray(paths) / L
return tuple(tau), tuple(nodes)
|
<reponame>eminence/wasm-bindgen<gh_stars>1-10
extern crate base64;
extern crate tempfile;
use std::collections::{HashMap, HashSet};
use std::fs;
use std::io;
use std::process::Command;
use failure::{Error, ResultExt};
use parity_wasm::elements::*;
pub struct Config {
base64: bool,
wasm2asm: bool,
fetch_path: Option<String>,
}
pub struct Output {
module: Module,
base64: bool,
wasm2asm: bool,
fetch_path: Option<String>,
}
impl Config {
pub fn new() -> Config {
Config {
base64: false,
wasm2asm: false,
fetch_path: None,
}
}
pub fn base64(&mut self, base64: bool) -> &mut Self {
self.base64 = base64;
self
}
pub fn wasm2asm(&mut self, wasm2asm: bool) -> &mut Self {
self.wasm2asm = wasm2asm;
self
}
pub fn fetch(&mut self, path: Option<String>) -> &mut Self {
self.fetch_path = path;
self
}
pub fn generate(&mut self, wasm: &[u8]) -> Result<Output, Error> {
if !self.base64 && !self.fetch_path.is_some() && !self.wasm2asm {
bail!("one of --base64, --fetch, or --wasm2asm is required");
}
let module = deserialize_buffer(wasm)?;
Ok(Output {
module,
base64: self.base64,
wasm2asm: self.wasm2asm,
fetch_path: self.fetch_path.clone(),
})
}
}
impl Output {
pub fn typescript(&self) -> String {
let mut exports = format!("/* tslint:disable */\n");
if let Some(i) = self.module.export_section() {
let imported_functions = self
.module
.import_section()
.map(|m| m.functions() as u32)
.unwrap_or(0);
for entry in i.entries() {
let idx = match *entry.internal() {
Internal::Function(i) => i - imported_functions,
Internal::Memory(_) => {
exports.push_str(&format!(
"
export const {}: WebAssembly.Memory;
",
entry.field()
));
continue;
}
Internal::Table(_) => {
exports.push_str(&format!(
"
export const {}: WebAssembly.Table;
",
entry.field()
));
continue;
}
Internal::Global(_) => continue,
};
let functions = self
.module
.function_section()
.expect("failed to find function section");
let idx = functions.entries()[idx as usize].type_ref();
let types = self
.module
.type_section()
.expect("failed to find type section");
let ty = match types.types()[idx as usize] {
Type::Function(ref f) => f,
};
let mut args = String::new();
for (i, _) in ty.params().iter().enumerate() {
if i > 0 {
args.push_str(", ");
}
args.push((b'a' + (i as u8)) as char);
args.push_str(": number");
}
exports.push_str(&format!(
"
export function {name}({args}): {ret};
",
name = entry.field(),
args = args,
ret = if ty.return_type().is_some() {
"number"
} else {
"void"
},
));
}
}
if self.base64 {
exports.push_str("export const booted: Promise<boolean>;");
}
return exports;
}
pub fn js(self) -> Result<String, Error> {
if self.wasm2asm {
return self.js_wasm2asm();
}
let mut js_imports = String::new();
let mut exports = String::new();
let mut set_exports = String::new();
let mut imports = String::new();
if let Some(i) = self.module.import_section() {
let mut set = HashSet::new();
for entry in i.entries() {
match *entry.external() {
External::Function(_) => {}
External::Table(_) => {
bail!("wasm imports a table which isn't supported yet");
}
External::Memory(_) => {
bail!("wasm imports memory which isn't supported yet");
}
External::Global(_) => {
bail!("wasm imports globals which aren't supported yet");
}
}
if !set.insert(entry.module()) {
continue;
}
let name = (b'a' + (set.len() as u8)) as char;
js_imports.push_str(&format!(
"import * as import_{} from '{}';",
name,
entry.module()
));
imports.push_str(&format!("'{}': import_{}, ", entry.module(), name));
}
}
if let Some(i) = self.module.export_section() {
for entry in i.entries() {
exports.push_str("export let ");
exports.push_str(entry.field());
exports.push_str(";\n");
set_exports.push_str(entry.field());
set_exports.push_str(" = wasm.exports.");
set_exports.push_str(entry.field());
set_exports.push_str(";\n");
}
}
let inst = format!(
"
WebAssembly.instantiate(bytes,{{ {imports} }})
.then(obj => {{
const wasm = obj.instance;
{set_exports}
}})
",
imports = imports,
set_exports = set_exports,
);
let (bytes, booted) = if self.base64 {
let wasm = serialize(self.module).expect("failed to serialize");
(
format!(
"
let bytes;
const base64 = \"{base64}\";
if (typeof Buffer === 'undefined') {{
bytes = Uint8Array.from(atob(base64), c => c.charCodeAt(0));
}} else {{
bytes = Buffer.from(base64, 'base64');
}}
",
base64 = base64::encode(&wasm)
),
inst,
)
} else if let Some(ref path) = self.fetch_path {
(
String::new(),
format!(
"
fetch('{path}')
.then(res => res.arrayBuffer())
.then(bytes => {inst})
",
path = path,
inst = inst
),
)
} else {
bail!("the option --base64 or --fetch is required");
};
Ok(format!(
"
{js_imports}
{bytes}
export const booted = {booted};
{exports}
",
bytes = bytes,
booted = booted,
js_imports = js_imports,
exports = exports,
))
}
fn js_wasm2asm(self) -> Result<String, Error> {
let mut js_imports = String::new();
let mut imported_items = Vec::new();
if let Some(i) = self.module.import_section() {
let mut name_map = HashMap::new();
for (i, entry) in i.entries().iter().enumerate() {
match *entry.external() {
External::Function(_) => {}
External::Table(_) => {
bail!("wasm imports a table which isn't supported yet");
}
External::Memory(_) => {
bail!("wasm imports memory which isn't supported yet");
}
External::Global(_) => {
bail!("wasm imports globals which aren't supported yet");
}
}
let m = name_map.entry(entry.field()).or_insert(entry.module());
if *m != entry.module() {
bail!(
"the name `{}` is imported from two differnet \
modules which currently isn't supported in `wasm2asm` \
mode"
);
}
let name = format!("import{}", i);
js_imports.push_str(&format!(
"import {{ {} as {} }} from '{}';\n",
entry.field(),
name,
entry.module()
));
imported_items.push((entry.field().to_string(), name));
}
}
let mut js_exports = String::new();
if let Some(i) = self.module.export_section() {
let mut export_mem = false;
for entry in i.entries() {
match *entry.internal() {
Internal::Function(_) => {}
Internal::Memory(_) => export_mem = true,
Internal::Table(_) => continue,
Internal::Global(_) => continue,
};
js_exports.push_str(&format!("export const {0} = ret.{0};\n", entry.field()));
}
if !export_mem {
bail!(
"the `wasm2asm` mode is currently only compatible with \
modules that export memory"
)
}
}
let memory_size = self.module.memory_section().unwrap().entries()[0]
.limits()
.initial();
let mut js_init_mem = String::new();
if let Some(s) = self.module.data_section() {
for entry in s.entries() {
let offset = entry.offset().code();
if offset.len() != 2 {
bail!("don't recognize data offset {:?}", offset)
}
if offset[1] != Instruction::End {
bail!("don't recognize data offset {:?}", offset)
}
let offset = match offset[0] {
Instruction::I32Const(x) => x,
_ => bail!("don't recognize data offset {:?}", offset),
};
let base64 = base64::encode(entry.value());
js_init_mem.push_str(&format!("_assign({}, \"{}\");\n", offset, base64));
}
}
let td = tempfile::tempdir()?;
let wasm = serialize(self.module)?;
let wasm_file = td.as_ref().join("foo.wasm");
fs::write(&wasm_file, wasm)
.with_context(|_| format!("failed to write wasm to `{}`", wasm_file.display()))?;
let wast_file = td.as_ref().join("foo.wast");
run(
Command::new("wasm-dis")
.arg(&wasm_file)
.arg("-o")
.arg(&wast_file),
"wasm-dis",
)?;
let js_file = td.as_ref().join("foo.js");
run(
Command::new("wasm2asm")
.arg(&wast_file)
.arg("-o")
.arg(&js_file),
"wasm2asm",
)?;
let asm_func = fs::read_to_string(&js_file)
.with_context(|_| format!("failed to read `{}`", js_file.display()))?;
let mut make_imports = String::from(
"
var imports = {};
",
);
for (name, import) in imported_items {
make_imports.push_str(&format!("imports['{}'] = {};\n", name, import));
}
Ok(format!(
"\
{js_imports}
{asm_func}
const mem = new ArrayBuffer({mem_size});
const _mem = new Uint8Array(mem);
function _assign(offset, s) {{
if (typeof Buffer === 'undefined') {{
const bytes = atob(s);
for (let i = 0; i < bytes.length; i++)
_mem[offset + i] = bytes.charCodeAt(i);
}} else {{
const bytes = Buffer.from(s, 'base64');
for (let i = 0; i < bytes.length; i++)
_mem[offset + i] = bytes[i];
}}
}}
{js_init_mem}
{make_imports}
const ret = asmFunc({{
Math,
Int8Array,
Uint8Array,
Int16Array,
Uint16Array,
Int32Array,
Uint32Array,
Float32Array,
Float64Array,
NaN,
Infinity,
}}, imports, mem);
{js_exports}
",
js_imports = js_imports,
js_init_mem = js_init_mem,
asm_func = asm_func,
js_exports = js_exports,
make_imports = make_imports,
mem_size = memory_size * (1 << 16),
))
}
}
fn run(cmd: &mut Command, program: &str) -> Result<(), Error> {
let output = cmd.output().with_context(|e| {
if e.kind() == io::ErrorKind::NotFound {
format!(
"failed to execute `{}`, is the tool installed \
from the binaryen project?\ncommand line: {:?}",
program, cmd
)
} else {
format!("failed to execute: {:?}", cmd)
}
})?;
if output.status.success() {
return Ok(());
}
let mut s = format!("failed to execute: {:?}\nstatus: {}\n", cmd, output.status);
if !output.stdout.is_empty() {
s.push_str(&format!(
"----- stdout ------\n{}\n",
String::from_utf8_lossy(&output.stdout)
));
}
if !output.stderr.is_empty() {
s.push_str(&format!(
"----- stderr ------\n{}\n",
String::from_utf8_lossy(&output.stderr)
));
}
bail!("{}", s)
}
|
Despite being named to the Seahawks’ 53-man roster in December 2014, wide receiver Chris Matthews became a household name — at least in Seattle — in just a mere two months.
The 6-foot-5, 218-pound wide receiver made arguably two of the biggest plays of the Seahawks’ 2014 season with his onside kick recovery during the NFC championship game, then followed it up with his first career NFL touchdown in Super Bowl XLIX.
There is no doubt the 25-year-old was reaping as much, or more, praise during Super Bowl XLIX as were quarterback Russell Wilson or any of the members of the Legion of Boom. In fact, Matthews was arguably going to be the Super Bowl’s MVP if Wilson’s interception at the goal line in the final seconds didn’t seal Seattle’s 28-24 loss to the New England Patriots.
Matthews would have taken the podium to accept his MVP trophy as confetti fell to the ground at the University of Phoenix Stadium — on the very same day he caught his first NFL pass.
Instead, the receiver was in the locker room with the rest of the dejected Seahawks who came one yard shy of completing back-to-back Super Bowl victories.
Fast-forward four months and the Super Bowl talk is fading into the past, but questions still linger. Is Matthews just a one-hit wonder? Was his breakout Super Bowl performance just a fluke? Will Matthews even make the Seahawks 53-man active roster this fall?
It seems almost unthinkable that a player could go from almost Super Bowl XLIX MVP to missing the cut, but it just might happen to Matthews with the depth in the Hawks’ wide receivers group.
Seattle will bring back seasoned veterans Doug Baldwin, Jermaine Kearse and Ricardo Lockette in addition to second-year players Paul Richardson and Kevin Norwood. Add in rookies in third-round pick Tyler Lockett and other hopefuls, and the wideout position is quickly becoming more and more crowded.
There is one big factor working in his favor, aside from his height. Throughout the Hawks’ organized team activities (OTAs) in May and June, Matthews had a big role on special teams, being on all four special teams units for the Seahawks, according to Seattle special teams coordinator Brian Schneider.
“I’ve always really liked Chris,” Schneider said Tuesday at the Virginia Mason Athletic Center in Renton. “I loved him in training camp last year because he’s a unique athlete. He can rush the punter really well, he’s able to dip and move and do some things like that. … He can do a lot of different things for you since he’s big. He can run, he is slinky, he’s athletic.”
Matthews is entering second season with the Seahawks after Seattle signed him in February 2014, just days after their Super Bowl XLVIII win, on a two-year, $940,000 contract.
In fact, Matthews almost didn’t pick up the original phone call from the Seahawks asking him if he wanted to try out for the team.
At the time, 15 months ago, Matthews was working two jobs: one at Foot Locker and the other as a security guard.
When Matthews answered the phone call from the Hawks asking if he wanted to try out for the team that night, he told them he didn’t get off work until 9 p.m. so he didn’t know if he could make it, according to Sports Illustrated. Matthews’ agent then called Matthews and told him to haul his butt onto the next flight to Seattle.
Taking his agent’s advice, the receiver ended up earning a spot on the Hawks offseason roster, but he didn’t make Seattle’s active roster to start the season.
During training camp, Matthews was hampered by a hamstring injury and was released at the end of preseason on Aug. 30. Afterward, over the span of three months, the Seahawks signed and released Matthews to the practice squad multiple times, until he made it onto the active roster on Dec. 6.
Matthews’ first claim to fame came in the Hawks’ improbable 28-22 win in the NFC championship game at CenturyLink Field against the Green Bay Packers on Jan. 18.
The 25-year-old was the improbable player who recovered the equally improbable onside kick that set up Seattle’s final drive to steal the game from the Packers and earn Seattle a trip to Super Bowl XLIX.
“That was huge,” Hawks wide receiver Jermaine Kearse said at the time. “I talk to Chris a lot and just to see his progression, even when he was on practice squad and when he got activated to the 53, just to see him maximize opportunities is definitely joyful.”
Head over to the Super Bowl, and the rest is history. On Feb. 1, Matthews led the Hawks in receiving with 109 yards and one touchdown on four receptions, including two outstanding catches of 44 and 45 yards, to give the Seahawks the glimmer of hope that almost propelled them to victory.
“We’ve always known that he’s talented,” wide receiver Doug Baldwin said after the Super Bowl loss. “We’ve always known that he’s had the ability to play. That’s why he was in the game.”
The previously unknown wideout, undrafted out of the University of Kentucky in 2010, had the competitive spirit running through his veins after being born into a highly athletic family.
Matthews’ mother, Michelle, played basketball at Texas Christian University. His father, Darell, played football at Lane University. And his cousin was the late Reggie White, the late Hall of Famer who was a two-time NFL Defensive Player of the Year, 13-time Pro Bowler and 12-time All-Pro in his 15-year NFL career.
Matthews grew up in Los Angeles, California, where he attended Susan Dorsey High School and was a two-sport athlete. Playing tight end and defensive end, his football team won a city championship and he tied a school record by catching four touchdown passes in a single game.
Matthews also took his talents to the hardwood, playing forward on the basketball team, helping advance the team to the state tournament his senior year.
Heading into college, he wanted to enroll at UCLA, according to Scout.com, but was academically ineligible. In the end, after personal attempts to get recruited by USC under Pete Carroll, Matthews enrolled at Los Angeles Harbor College.
The talented receiver excelled as a sophomore, catching 80 balls for 1,235 yards and 11 touchdowns in only nine games. He was named first-team junior college All-America and All-California.
Matthews was among the nation’s top 10 junior college prospects and the No. 2 wide receiver, as ranked by Rivals.com. With all his success at junior college, Matthews transferred to the University of Kentucky for his junior and senior years.
As a junior at Kentucky in 2009, the highly touted receiver had 32 catches for 354 yards and three touchdowns. As a senior in 2010, he was No. 1 on the team with nine receiving touchdowns.
After his collegiate career came to a close, Matthews went undrafted, but was signed by the Cleveland Browns for a brief stint before they released him ahead of the season. Matthews didn’t play a down of football in 2011.
In 2012, Matthews took a turn up north and played in the Canadian Football League.
As a receiver for the Winnipeg Blue Bombers, Matthews won the 2012 CFL Most Outstanding Rookie Award after he caught 81 passes for 1,192 yards and seven touchdowns. In 2013, he was sidelined for most of the year with a turf-toe injury, causing him to miss 13 games.
Now in 2015, after the heroics in the NFC championship game and the spectacular catches in Super Bowl XLIX, Matthews in back at the VMAC this summer, practicing with his teammates and finding his role on one of the most talented rosters in the NFL.
The 6-foot-5 receiver stands out at practice, looking like a true athletic threat next to the members of the Seahawks’ secondary due to the his size. Matthews just might be the big-time, big-bodied receiver the Hawks’ are looking to integrate into their arsenal of plays this upcoming season, but he still has a lot to learn and a lot to prove if he wants to make the team this season.
His teammates believe he can do it.
“I think he’s going to be dynamic,” All-Pro cornerback Richard Sherman said after practice June 9. “I think he’s going to be that big receiver that we’ve expected. … I thought that last year. Unfortunately, he didn’t get an opportunity until the Super Bowl, but we practice against him every day and have to deal with his size and his athletic ability, and it’s fun.
“I think the Super Bowl was a bit of his coming-out party, but hopefully he takes that momentum and continues it to the next season.”
window._taboola = window._taboola || []; _taboola.push({ mode: 'thumbnails-c', container: 'taboola-interstitial-gallery-thumbnails-5', placement: 'Interstitial Gallery Thumbnails 5', target_type: 'mix' });
window._taboola = window._taboola || []; _taboola.push({ mode: 'thumbnails-c', container: 'taboola-interstitial-gallery-thumbnails-10', placement: 'Interstitial Gallery Thumbnails 10', target_type: 'mix' });
window._taboola = window._taboola || []; _taboola.push({ mode: 'thumbnails-c', container: 'taboola-interstitial-gallery-thumbnails-14', placement: 'Interstitial Gallery Thumbnails 14', target_type: 'mix' });
Photo: Otto Greule Jr / Getty Images Image 1 of / 15 Caption Close Image 2 of 15 Chris Matthews (13) of the Seattle Seahawks recovers an onside kick against the Green Bay Packers during the 2015 NFC Championship game at CenturyLink Field on January 18, 2015 in Seattle, Washington. Chris Matthews (13) of the Seattle Seahawks recovers an onside kick against the Green Bay Packers during the 2015 NFC Championship game at CenturyLink Field on January 18, 2015 in Seattle, Washington. Photo: Ronald Martinez / Getty Images Image 3 of 15 Seattle Seahawks' Chris Matthews (13) and DeShawn Shead celebrate after overtime of the NFL football NFC Championship game against the Green Bay Packers Sunday, Jan. 18, 2015, in Seattle. Seattle Seahawks' Chris Matthews (13) and DeShawn Shead celebrate after overtime of the NFL football NFC Championship game against the Green Bay Packers Sunday, Jan. 18, 2015, in Seattle. Photo: Elaine Thompson / Associated Press Image 4 of 15 Chris Matthews (13) of the Seattle Seahawks makes a catch for a first down in the first half against Kyle Arrington (25) of the New England Patriots during Super Bowl XLIX at University of Phoenix Stadium on February 1, 2015 in Glendale, Arizona. less Chris Matthews (13) of the Seattle Seahawks makes a catch for a first down in the first half against Kyle Arrington (25) of the New England Patriots during Super Bowl XLIX at University of Phoenix Stadium on ... more Photo: Jamie Squire / Getty Images Image 5 of 15 Image 6 of 15 Seattle Seahawks wide receiver Chris Matthews (13) celebrates his touchdown catch during the first half of NFL Super Bowl XLIX football game against the New England Patriots Sunday, Feb. 1, 2015, in Glendale, Ariz. less Seattle Seahawks wide receiver Chris Matthews (13) celebrates his touchdown catch during the first half of NFL Super Bowl XLIX football game against the New England Patriots Sunday, Feb. 1, 2015, in Glendale, ... more Photo: Matt York / Associated Press Image 7 of 15 Seattle Seahawks wide receiver Chris Matthews (13) reacts after catching a pass during the first half of NFL Super Bowl XLIX football game against the New England Patriots on Sunday, Feb. 1, 2015, in Glendale, Ariz. less Seattle Seahawks wide receiver Chris Matthews (13) reacts after catching a pass during the first half of NFL Super Bowl XLIX football game against the New England Patriots on Sunday, Feb. 1, 2015, in Glendale, ... more Photo: Brynn Anderson / Associated Press Image 8 of 15 Seattle Seahawks head coach Pete Carroll embraces Seattle Seahawks wide receiver Chris Matthews (13) after Matthews made a touchdown catch against the New England Patriots during the first half of NFL Super Bowl XLIX football game Sunday, Feb. 1, 2015, in Glendale, Ariz. less Seattle Seahawks head coach Pete Carroll embraces Seattle Seahawks wide receiver Chris Matthews (13) after Matthews made a touchdown catch against the New England Patriots during the first half of NFL Super ... more Photo: Ross D. Franklin / Associated Press Image 9 of 15 Seattle Seahawks wide receiver Chris Matthews (13) runs against New England Patriots free safety Devin McCourty (32) during the second half of NFL Super Bowl XLIX football game Sunday, Feb. 1, 2015, in Glendale, Ariz. less Seattle Seahawks wide receiver Chris Matthews (13) runs against New England Patriots free safety Devin McCourty (32) during the second half of NFL Super Bowl XLIX football game Sunday, Feb. 1, 2015, in ... more Photo: Elise Amendola / Associated Press Image 10 of 15 Image 11 of 15 Seattle Seahawks wide receiver Chris Matthews (13) makes a catch against New England Patriots cornerback Kyle Arrington (25) during the second half of NFL Super Bowl XLIX football game Sunday, Feb. 1, 2015, in Glendale, Ariz. less Seattle Seahawks wide receiver Chris Matthews (13) makes a catch against New England Patriots cornerback Kyle Arrington (25) during the second half of NFL Super Bowl XLIX football game Sunday, Feb. 1, 2015, in ... more Photo: Charlie Riedel / Associated Press Image 12 of 15 Seattle Seahawks wide receiver Chris Matthews speaks during a news conference after the NFL Super Bowl XLIX football game against the New England Patriots Sunday, Feb. 1, 2015, in Glendale, Ariz. Seattle Seahawks wide receiver Chris Matthews speaks during a news conference after the NFL Super Bowl XLIX football game against the New England Patriots Sunday, Feb. 1, 2015, in Glendale, Ariz. Photo: Matt York / Associated Press Image 13 of 15 Seattle Seahawks wide receiver Chris Matthews talks to reporters in front of his locker at team headquarters, Tuesday, Feb. 3, 2015, in Renton, Wash. Seattle Seahawks wide receiver Chris Matthews talks to reporters in front of his locker at team headquarters, Tuesday, Feb. 3, 2015, in Renton, Wash. Photo: Ted S. Warren / Associated Press Image 14 of 15 Seattle Seahawks quarterback Russell Wilson (3) walks with Chris Matthews following an NFL football organized team activity Tuesday, June 9, 2015, in Renton, Wash. Seattle Seahawks quarterback Russell Wilson (3) walks with Chris Matthews following an NFL football organized team activity Tuesday, June 9, 2015, in Renton, Wash. Photo: Elaine Thompson / Associated Press Image 15 of 15 Seattle Seahawks wide receiver Chris Matthews: From unknown hero to second-year question mark 1 / 15 Back to Gallery
Visit seattlepi.com for Seattle Seahawks news. Contact sports reporter Samantha Pell at 206-448-8341, [email protected] or @sammyjade18. |
typedef struct s s;
int main(void) {
s a;
return 0;
}
struct s { int x; };
|
NUREMBERG, Germany
SUSE® today announced Dr. Thomas Di Giacomo has joined the company in the new role of chief technology officer, the latest addition to SUSE’s executive leadership team. Di Giacomo will report directly to SUSE CEO Nils Brauckmann. This new executive role further bolsters the rapid innovation, growth and momentum of SUSE’s business and expanding solution portfolio from the enterprise Linux operating system to the OpenStack cloud infrastructure and Ceph storage solutions.
“Thomas brings a wealth of industry insight and experience that will help SUSE more rapidly advance as our solution portfolio grows to meet increasing global demand,” Brauckmann said. “As CTO, he will engage in active, strategic dialog with our customers, our partners and our many important open source communities as we continuously adapt to help our customers succeed.”
Di Giacomo’s industry and community engagement will extend well beyond Linux to include NFV, PaaS, IaaS, containers and orchestration, where the open source development model is driving continuous and rapid innovation. SUSE is ideally positioned to help customers and partners benefit from the emergence of new open source innovations such as software-defined computing, storage and networking and to help them embrace new IT paradigms such as DevOps. As SUSE CTO, Di Giacomo’s vision is a software-defined and cloud-based, IT-powered future for the enterprise.
“IT leaders around the world face the challenge of ensuring business continuity and reducing costs while constantly improving business agility and innovating to create a competitive edge,” Di Giacomo said. “We’re now in the middle of a software-defined IT revolution powered by open source innovation that will deliver the enterprise technology paired with the economic scalability they need to meet that challenge. At SUSE, our proven ability to adapt open source innovation for the enterprise and our focus on strategic partnerships across the industry makes this new CTO role very exciting for me.”
Matt Eastwood, senior vice president of Enterprise Infrastructure and Datacenter at IDC, said, “Most organizations are evolving into third-platform businesses that value innovation as a means of achieving digital market leadership. Customers are looking for technology providers with effective and imaginative leadership, and SUSE’s executive addition to support and expand growth makes the company that much stronger in the growing open source software market.”
Prior to joining SUSE, Di Giacomo served as CTO and vice president of innovation at Swisscom Hospitality Services, as well as CTO of the Hoist Group, a global provider of IT services to the hospitality and health care industries. He has expertise in open source platforms, development and support of global information systems and technologies. Di Giacomo holds a Ph.D. in computer science from the University of Geneva, where he was a senior researcher involved in both academic work and joint corporate projects with partners such as LG, Samsung, France Telecom, Siemens, Deutsche Telekom, T-Systems, Telecom Italia, Sony and Microsoft.
About SUSE
SUSE, a pioneer in open source software, provides reliable, interoperable Linux, cloud infrastructure and storage solutions that give enterprises greater control and flexibility. More than 20 years of engineering excellence, exceptional service and an unrivaled partner ecosystem power the products and support that help our customers manage complexity, reduce cost, and confidently deliver mission-critical services. The lasting relationships we build allow us to adapt and deliver the smarter innovation they need to succeed – today and tomorrow. For more information, visit www.suse.com.
Copyright 2016 SUSE LLC. All rights reserved. SUSE and the SUSE logo are registered trademarks of SUSE LLC in the United States and other countries. All third-party trademarks are the property of their respective owners. |
// CreateEpinioUser creates a new "user" BasicAuth Secret labeled as an Epinio User.
func (m *Machine) CreateEpinioUser() (string, string) {
user, password := catalog.NewUserCredentials()
secretData := fmt.Sprintf(`apiVersion: v1
stringData:
username: "%s"
password: "%s"
kind: Secret
metadata:
labels:
epinio.suse.org/api-user-credentials: "true"
name: epinio-user-%s
namespace: epinio
type: BasicAuth
`, user, password, user)
secretTmpFile := catalog.NewTmpName("tmpUserFile") + `.yaml`
err := os.WriteFile(secretTmpFile, []byte(secretData), 0600)
Expect(err).ToNot(HaveOccurred())
defer os.Remove(secretTmpFile)
out, err := helpers.Kubectl("apply", "-f", secretTmpFile)
Expect(err).ToNot(HaveOccurred(), out)
return user, password
} |
Houston Rockets center Dwight Howard is hoping this is the year the Rockets contend for a title. (Photo11: Jaime Valdez, USA TODAY Sports)
This time a year ago, Dwight Howard was at the center of the NBA free agency frenzy that was just about to get under way. Now, he's on the outside looking in.
For now.
The Houston Rockets big man who left the Los Angeles Lakers behind to join James Harden & Co. discussed the forthcoming free agency period with USA TODAY Sports this week, saying he would love to play with fellow All-Stars like LeBron James or Carmelo Anthony but that he has no plans to lead the recruiting effort. His focus is on leading his young Rockets team, and perhaps even taking the sort of stern approach that would belie his infamously-goofy style.
The roster work is for general manager Daryl Morey to worry about. And there's plenty of it to be done.
Morey is known to be hoping to add a third All-Star caliber player via free agency or trade, and the maneuvering has already begun to make it possible. Small forward Chandler Parson is still seen as a pivotal part of this mix, of course, but the Rockets' decision to decline his fourth-year team option for next season and instead let him become a restricted free agent this summer was a means to this end.
The plan, if all goes well, would be to free up the salary cap space necessary for another star while then matching any offer for Parsons from other teams (because he would be restricted, they could go over the salary cap to do so). What's more, the Rockets are planning on trading center Omer Asik and point guard Jeremy Lin as a way of making room for the likes of LeBron James, Carmelo Anthony, Chris Bosh or any other maximum-salary level caliber player who's available.
Morey has fallen short in finding deals for Asik and Lin in the past, but the fact that he's merely looking for expiring contracts in return this time around means there is a sense internally that he'll be able to find a home for their massive expiring contracts (both player's salary cap number is $8.3 million, but – as part of their deals which have what's called a "poison pill provision" – they will both be paid approximately $14.3 million next season).
None of which is part of Howard's job description.
The 10-year veteran who is so hungry for his first title is responsible for the on-court success, and he said in the extensive interview that he must find a way to compete like he did in the playoffs all year long if the Rockets are going to avoid the sort of finish they suffered last month. Howard averaged 26 points (54.7% shooting) and 13.7 rebounds and 2.7 blocks per game in the first round playoff loss against the Portland Trailblazers, but the way it all ended – with Damian Lillard's buzzer-beating game-winner in Game 6 that left Howard doubled over in disappointment – left him wanting more yet again.
GALLERY: Dwight Howard through the years
The following is an edited transcript of the interview.
Q: How's the offseason treating you?
A: "It's been decent, just trying to keep my mind off those 0.9 seconds that seemed to be two seconds instead of 0.9. That (Lillard shot) is probably going to stick with me all summer. I mean every time I work out I just think about that, and how tough it is in the playoffs. Just thinking about everything, really wanting to get to the Finals again.
Q: It's obviously not about the individual aspect in the playoffs, but did you take any solace in the fact that you played so well?
A: "Well I've just got to do that for 82 games … I need to set the tone early in the season and keep it going, and take it to another notch. That's what I've been talking about all summer with the coaches and everybody. That's the plan.
Q: So look back a bit for me. It's been almost a year since you left L.A. and headed for Texas. How do you reflect on that decision now?
A: "I made the best decision for me. Looking at this organization, where we're trying to go, I think all of us are pretty much on the same page. Each day I'm talking to the people up top, trying to figure out ways to try and get better. The coaching staff, from our trainer, in the weight room the guys are working on our bodies every day just trying to figure out how to get better. That's been our focus.
"After the playoffs this year, we saw a lot of things in ourselves that we needed to change. Since then, I've just been on a mission to do whatever I can to lead this team. Every day, I'm there at 8 am in the weight room with these guys … Running on the track with them, going to the boxing gym with them, just trying to provide leadership. I've been in the league a long time, and even though I played a lot of (meaningful) basketball, this void is still in me. The void of not winning a championship. I want it extremely bad, and I want these guys to have that same kind of motivation and attitude that I have. I think my decision was great. I think it has forced me to really grow up as a man, as a basketball player, a teammate, father, everything. I think this is great for me."
Q: What now, then? You think you can convince LeBron to come your way?
A: "A lot of people have talked about it, but right now my job is to come in here every day and get better and help these young guys grow. That's what I'm doing every day. I want to give those guys (who can be free agents) time to think. They just got finished playing. I know LeBron is really hurt right now. I didn't even think about (calling him). I've talked about it before, but the main thing right now is making sure I'm (keeping) these young guys in line.
Q: What about 'Melo?
A: "I haven't spoken with Melo personally. I know this is a time for him when he has to really just focus on what's going to be best for him. And I really believe that in this point in Melo's career, he just wants to win. He's done everything – we both have that kind of same mentality to where all the individual accolades, we've got them. We've got a gold medal, he has been in tops in scoring for a while, but those are all individual things. I think at this point he just wants to win, so it would be great to have him here because I know what his focus would be. It's up to him, where he's at in his career. But I want people on my team who are all about winning. That's my focus.
"I don't know what (Anthony) is going to do, but he wants to win. So he's going to be looking for a place to go where he can win. He's made enough money. He's done everything. I think he just wants to win right now. That's his only goal. I've always been a Melo fan. One thing he said in an interview a long time ago, I think my first or second year in the league, I remember him saying that if he could play with one guy in the league he would play with Dwight Howard, so you never know. You never know what could happen. Right now, I don't know, but for Melo's sake I just hope he goes somewhere where he feels like he has a chance to win and be successful for the next four or five years of his career.
Q: Does that mean you won't call any of these guys before July 1, then, just let them go through the process?
A: "Probably just let them go through the process. I know for me when I was going through it, talking to a lot of people can really mess you up. It's not really what you want, it's what everybody else feels like is best for you. So I just got away from everything and everybody and really just focused on what I wanted."
Q: Now that you've been in Houston for a year, how do you feel about the decision in terms of quality of life?
A: "I love it. The only problem is the traffic, because I stay 45 minutes outside of Houston. It takes a long time to get home every day, but I enjoy driving so it's pretty much cool with me. But living here has been great. There are some great people here. I've enjoyed my year so far, being in and out of different restaurants, meeting people, going to the movies – that's my favorite pastime. So it's been great. It's been great for me."
Q: There was a lot of talk about how your brand would take a hit by going out there. How are you feeling on that front?
A: "I think all that stuff will change. The biggest thing is just winning. My concern is just winning. That's how you build your brand back. Winning and just dominating on the floor, so that's all I've been thinking about. Basically taking what I did during the playoffs, putting it into 82 games, and then coming up (strong) in the playoffs. That's been on my mind. That's what I've been working on all summer is getting my mind and my body conditioned for a long run."
Q: What specifically needs to change?
A: "I just think our attitude, and it starts with me. My attitude in the playoffs was a little bit different. I had my fun. I joked around, but I've got to make sure that for 48 minutes on the floor I'm dominating. I know people are used to seeing me smiling and having a good time, and I'm going to have a good time, but at the same time I want to win. That's the reason why I play this game. And for so long, I've been ridiculed for having fun on the floor, but I just think I've got to change my approach to certain things – how I am in the locker room, how I am in practice, all that stuff.
"I just think it's a different approach. I'm still going to be myself, and have fun with a smile and joke around with fans. But when it comes to basketball, and what we're trying to accomplish, I'll just have a little bit different approach than in the past. I can go out there and have fun and smile and get 25 points and 20 rebounds. But for our team to win, I can't have that approach. I go out there and dominate, and show them how to do it, because I don't think a lot of guys on our team can have fun like I do and still dominate. I've just got to win, so if I can lead these guys in the right direction, and it starts with me." |
/** Tries to handle an ack intent. Returns {@code true} iff the intent is an ack intent. */
private boolean tryHandleAckIntent(Intent intent) {
byte[] data = AndroidListenerIntents.findAckHandle(intent);
if (data == null) {
return false;
}
getClient().acknowledge(AckHandle.newInstance(data));
return true;
} |
/**
* Method that update an CryptoTransmissionMetadata in the data base.
*
* @throws CantUpdateRecordDataBaseException
*/
public void changeState(UUID transaction_id, TransactionTransmissionStates transactionTransmissionStates) throws CantUpdateRecordDataBaseException {
if (transaction_id == null) {
throw new IllegalArgumentException("The entity is required, can not be null");
}
try {
BusinessTransactionMetadata businessTransactionMetadata = getMetadata(transaction_id);
businessTransactionMetadata.setState(transactionTransmissionStates);
DatabaseTable addressExchangeRequestTable = database.getTable(CommunicationNetworkServiceDatabaseConstants.TRANSACTION_TRANSMISSION_HASH_TABLE_NAME);
DatabaseTableRecord entityRecord = addressExchangeRequestTable.getEmptyRecord();
/*
* 1- Create the record to the entity
*/
DatabaseTableRecord cryptoTransmissionMetadataRecord = buildDatabaseRecord(entityRecord, businessTransactionMetadata);
/*
* 2.- Create a new transaction and execute
*/
DatabaseTransaction transaction = getDataBase().newTransaction();
transaction.addRecordToUpdate(getDatabaseTable(), cryptoTransmissionMetadataRecord);
getDataBase().executeTransaction(transaction);
} catch (DatabaseTransactionFailedException databaseTransactionFailedException) {
StringBuffer contextBuffer = new StringBuffer();
contextBuffer.append("Table Name: " + CommunicationNetworkServiceDatabaseConstants.TRANSACTION_TRANSMISSION_HASH_TABLE_NAME);
String context = contextBuffer.toString();
String possibleCause = "The record do not exist";
CantUpdateRecordDataBaseException cantUpdateRecordDataBaseException = new CantUpdateRecordDataBaseException(CantDeleteRecordDataBaseException.DEFAULT_MESSAGE, databaseTransactionFailedException, context, possibleCause);
throw cantUpdateRecordDataBaseException;
} catch (PendingRequestNotFoundException e) {
e.printStackTrace();
} catch (CantGetTransactionTransmissionException e) {
e.printStackTrace();
} catch (Exception e){
e.printStackTrace();
throw new CantUpdateRecordDataBaseException(CantUpdateRecordDataBaseException.DEFAULT_MESSAGE,e, "Exception not handled by the plugin, there is a problem in database and I cannot update the record.","");
}
} |
<reponame>MyLanPangzi/fullstack<gh_stars>0
/**
* 1,多态性this,类的方法可以返回this,this的指向变得很灵活,既可以指向父类也可以指向子类
* 2,可以用来构造fluent API,链式编程
*/
class BasicCalculator {
constructor(protected value: number = 0) {
}
add(x: number) {
this.value += x;
return this;
}
sub(x: number) {
this.value -= x;
return this;
}
currentValue() {
return this.value;
}
}
let calc = new BasicCalculator(2);
console.log(calc.add(1).sub(2).currentValue());
class ScientificCalculator extends BasicCalculator {
constructor(value: number) {
super(value);
}
mul(x: number) {
this.value *= x;
return this;
}
}
let value = new ScientificCalculator(2).add(1).sub(2).mul(3).currentValue();
console.log(value) |
Mendelian Randomization Analysis of Hemostatic Factors and Their Contribution to Peripheral Artery Disease—Brief Report
Supplemental Digital Content is available in the text. Background and Objective: Peripheral artery disease (PAD) is the third most common form of atherosclerotic vascular disease and is characterized by significant functional disability and increased cardiovascular mortality. Recent genetic data support a role for a procoagulation protein variant, the factor V Leiden mutation, in PAD. The role of other hemostatic factors in PAD remains unknown. We evaluated the role of hemostatic factors in PAD using Mendelian randomization. Approach and Results: Two-sample Mendelian randomization to evaluate the roles of FVII (factor VII), FVIII (factor VIII), FXI (factor XI), VWF (von Willebrand factor), and fibrinogen in PAD was performed using summary statistics from GWAS for hemostatic factors performed within the Cohorts for Heart and Aging Research in the Genome Epidemiology Consortium and from GWAS performed for PAD within the Million Veteran Program. Genetically determined FVIII and VWF, but not FVII, FXI, or fibrinogen, were associated with PAD in Mendelian randomization experiments (FVIII: odds ratio, 1.41 , P=6.0×10−7, VWF: odds ratio, 1.28 , P=0.0073). In single variant sensitivity analysis, the ABO locus was the strongest genetic instrument for both FVIII and VWF. Conclusions: Our results suggest a role for hemostasis, and by extension, thrombosis in PAD. Further study is warranted to determine whether VWF and FVIII independently affect the biology of PAD. |
United States Supreme Court case
Sorrell v. IMS Health Inc., 564 U.S. 552 (2011),[1] is a United States Supreme Court case in which the Court held that a Vermont statute that restricted the sale, disclosure, and use of records that revealed the prescribing practices of individual doctors violated the First Amendment.[A]
Background [ edit ]
In 2007, Vermont passed the Prescription Confidentiality Law that required, among other things, that records containing a doctor's prescribing practices not be sold or used for marketing purposes unless the doctor consented. The law was a response to a Vermont Medical Society resolution stating that using the prescribing history of doctors in marketing was an intrusion into the way doctors practice medicine.[3][4] The Vermont Medical Society had found that the marketing efforts of pharmaceutical companies used in large part the data of individual doctors' prescribing patterns, sold to the companies by pharmacies without the doctors' consent[5] and successfully lobbied the Vermont legislature to enact the law.[6]
Data mining companies and pharmaceutical manufactures contended that the law violated their First Amendment rights and sought declaratory and injunctive relief against Vermont officials.[B] The United States District Court for the District of Vermont denied relief; the plaintiffs appealed to the United States Court of Appeals for the Second Circuit which reversed, holding that the law violated the First Amendment by restricting the speech of the companies without adequate justification.[C] Vermont's Attorney General appealed to the Supreme Court, which granted certiorari to resolve the contradiction of a ruling of the United States Court of Appeals for the First Circuit US Court of Appeals for the First Circuit, which had upheld similar laws in New Hampshire and Maine, concluding that the laws regulated economic conduct, not commercial speech.[7]
Opinion [ edit ]
Justice Kennedy, the author of the Court's opinion.
Associate Justice Anthony Kennedy delivered the opinion of the Court, which Chief Justice Roberts, Justice Scalia, Justice Thomas, Justice Alito, and Justice Sotomayor joined. The Court held that the law violated the First Amendment and affirmed the judgment of the Court of Appeals.
The first finding of the Court was that the law placed content and speaker based restrictions on speech.[D] Citing Cincinnati v. Discovery Network, Inc., the Court noted that these restrictions warranted heightened judicial scrutiny.[E]
The Court rejected Vermont's argument that the law was only a commercial regulation and not a regulation of speech on the grounds that the law imposed more than an incidental burden on speech.[F]
The second and final finding of the Court was that Vermont did not meet its burden to justify its content-based law as consistent with the First Amendment. According to Board of Trustees, State Univ. of N. Y. v. Fox, Vermont must demonstrate that the law directly advances a substantial government interest.[G] The Court rejected Vermont's claims that the law was necessary to protect medical privacy and achieve improved public healthcare.[H]
Dissent [ edit ]
Justice Breyer, the author of the opinion for the dissent.
Associate Justice Stephen Breyer wrote a dissenting opinion, which Justice Ginsburg and Justice Kagan joined. Breyer argued that the law should be reviewed as an economic regulation, not under a heightened standard applied for First Amendment issues. Breyer found that the legitimate regulatory objectives outweighed the small harm done to First Amendment interests.[I] Breyer also noted that applying a strict First Amendment standard whenever a legislative program burdened speech would give judges the power to choose to undermine or support legislative efforts.[J]
Notes [ edit ]
^ [2] Page 1. "Vermont law restricts the sale, disclosure, and use of pharmacy records that reveal the prescribing practices of individual doctors... Speech in aid of pharmaceutical marketing, however, is a form of expression protected by the Free Speech Clause of the First Amendment. As a consequence, Vermont’s statute must be subjected to heightened judicial scrutiny. The law cannot satisfy that standard.",Page 1. ^ [2] pp 5-6. "The present case involves two consolidated suits. One was brought by three Vermont data miners, the other by an association of pharmaceutical manufacturers that produce brand-name drugs. These entities are the respondents here. Contending that [the Prescription Confidentiality Law] violates their First Amendment rights as incorporated by the Fourteenth Amendment, the respondents sought declaratory and injunctive relief against the petitioners, the Attorney General and other officials of the State of Vermont.",pp 5-6. ^ [2] p 6. "After a bench trial, the United States District Court for the District of Vermont denied relief.... The United States Court of Appeals for the Second Circuit reversed and remanded. It held that [the Prescription Confidentiality Law] violates the First Amendment by burdening the speech of pharmaceutical marketers and data miners without an adequate justification.",p 6. ^ [2] p 8. "On its face, Vermont’s law enacts content and speaker based restrictions on the sale, disclosure, and use of prescriber-identifying information.",p 8. ^ [2] p 9. "Act 80 is designed to impose a specific, content-based burden on protected expression. It follows that heightened judicial scrutiny is warranted. See Cincinnati v. Discovery Network, Inc",p 9. ^ [2] p 11. "[the law] imposes more than an incidental burden on protected expression. Both on its face and in its practical operation, Vermont’s law imposes a burden based on the content of speech and the identity of the speaker.",p 11. ^ [2] p 16. "To sustain the targeted, content-based burden [the law] imposes on protected expression, the State must show at least that the statute directly advances a substantial governmental interest",p 16. ^ [2] pp 16-17. "The State’s asserted justifications for [the law] come under two general headings. First, the State contends that its law is necessary to protect medical privacy, including physician confidentiality, avoidance of harassment, and the integrity of the doctor-patient relationship. Second, the State argues that [the law] is integral to the achievement of policy objectives—namely, improved public health and reduced healthcare costs. Neither justification withstands scrutiny.",pp 16-17. ^ [8] p 2. "I would ask whether Vermont’s regulatory provisions work harm to First Amendment interests that is disproportionate to their furtherance of legitimate regulatory objectives. And in doing so, I would give significant weight to legitimate commercial regulatory objectives- as this Court did in 'Glickman'. The far stricter, specially 'heightened' First Amendment standards that the majority would apply to this instance of commercial regulation are out of place here.",p 2. ^ [8] p 5. "to apply a 'heightened' First Amendment standard of review whenever such a program burdens speech would transfer from legislatures to judges the primary power to weigh ends and to choose means, threatening to distort or undermine legitimate legislative objectives.",p 5. |
/**
* Creates a Distributed Region
*
* @param vm
*/
protected AsyncInvocation checkManagerView(final VM vm,
final DistributedMember oneManager) {
SerializableRunnable createRegion = new SerializableRunnable(
"Check Manager View") {
public void run() {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
SystemManagementService service = (SystemManagementService) getManagementService();
ObjectName memberMBeanName = service.getMemberMBeanName(oneManager);
MemberMXBean bean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
assertNotNull(bean);
long t1 = bean.getMemberUpTime();
try {
this.wait(ManagementConstants.REFRESH_TIME *3);
} catch (InterruptedException e) {
fail("interrupted");
}
long t2 = bean.getMemberUpTime();
assertTrue(t2>t1);
}
};
return vm.invokeAsync(createRegion);
} |
from math import *
n=int(input())
l=floor(sqrt(n))+1
ans=[0]*n
def f(a,b,c):
return a*a+b*b+c*c+a*b+b*c+c*a
for x in range(1,l+1):
for y in range(1,l+1):
for z in range(1,l+1):
g=f(x,y,z)
if g<=n:
ans[g-1]+=1
for i in range(n):
print(ans[i]) |
#ifndef HELLO_LIB_H
#define HELLO_LIB_H
int exampleIncrement(int i);
#endif
|
// Move Reticle to mouse cursor position when it moves
int Reticle::eventHandler(const df::Event *p_e) {
if (p_e->getType() == df::MSE_EVENT) {
const df::EventMouse *p_mouse_event =
dynamic_cast <const df::EventMouse *> (p_e);
if (p_mouse_event->getMouseAction() == df::MOVED) {
setPosition(p_mouse_event->getMousePosition());
return 1;
}
}
return 0;
} |
// Devuelve el objeto edificio. Modificacion para poder reutilizar la funcion.
public Edificio detectarEdificio(String unEdificio){
if(unEdificio.equals("Banco")){
return this.banco;
}
if(unEdificio.equals("Aeropuerto")){
return this.aeropuerto;
}
return this.biblioteca;
} |
<gh_stars>1-10
package dk.in2isoft.onlineobjects.test.model;
import static org.junit.Assert.assertEquals;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.springframework.beans.factory.annotation.Autowired;
import dk.in2isoft.commons.parsing.HTMLDocument;
import dk.in2isoft.onlineobjects.core.ModelService;
import dk.in2isoft.onlineobjects.core.Operator;
import dk.in2isoft.onlineobjects.core.Query;
import dk.in2isoft.onlineobjects.core.SearchResult;
import dk.in2isoft.onlineobjects.core.exceptions.EndUserException;
import dk.in2isoft.onlineobjects.model.Entity;
import dk.in2isoft.onlineobjects.model.InternetAddress;
import dk.in2isoft.onlineobjects.modules.index.IndexManager;
import dk.in2isoft.onlineobjects.modules.index.IndexSearchQuery;
import dk.in2isoft.onlineobjects.modules.index.IndexSearchResult;
import dk.in2isoft.onlineobjects.modules.index.IndexService;
import dk.in2isoft.onlineobjects.modules.networking.HTMLService;
import dk.in2isoft.onlineobjects.services.ConfigurationService;
import dk.in2isoft.onlineobjects.services.FileService;
import dk.in2isoft.onlineobjects.test.AbstractSpringTestCase;
import dk.in2isoft.onlineobjects.test.EssentialTests;
@Category(EssentialTests.class)
public class TestIndexService extends AbstractSpringTestCase {
private static final Logger log = LogManager.getLogger(TestIndexService.class);
@Autowired
private ConfigurationService configurationService;
@Autowired
private ModelService modelService;
@Autowired
private FileService fileService;
@Autowired
private IndexService indexService;
@Autowired
private HTMLService htmlService;
//@Test
public void testInternetAddress() throws EndUserException {
Operator operator = modelService.newAdminOperator();
IndexManager index = indexService.getIndex("testIndex");
index.clear();
assertEquals(0, index.getDocumentCount());
Query<InternetAddress> query = Query.of(InternetAddress.class).withPaging(0, 20).orderByName();
List<InternetAddress> list = modelService.list(query, operator);
for (InternetAddress address : list) {
log.info(address.getAddress());
Document doc = new Document();
try {
HTMLDocument html = htmlService.getDocumentSilently(address.getAddress());
if (html!=null) {
doc.add(new StringField("text", html.getText(), Field.Store.YES));
}
} catch (Exception e) {
log.info(e.getMessage(), e);
}
index.update(address, doc);
}
assertEquals(list.size(), index.getDocumentCount());
operator.commit();
}
@Test
public void testSearch() throws EndUserException {
IndexManager index = indexService.getIndex("testIndex");
index.clear();
assertEquals(0, index.getDocumentCount());
{
Document doc = new Document();
doc.add(new TextField("text", "Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Cras mattis consectetur purus sit amet fermentum. Donec sed odio dui. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Aenean lacinia bibendum nulla sed consectetur.", Store.NO));
Entity entity = new Entity();
entity.setId(1);
index.update(entity, doc);
}
{
Document doc = new Document();
doc.add(new TextField("text", "the quick brown fox", Store.YES));
Entity entity = new Entity();
entity.setId(2);
index.update(entity, doc);
}
assertEquals(2, index.getDocumentCount());
IndexSearchQuery indexQuery = new IndexSearchQuery("a*");
indexQuery.setPage(0);
indexQuery.setPageSize(10);
SearchResult<IndexSearchResult> found = index.search(indexQuery);
assertEquals(1, found.getTotalCount());
}
public void setFileService(FileService fileService) {
this.fileService = fileService;
}
public FileService getFileService() {
return fileService;
}
public void setConfigurationService(ConfigurationService configurationService) {
this.configurationService = configurationService;
}
public ConfigurationService getConfigurationService() {
return configurationService;
}
public void setModelService(ModelService modelService) {
this.modelService = modelService;
}
public ModelService getModelService() {
return modelService;
}
public void setIndexService(IndexService indexService) {
this.indexService = indexService;
}
public void setHtmlService(HTMLService htmlService) {
this.htmlService = htmlService;
}
} |
Synthesis and Preclinical Evaluation of SP94 for Micro-PET Imaging of GRP78 Expression in Hepatocellular Carcinoma.
Glucose-regulated protein 78 (GRP78) is overexpressed in a wide variety of solid tumors, serving as a well-characterized target for tumor imaging or therapy. In this work, we developed a GRP78-responsive radiotracer (DOTA-68Ga)-Gly-Gly-Gly-Ser-Phe-Ser-Ile-Ile-His-Thr-Pro-Ile-Leu-Pro-Leu-Gly-Gly-Cys ( SP94) for hepatocellular carcinoma (HCC) micro-PET imaging. DOTA-SP94 was synthesized by solid phase synthesis and then radiolabeled with 68GaCl3 with >99% radiochemical purity. The expression levels of GRP78 in HepG2 cells were confirmed by Western blotting. In vitro and in vivo study of SP94 showed high stability and high uptake in GRP78-overexpressing HepG2 cells and tumor, fast clearance, and low nontarget uptake. Micro-PET images showed excellent tumor accumulation of SP94 in the HepG2-implanted nude mice tumor model. Additionally, the radiotracer uptake in HepG2 tumors can be blocked by unlabeled DOTA-SP94, suggesting that the tracer uptake by HCC was receptor-mediated. We envision that our radiotracer can be used for noninvasive imaging of HCC and is worthy of further clinical investigations. |
package command
import (
"github.com/jcalmat/bob/cmd/cli/ui"
"github.com/jcalmat/bob/pkg/config"
)
type Command struct {
ConfigApp config.App
Screen *ui.Screen
}
|
Kaspars Gorkss: Linked with a loan move to Leeds
Gorkss has found himself out of favour at Reading in recent weeks and has not featured for Brian McDermott's men since the Premier League defeat to Arsenal in December.
The 31-year-old is thought to be interested in a move away from Reading in search of regular first-team football.
The news has alerted a number of clubs to Gorkss' possible availability before the close of the transfer window.
Leeds are thought to be in the market for a new defender after seeing Alan Tate return to Swansea following a loan spell at Elland Road.
Leeds boss Neil Warnock is a big fan of Gorkss having worked with him during his time in charge of Queens Park Rangers and he is thought to be considering a move to be reunited with the Latvian stopper. |
class ShortOrderKitchenMixin:
"""Provides cook() method to create food.
Also provides brew() to provide basic coffee.
Expects class to have `self.ready` attribute of type Dict[str, List[str]]
"""
def cook(self, order, customer):
print(f"Cooking {order} for {customer}")
self.ready[customer].append(order) # type: ignore
def brew(self, order, customer):
print(f"Pour drip coffee for {customer}")
self.ready[customer].append("Coffee") |
<gh_stars>10-100
class DataContentProvider:
""" Interface class for getting content of files """
def read(self, filepath: str) -> str:
"""
Return <file content>: usual case
None: data source could not be found/opened
"""
raise Exception ("implement in subclass")
def write(self, filepath: str, content: str):
"""
Return:
True, `content` was written
False, otherwise
"""
raise Exception ("implement in subclass") |
def temporal_filter_date(self, mpd_df, filterdate):
raw_collection = mpd.TrajectoryCollection(mpd_df, 'track.id',
min_length=1)
traj_collection = raw_collection.split_by_date('day')
filterday_tracks = []
for traj in traj_collection.trajectories:
if(traj.df['track.begin'][0][0:10] == filterdate):
filterday_tracks.append(traj.df['track.id'][0])
filtered = []
for f_track in filterday_tracks:
for traj in traj_collection.trajectories:
if(traj.df['track.id'][0] == f_track):
filtered.append(traj)
break
result = copy(traj_collection)
result.trajectories = filtered
return result |
High-sensitivity immunoassay using a novel upconverting phosphor reporter
A new class of reporter label, consisting of rare earth elements embedded in a crystalline particle, has been developed for in vitro diagnostic applications. These unique labels upconvert low energy (IR) radiation to high energy light by a multiphoton absorption process and subsequent phosphorescence emission. As a result, upconverting phosphors can be visualized with no biological background or autofluorescence signal. In addition, phosphors have narrow absorption and emission bands, making them ideal for simultaneous multianalyte test. The crystalline nature of the phosphors makes them insensitive to environmental conditions, with essentially infinite shelf life and no photobleaching at the irradiances used for excitation. We have covalently coupled (Y0.86Yb0.08Er0.06)6O2S phosphor labels to antibody probes to create a reporter reagent that can be excited by 980 nm radiation from a diode laser and detected by a modified spectrofluorimeter. Target analyte sensitivities of approximately 10 ng/mL to Staphylococcal enterotoxin B have been demonstrated using a sandwich assay in a magnetic bead or capillary wick formats in a non-optimized assay system. These results are directly applicable to the development of assays that can be performed on microfabricated biochips or in microflow channels. |
Association between sleep duration and obesity is age- and gender-dependent in Chinese urban children aged 6–18 years: a cross-sectional study
Background Information on the relationship between sleep duration and obesity among children in urban Guangzhou, China is limited. This study aims to examine the relationship between sleep duration and obesity in children aged 6–18 years. Methods The sample consisted of 11,830 children aged 6–18 years. The children were randomly selected from 13 schools in three urban districts of Guangzhou. The study was conducted from September to November 2013. The height and weight of the children were measured. Adiposity status was estimated using body mass index and according to the cut point in China criteria. In the structured questionnaire, children reported daily sleep hours (less than 7 h, 7–9 h and more than 9 h), weekly food intake amount (including vegetables, fruit, sugar beverages and meat), physical activity and sedentary time. A caretaker would answer the questionnaire on behalf of a child aged below nine. Results A total of 8,760 children (49.0 % boys) completed the study. The prevalence of obesity was 8.4 % (9.8 % in boys and 5.7 % in girls). Adjusted for age, diet and physical activity/sedentary behaviour, the odds ratio (OR) for obesity comparing sleeping <7 h (short sleep duration, SSD) with ≥9 h (long sleep duration, LSD) was 0.70 (95 % CI: 0.69–0.72) among boys and 1.73 (95 % CI: 1.71–1.74) among girls. Stratified by age, OR for boys aged 6–12 years comparing SSD with LSD was 0.60 (95 % CI: 0.55–0.66); by contrast, OR was 1.33 (95 % CI: 1.30–1.37) for boys aged 13–18 years. Conclusion Short sleep duration is associated with increased chances of obesity among girls and 13- to 18-year-old boys, but the chances of obesity are decreased among 6- to 12-year-old boys. Age and gender should be regarded as specific characteristics for the effects of short sleep on obesity.
Background
Sleep is an important modulator of growth, maturation and health of children and adolescents . However, as a hallmark of modern society, sleep duration is decreasing for both children and adults in the last few decades . In the 1960s, the average sleep duration in the United States was more than 8 h , but dropped to 7 h in 1995 . In 2005, a survey conducted on children showed that the average sleep duration lasted from 8.4 h (11-12 years old) to less than 7 h (16-17 years old) in the United States . Reports from China, Australia and other countries also indicated a decreasing sleep duration among children in recent years. Short sleep duration is indeed a global phenomenon.
Short sleep duration is associated with neuroendocrine and metabolic modification, including decreased levels of leptin, glucose tolerance and insulin sensitivity, as well as increased levels of ghrelin, hunger and appetite . Moreover, evidence suggests the linkage between short sleep and specific behaviour, such as low physical activity and low consumption of fruit and vegetables . Metabolic change and behaviour are strongly associated with obesity, and thus raise the concern if short sleep duration is a risk factor of childhood obesity.
Many studies have explored the relationship between sleep duration and obesity. Several cross-sectional studies have reported that short sleep duration is associated with childhood obesity . With regard to prospective studies, a meta-analysis that reviewed 22 longitudinal studies revealed twice the risk of obesity in subjects reporting short sleep . However, the age ranges within the published studies typically vary from preschool children to adolescents. Sleep duration changes as a child grows to adulthood and generally decreases when children get older . However, reports using objective measurement indicated that sleep duration increases from mid-to late adolescence . In this case, age should be considered when an epidemiologic study is conducted. Gender is another factor that should be taken into account. The requirements for daily sleep duration may also vary due to the different hormone levels of boys and girls. In addition, genderspecific factors that can influence the prevalence of obesity remain unknown. Moreover, obesity is not only affected by sleep, but is also modulated by physical activity, diet, habit and other behavioural factors that are difficult to quantify .
Although the relationship between sleep duration and obesity has been extensively investigated in children, information on the age-and gender-specific effect is limited. Additionally, this association remains obscure in the Chinese children population. Given this background, we explored whether the relationship between sleep duration and obesity is age-and gender-dependent in the Chinese children. We conducted a cross-sectional study among children aged 6-18 years from September to November 2013 in the urban area of Guangzhou. Our study investigated (i) the up-to-date prevalence of obesity, (ii) distribution of sleep duration and (iii) association between obesity and short sleep duration in different age and gender groups. For possible confounding factors, we adjusted physical activity/sedentary behaviour and dietary intake.
Sampling and data sources overview
Data were obtained from the study of Student Constitution and Health, which was conducted in 2013 in Guangzhou, a city in south China. Multistage cluster sampling was used. Ten districts in Guangzhou were randomly selected by computer, and the random sequence of schools was computer-generated and stratified by (1) school district, (2) school grades (primary, middle, or high) and n school size in each district. All of the students in the selected schools in grades 1 to 12 were invited to participate in the survey. After a school is confirmed to be eligible, informed consent was obtained from parents and children. Thirteen schools, which included 11,830 children, agreed to participate in the study. The Ethical Committee of School of Public Health, Sun Yat-sen University approved this study.
Anthropometric measurement
Each child underwent an anthropometric measurement from September to November 2013. A qualified technician measured the children's height (centimetre, cm) and weight (kilogram, kg). All of the measurements were conducted in the school where the children studied. A metal column height measuring stand (precision: 0.1 cm) was used in measuring heights. Children were required to stand erect with back, buttocks and heels in continuous contact with the vertical height rod of the stadiometer and head orientated in the Frankfurt plane. The horizontal headpiece was then placed on top of the child's head to measure the height. When weight was measured, children were required to wear underwear and to stand on the lever scale (precision: 0.1 kg) at ease. The height and weight of each child were measured twice, and the average numbers were recorded to decrease error. Data of children suffering from obvious diseases or physical/mental deformities were excluded.
Questionnaire survey
A self-reported questionnaire was designed to obtain information on gender, date of birth, date of survey, daily food intake (including fruit, vegetables, sugar beverages and meat) daily physical activity/sedentary behaviour and daily sleep duration. From September to November 2013, inspectors who were familiar with the questionnaire went to schools and distributed the questionnaire. Children enrolled in the study were gathered and answered the questionnaire under supervision of the inspectors. Any question or confusion from children was clarified to ensure that every child understood all of the items. The completed questionnaires were checked for quality control. If the child was under nine years old, one of the parents would answer the questionnaire on the child's behalf to prevent inaccurate information. Questionnaires were distributed in class, and children were instructed to give the form to their parents. Parents were provided with instructions on answering the questionnaire via telephone or message. The team ensured that children would bring back the answered questionnaire to school. When all of the questionnaires were handed in, researchers would collect them from each class, and quality control would be performed. We emphasized that the first caregiver of the child should answer the questionnaire for he or she knew the child well. If the caregivers had any questions, then they should check with the child. Questionnaire items are described as follows.
Sleep duration was assessed by the question, 'How many hours each day do you spend sleeping?' Sleep duration was categorized as <7 h, 7-9 h and ≥9 h.
Daily food intake
Fruit intake was assessed by the question, 'How many servings of fruit do you usually eat each day? One serving of fruit has the size of an adult's fist'.
Vegetable intake was assessed by the question, 'How many servings of vegetables do you usually eat each day? One serving of vegetable has the size of an adult's fist'.
Sugar beverage consumption was assessed by the question, 'How many servings of sugar beverages do you usually take each day? One serving of sugar beverage is 250 millilitres'. Sugar beverage includes soda (i.e. Coca-Cola), energy drinks (i.e. Red Bull), milk drinks, juice with sugar and other beverages that contain sugar.
Meat intake was assessed by the question, 'How many servings of meat do you usually eat each day? One serving of meat has the size of an adult's palm'.
Daily physical activity and sedentary behaviour
High level physical activity (HLPA) was assessed by the question, 'How many hours each day do you usually spend in high level physical activity? High level physical activity means activity that causes people to be out of breath, perspire and experience extreme exhaustion, such as basketball, football, carrying a heavy load etc.'.
Middle level physical activity (MLPA) was assessed by the question, 'How many hours each day do you usually spend in middle level physical activity? Middle level physical activity means activity that causes people to mildly perspire and experience slight exhaustion, such as bicycling, playing table tennis, badmintonetc. but not walking'.
Walking was assessed by the question, 'How many hours each day do you usually spend in walking? Walking includes those that happened at school, home, commute between school and home, and for exercise'.
Sedentary behaviour was assessed by the question, 'How many hours each day do you usually spend in sitting or lying still at school and home (excluding sleeping)?' The questionnaire has not been statistically validated nor tested for reliability.
Definitions of obesity
Body mass index (BMI) was calculated by dividing weight in kilograms by height in metres squared (kg/m 2 ). Obesity was defined according to the latest Chinese criteria (Table 1) .
Statistical analysis
Data were inputted by Epidata 3.0 software (The EpiData Association, Odense, Denmark) and analyzed by Statistical Package for the Social Sciences (SPSS, version 13, IBM Corporation, New York). Descriptive statistics were calculated for all of the variables, including continuous variables (presented as mean values and standard errors) and categorical variables (presented as proportions). The differences of categorical variables were evaluated by chi-square tests. For continuous variables, t-tests were used to evaluate gender differences. One-way ANOVA was employed to evaluate differences among sleep duration groups, and post hoc comparison between groups was performed via Student-Newman-Keuls tests. The association between sleep duration and risk of obesity was evaluated by logistic regression models, which were initially adjusted for age and gender; dietary intake, physical activity and sedentary behaviour were subsequently introduced into the model. Cluster data from 13 schools were also introduced into the model, and robust standard error was used to minimize the effect that data obtained from different schools may have. The results were reported by odds ratios (ORs) and corresponding 95 % confidence intervals (CIs). P values less than 0.05 were considered statistically significant.
Baseline characteristics of the study population
The sample comprised 8,760 children aged 6-18 years (mean 11.42 years, 49 % boys). The baseline characteristics of the participants, such as anthropometry, dietary intake, physical activity/sedentary behaviour, sleep duration and prevalence of obesity, are described (see Table 2). Compared with girls, boys had higher mean values of height, weight, BMI, daily intake of foods (vegetables, meat and sugar beverages) and physical activity (all p < 0.05, Table 2), but lower mean value of sedentary behaviour (p < 0.05, Table 2). The overall prevalence of obesity was 8.4 % (9.8 % in boys, 5.7 % in girls, p < 0.001). In total, 17.9 % of the participants reported sleep duration less than 7 h, whereas 23.1 % reported more than 9 h each day. More girls had shorter sleep duration than boys (see Table 2). The trend showed that children tend to have less sleep hours as they grow up (see Fig. 1), and gender-specific patterns are similar in boys and girls.
Sample characteristic across sleep duration groups
Compared with children who had long sleep duration (LSD, >9 h/night), participants who had short sleep duration (SSD, <7 h/night) had increased age, height, weight and BMI (all p < 0.05, Table 3). For dietary intake, SSD children had a lower daily intake of fruit (p < 0.05, Table 3) but a higher daily intake of meat and sugar beverages (both p < 0.05, Table 3) compared with LSD children. For physical activity, daily high level physical activity (HPLA) time and middle level physical activity (MPLA) time were both shorter in SSD children than in LSD children (both p < 0.05, Table 3), whereas daily walking and sedentary time were both longer in SSD children (both p < 0.05, Table 3). In total, the prevalence of obesity was age-and gender-dependent (see Table 3) and significantly different among sleep durations (p = 0.001, Table 3). For older boys, the prevalence of obesity was highest in MSD children, (9.1 %, p = 0.016, Table 3). The prevalence of obesity varied in other age and gender groups, but it did not reach the statistical significance (all p > 0.05, Table 3).
Association between sleep duration and obesity
According to sleep duration, the odds ratios (ORs) for obesity are summarized in Table 4. Compared with LSD group, both SSD and MSD were significantly associated with obesity (ORs: 1.271 and 1.471, 95 % CI: 1.267-1.275 and 1.462-1.479, respectively, as shown in Table 4) after age and gender were adjusted, and multivariate adjusted analysis showed similar association (ORs: 1.581 and 1.328, 95 % CI: 1.572-1.590 and 1.324-1.332, SSD and MSD, respectively, as shown in Table 4).
Stratified by gender, SSD was positively associated with obesity in girls but inversely associated with obesity in boys (age adjusted, ORs: 1.605 and 0.655, 95 % CI: 1.594-1.615 and 0.641-0.669, respectively, as shown in Table 3). MSD was positively associated with obesity in both genders (age adjusted, ORs: 1.207 and 1.313; 95 % CI: 1.201-1.214 and 1.307-1.318, boys and girls, respectively, as shown in Table 3). When multivariate adjusted (including age, dietary intake and physical activity/sedentary behaviour), the ORs of the groups were 1. Table 3).
Stratified by age and gender, SSD was positively associated with obesity risk in older boys but inversely associated with obesity risk in younger boys (ORs: 1.331 and 0.603; 95 % CI: 1.297-1.365 and 0.551-0.660, respectively, as shown in Table 3). For girls, SSD was positively associated with obesity in both older and younger age groups (ORs: 2.868 and 1.748; 95 % CI: 2.826-2.909 and 1.728-1.768, respectively, as shown in Table 3). For boys with MSD, the association between sleep duration and obesity risk was stronger in the older group than in the younger group (ORs: 2.220 and 1.121; 95 % CI: 2.192-2.249 and 1.114-1.127, respectively, as shown in Table 3). MSD girls shared a higher obesity risk than their LSD counterparts (ORs: 2.247 and 1.319; 95 % CI: 2.217-2.277 and 1.313-1.325 for older and younger age groups, respectively, as shown in Table 3).
Discussion
Childhood obesity has become an international epidemic as the risk of obesity-related morbidity increases in different countries. Considering the long-term potential complications of obesity, identifying the different etiologies of this disease is increasingly underscored . Sleep duration is related to obesity and influenced by numerous factors, such as gender, age, physical activity and dietary intake. However, information on this phenomenon is limited, particularly in the Chinese population. Using a cross-sectional survey on 8,760 children, we determined that the prevalence of childhood obesity was 8.4 % in the urban area of China, and was higher in boys than in girls. Moreover, sleep duration decreased as children grew. Most importantly, short sleep duration was related to the increased risk of obesity in girls and 13-to 18-year-old boys, whereas the decreased risk of obesity was found among boys aged 6-12 years. Generally, the results of this study suggest that the association between sleep duration and obesity is age-and gender-dependent, and pre-puberty boys can present an interesting population for further investigation. Compared with the other well-known risk factors of obesity, such as parental obesity, TV viewing, socio-economic status and physical activity, short sleep duration was reported to be an independent risk factor of obesity . The recommended sleep duration for a child is 9-11 h per night . However, in the current study, more than half of the 6-year-old children could not get 9 h of sleep per night. Moreover, insufficient sleep became more serious with increasing age, and nearly 100 % of the children slept less than 9 h per night at age 18 (see Fig. 1). Epidemiological evidence shows that short sleep duration is associated with obesity, metabolic diseases and all-cause mortality . Additionally, short sleep duration is linked with stress reaction . As a stressor, long-lasting daily short sleep activates oxidative stress and systematic inflammation, which may finally induce the onset of chronic . Hence, proper sleep duration is critically important for the long-term health of children.
Although the association between short sleep duration and child obesity has been reported by cross-sectional studies, the underlying mechanism remains unclear. The imbalance of energy intake and expenditure is currently considered the most plausible reason for the increased risk of obesity of short duration sleepers . Energy intake is regulated by ghrelin and leptin, which have opposing functions in appetite regulation . Ghrelin stimulates hunger and increases food intake, whereas leptin suppresses appetite and improves energy expenditure . Laboratory studies revealed that short sleep could increase ghrelin level and decrease leptin level in the human body, which may alter eating habits and eventually predispose weight gain and obesity in the future .
In this study, we observed the increased intake of meat and sugar beverages for children who had less than 7 h sleep (see Table 2). Although we did not test the ghrelin and leptin levels of participants, our results supported the laboratory findings of appetite hormone. Our findings are also consistent with epidemiological studies that reported the association between less sleep and more consumption of high-calorie food , such as sugar beverages . Moreover, energy is believed to contribute to the association between short sleep and obesity. Insufficient sleep with increased fatigue and daytime sleepiness would eventually reduce the motivation to exercise . Additionally, sedentary behaviours, such as TV viewing and playing video games, proved to be important lifestyle factors of childhood obesity . In our study, children with short sleep duration had less HLPA and MLPA, but more walking and sedentary behaviour time (see Table 2), which supported the aforementioned points. Several studies have explored the U-shape association between long or short sleep duration and obesity. However, when sleep duration is a continuous variable, the U-shape can be tested more easily. Considering that sleep duration is a categorical variable in our study, the U-shape association cannot be ruled out. Numerous studies have reported that gender affects the relationship between short sleep and overweight/obesity . For instance, several studies have suggested that the effect of sleep duration on obesity was only present in females with greater sleep debt . A widespread belief is that females require less sleep hours than males . We also determined that more girls had less than 7 h of sleep duration than boys (see Table 1). Given that the current study showed a significant obesity risk for girls with short sleep, less than 7 h of sleep duration is sufficiently short to predict the higher risk of obesity in females. Furthermore, our findings indicated that girls with less than 7 h of sleep duration had longer sedentary time, which explained the reason for higher risk of obesity.
Compared with girls, boys had a different pattern in the association between sleep and obesity. The results of this study revealed that pre-puberty boys (aged 6-12 years) with less than 7 h of sleep showed a decreased risk for obesity. From the perspective of energy intake and expenditure, sleeping reduces the basic metabolic rate and energy expenditure . Considering that boys require more sleep hours than girls , less than 7 h of sleep for boys may be extremely short, which could induce more energy expenditure compared with girls. We also found that obesity prevalence among boys aged 13-18 years was higher in the 7-9 sleep-hour group than in the 7 sleep-hour group. Extra energy expenditure occurs in longer waking up time as well. Collings et al. concluded that adiposity was inversely associated with sleep duration among adolescent boys, but not girls, which further confirmed the gender-specific effect. The preceding speculation indicates the worthiness of exploring the mechanism of short sleep effect on obesity from the perspective of energy intake and expenditure in the future.
In addition to gender, puberty seems an important factor in the effect of obesity. In the dynamic developmental period of physical and sexual development, adolescents require adequate time of sleep. However, no difference was found between the period of prepuberty and puberty in females in this study. For boys, puberty induces a dramatic change, and less than 7 h of sleep could turn from a protective factor to become a risk of obesity. However, the role of puberty is unclear in the effect of sleep on obesity among boys. We speculate that rapid endocrine and metabolic change during puberty might be one reason. Additionally, the requirement of sleep time in girls is relatively shorter compared with boys; thus, the influence of short sleep duration on boys is more obvious . The inner mechanism that puberty changes the pattern of sleep and obesity is warranted.
Other aspects may affect the association between obesity and sleep duration. Later bedtime is regarded as a risk factor of increased BMI , even if sleep duration remains the same. Sleep quality should be considered as well because poor sleep quality can be a risk factor of obesity . Sleep apnea can be an independent risk factor of obesity . However, obesity-related sleep apnea could result in sudden awakening at night and decrease sleep duration. Although Colings et al. previously reported the lack of association between adiposity and changes in sleep duration from mid-to late adolescence, the reverse causality of the association cannot be ruled out. As a cross-sectional study, we did not aim to explore the causality, but our findings may help enhance the understanding on the association itself, such as potential gender-specific effect.
The population in our study consists of children in the urban area of Guangzhou. Guangzhou is the third largest city in China, which is located along the south coast. With regard to economic development, cities along the east and south coast are more developed relative to inland and west cities of China; consequently, the average income is higher in Guangzhou. Additionally, cities in the south differ from those in north China in terms of lifestyle (i.e. diet preference), which may potentially affect the external validity. In conclusion, our study can be representative when referring to children in urban cities in southern China.
Several limitations are found in this study. Given that the study was conducted in a cross-sectional manner, the causal pathways underlying the observed relationships could hardly be detected. The questionnaire has not been statistically validated nor tested for reliability; thus, potential bias cannot be excluded. Sleep duration was reported by the parents of children under nine years old, which sometimes could be an ideal sleep duration that the parents think their children had other than the latter's actual sleep duration . Children older than nine years personally reported the information, which may have self-reported bias. In addition, nearly 25 % of participants either failed to complete the anthropometric procedure or refused to answer the questionnaire. Obese children felt might feel embarrassed to be weighed, which may induce a relatively low prevalence of obesity. Thus, the excluded subjects may have a higher rate of obesity. An objective technique is considerably useful in conducting sleep research and generally deemed to be the optimal manner. Although diverse lifestyle behaviours were adjusted, residual confounding remained in the models because of methodological imperfection, which may compromise the results.
Conclusion
Overall, short sleep duration is associated with obesity among children. Short sleep duration increases the obesity risk for girls and 13-to 18-year-old boys, but decreases the obesity risk for boys aged 6-12 years in the urban area of China. Data suggest that age and |
/**
* The main view contains a button and a click listener.
*/
@Route("")
public class MainView extends VerticalLayout {
@Inject
GreetService greetService;
public MainView() {
Chart chart = new Chart(ChartType.COLUMN);
Configuration conf = chart.getConfiguration();
conf.setTitle("Reindeer Kills by Predators");
conf.setSubTitle("Kills Grouped by Counties");
ListSeries series = new ListSeries("Diameter");
series.setData(4900, 12100, 12800,
6800, 143000, 125000,
51100, 49500);
conf.addSeries(series);
add(chart);
// Use TextField for standard text input
TextField textField = new TextField("Your name");
textField.addThemeName("bordered");
// Button click listeners can be defined as lambda expressions
Button button = new Button("Say hello", e -> Notification
.show(greetService.greet(textField.getValue())));
// Theme variants give you predefined extra styles for components.
// Example: Primary button is more prominent look.
button.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
// You can specify keyboard shortcuts for buttons.
// Example: Pressing enter in this view clicks the Button.
button.addClickShortcut(Key.ENTER);
// Use custom CSS classes to apply styling. This is defined in shared-styles.css.
addClassName("centered-content");
add(textField, button);
}
} |
The Anti Defamation League calls for calm and for government action in wake of attacks on African refugees. The statement includes some racism of its own:
While we recognize the complexity involved in properly addressing this issue, and sympathize with Israeli citizens whose personal security has been compromised by the lawlessness and violence of some migrants, we are disturbed by inflammatory public statements made by certain Israeli officials, some of which has veered into racism. These statements are counterproductive and only serve to further inflame tensions.
But in “Police distort crime date, inciting violence against refugees,” Sigal Rozen at +972 quotes police statistics showing a low crime rate among the migrants:
Real police data, presented in a meeting held by the Knesset Committee on Foreign Workers on March 19, indicate that the crime rate among foreigners in Israel stood at 2.24 percent in 2011 (1,223 criminal cases out of a total of 54,497 foreigners). The 2011 data on Israeli crime has not yet been published, but according to police data reported to the Knesset, the crime rate among the general population in Israel stood at 4.99 percent in 2010…. the general crime rate in Israel is more than double that of Africans in Israel.
Scant mention by Jeffrey Goldberg of the attacks; he diminishes the episode and leaves out the official encouragement of the riots:
Then came the disturbing news that in a poor neighborhood of Tel Aviv, Sudanese immigrants were set upon by Israeli hooligans. ‘Fascism’ might be a strong word, and of course Israel is judged by a double-standard (triple-standard, actually), but this is not what should be happening in a country that calls itself a Jewish state.
Great post by liberal Zionist Peter Beinart concludes with some implicit sympathy for the delegitimizers of Israel. Excerpt:
A reviled, powerless minority discussed in the language of war and disease? Where have my Jewish ears heard that before? Last night, looking for a little moral outrage, I went to the Anti-Defamation League’s website, since they’ve done good work on anti-immigrant racism in Europe and the United States. Nothing doing. The top stories were on Holocaust denial in Greece, the Rutgers spying case and school bullying. I tried the American Jewish Committee, whose mission is to “advance human rights and democratic values in the United States and around the world.” Nada. Their featured stories were about Memorial Day, Iran and black-Jewish cooperation for civil rights (ah, the irony). How about AIPAC, which declares that America and Israel are natural allies because “both nations were founded by refugees seeking political and religious freedom… Both have absorbed waves of immigrants seeking political freedom and economic well-being.” Nope. Or the Presidents’ Conference, which aims to “enhance the security and dignity of Jews.” Sure seems like Jewish dignity could use a little enhancing right now in south Tel Aviv. Zilch.
Oh and this just in (thanks Susie Kneedler), from Jeremy Ben-Ami of J Street. I’m removing his disclaimers to emphasize the positive aspects of his statement: |
<reponame>Ezeer/VegaStrike_win32FR
// Copyright (c) 2006 <NAME>
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MATH_BESSEL_K0_HPP
#define BOOST_MATH_BESSEL_K0_HPP
#include <boost/math/tools/rational.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/assert.hpp>
// Modified Bessel function of the second kind of order zero
// minimax rational approximations on intervals, see
// <NAME> Blair, Chalk River Report AECL-3461, 1969
namespace boost { namespace math { namespace detail{
template <typename T, typename Policy>
T bessel_k0(T x, const Policy& pol)
{
BOOST_MATH_INSTRUMENT_CODE(x);
static const T P1[] = {
static_cast<T>(2.4708152720399552679e+03L),
static_cast<T>(5.9169059852270512312e+03L),
static_cast<T>(4.6850901201934832188e+02L),
static_cast<T>(1.1999463724910714109e+01L),
static_cast<T>(1.3166052564989571850e-01L),
static_cast<T>(5.8599221412826100000e-04L)
};
static const T Q1[] = {
static_cast<T>(2.1312714303849120380e+04L),
static_cast<T>(-2.4994418972832303646e+02L),
static_cast<T>(1.0L)
};
static const T P2[] = {
static_cast<T>(-1.6128136304458193998e+06L),
static_cast<T>(-3.7333769444840079748e+05L),
static_cast<T>(-1.7984434409411765813e+04L),
static_cast<T>(-2.9501657892958843865e+02L),
static_cast<T>(-1.6414452837299064100e+00L)
};
static const T Q2[] = {
static_cast<T>(-1.6128136304458193998e+06L),
static_cast<T>(2.9865713163054025489e+04L),
static_cast<T>(-2.5064972445877992730e+02L),
static_cast<T>(1.0L)
};
static const T P3[] = {
static_cast<T>(1.1600249425076035558e+02L),
static_cast<T>(2.3444738764199315021e+03L),
static_cast<T>(1.8321525870183537725e+04L),
static_cast<T>(7.1557062783764037541e+04L),
static_cast<T>(1.5097646353289914539e+05L),
static_cast<T>(1.7398867902565686251e+05L),
static_cast<T>(1.0577068948034021957e+05L),
static_cast<T>(3.1075408980684392399e+04L),
static_cast<T>(3.6832589957340267940e+03L),
static_cast<T>(1.1394980557384778174e+02L)
};
static const T Q3[] = {
static_cast<T>(9.2556599177304839811e+01L),
static_cast<T>(1.8821890840982713696e+03L),
static_cast<T>(1.4847228371802360957e+04L),
static_cast<T>(5.8824616785857027752e+04L),
static_cast<T>(1.2689839587977598727e+05L),
static_cast<T>(1.5144644673520157801e+05L),
static_cast<T>(9.7418829762268075784e+04L),
static_cast<T>(3.1474655750295278825e+04L),
static_cast<T>(4.4329628889746408858e+03L),
static_cast<T>(2.0013443064949242491e+02L),
static_cast<T>(1.0L)
};
T value, factor, r, r1, r2;
BOOST_MATH_STD_USING
using namespace boost::math::tools;
static const char* function = "boost::math::bessel_k0<%1%>(%1%,%1%)";
if (x < 0)
{
return policies::raise_domain_error<T>(function,
"Got x = %1%, but argument x must be non-negative, complex number result not supported", x, pol);
}
if (x == 0)
{
return policies::raise_overflow_error<T>(function, 0, pol);
}
if (x <= 1) // x in (0, 1]
{
T y = x * x;
r1 = evaluate_polynomial(P1, y) / evaluate_polynomial(Q1, y);
r2 = evaluate_polynomial(P2, y) / evaluate_polynomial(Q2, y);
factor = log(x);
value = r1 - factor * r2;
}
else // x in (1, \infty)
{
T y = 1 / x;
r = evaluate_polynomial(P3, y) / evaluate_polynomial(Q3, y);
factor = exp(-x) / sqrt(x);
value = factor * r;
BOOST_MATH_INSTRUMENT_CODE("y = " << y);
BOOST_MATH_INSTRUMENT_CODE("r = " << r);
BOOST_MATH_INSTRUMENT_CODE("factor = " << factor);
BOOST_MATH_INSTRUMENT_CODE("value = " << value);
}
return value;
}
}}} // namespaces
#endif // BOOST_MATH_BESSEL_K0_HPP
|
/**
* Asynchronous task for saving edited photo as a new copy.
*/
public class SaveCopyTask extends AsyncTask<Bitmap, Void, Uri> {
/**
* Callback for the completed asynchronous task.
*/
public interface Callback {
void onComplete(Uri result);
}
private static final String TIME_STAMP_NAME = "'IMG'_yyyyMMdd_HHmmss";
private static final int INDEX_DATE_TAKEN = 0;
private static final int INDEX_LATITUDE = 1;
private static final int INDEX_LONGITUDE = 2;
private static final String[] IMAGE_PROJECTION = new String[] {
ImageColumns.DATE_TAKEN,
ImageColumns.LATITUDE,
ImageColumns.LONGITUDE,
};
private final Context context;
private final Uri sourceUri;
private final Callback callback;
private final String albumName;
private final String saveFileName;
public SaveCopyTask(Context context, Uri sourceUri, Callback callback) {
this.context = context;
this.sourceUri = sourceUri;
this.callback = callback;
albumName = context.getString(R.string.edited_photo_bucket_name);
saveFileName = new SimpleDateFormat(TIME_STAMP_NAME).format(
new Date(System.currentTimeMillis()));
}
/**
* The task should be executed with one given bitmap to be saved.
*/
@Override
protected Uri doInBackground(Bitmap... params) {
// TODO: Support larger dimensions for photo saving.
if (params[0] == null) {
return null;
}
Bitmap bitmap = params[0];
File file = save(bitmap);
Uri uri = (file != null) ? insertContent(file) : null;
bitmap.recycle();
return uri;
}
@Override
protected void onPostExecute(Uri result) {
String message = (result == null) ? context.getString(R.string.saving_failure)
: context.getString(R.string.photo_saved, albumName);
Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
callback.onComplete(result);
}
private File save(Bitmap bitmap) {
String directory = Environment.getExternalStorageDirectory().toString() + "/" + albumName;
return new BitmapUtils(context).saveBitmap(
bitmap, directory, saveFileName, Bitmap.CompressFormat.JPEG);
}
/**
* Insert the content (saved file) with proper source photo properties.
*/
private Uri insertContent(File file) {
long now = System.currentTimeMillis() / 1000;
long dateTaken = now;
double latitude = 0f;
double longitude = 0f;
ContentResolver contentResolver = context.getContentResolver();
Cursor cursor = null;
try {
cursor = contentResolver.query(sourceUri, IMAGE_PROJECTION, null, null, null);
if ((cursor != null) && cursor.moveToNext()) {
dateTaken = cursor.getLong(INDEX_DATE_TAKEN);
latitude = cursor.getDouble(INDEX_LATITUDE);
longitude = cursor.getDouble(INDEX_LONGITUDE);
}
} catch (Exception e) {
// Ignore error for lacking property columns from the source.
} finally {
if (cursor != null) {
cursor.close();
}
}
ContentValues values = new ContentValues();
values.put(Images.Media.TITLE, saveFileName);
values.put(Images.Media.DISPLAY_NAME, saveFileName);
values.put(Images.Media.MIME_TYPE, "image/jpeg");
values.put(Images.Media.DATE_TAKEN, dateTaken);
values.put(Images.Media.DATE_MODIFIED, now);
values.put(Images.Media.DATE_ADDED, now);
values.put(Images.Media.ORIENTATION, 0);
values.put(Images.Media.DATA, file.getAbsolutePath());
values.put(Images.Media.SIZE, file.length());
// TODO: Change || to && after the default location issue is fixed.
if ((latitude != 0f) || (longitude != 0f)) {
values.put(Images.Media.LATITUDE, latitude);
values.put(Images.Media.LONGITUDE, longitude);
}
return contentResolver.insert(Images.Media.EXTERNAL_CONTENT_URI, values);
}
} |
// Shutdown stops a node and cleansup
func (n *Node) Shutdown() {
if n.client != nil {
n.client.Shutdown()
}
if err := n.Stop(); err != nil {
log.Printf("%s: Cannot stop node: %v", n, err)
}
if err := n.Cleanup(); err != nil {
log.Printf("%s: Cannot cleanup: %v", n, err)
}
log.Printf("%s: Shutdown", n)
} |
Rheological and Thermal Analysis of Bentonites for Water Base Drilling Fluids
The objective of this research is to investigate the rheological and thermal properties of bentonites for water base drilling fluids. Rheological experiments were performed with 4 different bentonite samples and clay percentages, cation-exchange capacity (CEC), swelling volume, pH, and physical and rheological properties of the samples are determined. The thermal behaviors of bentonite samples were investigated using simultaneous thermogravimetry (TG/DTG) and differential thermal analysis (DTA) techniques. It was observed that all bentonite samples exhibit 2 weight loss events on heating. Similar behavior was observed with the bentonite samples studied in the literature. |
<gh_stars>10-100
package com.benjaminwan.chinesettstflite.utils;
import android.util.Log;
import androidx.annotation.Nullable;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author {@link "mailto:<EMAIL>" "<NAME>"}
* Created 2020-07-25 17:25
*/
public class Processor {
private static final String TAG = "processor";
private static final String[] VALID_SYMBOLS = new String[]{
"AA",
"AA0",
"AA1",
"AA2",
"AE",
"AE0",
"AE1",
"AE2",
"AH",
"AH0",
"AH1",
"AH2",
"AO",
"AO0",
"AO1",
"AO2",
"AW",
"AW0",
"AW1",
"AW2",
"AY",
"AY0",
"AY1",
"AY2",
"B",
"CH",
"D",
"DH",
"EH",
"EH0",
"EH1",
"EH2",
"ER",
"ER0",
"ER1",
"ER2",
"EY",
"EY0",
"EY1",
"EY2",
"F",
"G",
"HH",
"IH",
"IH0",
"IH1",
"IH2",
"IY",
"IY0",
"IY1",
"IY2",
"JH",
"K",
"L",
"M",
"N",
"NG",
"OW",
"OW0",
"OW1",
"OW2",
"OY",
"OY0",
"OY1",
"OY2",
"P",
"R",
"S",
"SH",
"T",
"TH",
"UH",
"UH0",
"UH1",
"UH2",
"UW",
"UW0",
"UW1",
"UW2",
"V",
"W",
"Y",
"Z",
"ZH"
};
private static final Pattern CURLY_RE = Pattern.compile("(.*?)\\{(.+?)\\}(.*)");
private static final Pattern COMMA_NUMBER_RE = Pattern.compile("([0-9][0-9\\,]+[0-9])");
private static final Pattern DECIMAL_RE = Pattern.compile("([0-9]+\\.[0-9]+)");
private static final Pattern POUNDS_RE = Pattern.compile("£([0-9\\,]*[0-9]+)");
private static final Pattern DOLLARS_RE = Pattern.compile("\\$([0-9.\\,]*[0-9]+)");
private static final Pattern ORDINAL_RE = Pattern.compile("[0-9]+(st|nd|rd|th)");
private static final Pattern NUMBER_RE = Pattern.compile("[0-9]+");
private static final String PAD = "_";
private static final String EOS = "~";
private static final String SPECIAL = "-";
private static final String[] PUNCTUATION = "!'(),.:;? ".split("");
private static final String[] LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
private static final List<String> SYMBOLS = new ArrayList<>();
private static final Map<String, String> ABBREVIATIONS = new HashMap<>();
private static final Map<String, Integer> SYMBOL_TO_ID = new HashMap<>();
public Processor() {
SYMBOLS.add(PAD);
SYMBOLS.add(SPECIAL);
for (String p : PUNCTUATION) {
if (!"".equals(p)) {
SYMBOLS.add(p);
}
}
for (String l : LETTERS) {
if (!"".equals(l)) {
SYMBOLS.add(l);
}
}
for (String validSymbol : VALID_SYMBOLS) {
SYMBOLS.add("@" + validSymbol);
}
SYMBOLS.add(EOS);
for (int i = 0; i < SYMBOLS.size(); ++i) {
SYMBOL_TO_ID.put(SYMBOLS.get(i), i);
}
ABBREVIATIONS.put("mrs", "misess");
ABBREVIATIONS.put("mr", "mister");
ABBREVIATIONS.put("dr", "doctor");
ABBREVIATIONS.put("st", "saint");
ABBREVIATIONS.put("co", "company");
ABBREVIATIONS.put("jr", "junior");
ABBREVIATIONS.put("maj", "major");
ABBREVIATIONS.put("gen", "general");
ABBREVIATIONS.put("drs", "doctors");
ABBREVIATIONS.put("rev", "reverend");
ABBREVIATIONS.put("lt", "lieutenant");
ABBREVIATIONS.put("hon", "honorable");
ABBREVIATIONS.put("sgt", "sergeant");
ABBREVIATIONS.put("capt", "captain");
ABBREVIATIONS.put("esq", "esquire");
ABBREVIATIONS.put("ltd", "limited");
ABBREVIATIONS.put("col", "colonel");
ABBREVIATIONS.put("ft", "fort");
}
private List<Integer> symbolsToSequence(String symbols) {
List<Integer> sequence = new ArrayList<>();
for (int i = 0; i < symbols.length(); ++i) {
Integer id = SYMBOL_TO_ID.get(String.valueOf(symbols.charAt(i)));
if (id == null) {
Log.e(TAG, "symbolsToSequence: id is not found for " + symbols.charAt(i));
} else {
sequence.add(id);
}
}
return sequence;
}
private List<Integer> arpabetToSequence(@Nullable String symbols) {
List<Integer> sequence = new ArrayList<>();
if (symbols != null) {
String[] as = symbols.split(" ");
for (String s : as) {
sequence.add(SYMBOL_TO_ID.get("@" + s));
}
}
return sequence;
}
private String convertToAscii(String text) {
byte[] bytes = text.getBytes(StandardCharsets.US_ASCII);
return new String(bytes);
}
private String collapseWhitespace(String text) {
return text.replaceAll("\\s+", " ");
}
private String expandAbbreviations(String text) {
for (Map.Entry<String, String> entry : ABBREVIATIONS.entrySet()) {
text = text.replaceAll("\\b" + entry.getKey() + "\\.", entry.getValue());
}
return text;
}
private String removeCommasFromNumbers(String text) {
Matcher m = COMMA_NUMBER_RE.matcher(text);
while (m.find()) {
String s = m.group().replaceAll(",", "");
text = text.replaceFirst(m.group(), s);
}
return text;
}
private String expandPounds(String text) {
Matcher m = POUNDS_RE.matcher(text);
while (m.find()) {
text = text.replaceFirst(m.group(), m.group() + " pounds");
}
return text;
}
private String expandDollars(String text) {
Matcher m = DOLLARS_RE.matcher(text);
while (m.find()) {
String dollars = "0";
String cents = "0";
String spelling = "";
String s = m.group().substring(1);
String[] parts = s.split("\\.");
if (!s.startsWith(".")) {
dollars = parts[0];
}
if (!s.endsWith(".") && parts.length > 1) {
cents = parts[1];
}
if (!"0".equals(dollars)) {
spelling += parts[0] + " dollars ";
}
if (!"0".equals(cents) && !"00".equals(cents)) {
spelling += parts[1] + " cents ";
}
text = text.replaceFirst("\\" + m.group(), spelling);
}
return text;
}
private String expandDecimals(String text) {
Matcher m = DECIMAL_RE.matcher(text);
while (m.find()) {
String s = m.group().replaceAll("\\.", " point ");
text = text.replaceFirst(m.group(), s);
}
return text;
}
private String expandOrdinals(String text) {
Matcher m = ORDINAL_RE.matcher(text);
while (m.find()) {
String s = m.group().substring(0, m.group().length() - 2);
long l = Long.valueOf(s);
String spelling = NumberNorm.toOrdinal(l);
text = text.replaceFirst(m.group(), spelling);
}
return text;
}
private String expandCardinals(String text) {
Matcher m = NUMBER_RE.matcher(text);
while (m.find()) {
long l = Long.valueOf(m.group());
String spelling = NumberNorm.numToString(l);
text = text.replaceFirst(m.group(), spelling);
}
return text;
}
private String expandNumbers(String text) {
text = removeCommasFromNumbers(text);
text = expandPounds(text);
text = expandDollars(text);
text = expandDecimals(text);
text = expandOrdinals(text);
text = expandCardinals(text);
return text;
}
private String cleanTextForEnglish(String text) {
text = convertToAscii(text);
text = text.toLowerCase();
text = expandAbbreviations(text);
try {
text = expandNumbers(text);
} catch (Exception e) {
Log.d(TAG, "Failed to convert numbers", e);
}
text = collapseWhitespace(text);
Log.d(TAG, "text preprocessed: " + text);
return text;
}
public int[] textToIds(String text) {
List<Integer> sequence = new ArrayList<>();
while (text != null && text.length() > 0) {
Matcher m = CURLY_RE.matcher(text);
if (!m.find()) {
sequence.addAll(symbolsToSequence(cleanTextForEnglish(text)));
break;
}
sequence.addAll(symbolsToSequence(cleanTextForEnglish(m.group(1))));
sequence.addAll(arpabetToSequence(m.group(2)));
text = m.group(3);
}
int size = sequence.size();
Integer[] tmp = new Integer[size];
tmp = sequence.toArray(tmp);
int[] ids = new int[size];
for (int i = 0; i < size; ++i) {
ids[i] = tmp[i];
}
return ids;
}
}
|
#include "stdafx.h"
#include "ForceGenerators.h"
#include "RigidBodySimulator.h"
namespace sg {
namespace physics {
//=============================================================================
GravityGenerator::GravityGenerator(float3 const& gravity)
: m_gravity(gravity)
{
}
//'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
void GravityGenerator::Apply(ArrayView<RigidBodyProperties> ioRigidBodies, float dt) const
{
float3 const g = m_gravity;
for(auto& it : ioRigidBodies)
{
if(it.isFixed)
continue;
it.linearVelocity += g * dt;
}
}
//=============================================================================
}
}
|
/**
* Applies all generic strategies to a given function
*
* @param cxxFun
* the function to analyze
* @param options
* JSON with HLS options
*/
public static void applyGenericStrategies(AFunction cxxFun, String options) {
ClavaLog.info("HLS API: applying all generic strategies to function " + cxxFun.getNameImpl());
ClavaHLS hls = createHLS(cxxFun);
ClavaHLSOptions op = new ClavaHLSOptions();
hls.applyGenericStrategies(op);
} |
from solver import solver
import solver_tools as st
class FAS(solver):
def __init__(self, pre_smoother, pre_n, post_smoother, post_n,
restriction, interpolation, coarse_solver, J_min, tol=None, verbose=False):
self._pre_smoother = pre_smoother
self._post_smoother = post_smoother
self._coarse_solver = coarse_solver
self.J_min = J_min
self.pre_n = pre_n
self.post_n = post_n
self._restriction = restriction
self._interpolation = interpolation
self.tol = tol
self.verbose = verbose
params = (self._pre_smoother, self.pre_n, self._post_smoother, self.post_n,
self._restriction, self._interpolation, self._coarse_solver, self.J_min)
self.smoother = lambda equation, current, rhs: st.FAS(equation, current, rhs, *params)
@property
def pre_smoother(self):
return self._pre_smoother
@pre_smoother.setter
def pre_smoother(self, smoother):
self._pre_smoother = smoother
self.refresh_parameters()
@property
def post_smoother(self):
return self._post_smoother
@post_smoother.setter
def post_smoother(self, smoother):
self._post_smoother = smoother
self.refresh_parameters()
@property
def coarse_solver(self):
return self._coarse_solver
@coarse_solver.setter
def coarse_solver(self, solver):
self._coarse_solver = solver
self.refresh_parameters()
@property
def restriction(self):
return self._restriction
@restriction.setter
def restriction(self, frestriction):
self._restriction = frestriction
self.refresh_parameters()
@property
def interpolation(self):
return self._interpolation
@interpolation.setter
def interpolation(self, finterpolation):
self._interpolation = finterpolation
self.refresh_parameters()
def refresh_parameters(self):
params = (self._pre_smoother, self.pre_n, self._post_smoother, self.post_n, \
self._restriction, self._interpolation, self._coarse_solver, self.J_min)
self.smoother = lambda equation, current, rhs: st.FAS(equation, current, rhs, *params)
|
<reponame>Ampil1/globus-soft-oauth<gh_stars>0
import { Schema } from 'mongoose';
export enum Provider {
FACEBOOK = 'FACEBOOK',
GOOGLE = 'GOOGLE',
}
export const UserSchema = new Schema({
fullNmae: { type: String },
email: { type: String, trim: true, lowercase: true, sparse: true },
password: { type: String },
salt: { type: String },
role: { type: String },
provider: { type: Provider },
facebookEmail: { type: String },
googleEmail: { type: String },
facebookId: { type: String },
googleId: { type: String },
}, {
timestamps: true
});
|
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ArrayList<Vehiculo> vehiculos = new ArrayList<>();
int op;
do{
op = menu();
switch(op){
case 1: registrarVehiculo(vehiculos);
break;
case 2: mostrasMayor90(vehiculos);
break;
case 3: mostrarMontoTotal(vehiculos);
break;
}
}while(op != 4);
} |
<reponame>jmlopez-rod/tslint-eslint-rules
/// <reference path='../../../typings/mocha/mocha.d.ts' />
import { runTest, IScripts } from './helper';
/**
* Borrowing tests from eslint:
* https://github.com/eslint/eslint/blob/master/tests/lib/rules/no-multi-spaces.js
*/
const rule = 'no-multi-spaces';
const scripts: { valid: IScripts, invalid: IScripts } = {
valid: [
'var a = 1;',
'var a=1;',
'var a = 1, b = 2;',
'var arr = [1, 2];',
'var arr = [ (1), (2) ];',
`var obj = {'a': 1, 'b': (2)};`,
`var obj = {'a': 1,\n 'b': (2)};`,
'\t\tvar x = 5,\n\t\t y = 2;',
'a, b',
'a >>> b',
'a ^ b',
'(a) | (b)',
'a & b',
'a << b',
'a !== b',
'a >>>= b',
'if (a & b) { }',
'function foo(a,b) {}',
'function foo(a, b) {}',
'if ( a === 3 && b === 4) {}',
'if ( a === 3||b === 4 ) {}',
'if ( a <= 4) {}',
'var foo = bar === 1 ? 2: 3',
'[1, , 3]',
'[1, ]',
'[ ( 1 ) , ( 2 ) ]',
'a = 1, b = 2;',
'(function(a, b){})',
'x.in = 0;',
'(function(a,/* b, */c){})',
'(function(a,/*b,*/c){})',
'(function(a, /*b,*/c){})',
'(function(a,/*b,*/ c){})',
'(function(a, /*b,*/ c){})',
'(function(/*a, b, */c){})',
'(function(/*a, */b, c){})',
'(function(a, b/*, c*/){})',
'(function(a, b/*,c*/){})',
'(function(a, b /*,c*/){})',
'(function(a/*, b ,c*/){})',
'(function(a /*, b ,c*/){})',
'(function(a /*, b ,c*/){})',
'/**\n * hello\n * @param {foo} int hi\n * set.\n * @private\n*/',
'/**\n * hello\n * @param {foo} int hi\n * set.\n * set.\n * @private\n*/',
'var a,/* b,*/c;',
'var foo = [1,/* 2,*/3];',
'var bar = {a: 1,/* b: 2*/c: 3};',
'var foo = \'hello world\';',
'var foo = \' \';',
'var foo = ` `;',
'var foo = " ";',
'var foo = " \' ";',
'function foo() {\n return;\n}',
'function foo() {\n if (foo) {\n return;\n }\n}',
'var foo = `hello world`;',
'({ a: b })',
{
code: '({ a: b })',
options: [{ exceptions: { PropertyAssignment: false } }]
},
{
code: 'var answer = 6 * 7;',
options: [{ exceptions: { VariableDeclaration: true, BinaryExpression: true } }]
}
],
invalid: [
{
code: 'function foo(a, b) {}',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'var foo = (a, b) => {}',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'var a = 1',
errors: [{
message: "Multiple spaces found before '1'."
}]
},
{
code: 'var a = 1, b = 2;',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'a << b',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: "var arr = {'a': 1, 'b': 2};",
errors: [{
message: "Multiple spaces found before ''b''."
}]
},
{
code: 'if (a & b) { }',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'if ( a === 3 && b === 4) {}',
errors: [{
message: "Multiple spaces found before '&&'."
}, {
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'var foo = bar === 1 ? 2: 3',
errors: [{
message: "Multiple spaces found before '2'."
}, {
message: "Multiple spaces found before '3'."
}]
},
{
code: 'var a = [1, 2, 3, 4]',
errors: [{
message: "Multiple spaces found before '2'."
}, {
message: "Multiple spaces found before '3'."
}, {
message: "Multiple spaces found before '4'."
}]
},
{
code: 'var arr = [1, 2];',
errors: [{
message: "Multiple spaces found before '2'."
}]
},
{
code: '[ , 1, , 3, , ]',
errors: [{
message: "Multiple spaces found before ','."
}, {
message: "Multiple spaces found before ','."
}, {
message: "Multiple spaces found before ','."
}, {
message: "Multiple spaces found before ']'."
}]
},
{
code: 'a >>> b',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'a = 1, b = 2;',
errors: [{
message: "Multiple spaces found before 'b'."
}, {
message: "Multiple spaces found before '2'."
}]
},
{
code: '(function(a, b){})',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'function foo(a, b){}',
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'var o = { fetch: function () {} };',
errors: [{
message: "Multiple spaces found before '('."
}]
},
{
code: 'var o = { fetch: function () {} };',
errors: [{
message: "Multiple spaces found before '('."
}]
},
{
code: 'function foo () {}',
errors: [{
message: "Multiple spaces found before '('."
}]
},
{
code: 'if (foo) {}',
errors: [{
message: "Multiple spaces found before '{'."
}]
},
{
code: 'function foo(){}',
errors: [{
message: "Multiple spaces found before 'foo'."
}]
},
{
code: 'if (foo) {}',
errors: [{
message: "Multiple spaces found before '('."
}]
},
{
code: 'try {} catch(ex) {}',
errors: [{
message: "Multiple spaces found before '{'."
}]
},
{
code: 'try {} catch (ex) {}',
errors: [{
message: "Multiple spaces found before '('."
}]
},
{
code: 'var o = { fetch: function () {} };',
errors: [{
message: "Multiple spaces found before '('."
}]
},
{
code: 'throw error;',
errors: [{
message: "Multiple spaces found before 'error'."
}]
},
{
code: 'function foo() { return bar; }',
errors: [{
message: "Multiple spaces found before 'bar'."
}]
},
{
code: 'switch (a) {default: foo(); break;}',
errors: [{
message: "Multiple spaces found before '('."
}]
},
{
code: 'var answer = 6 * 7;',
errors: [{
message: "Multiple spaces found before 'answer'."
}, {
message: "Multiple spaces found before '7'."
}]
},
{
code: '({ a: 6 * 7 })',
errors: [{
message: "Multiple spaces found before '*'."
}]
},
{
code: '({ a: ( 6 / 4 * 7) })',
errors: [{
message: "Multiple spaces found before '6'."
}, {
message: "Multiple spaces found before '/'."
}, {
message: "Multiple spaces found before '4'."
}, {
message: "Multiple spaces found before '*'."
}, {
message: "Multiple spaces found before '}'."
}]
},
{
code: '({ a: ( 6 / 4 * 7) })',
options: [{ exceptions: { PropertyAssignment: false } }],
errors: [{
message: "Multiple spaces found before '('."
}, {
message: "Multiple spaces found before '6'."
}, {
message: "Multiple spaces found before '/'."
}, {
message: "Multiple spaces found before '4'."
}, {
message: "Multiple spaces found before '*'."
}, {
message: "Multiple spaces found before '}'."
}]
},
{
code: '({ a: b })',
options: [{ exceptions: { PropertyAssignment: false } }],
errors: [{
message: "Multiple spaces found before 'b'."
}]
},
{
code: 'var foo = { bar: function() { return 1 + 2; } };',
errors: [{
message: "Multiple spaces found before '+'."
}]
},
{
code: '\t\tvar x = 5,\n\t\t y = 2;',
errors: [{
message: "Multiple spaces found before '2'."
}]
},
{
code: 'var x =\t 5;',
errors: [{
message: "Multiple spaces found before '5'."
}]
}
]
};
describe(rule, () => {
it('should pass when avoiding unnecessary spaces', () => {
runTest(rule, scripts.valid);
});
it('should fail when using multiple spaces', () => {
runTest(rule, scripts.invalid);
});
});
|
package main
import (
"bindings"
"flag"
"fmt"
"github.com/google/uuid"
"log"
"math/rand"
"runtime"
"state"
"time"
)
var clientId string = *flag.String("id", "", "the id of the client. Default is RFC 4122 nodeID.")
var masterAddr *string = flag.String("maddr", "", "Master address. Defaults to localhost")
var masterPort *int = flag.Int("mport", 7087, "Master port. ")
var reqsNb *int = flag.Int("q", 1000, "Total number of requests. ")
var writes *int = flag.Int("w", 100, "Percentage of updates (writes). ")
var psize *int = flag.Int("psize", 100, "Payload size for writes.")
var noLeader *bool = flag.Bool("e", false, "Egalitarian (no leader). ")
var fast *bool = flag.Bool("f", false, "Fast Paxos: send message directly to all replicas. ")
var localReads *bool = flag.Bool("l", true, "Execute reads at the closest (local) replica. ")
var procs *int = flag.Int("p", 2, "GOMAXPROCS. ")
var conflicts *int = flag.Int("c", 0, "Percentage of conflicts. Defaults to 0%")
var verbose *bool = flag.Bool("v", false, "verbose mode. ")
var scan *bool = flag.Bool("s", false, "replace read with short scan (100 elements)")
func main() {
flag.Parse()
runtime.GOMAXPROCS(*procs)
rand.Seed(time.Now().UnixNano())
if *conflicts > 100 {
log.Fatalf("Conflicts percentage must be between 0 and 100.\n")
}
proxy := bindings.NewParameters(*masterAddr, *masterPort, *verbose, *noLeader, *fast, *localReads)
proxy.Connect()
if clientId == "" {
clientId = uuid.New().String()
}
log.Printf("client: %v", clientId)
karray := make([]state.Key, *reqsNb)
put := make([]bool, *reqsNb)
clientKey := state.Key(uint64(uuid.New().Time())) // a command id unique to this client.
for i := 0; i < *reqsNb; i++ {
put[i] = false
if *writes > 0 {
r := rand.Intn(100)
if r <= *writes {
put[i] = true
}
}
karray[i] = clientKey
if *conflicts > 0 {
r := rand.Intn(100)
if r <= *conflicts {
karray[i] = 42
}
}
}
before_total := time.Now()
for j := 0; j < *reqsNb; j++ {
before := time.Now()
key := int64(karray[j])
if put[j] {
value := make([]byte, *psize)
rand.Read(value)
proxy.Write(key, state.Value(value))
} else {
if *scan{
proxy.Scan(key,int64(100))
}else{
proxy.Read(key)
}
}
after := time.Now()
duration := after.Sub(before)
fmt.Printf("latency %d\n", to_ms(duration.Nanoseconds()))
fmt.Printf("chain %d-1\n", to_ms(after.UnixNano()))
}
fmt.Printf(proxy.Stats() + "\n")
proxy.Disconnect()
after_total := time.Now()
fmt.Printf("Test took %v\n", after_total.Sub(before_total))
}
// convert nanosecond to millisecond
func to_ms(nano int64) int64 {
return nano / 1000000
}
|
/**
* This function tries to parse the text from a text field into a number,
* if it fails false is returned otherwise true
* @param textField the field which should be checked
* @return true if text is a number otherwise false
*/
private boolean canParseNumber(TextField textField) {
try {
fmt.parse(textField.getText());
} catch (ParseException e) {
return false;
}
return true;
} |
<filename>src/model/Type.d.ts
export interface Position {
lng: string,
lat: string
}
export interface Sign {
id?: string,
foreignId: string, // 外键id
eid: number | string, // 客户id
sourceId: number, // 签到来源,1巡检,2试验,3消缺,4值守
type: number, // 1签到,2签出
longitude: string, // 经度
latitude: string, // 纬度
remark?: string, // 备注
createId?: string, // 签到人userId
createBy?: string, // 签到人username
createTime?: Date, // 签到时间
signPersonList?: SignPerson[], // 签到人列表
repeat?: boolean// 是否需要重复签到
}
export interface SignPerson {
id?: string,
signId?: string, // 签到表id
type?: number, // 0主签到人,1附加签到人
userId?: string, // 用户id
fullName?: string// 签到人姓名
}
|
<reponame>ekkrym/CovidTrendModel
"""
To run the retrospective forecasts based on the data available
at each day between "2020-04-01" and "2021-12-15"
The results are saved in TrendForecast folders in the folders
data/paper/horison_*i*_week/JHU_*type*/ where i=1,2, type is "cases" or "deaths"
python source/paper_compute_forecasts.py
"""
import multiprocessing
import os
import time
import warnings
import getopt, sys
import pickle
import warnings
warnings.filterwarnings("ignore")
import numpy as np
import pandas as pd
import time
import datetime
from datetime import date, timedelta
#os.chdir("source/")
sys.path.append('methods_configuration/')
from precomputing import read_countrydata, read_countries, repair_increasing
from smoothing import piecewise_STL,simple_mirroring
from forecast_one_country import forecast_one_country
from function_configuration import METHODS
from visualization import plot_last_forecast
from countries_preselected import countries_JHU, countries_US
def parse_col_links(data_col):
if "global" in data_col:
datasource, parse_column = "JHU", "Country/Region"
elif "US" in data_col:
datasource, parse_column = "JHU_US", "Province_State"
if ("confirmed" in data_col) or ("cases" in data_col):
typedata = "cases"
else:
typedata = "deaths"
return datasource, parse_column, typedata
def get_methods_params(subset,call_from_notebook=False):
#---------------------------forecasting method selection----------------------------------
methods_df_path = "methods_configuration/selected_methods_const.csv"
if call_from_notebook:
methods_df_path = "../methods_configuration/selected_methods_const.csv"
methods_pd = pd.read_csv(methods_df_path)
methods = [METHODS[x] for x in list(methods_pd["method"].values[subset])]
kwargs_list = [eval(x) for x in list(methods_pd["parameters"].values[subset])]
names = list(methods_pd["description"].values[subset])
cv_flag = list(methods_pd["cv"].astype(int).values[subset])
return methods, kwargs_list, names, cv_flag
def check_existance(folder):
if not os.path.isdir(folder):
os.makedirs(folder)
def create_folders(save_folder,hor_forecast,data_type):
save_path = ""
for add_ in [save_folder,hor_forecast,data_type]:
save_path = save_path + add_
check_existance(save_path)
for add_ in ["Target","CI","Point"]:
check_existance(save_path+add_)
return save_path
def extrapolate_linearly_weekly(daily_smoothed):
data_smoothed = H*pd.Series(daily_smoothed[:-H]).rolling(H).mean().values
if data_smoothed[-1]-data_smoothed[-H]>0:
weekly_forecast = data_smoothed[-1]+(data_smoothed[-1]-data_smoothed[-H])
else:
weekly_forecast = np.exp(np.log(data_smoothed[-1])+(np.log(data_smoothed[-1])-np.log(data_smoothed[-H])))
weekly_forecast = np.where(weekly_forecast>0,weekly_forecast,0)
return weekly_forecast
def save_retrospective_predictions(date, data_col, countries, subset,
smoothing_fun, H=7, call_from_notebook=False, save_folder="data/paper/", typedata="",method_addon=""):
#--------------prepare df's for saving---------------------------------------------
forecast = pd.DataFrame(columns = ["country", "target_date", "forecast"])
q = [0.01,0.025] + list(np.arange(0.05,1,0.05)) + [0.975,0.99]
q = [str(round(x,3)) for x in q]
forecast_ci = pd.DataFrame(columns = q + ["date"] + ["confidence_norm","country"])
target = pd.DataFrame(columns = ["country","target_date", "target"])
hor_forecast = "horison_"+ str(int(H/7))+"_week/"
data_type = datasource+ "_"+typedata+"/TrendForecast"+method_addon+"/"
path_save = create_folders(save_folder,hor_forecast,data_type)
#------------------load retrospective data------------------------------------------
print(date, " started")
link_for_forecast = retro_data_info[retro_data_info["date"]==str(date)[:10]][data_col].values[0]
target_date= date + timedelta(days=H)
link_for_target = retro_data_info[retro_data_info["date"]==str(target_date)[:10]][data_col].values[0]
df_for_forecast = pd.read_csv(link_for_forecast)
df_for_target = pd.read_csv(link_for_target)
countries_intersection = set(df_for_forecast[parse_column].unique()).intersection(countries)
cumulative_list, date_list = read_countries(df_for_forecast, countries_intersection, 0, datasource, typedata=typedata)
cumulative_target, date_target = read_countries(df_for_target, countries_intersection, 0, datasource, typedata=typedata)
#------------------------------------------------------------------------------------
for country, cumulative_cases, cumulative_target_, dates_,dates_target_ in zip(countries_intersection, cumulative_list, cumulative_target, date_list, date_target):
cumulative_cases_ = repair_increasing(cumulative_cases)
cumulative_target_ = repair_increasing(cumulative_target_)
return_dict, _, ci_full = forecast_one_country({}, country, cumulative_cases, dates_,
methods, kwargs_list, names, smoothing_fun,
datasource, H=H, return_val=True, saveplot=False, newly=True)
#---------point forecast---------------------------------
smoothed = np.ravel(return_dict[country][-2]["daily_smoothed"].values[::-1].copy())
weekly_forecast = np.sum(smoothed[-7:])
target_date = return_dict[country][-2]["date"].values[0]
forecast = forecast.append(pd.DataFrame([[country, target_date, weekly_forecast]], columns=forecast.columns), ignore_index=True)
#---------"probabilistic" forecast------------------------
if len(ci_full)>0:
forecast_ci = forecast_ci.append(ci_full[ci_full["horizon"]=="w"+str(int(H/7))], ignore_index=True)
#---------target------------------------------------------ d
daily_target = np.diff(cumulative_target_)
# weekly_target = np.sum(daily_target[-7:])
weekly_target = 7*np.median(daily_target[-7:])
target_date_ = dates_target_[-1]
target = target.append(pd.DataFrame([[country, target_date_, weekly_target]], columns=target.columns), ignore_index=True)
target_path = path_save + "Target/Target"+"_"+str(H)+"_" + str(date)[:10]+ ".csv"
forecast_ci_path = path_save + "CI/Forecast_CI_h" + str(H)+"_TrendModel_" + str(date)[:10]+".csv"
forecast_path = path_save + "Point/Forecast_point_h"+ str(H)+"_TrendModel_" + str(date)[:10]+ ".csv"
target.to_csv(target_path)
forecast_ci.rename(columns={"date": "target_date"}).to_csv(forecast_ci_path)
forecast.to_csv(forecast_path)
print(date, " finished")
if __name__ == '__main__':
#------setup--------------------------------------------------
nthreads = 10#0
starting_time = "2020-04-01"
end_time = "2021-12-15"
#-------------------------------------------------------------
start_date = datetime.datetime.strptime(starting_time, "%Y-%m-%d")
end_date = datetime.datetime.strptime(end_time, "%Y-%m-%d")
dates = pd.date_range(start_date, end_date, freq='d')
methods,kwargs_list,names,cv_flag = get_methods_params([3],False)
retro_data_info = pd.read_csv("data/JHU_data_links.csv")
retro_data_info.columns = ["date"] + list(retro_data_info.columns)[1:]
print(retro_data_info)
#-----------------full scenario---------------------------------
horisons = [7,14]
data_cols = ["global-confirmed", "US-deaths"]
countries_list = [countries_JHU, countries_US]
smoothing_funcs = {"cases": [(piecewise_STL,"")],
"deaths":[(piecewise_STL,"")]}
# -----------------------scenario JHU deaths----------------
#horisons = [7,14]
#data_cols = ["global-deaths"]
#countries_list = [countries_JHU]
#smoothing_funcs = {"deaths":[(piecewise_STL,"")]}
# ----------------------------------------------------------------
processes = []
manager = multiprocessing.Manager()
counter = 0
for H in horisons:
for data_col, countries in zip(data_cols, countries_list):
datasource, parse_column, typedata = parse_col_links(data_col)
for (smoothing_fun, method_addon) in smoothing_funcs[typedata]:
for ii,date in enumerate(dates):
counter+=1
p = multiprocessing.Process(
target=save_retrospective_predictions,
args=(date, data_col, countries, [3],
smoothing_fun, H, False, "data/paper/", typedata, method_addon))
processes.append(p)
p.start()
if counter%nthreads==0:
for process in processes:
process.join()
processes = []
manager = multiprocessing.Manager()
for process in processes:
process.join() |
<gh_stars>1000+
// Copyright (c) 2018-2021, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the sources of this project regarding your
// rights to use or distribute this software.
package docs
// Plugin command usage.
const (
PluginUse string = `plugin [plugin options...]`
PluginShort string = `Manage Singularity plugins`
PluginLong string = `
The 'plugin' command allows you to manage Singularity plugins which
provide add-on functionality to the default Singularity installation.`
PluginExample string = `
All group commands have their own help output:
$ singularity help plugin compile
$ singularity plugin list --help`
)
// Plugin compile command usage.
const (
PluginCompileUse string = `compile [compile options...] <host_path>`
PluginCompileShort string = `Compile a Singularity plugin`
PluginCompileLong string = `
The 'plugin compile' command allows a developer to compile a Singularity
plugin in the expected environment. The provided host directory is the
location of the plugin's source code. A compiled plugin is packed into a SIF file.`
PluginCompileExample string = `
$ singularity plugin compile $HOME/singularity/test-plugin`
)
// Plugin install command usage.
const (
PluginInstallUse string = `install <plugin_path>`
PluginInstallShort string = `Install a compiled Singularity plugin`
PluginInstallLong string = `
The 'plugin install' command installs the compiled plugin found at plugin_path
into the appropriate directory on the host.`
PluginInstallExample string = `
$ singularity plugin install $HOME/singularity/test-plugin/test-plugin.sif`
)
// Plugin uninstall command usage.
const (
PluginUninstallUse string = `uninstall <name>`
PluginUninstallShort string = `Uninstall removes the named plugin from the system`
PluginUninstallLong string = `
The 'plugin uninstall' command removes the named plugin from the system`
PluginUninstallExample string = `
$ singularity plugin uninstall example.org/plugin`
)
// Plugin list command usage.
const (
PluginListUse string = `list [list options...]`
PluginListShort string = `List installed Singularity plugins`
PluginListLong string = `
The 'plugin list' command lists the Singularity plugins installed on the host.`
PluginListExample string = `
$ singularity plugin list
ENABLED NAME
yes example.org/plugin`
)
// Plugin enable command usage.
const (
PluginEnableUse string = `enable <name>`
PluginEnableShort string = `Enable an installed Singularity plugin`
PluginEnableLong string = `
The 'plugin enable' command allows a user to enable a plugin that is already
installed in the system and which has been previously disabled.`
PluginEnableExample string = `
$ singularity plugin enable example.org/plugin`
)
// Plugin disable command usage.
const (
PluginDisableUse string = `disable <name>`
PluginDisableShort string = `disable an installed Singularity plugin`
PluginDisableLong string = `
The 'plugin disable' command allows a user to disable a plugin that is already
installed in the system and which has been previously enabled.`
PluginDisableExample string = `
$ singularity plugin disable example.org/plugin`
)
// Plugin inspect command usage.
const (
PluginInspectUse string = `inspect (<name>|<image>)`
PluginInspectShort string = `Inspect a singularity plugin (either an installed one or an image)`
PluginInspectLong string = `
The 'plugin inspect' command allows a user to inspect a plugin that is already
installed in the system or an image containing a plugin that is yet to be installed.`
PluginInspectExample string = `
$ singularity plugin inspect sylabs.io/test-plugin
Name: sylabs.io/test-plugin
Description: A test Singularity plugin.
Author: Sylabs
Version: 0.1.0`
)
// Plugin create command usage.
const (
PluginCreateUse string = `create <host_path> <name>`
PluginCreateShort string = `Create a plugin skeleton directory`
PluginCreateLong string = `
The 'plugin create' command allows a user to creates a plugin skeleton directory
structure to start development of a new plugin.`
PluginCreateExample string = `
$ singularity plugin create ~/myplugin github.com/username/myplugin
$ ls -1 ~/myplugin
go.mod
main.go
singularity_source
`
)
|
// CacheFile stores the file in the cache path
func CacheFile(file string, img *Image, cfg *Config) {
f, err := os.Create(cfg.CachePath + "/" + file)
if err == nil {
defer f.Close()
img.Write(f)
if cfg.Verbose {
fmt.Println("vermittler: storing file `" + file + "` in cache")
}
} else {
panic(err.Error())
}
} |
So around the time Warner Bros. announced that Justice League was coming as the follow-up to Batman V Superman: Dawn of Justice, word came down that there were nine films currently in development at various stages at Warner Bros. Obviously, we already know a couple of them...and there will likely be at least one more announced during the Warner Bros. panel at San Diego Comic Con International this summer. But...what else is in development? We looked back at our master list of what's with whom, sprinkled in some common sense and here are what we figure to be the nine most likely films in development right now at Warner Bros. Of course, the first two are gimmes...but it's not totally clear that there are only nine in development, or nine beyond the two already named. So for the sake of argument, we're making a list of eleven here and will only glance over the two everyone already knows about. Batman v Superman: Dawn of Justice and Justice League We already know these films are in the pipeline. Dawn of Justice is shooting right now, to be followed up by Justice League, for which it's setting the stage by establishing at least four Justice League members that we know of (Batman, Superman, Wonder Woman and Cyborg, who has also been cast). Batman Someone clever recently said that there's always a Batman movie in development at Warner Bros. and, given the value of Batman as a franchise and the reported duration of Ben Affleck's contract to play the character, it seems a given that Batman v Superman isn't the only one we'll be getting soon. Affleck's older, more world-weary Batman gives the filmmakers the opportunity to jump into the deep end, using his appearances in Dawn of Justice and Justice League as all you really need to know and avoiding an origin story altogether since this is, after all, the second reboot in 20 years. And, yes, we've heard the same rumors of Affleck (who won an Academy Award for Best Picture just prior to signing on to play Batman) will direct the first Batman solo feature after Man of Steel. It wouldn't be surprising if that turned out to be true, especially since at one point not that long ago, Affleck was quoted as saying that he was so much more interested in directing these days than he was in acting that in most cases he'd rather just act in films he's already directing. Odds of a Kevin Smith pass at the script? 4:1. Wonder Woman Yes, it's true -- the same report that said Justice League was coming also said there was no Wonder Woman solo film. We know. But we also know there's simply no way that's true. There's been enormous pressure on Warner Bros. and DC Entertainment to get Wonder Woman right for a while. There's been a failed TV pilot and another series that almost went to pilot before being cancelled just in the last five years. And they've already got an actress cast who's the perfect combination of recognizable to casual fans but not famous enough to demand a ton of money. Rumor is they've locked up Gal Gadot for a bunch of pictures including at least one solo Wonder Woman film. None of this points to a character who isn't being groomed for her own movie. Dark Universe While it wasn't mentioned when The Wall Street Journal went live with Justice League information, Dark Universe is basically the supernatural companion to that film. Based on a number of characters who appear in DC Comics's Justice League Dark, the film is expected from Pacific Rim and Hellboy director Guillermo del Toro and will feature Constantine, Deadman, Swamp Thing, Zatanna and more. Here's the problem: With John Constantine headed to NBC for a TV series and del Toro frequently taking years to deliver on any given project, this one may be classified as "in development" but is almost certainly not going to happen for at least four years. Metal Men Barry Sonnenfeld of Men in Black fame has been working on this forever. The exact status of the script and whether it's actually still a priority for anyone isn't clear, but it was one of the movies specifically referenced as in development in the Wall Street Journal. Shazam A project which, like Metal Men, seemed to have died on the vine...but that The Wall Street Journal still classifies as happening. Suddenly we've got people thinking that maybe The Rock is back into this film, in which he was once expected to play Black Adam before the whole thing fell apart. Aquaman This is a project that Geoff Johns, Chief Creative Officer of DC Entertainment and Executive Producer of Green Lantern, Arrow and The Flash, really would like to see happen, and while the character may be a joke to mainstream audiences, his name is a familiar one and Warners seems convinced that it's a potentially valuable IP. There was already a much-loved pilot made for The CW and made available via iTunes when it didn't air. Now, there's a best-selling comic and a Justice League movie coming. It seems virtually guaranteed this is going to happen. 100 Bullets This has been discussed as a cable/pay TV miniseries before (David Goyer was expected to do it at Showtime), but The Wall Street Journal has it down as a movie adaptation. Not surprising, since it isn't as though Goyer has a ton of free time right now. 100 Bullets, like Fables and Sandman after it, have creator participation; it's based on a critically-acclaimed Vertigo series and won't tie into the DC Cinematic Universe that will see Man of Steel crossing over with other Justice League-related films. Fables This one has been in development on and off for years, but it's basically stuck in movies-or-nothing mode right now because ABC, after passing on the book, made something remarkably similar in the form of Once Upon a Time. Now, like when visuals from Grant Morrison's The Invisibles were echoed in The Matrix, it's kind of stuck between a rock and a hard place because people saw the one that came second, first. Sandman Joseph Gordon-Levitt is attached to produce with rumors that either he or screenwriter David S. Goyer will direct. Neil Gaiman is attached as a consultant of some kind...and JGL also might star. That's literally everything we know about this project, which is probably more real than almost anything else on the list. |
Jake “The Snake” Roberts is eating a hamburger. He’s sitting down, slouching a bit to his right, maybe, but you can tell how tall he is. His fast food takeout bag is wadded up on the table in front of him, on top of his 8 x 10 glossies. He grins to himself between chews. A fan approaches for a photo — one that he’ll pay probably $20 for — and Jake leans in, nods kindly at whatever reminiscence the fan shares with him, and then they pose together, comically stone-faced, while a buddy takes a picture on a digital camera. Jake is still holding his hamburger.
It’s around this time that I think to myself, Good god, I’m really at WrestleMania.
Not literally, of course, not at that moment. I was at WrestleReunion, a non-WWE-sponsored pro wrestling autograph convention held in a hotel conference room in Miami Beach. It was 85 degrees and sunny outside, the sort of day in which tourists normally crowd the beach, and yet hundreds of out-of-town fans were crammed into the hotel lobby waiting to meet their childhood idols. Wrestlers of all vintage were there — old Georgia guys like The Masked Superstar, Stan Hansen, Nikita Koloff, Larry Zbyszko, and Kevin Sullivan; ECW guys like Tommy Dreamer, Sabu, and Rhino; WWF guys like Greg “The Hammer” Valentine, Brutus “The Barber” Beefcake, “Mr. Wonderful” Paul Orndorff, Kevin Nash, and Ahmed Johnson, who I suspect gets trotted out at these events as a grim spectacle of obscene weight gain. For galling weight loss, fans pivot left, toward Lex Luger, who has become diminished and atrophied by a stroke and subsequent paralysis. Bobby “The Brain” Heenan’s face has been ravaged by cancer surgeries, but fans so desperately want to meet the man who functionally introduced humor and snark into the WWF that there’s no feeling of “stunt-booking,” as they say in the biz.
To Heenan’s right, behind a cluster of anxious thirtysomething fanboys, was a table of “divas,” as WWE calls them — Torrie Wilson, Mickie James, Daffney, and Diana Hart Smith, who for some reason was wearing a pageant dress and sash. “Was she Miss Canada or something?” I wonder aloud. The guy next to me, in a CM Punk shirt, shrugs his shoulders and goes back to ogling Mickie James.
In the back of the room, Gangrel, a wrestling vampire of Attitude Era prominence, was asleep sitting up. Or meditating, I guess. A fan approached him tentatively, not quite sure what to do, and Gangrel sprang to life, like somebody pulled the cord in his back. A table over, Valentine sat glumly next to his wife, with his bleach-blond tresses a dangling frame around his boxer’s mug. In his glory days, he’d wear a sequined robe to the ring, but Saturday he sported a white T-shirt and looked like an aging roadie. To his left, Beefcake posed with a fan, letting her hold his infamous candy-striped hedge clippers. Without the shears you might not even recognize him; his hair was close-cropped and lighter than in his heyday, and his skin was dark and reddish, like a dockworker’s.
A gigantic man with a reddish-grey goatee and a Kangol hat walked through the crowd with a rolling suitcase. It was Vader, and despite his size, nobody noticed him. Away from the big stage, these guys look surprisingly human; without the folding table and the glossy photos, nobody notices you at all. If WrestleMania is where history is made, as WWE often says, WrestleReunion is where history hangs out on sofas in the hotel lobby.
I had my picture taken with the New Age Outlaws — god, Billy Gunn was huge — and gawked at Shelly Martinez, and ended up talking with Colt Cabana. Cabana is probably the most famous indie wrestler in the world, although this is certainly up for debate. He’s a buddy of CM Punk who had a short and ill-fated run in WWE as Scotty Goldman, the wrestling Jew. He now tours the world, working in indie promotions like Ring of Honor, and he records one of the Web’s great wrestling treasures: the Art of Wrestling podcast. He chuckled over my shoulder at the specter of Jake Roberts — who had arisen from his folding chair and looked more or less like a beer keg on stilts — hitting on some woman. Another day, these sights might have seemed sad, but this was WrestleMania weekend, and Jake is a legend. I got to see him hit on a woman and eat a McDonald’s hamburger, and that’s more than I could have hoped for.
The night before, I found myself at Ft. Lauderdale’s War Memorial Auditorium, watching Ring of Honor’s “Showdown in the Sun” event. Like a lot of indie promotions, ROH follows WrestleMania to town to take advantage of the concentration of wrestling fans. In pro wrestling’s pre-WWF days, shows were held in VFW auditoriums and bingo halls, and that ROH event — with its old-school, NWA-meets-ECW vibe — made me feel like I’d climbed into a time machine. The show was glorious, not least because of the crowd, who, as with most ROH shows, seemed to show up primarily to take part in semi-ironic chants. Two fans behind me chattered in Dutch throughout the show, and yet they chanted louder than anybody else in perfect, unaccented English. When Maria Kanellis — former WWE sexpot and the real-life ex-girlfriend of CM Punk — sauntered out with her new boyfriend, Mike Bennett, the guys behind me led the crowd in a hearty “You screwed Punk!” chant. And while I don’t wholly endorse the public shaming of somebody whose only offense was that she happened to have previously been in a relationship with a popular star, I deeply admire their commitment to fandom.
The difference between an ROH show and a WWE show is profound. WWE is high-gloss, heavily produced, and entirely scripted; ROH is sometimes disturbingly realistic and sometimes broadly comical. Production values are not a guiding principle; experience is. While WWE often seems to be deliberately spiting its fans, rejecting their whooped preferences in favor of its own dictates, ROH embraces the fans as an equal partner in the show. This accounts not just for the wrestlers sometimes following crass direction from the audience — “We want tables!” — but also in their sincere concern for the grapplers when a stunt seems to be pushing the envelope — “Please don’t die! Please don’t die!”
There was a great moment toward the end of the card, when the much-beloved El Generico — a (deliberately) fake Mexican luchador — and resident bad boy Kevin Steen brawled out of the ring and onto the stage behind it, which held the most desirable seats in the house. The two guys threw punches under the half-lit house lights, and as they teased a devastating move on the stage’s hard floor, you couldn’t help but see even further back into wrestling history. It was the exhibitionism of the vaudeville stage. If, again, WrestleMania is where history is made, ROH was living history, an interactive time capsule that is frequently more vital than its big-league counterpart.
On Saturday night, WWE embraced its own history at its annual Hall of Fame induction ceremony. The night started strong with John “Bradshaw” Layfield introducing his old tag team partner Ron Simmons, the first black WCW champion, and thus the first black champion of a national promotion, with a poignant and hilarious speech that touched on the history of race in pro sports, in which Simmons’s championship is neatly situated. He closed with a hilarious jab to the Internet era of pro wrestling. Recalling a night when he and Simmons did an 8.6 television rating (the ratings leading up to this year’s Mania hovered around 3.1), he said to the contemporary stars assembled in front of him in their Sunday best, “If one of you puts up an 8.6 against the networks, I’d appreciate it if someone would tweet me.”
Simmons and many of the night’s other inductees — Mil Máscaras, the Four Horsemen, and even Yokozuna — existed in a pro wrestling landscape so different from the current one it’s almost hard to imagine. During the Horsemen’s heyday, up to half of the TV audience would watch them wail on rivals like Dusty Rhodes — who inducted them that night — in tiny television studios, where they put on morality plays for the masses. To see them honored by WWE so sincerely, and to listen to the fans inside AmericanAirlines Arena cheer them so loudly — was touching. If at WrestleReunion fans sought fleeting personal contact with the stars of their childhood, the Hall of Fame ceremony was a night to let history speak, and to shower the inductees with fame for a last time.
There were two other inductees that night: Edge, a modern megastar who was forced by a neck injury to retire immediately after last year’s Mania, and Mike Tyson, who went into the often derided “celebrity wing” of the Hall of Fame. Tyson was joyous, appreciative of the attention, and, unlike other celebrity inductees, he deserved it; his role in the D-Generation X–Steve Austin feud in 1998 played a huge part in WWE getting the better of its rival WCW and surviving the Monday Night Wars. Edge’s induction, on the other hand, was full of melancholy. He was forced abruptly out of his dream job, and although he seemed to take it in stride, the same couldn’t be said for his (real-life) best friend Christian, who cried while inducting him. Edge, though emotional, was resolute, quoting some advice he’d heard: “Decide what to be and go be it. And I did. And I’m a Hall of Famer.”
The only moment more touching than that was when Tully Blanchard, now a minister, spoke during the Horsemen’s induction. “I wake up every day with a little twinge in my back, a little twinge in my neck,” he said, but he wouldn’t change it for the world. Not just the “limousine-riding, jet-flying” life he got to lead, but the connection with the fans, tens of thousands of whom were cheering him on as he spoke: “We are all, all of us, all the way to the top, intertwined.” The audience erupted. On a night dedicated to the performers, the performers, almost to a one, dedicated the night to the fans.
Walking into Sun Life Stadium, I was overwhelmed by the crowd. I elbowed my way to my seat — I was on the floor, 75 rows or so from the ring — and I turned around, feeling the masses pulse around me. It’s almost unsettling, all those people amped up, standing in disregard for the folding chairs set up in rows atop what would have been Astroturf on another night. But we were all together in the mob that night. I was in league with the tattooed guy from L.A. to my left, the Irish guy in front of us, the loudmouth Kane fan to his right, and the 8-year-old girl to my right and her brother, single-mindedly determined to get his “If Cena Wins, We Riot” sign onto TV. That’s the fan’s meager validation in the WWE universe — they don’t often listen to your chants, but if the cameras catch glimpse of you, you’ve made your tiny place in history.
When Sheamus came out to open the show and dispatched WWE World Heavyweight Champ Daniel Bryan in mere seconds, the Irish guy in front of me stood up on his seat, Ireland flag draped around his shoulders, and screamed heartily. We all screamed with him. A few matches later, when Kane surprised everyone by beating Randy Orton, the Kane fan went into a seizure of ecstasy. He jumped around, fist-pumping and hugging people, until he broke his chair. (He managed through the rest of the show by sitting at a certain, careful angle.) A while later, the Kane fan’s buddy got a text from his sister, who had been sitting at home monitoring the show. She saw him on TV, she said, in front of some guy’s “If Cena wins, we riot” sign, and she had it saved on DVR. There it was. History.
At WrestleMania 28, the spotlight was trained squarely on making new history. The Rock and John Cena squared off in a “once in a lifetime” match of era supremacy, and the Triple H–Undertaker “Hell in a Cell” match was billed as “the end of an era.” The finish of that match was hardly in doubt — the win would take ‘Taker’s WrestleMania record to a tidy 20-0 — but the match was so well built that it had every fan breathless. Special referee Shawn Michaels (Triple H’s pal and one of Undertaker’s most notable foes) fell victim to an Undertaker choke hold when he came close to calling the match to end the punishment suffered by a decimated ‘Taker. Michaels later reciprocated by superkicking Undertaker, and when Triple H followed up with his signature Pedigree, every fan thought for a second that it could really be over. It wasn’t. ‘Taker won, and after the match, the three men helped each other back up the ramp to the back. They paused, just for a moment, at the top of the stage, and the Undertaker nodded at the crowd, and it almost seemed that the three men would take a bow. Instead, ‘Taker turned and, in the most really real moment of the night, he hugged his erstwhile enemies. Cheers of thanks filled the stadium. If that was the end of the Undertaker’s illustrious career, it was a fitting moment.
When The Rock and John Cena came out for their match, it almost felt like there was nothing they could do to top “Hell in a Cell” or the night’s CM Punk–Chris Jericho wrestling clinic, but they did. When Cena emerged from the back, the masses booed lustily. Miami is Rock’s hometown, and the sort of fans who spend good money to travel long distances to WrestleMania are exactly the kind of fans who love to hate Cena. Once the match started, however, the power of the moment overtook the jeers. There were cheers (mostly for Rock) and boos (mostly for Cena), but the greater feeling was one of being part of something important.
I don’t know if that feeling conferred itself to people watching on pay-per-view; by the responses I’ve seen, I assume it didn’t. But for the fans who watched those two icons live, the monotony of Cena and Rock’s yearlong feud faded away and was replaced by pure spectacle. The consensus going into the match was that Cena would probably win — he’s the one signed to a long-term WWE contract, after all — or that, if he lost, it would be due to some interference that WWE would use to set up his next feud. Instead, The Rock won cleanly, decisively, and the fans were stunned in the best possible way.
Around us, crowds were chanting: “Rocky! Rocky! Rocky!”
WWE had given us what we had asked for and what few of us were expecting. It was shocking. We stumbled out, all 78,000 of us, into the parking lot. There was no tailgate, no after-party. There was only a long drive back to a hotel room. Fans whooped with what energy they had left, dwindling howls after a long, memorable weekend.
I guess we won’t know if WrestleMania 28 was truly “historic” until at least a few years have passed. But however it shakes out, we were a part of it. |
<gh_stars>0
"""@package
This package enables the project usage for the database.
"""
import re
from datetime import date
from src.models.type import Type
from src.models import EmployeeDataAccess, GuideDataAccess, LikeDataAccess
def extract_text(html):
"""
Removes the tags from a HTML string.
:param html: The HTML to refactor.
:return: The refactored HTML string.
"""
return re.sub(extract_text.regex, "", html)
"""Compile regex only once to increase speed"""
extract_text.regex = re.compile("<.*?>", re.IGNORECASE)
class Project:
"""
This class defines a project.
"""
def __init__(self, project_id, title, max_students, description_id, research_group, is_active, last_updated,
view_count, extension, creation_date=date.today().strftime("%Y-%m-%d")):
"""
Project initializer.
:param project_id: The project ID.
:param title: The title of the project.
:param max_students: The maxumum amount of student that can participate in the project.
:param description_id: The ID of the document containing the desciption.
:param research_group: The ID of the connected research group.
:param is_active: Active status of the project.
:param last_updated: Timestamp when the project was last updated.
:param view_count: Amount of views the project has.
:param extension: Boolean to indicate whether an extension to next year is needed.
"""
"""Columns in Project table"""
self.project_id = project_id
self.title = title
self.max_students = max_students
self.description_id = description_id
self.research_group = research_group
self.is_active = is_active
self.last_updated = last_updated
self.view_count = view_count
self.extension = extension
self.creation_date = creation_date
"""Data from other tables"""
self.html_content_eng = None
self.html_content_nl = None
self.tags = None
self.types = None
self.employees = None
self.registrations = None
self.attachments = None
self.liked = False
def to_dict(self):
"""
Converts object to a dictionary.
:return: Dictionary of the object data.
"""
value = vars(self)
if type(self.employees) is list:
value["employees"] = [obj.to_dict() for obj in self.employees]
value['last_updated'] = value['last_updated'].timestamp()
return value
class ProjectDataAccess:
"""
This class interacts with the Project component of the database.
"""
def __init__(self, dbconnect):
"""
Initiates the ProjectDataAccess object.
:param dbconnect: The database connection.
"""
self.dbconnect = dbconnect
def get_project_ids(self, active_only=False): # TODO #2 error for empty fetch
"""
Fetches all the project ID's from the database.
:param active_only: Indicate whether the ID's of only active projects are needed.
:return: List of project ID's
"""
cursor = self.dbconnect.get_cursor()
if active_only:
cursor.execute('SELECT project_id FROM project WHERE is_active = TRUE')
else:
cursor.execute('SELECT project_id FROM project')
return [row[0] for row in cursor]
def get_projects(self, active_only, details=False): # TODO #2 error for empty fetch
"""
Fetches all the projects and their data.
:param active_only: Indicate whether the ID's of only active projects are needed.
:param details: Indicate whether the full description and employee list is needed.
:return: A list with project objects.
"""
projects = list()
for project_id in self.get_project_ids(active_only):
project = self.get_project(project_id, active_only)
if not details:
self.minimize_project(project)
projects.append(project)
return projects
@staticmethod
def minimize_project(project):
"""Remove tags and cut the html to 400 chars"""
if project.html_content_nl is not None:
project.html_content_nl = extract_text(project.html_content_nl)[0:400]
if project.html_content_eng is not None:
project.html_content_eng = extract_text(project.html_content_eng)[0:400]
new_guides = dict()
for guide in project.employees:
guidance = guide.guidance_type
"""Add list if not present"""
if not new_guides.get(guidance):
new_guides[guidance] = []
# Add name
new_guides[guidance].append(guide.employee.name)
project.employees = new_guides
def get_project(self, project_id, active_only):
"""
Fetches all the data of a given project.
:param project_id: The project ID to fetch info for.
:param active_only: Fetch only active projects.
:return: A list with project objects.
"""
"""Get all the project data"""
cursor = self.dbconnect.get_cursor()
"""Data from project table"""
cursor.execute('SELECT project_id, title, max_students, description_id, research_group, is_active, '
'last_updated, view_count, extension_needed, creation_date FROM project'
' WHERE project_id=%s', (project_id,))
row = cursor.fetchone()
project = Project(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9])
"""Types"""
types = list()
for project_type in self.get_project_types(project_id):
if not active_only or project_type.is_active:
types.append(project_type.type_name)
project.types = types
"""Tags"""
project.tags = self.get_project_tags(project_id)
"""Get guides, add employee info"""
guides = GuideDataAccess(self.dbconnect).get_guides_for_project(project_id)
for guide in guides:
guide.employee = EmployeeDataAccess(self.dbconnect).get_employee(guide.employee)
project.employees = guides
"""Registrations"""
cursor.execute('SELECT student, name, status, type, date FROM project_registration JOIN student s on '
'project_registration.student = s.student_id WHERE project=%s', (project_id,))
registrations = list()
for row in cursor:
registrations.append({"student_nr": row[0], "name": row[1], "status": row[2], "type": row[3],
"last_updated": row[4]})
project.registrations = registrations
"""Descriptions"""
cursor.execute('SELECT html_content_eng, html_content_nl FROM document WHERE document_id = %s',
(project.description_id,))
row = cursor.fetchone()
project.html_content_eng = row[0]
project.html_content_nl = row[1]
"""Attachments"""
cursor.execute('SELECT name, file_location FROM attachment WHERE document_id=%s', (project.description_id,))
attachments = list()
for row in cursor:
attachments.append({'name': row[0], 'file_location': row[1]})
project.attachments = attachments
return project
def get_project_types(self, project_id):
"""
Fetches the types for a given project.
:param project_id: The project ID to fetch the types for.
:return: A list of type objects.
"""
cursor = self.dbconnect.get_cursor()
cursor.execute('SELECT type, t.is_active FROM project_has_type JOIN type t '
'on project_has_type.type = t.type_name WHERE project=%s', (project_id,))
return [Type(row[0], row[1]) for row in cursor]
def get_project_tags(self, project_id):
"""
Fetches the tags for a given project.
:param project_id: The project ID to fetch the tags for.
:return: A list of tags names.
"""
cursor = self.dbconnect.get_cursor()
cursor.execute('SELECT tag FROM project_has_tag WHERE project=%s', (project_id,))
return [row[0] for row in cursor]
def get_most_viewed_projects(self, nr_of_projects, active_only):
"""
Fetches the top most viewed projects.
:param nr_of_projects: The length of the top.
:param active_only: Only fetch active projects.
:return: A list with project objects.
"""
cursor = self.dbconnect.get_cursor()
if active_only:
cursor.execute('SELECT project_id FROM project WHERE is_active = true ORDER BY view_count DESC')
else:
cursor.execute('SELECT project_id FROM project ORDER BY view_count DESC')
projects = list()
i = 0
for row in cursor:
if i >= nr_of_projects:
break
projects.append(self.get_project(row[0], active_only))
i += 1
return projects
def update_search_index(self):
cursor = self.dbconnect.get_cursor()
cursor.execute('REFRESH MATERIALIZED VIEW search_index; ')
self.dbconnect.commit()
def search(self, search_query, active_only):
"""
Fetches the searched projects.
:param search_query: The search query.
:param active_only: Only fetch active projects.
:return: A list with project ID's.
"""
cursor = self.dbconnect.get_cursor()
if active_only:
cursor.execute("SELECT project_id, ts_rank(document, plainto_tsquery('english', %s)) "
"FROM search_index "
"WHERE document @@ plainto_tsquery('english', %s) AND is_active = true "
"ORDER BY ts_rank(document, plainto_tsquery('english', %s)) DESC;",
(search_query, search_query, search_query))
else:
cursor.execute("SELECT project_id, ts_rank(document, plainto_tsquery('english', %s)) "
"FROM search_index "
"WHERE document @@ plainto_tsquery('english', %s) "
"ORDER BY ts_rank(document, plainto_tsquery('english', %s)) DESC;",
(search_query, search_query, search_query))
search_results = list()
for row in cursor:
search_results.append({"id": row[0], "rank": row[1]})
projects = []
for result in search_results:
project = self.get_project(result["id"], active_only)
self.minimize_project(project)
project = project.to_dict()
project["recommendation"] = result['rank']
projects.append(project)
return projects
def get_oldest_and_newest(self):
"""
Fetches the oldest and newest timestamp from the last_updated attribute.
:return: The oldest and newest timestamp.
"""
cursor = self.dbconnect.get_cursor()
cursor.execute('SELECT last_updated FROM project ORDER BY last_updated DESC LIMIT 1')
newest = cursor.fetchone()[0]
cursor.execute('SELECT last_updated FROM project ORDER BY last_updated ASC LIMIT 1')
oldest = cursor.fetchone()[0]
return oldest, newest
def add_project(self, obj):
"""
Adds a project to the database.
:param obj: The new project object.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('INSERT INTO Project(title, max_students, description_id, research_group, '
'is_active, extension_needed, creation_date) VALUES(%s,%s,%s,%s,%s,%s, CURRENT_DATE)',
(obj.title, obj.max_students, obj.description_id,
obj.research_group, obj.is_active, obj.extension))
# Get id and return updated object
cursor.execute('SELECT LASTVAL()')
iden = cursor.fetchone()[0]
obj.project_id = iden
self.dbconnect.commit()
return obj
except:
self.dbconnect.rollback()
raise
def add_view_count(self, project_id, amount):
"""
Increments the project view counter.
:param project_id: The project ID to increment the counter for.
:param amount: The amount to increment the counter with
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
cursor.execute('SELECT view_count FROM project WHERE project_id=%s', (project_id,))
count = cursor.fetchone()[0] + amount
try:
cursor.execute('UPDATE project SET view_count = %s WHERE project_id=%s', (count, project_id))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
def add_type(self, project_id, project_type):
"""
Adds a type to a project in the database.
:param project_id: The project to add a type for.
:param project_type: The new project type.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('INSERT INTO project_has_type(project, type) VALUES(%s,%s)',
(project_id, project_type))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
# def add_active_year(self, project_id, year):
# """
# Links a project with an academic year.
# :param project_id: The project to link with a year.
# :param year: The year to link.
# :raise: Exception if the database has to roll back.
# """
# cursor = self.dbconnect.get_cursor()
# try:
# cursor.execute('INSERT INTO project_has_year(project, year) VALUES(%s,%s)',
# (project_id, year))
# self.dbconnect.commit()
# except:
# self.dbconnect.rollback()
# raise
def add_project_tag(self, project_id, tag):
"""
Add a tag to a project.
:param project_id: The project to add a tag for.
:param tag: The new tag.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('INSERT INTO project_has_tag(project, tag) VALUES(%s,%s)',
(project_id, tag))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
def set_research_group(self, project_id, group_id):
"""
Sets the research group of a given project.
:param project_id: The project ID to set the research group for.
:param group_id: The new research group ID.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('UPDATE project SET research_group = %s WHERE project_id = %s', (group_id, project_id))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
def set_active(self, project_id, active):
"""
Sets the active status of a project.
:param project_id: The project ID to update the status for.
:param active: The new status of the project.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('UPDATE project SET is_active = %s WHERE project_id = %s', (active, project_id))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
def update_project(self, project_id, title, max_students, research_group, is_active):
"""
Updates the info for a project.
:param project_id: The project ID to update the info for.
:param title: The new title.
:param max_students: The new maxumum amount of students that can register.
:param research_group: The new research group.
:param is_active: The new activity status of the group.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute(
'UPDATE project SET title = %s, max_students = %s, research_group = %s, is_active = %s, last_updated = NOW() '
'WHERE project_id=%s',
(title, max_students, research_group, is_active, project_id))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
# def mark_all_projects_for_extension(self):
# """
# Marks all active projects for extension.
# :raise: Exception if something went wrong when updating the database.
# """
# cursor = self.dbconnect.get_cursor()
# try:
# cursor.execute('UPDATE project SET extension_needed = TRUE WHERE is_active = TRUE')
# self.dbconnect.commit()
# except:
# self.dbconnect.rollback()
# raise
# def extend_project(self, project_id):
# """
# Extend a project to the next year.
# :param project_id: The project to update.
# :raise: Exception if the database has to roll back.
# """
# cursor = self.dbconnect.get_cursor()
# try:
# cursor.execute('UPDATE project SET extension_needed = FALSE WHERE project_id=%s', (project_id,))
# self.dbconnect.commit()
# except:
# self.dbconnect.rollback()
# raise
def remove_tags(self, project_id): # TODO move to tag file?
"""
Removes all the tags from a project in the database.
:param project_id: The project to remove all tags from.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('DELETE FROM project_has_tag WHERE project=%s', (project_id,))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
def remove_tag(self, project_id, tag): # TODO move to tag file?
"""
Adds a tag to a project in the database.
:param project_id: The project to add a tag for.
:param tag: The tag to remove from the project.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('DELETE FROM project_has_tag '
'WHERE project=%s AND tag=%s;',
(project_id, tag))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
def remove_types(self, project_id): # TODO move to type file?
"""
Removes all types from a project in the database.
:param project_id: The project to remove all types for.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('DELETE FROM project_has_type WHERE project=%s', (project_id,))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
def remove_type(self, project_id, project_type):
"""
Removes a type from a project in the database.
:param project_id: The project to remove a type from.
:param project_type: The type to remove from the project.
:raise: Exception if the database has to roll back.
"""
cursor = self.dbconnect.get_cursor()
try:
cursor.execute('DELETE FROM project_has_type '
'WHERE project=%s AND type=%s;',
(project_id, project_type))
self.dbconnect.commit()
except:
self.dbconnect.rollback()
raise
# def delete_project_extension(self, project_id):
# """
# Sets a project to inactive and makes it so that an extension is not needed anymore.
# :param project_id: The project to update.
# :raise: Exception if the database has to roll back.
# """
# cursor = self.dbconnect.get_cursor()
# try:
# cursor.execute('UPDATE project SET extension_needed = %s, is_active = FALSE WHERE project_id=%s',
# (False, project_id))
# self.dbconnect.commit()
# except:
# self.dbconnect.rollback()
# raise
# def enforce_extensions(self):
# """
# Sets all projects where an extension was needed to inactive
# :raise: Exception if the database has to roll back.
# """
# cursor = self.dbconnect.get_cursor()
# try:
# cursor.execute('UPDATE project SET extension_needed = FALSE, is_active = FALSE WHERE extension_needed = TRUE')
# self.dbconnect.commit()
# except:
# self.dbconnect.rollback()
# raise
|
a,b,c=map(int,input().split())
d={"a":a,"b":b,"c":c}
for i in range(int(input())+1):
if d["a"]<d["b"]<d["c"]:
print("Yes")
exit()
elif d["a"]>=d["c"]: d["c"]*=2
elif d["a"]>=d["b"]: d["b"]*=2
elif d["b"]>=d["c"]: d["c"]*=2
print("No")
|
<gh_stars>0
package betterquesting.client.gui2.tasks;
import betterquesting.api.api.QuestingAPI;
import betterquesting.api2.client.gui.misc.GuiAlign;
import betterquesting.api2.client.gui.misc.GuiRectangle;
import betterquesting.api2.client.gui.misc.GuiTransform;
import betterquesting.api2.client.gui.misc.IGuiRect;
import betterquesting.api2.client.gui.panels.CanvasMinimum;
import betterquesting.api2.client.gui.panels.content.PanelFluidSlot;
import betterquesting.api2.client.gui.panels.content.PanelTextBox;
import betterquesting.api2.client.gui.themes.presets.PresetColor;
import betterquesting.api2.utils.QuestTranslation;
import betterquesting.core.BetterQuesting;
import betterquesting.questing.tasks.TaskFluid;
import mezz.jei.Internal;
import mezz.jei.api.recipe.IFocus.Mode;
import mezz.jei.gui.Focus;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.Optional.Method;
import java.util.UUID;
public class PanelTaskFluid extends CanvasMinimum {
private final IGuiRect initialRect;
private final TaskFluid task;
public PanelTaskFluid(IGuiRect rect, TaskFluid task) {
super(rect);
this.initialRect = rect;
this.task = task;
}
@Override
public void initPanel() {
super.initPanel();
int listW = initialRect.getWidth();
UUID uuid = QuestingAPI.getQuestingUUID(Minecraft.getMinecraft().player);
int[] progress = task.getUsersProgress(uuid);
boolean isComplete = task.isComplete(uuid);
String sCon = (task.consume ? TextFormatting.RED : TextFormatting.GREEN) + QuestTranslation.translate(task.consume ? "gui.yes" : "gui.no");
this.addPanel(new PanelTextBox(new GuiTransform(GuiAlign.TOP_EDGE, 0, 0, listW, 12, 0), QuestTranslation.translate("bq_standard.btn.consume", sCon)).setColor(PresetColor.TEXT_MAIN.getColor()));
for (int i = 0; i < task.requiredFluids.size(); i++) {
FluidStack stack = task.requiredFluids.get(i);
PanelFluidSlot slot = new PanelFluidSlot(new GuiRectangle(0, i * 28 + 12, 28, 28, 0), -1, stack);
if (BetterQuesting.hasJEI) slot.setCallback(this::lookupRecipe);
this.addPanel(slot);
StringBuilder sb = new StringBuilder();
sb.append(stack.getLocalizedName()).append("\n");
sb.append(progress[i]).append("/").append(stack.amount).append("mB\n");
if (progress[i] >= stack.amount || isComplete) {
sb.append(TextFormatting.GREEN).append(QuestTranslation.translate("betterquesting.tooltip.complete"));
} else {
sb.append(TextFormatting.RED).append(QuestTranslation.translate("betterquesting.tooltip.incomplete"));
}
PanelTextBox text = new PanelTextBox(new GuiRectangle(36, i * 28 + 12, listW - 36, 28, 0), sb.toString());
text.setColor(PresetColor.TEXT_MAIN.getColor());
this.addPanel(text);
}
recalculateSizes();
}
@Method(modid = "jei")
private void lookupRecipe(FluidStack fluid) {
if (fluid == null || Internal.getRuntime() == null) return;
Internal.getRuntime().getRecipesGui().show(new Focus<>(Mode.OUTPUT, fluid));
}
}
|
<filename>apiv1/cloud_props_test.go
package apiv1_test
import (
"encoding/json"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/bosh-cpi-go/apiv1"
)
type FakeCPs struct {
CP string `json:"cp1"`
}
var _ = Describe("CloudPropsImpl", func() {
It("allows customized unmarshaling", func() {
var cloudProps CloudPropsImpl
err := json.Unmarshal([]byte(`{"cp1": "cp1-val"}`), &cloudProps)
Expect(err).ToNot(HaveOccurred())
var cp FakeCPs
err = cloudProps.As(&cp)
Expect(err).ToNot(HaveOccurred())
Expect(cp).To(Equal(FakeCPs{CP: "cp1-val"}))
var wrongCP string
err = cloudProps.As(&wrongCP)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("json: cannot unmarshal object into Go value of type string"))
})
It("allows marshaling", func() {
var cloudProps CloudPropsImpl
err := json.Unmarshal([]byte(`{"cp1": "cp1-val"}`), &cloudProps)
Expect(err).ToNot(HaveOccurred())
bytes, err := json.Marshal(cloudProps)
Expect(err).ToNot(HaveOccurred())
Expect(bytes).To(Equal([]byte(`{"cp1":"cp1-val"}`)))
})
})
|
<gh_stars>0
/*
* This file is part of the uv_hal distribution (www.usevolt.fi).
* Copyright (c) 2017 <NAME>.
*
*
* MIT License
*
* Copyright (c) 2019 usevolt
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef HAL_UV_HAL_INC_UI_UV_UIGRAPH_H_
#define HAL_UV_HAL_INC_UI_UV_UIGRAPH_H_
#include <uv_hal_config.h>
#include "uv_utilities.h"
#include "uv_uiobject.h"
/// @file: defines a uigraph module. Uigraph is a graph that draws a graph background
/// and a graph specified by the given values.
#if CONFIG_UI
#ifndef CONFIG_UI_GRAPH_LINE_WIDTH
#error "CONFIG_UI_GRAPH_LINE_WIDTH should define the line width\
used when drawing the graph in pixels"
#endif
typedef struct __attribute__((packed)) {
int16_t x;
int16_t y;
bool interactive;
} uv_uigraph_point_st;
void uv_uigraph_point_init(uv_uigraph_point_st *this,
int16_t x, int16_t y, bool interactive);
typedef struct __attribute__((packed)) {
EXTENDS(uv_uiobject_st);
color_t coordinate_c;
color_t graph_c;
uv_uigraph_point_st *points;
uint16_t points_count;
int16_t active_point;
int16_t min_x;
int16_t min_y;
int16_t max_x;
int16_t max_y;
int16_t current_val_x;
int16_t current_val_y;
bool clicked;
// helper variables that define the content width and height. These are
// calculated in the draw function and stored here, so that they can be used
// in touch function.
int16_t content_w;
int16_t content_x;
int16_t content_h;
char *title;
const uv_uistyle_st *style;
} uv_uigraph_st;
#ifdef this
#undef this
#endif
#define this ((uv_uigraph_st*)me)
/// @brief: Initializes the button
///
/// @param points_buffer: Pointer to an array of *uv_uigraph_point_st* objects,
/// that should define the graph drawn on the screen
/// @param min_x: The minimum value for the X axis, i.e. the left edge
/// @param max_x: The maximum value for the X axis, i.e. the right edge
/// @param min_y: The minimum value for the Y axis, i.e. the bottom edge
/// @param max_y: The maximum value for the Y axis, i.e. the top edge
/// @param style: Pointer to the ui style used
void uv_uigraph_init(void *me, uv_uigraph_point_st *points_buffer,
uint16_t points_count, int16_t min_x, int16_t max_x,
int16_t min_y, int16_t max_y, const uv_uistyle_st *style);
/// @brief: True for one step cycle when the user presses the uigraph
static inline bool uv_uigraph_clicked(void *me) {
return this->clicked;
}
/// @brief: Returns the index number of the selected point. If no points are
/// selected, returns -1.
static inline int16_t uv_uigraph_get_selected_point(void *me) {
return this->active_point;
}
/// @brief: Sets the title text of the uigraph
static inline void uv_uigraph_set_title(void *me, char *str) {
this->title = str;
}
/// @brief: Returns the title if assigned
static inline char *uv_uigraph_get_title(void *me) {
return this->title;
}
/// @brief: Sets the coordinate color of the uigraph
static inline void uv_uigraph_set_coordinate_color(void *me, color_t c) {
this->coordinate_c = c;
}
/// @brief: Returns the uigraph coordinate color
static inline color_t uv_uigraph_get_coordinate_color(void *me) {
return this->coordinate_c;
}
/// @brief: Sets the main color of the uibutton. The button should be refreshed after
/// calling this.
static inline void uv_uigraph_set_graph_color(void *me, color_t c) {
this->graph_c = c;
}
/// @brief: Returns the button main color
static inline color_t uv_uigraph_get_graph_color(void *me) {
return this->graph_c;
}
/// @brief: Sets the current value on the graph. The *val_x* is shown
/// as a vertical line, and *val_y* is shown as a horizontal line.
// To disable any one of these, enter a value smaller than the minimum or bigger than
/// the maximum.
void uv_uigraph_set_current_val(void *me, int16_t val_x, int16_t val_y);
/// @brief: Step function should be called every step cycle
uv_uiobject_ret_e uv_uigraph_step(void *me, uint16_t step_ms);
/// @brief: Draw function. Normally this is called internally but it can also be
/// called when using draw callbacks
void uv_uigraph_draw(void *me, const uv_bounding_box_st *pbb);
void uv_uigraph_touch(void *me, uv_touch_st *touch);
#undef this
#endif
#endif /* HAL_UV_HAL_INC_UI_UV_UIGRAPH_H_ */
|
Pathogenesis of Dyspepsia
Functional dyspepsia (FD) is a highly prevalent and heterogeneous disorder. Although recent studies have investigated various pathophysiological mechanisms, the pathogenesis of FD remains obscure. Pathophysiological mechanisms currently proposed to be involved in FD symptom generation include delayed gastric emptying, impaired gastric accommodation to a meal, hypersensitivity to gastric distention, altered duodenal sensitivity to lipids or acid, abnormal duodenojejunal motility, and others. Pathogenetic factors implicated in the occurrence of FD include genetic susceptibility, Helicobacter pylori status, acute gastrointestinal infections and psychosocial factors. The present article provides an overview of pathogenetic factors, pathophysiologic mechanisms and their potential roles in FD. |
/// Prunes expired deploy information from an individual deploy collection, returns the total
/// deploys pruned
pub(super) fn prune_deploys(
deploys: &mut HashMap<DeployHash, DeployHeader>,
current_instant: Timestamp,
) -> usize {
let initial_len = deploys.len();
deploys.retain(|_hash, header| !header.expired(current_instant));
initial_len - deploys.len()
} |
<filename>code/contract_read_erc20.go
package main
import (
"fmt"
"log"
"math"
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
token "./contracts_erc20" // for demo
)
func main() {
client, err := ethclient.Dial("https://mainnet.infura.io")
if err != nil {
log.Fatal(err)
}
// Golem (GNT) Address
tokenAddress := common.HexToAddress("0x2D170ce1F719476FeC1a92856cf632aE93444b41")
instance, err := token.NewToken(tokenAddress, client)
if err != nil {
log.Fatal(err)
}
address := common.hextoaddress("0x380347b99285a3c7fEE2489A0A6EF9cf018589F1")
bal, err := instance.BalanceOf(&bind.CallOpts{}, address)
if err != nil {
log.Fatal(err)
}
name, err := instance.Name(&bind.CallOpts{})
if err != nil {
log.Fatal(err)
}
symbol, err := instance.Symbol(&bind.CallOpts{})
if err != nil {
log.Fatal(err)
}
decimals, err := instance.Decimals(&bind.CallOpts{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("name: %s\n", name) // "name: Golem Network"
fmt.Printf("symbol: %s\n", symbol) // "symbol: GNT"
fmt.Printf("decimals: %v\n", decimals) // "decimals: 18"
fmt.Printf("wei: %s\n", bal) // "wei: 74605500647408739782407023"
fbal := new(big.Float)
fbal.SetString(bal.String())
value := new(big.Float).Quo(fbal, big.NewFloat(math.Pow10(int(decimals))))
fmt.Printf("balance: %f", value) // "balance: 74605500.647409"
}
|
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright (c) 2020 <NAME>
# Copyright (c) 2020 Instituto Nacional de Tecnologïa Industrial
# License: Apache 2.0
# Project: KiAuto (formerly kicad-automation-scripts)
"""
Tests for eeschema_do miscellaneous stuff.
For debug information use:
pytest-3 --log-cli-level debug
"""
import os
import sys
import logging
# Look for the 'utils' module from where the script is running
script_dir = os.path.dirname(os.path.abspath(__file__))
prev_dir = os.path.dirname(script_dir)
sys.path.insert(0, prev_dir)
# Utils import
from utils import context
sys.path.insert(0, os.path.dirname(prev_dir))
from kiauto.misc import (EESCHEMA_CFG_PRESENT, KICAD_CFG_PRESENT, NO_SCHEMATIC, WRONG_SCH_NAME, EESCHEMA_ERROR,
WRONG_ARGUMENTS)
PROG = 'eeschema_do'
BOGUS_SCH = 'bogus.sch'
def test_eeschema_config_backup(test_dir):
""" Here we test the extreme situation that a previous run left a config
back-up and the user must take action. """
prj = 'good-project'
ctx = context.TestContextSCH(test_dir, 'Eeschema_config_bkp', prj)
# Create a fake back-up
if not os.path.isdir(ctx.kicad_cfg_dir):
logging.debug('Creating KiCad config dir')
os.makedirs(ctx.kicad_cfg_dir, exist_ok=True)
old_config_file = ctx.eeschema_conf + '.pre_script'
logging.debug('Eeschema old config: '+old_config_file)
with open(old_config_file, 'wt') as f:
f.write('Dummy back-up\n')
# Run the command
cmd = [PROG, 'run_erc']
ctx.run(cmd, EESCHEMA_CFG_PRESENT)
os.remove(old_config_file)
m = ctx.search_err('Eeschema config back-up found')
assert m is not None
ctx.clean_up()
def test_kicad_common_config_backup(test_dir):
""" Here we test the extreme situation that a previous run left a config
back-up and the user must take action. """
prj = 'good-project'
ctx = context.TestContextSCH(test_dir, 'Eeschema_common_config_bkp', prj)
# Create a fake back-up
if not os.path.isdir(ctx.kicad_cfg_dir):
logging.debug('Creating KiCad config dir')
os.makedirs(ctx.kicad_cfg_dir, exist_ok=True)
old_config_file = ctx.kicad_conf + '.pre_script'
logging.debug('KiCad common old config: '+old_config_file)
with open(old_config_file, 'wt') as f:
f.write('Dummy back-up\n')
# Run the command
cmd = [PROG, 'run_erc']
ctx.run(cmd, KICAD_CFG_PRESENT)
os.remove(old_config_file)
m = ctx.search_err('KiCad common config back-up found')
assert m is not None
ctx.clean_up()
def test_sch_not_found(test_dir):
""" When the provided .sch isn't there """
prj = 'good-project'
ctx = context.TestContextSCH(test_dir, 'Schematic_not_found', prj)
cmd = [PROG, 'run_erc']
ctx.run(cmd, NO_SCHEMATIC, filename='dummy')
m = ctx.search_err(r'ERROR:.* does not exist')
assert m is not None
ctx.clean_up()
def test_sch_no_extension(test_dir):
""" KiCad can't load a schematic file without extension """
prj = 'good-project'
ctx = context.TestContextSCH(test_dir, 'SCH_no_extension', prj)
cmd = [PROG, 'run_erc']
ctx.run(cmd, WRONG_SCH_NAME, filename='Makefile')
m = ctx.search_err(r'Input files must use an extension')
assert m is not None
ctx.clean_up()
def test_bogus_sch(test_dir):
""" A broken SCH file """
ctx = context.TestContextSCH(test_dir, 'Bogus_SCH', 'good-project')
# Current KiCad 5.99 (20201125) creates the warning dialog, but doesn't give it focus.
# So we never know about the problem.
if ctx.kicad_version < context.KICAD_VERSION_5_99:
sch = ctx.get_out_path(BOGUS_SCH)
# Create an invalid SCH
with open(sch, 'w') as f:
f.write('dummy')
cmd = [PROG, '-vv', '-r', 'run_erc']
ctx.run(cmd, EESCHEMA_ERROR, filename=sch)
assert ctx.search_err(r"eeschema reported an error") is not None
ctx.clean_up()
def test_sch_wrong_command(test_dir):
""" Wrong command line arguments """
ctx = context.TestContextSCH(test_dir, 'SCH_Wrong_Command', 'good-project')
cmd = [PROG, 'bogus']
ctx.run(cmd, WRONG_ARGUMENTS)
ctx.clean_up()
def test_time_out(test_dir):
""" ERC time-out """
ctx = context.TestContextSCH(test_dir, 'SCH_Time_Out', 'good-project')
cmd = [PROG, '--time_out_scale', '0', 'run_erc']
ctx.run(cmd, 1)
ctx.clean_up()
|
def _handle_data(self, model_name, payload):
if self._message_count == 1:
expected_type = self._response_type()
expected_name = expected_type._model_name()
if model_name != expected_name:
msg = "Unexpected response type: {}, expected: {}".format(model_name, expected_name)
raise UnmappedDataError(msg, payload)
shape = self._shape_from_json_payload(payload, expected_type)
self._initial_response_future.set_result(shape)
else:
expected_type = self._response_stream_type()
if expected_type is None:
msg = "Operation does not support response stream events, received type: {}".format(model_name)
raise UnmappedDataError(msg, payload)
expected_name = expected_type._model_name()
if model_name != expected_name:
msg = "Unexpected response stream event type: {}, expected: {}".format(model_name, expected_name)
raise UnmappedDataError(msg, payload)
shape = self._shape_from_json_payload(payload, expected_type)
self._stream_handler.on_stream_event(shape) |
/**
* Abstraction of a vertical sidebar displayed on the left side.
*/
public class NavigationSidebarLeft extends UiPart<VBox> {
private static final String FXML = "components/SidebarLeft.fxml";
private final MainWindow mainWindow;
public NavigationSidebarLeft(MainWindow mainWindow) {
super(FXML);
this.mainWindow = mainWindow;
}
@FXML
void handleEnterTripManager() {
mainWindow.executeGuiCommand(EnterTripManagerCommand.COMMAND_WORD);
}
@FXML
void handleEnterOverallView() {
mainWindow.executeGuiCommand(EnterDayPageCommand.COMMAND_WORD);
}
@FXML
private void handleEnterBookingsManager() {
}
@FXML
private void handleEnterInventoryManager() {
mainWindow.executeGuiCommand(EnterInventoryCommand.COMMAND_WORD);
}
} |
/**
* @file ref_mesh_builder.h
*
* @authors <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
*
* @brief Reference (sequential) implementation of "BaseMeshBuilder".
*
* @date 29 October 2019, 21:00
**/
#ifndef REF_MESH_BUILDER_H
#define REF_MESH_BUILDER_H
#include <vector>
#include "base_mesh_builder.h"
/**
* @brief The RefMeshBuilder class
*/
class RefMeshBuilder : public BaseMeshBuilder
{
public:
RefMeshBuilder(unsigned gridEdgeSize);
protected:
unsigned marchCubes(const ParametricScalarField &field);
float evaluateFieldAt(const Vec3_t<float> &pos, const ParametricScalarField &field);
void emitTriangle(const Triangle_t &triangle);
const Triangle_t *getTrianglesArray() const { return mTriangles.data(); }
std::vector<Triangle_t> mTriangles; ///< Temporary array of triangles
};
#endif // REF_MESH_BUILDER_H
|
/**
* Support reading our credential from the wire or disk.
*
* NOTE: If we aren't on the master, we expect the embedded credential
* to be provided, along with a module we can use to establish identity.
*/
private void readObject(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
ois.defaultReadObject();
if (!areOnMaster()) {
this.module = (GoogleRobotUsernamePasswordModule) ois.readObject();
}
} |
import { generateUUID } from '@common/helpers/UUID';
import Comment from './Comment';
import Confiability from './Confiability';
import Estabelishment from './Estabelishment';
import Product from './Product';
class Publishment {
public id: string;
public price: number;
public condition: any;
public createdAt?: Date;
public updatedAt?: Date;
public confiability: Confiability;
public estabelishment: Estabelishment;
public product: Product;
public comments: Comment[];
constructor(publishment?: Publishment) {
if (!publishment) {
this.id = generateUUID();
this.confiability = new Confiability();
this.createdAt = new Date();
} else {
Object.assign(this, publishment);
this.updatedAt = new Date();
}
}
public voteConfiability(confiability: number): void {
const avarage =
(this.confiability.avarage * this.confiability.count + confiability) /
(this.confiability.count + 1);
this.confiability.avarage = Math.floor(avarage);
this.confiability.count++;
}
}
export default Publishment;
|
/**
* Implementation of the {@link Session} interface for Server Message Block (SMB)
* also known as Common Internet File System (CIFS). The Samba project set out to
* create non-Windows implementations of SMB. Often Samba is thus used synonymously to SMB.
*
* SMB is an application-layer network protocol that manages shared access to files, printers
* and other networked resources.
*
* See <a href="https://en.wikipedia.org/wiki/Server_Message_Block">Server Message Block</a>
* for more details.
*
* @author Markus Spann
* @author Mark Fisher
* @author Oleg Zhurakousky
* @author Artem Bilan
* @author Prafull Kumar Soni
* @author Gregory Bragg
*
*/
public class SmbSession implements Session<SmbFile> {
private static final Log logger = LogFactory.getLog(SmbSession.class);
private static final String FILE_SEPARATOR = System.getProperty("file.separator");
private static final String SMB_FILE_SEPARATOR = "/";
private final SmbShare smbShare;
/**
* Constructor for an SMB session.
* @param _host server NetBIOS name, DNS name, or IP address, case-insensitive
* @param _port port
* @param _domain case-sensitive domain name
* @param _user case-sensitive user name
* @param _password case-sensitive password
* @param _shareAndDir server root SMB directory
* @param _replaceFile replace existing files if true
* @param _useTempFile make use temporary files when writing
* @throws IOException in case of I/O errors
*/
SmbSession(String _host, int _port, String _domain, String _user, String _password, String _shareAndDir,
boolean _replaceFile, boolean _useTempFile) throws IOException {
this(new SmbShare(new SmbConfig(_host, _port, _domain, _user, _password, _shareAndDir)));
this.smbShare.setReplaceFile(_replaceFile);
this.smbShare.setUseTempFile(_useTempFile);
}
/**
* Constructor for an SMB session.
* @param _smbShare SMB share resource
*/
public SmbSession(SmbShare _smbShare) {
Assert.notNull(_smbShare, "smbShare must not be null");
this.smbShare = _smbShare;
if (logger.isDebugEnabled()) {
logger.debug("New " + getClass().getName() + " created.");
}
}
/**
* Deletes the file or directory at the specified path.
* @param _path path to a remote file or directory
* @return true if delete successful, false if resource is non-existent
* @throws IOException on error conditions returned by a CIFS server
*/
@Override
public boolean remove(String _path) throws IOException {
Assert.hasText(_path, "path must not be empty");
boolean removed = false;
SmbFile removeFile = createSmbFileObject(_path);
if (removeFile.exists()) {
removeFile.delete();
removed = true;
}
if (!removed && logger.isInfoEnabled()) {
logger.info("Could not remove non-existing resource [" + _path + "].");
}
else if (logger.isInfoEnabled()) {
logger.info("Successfully removed resource [" + _path + "].");
}
return removed;
}
/**
* Returns the contents of the specified SMB resource as an array of SmbFile objects.
* In case the remote resource does not exist, an empty array is returned.
* @param _path path to a remote directory
* @return array of SmbFile objects
* @throws IOException on error conditions returned by a CIFS server or if the remote resource is not a directory.
*/
@Override
public SmbFile[] list(String _path) throws IOException {
SmbFile[] files = new SmbFile[0];
try {
SmbFile smbDir = createSmbDirectoryObject(_path);
if (!smbDir.exists()) {
if (logger.isWarnEnabled()) {
logger.warn("Remote directory [" + _path + "] does not exist. Cannot list resources.");
}
return files;
}
else if (!smbDir.isDirectory()) {
throw new NestedIOException("Resource [" + _path + "] is not a directory. Cannot list resources.");
}
files = smbDir.listFiles();
}
catch (SmbException _ex) {
throw new NestedIOException("Failed to list resources in [" + _path + "].", _ex);
}
if (logger.isDebugEnabled()) {
logger.debug("Successfully listed " + files.length + " resource(s) in [" + _path + "]"
+ ": " + Arrays.toString(files));
}
else if (logger.isInfoEnabled()) {
logger.info("Successfully listed " + files.length + " resource(s) in [" + _path + "]" + ".");
}
return files;
}
/**
* Reads the remote resource specified by path and copies its contents to the specified
* {@link OutputStream}.
* @param _path path to a remote file
* @param _outputStream output stream
* @throws IOException on error conditions returned by a CIFS server or if the remote resource is not a file.
*/
@Override
public void read(String _path, OutputStream _outputStream) throws IOException {
Assert.hasText(_path, "path must not be empty");
Assert.notNull(_outputStream, "outputStream must not be null");
try {
SmbFile remoteFile = createSmbFileObject(_path);
if (!remoteFile.isFile()) {
throw new NestedIOException("Resource [" + _path + "] is not a file.");
}
FileCopyUtils.copy(remoteFile.getInputStream(), _outputStream);
}
catch (SmbException _ex) {
throw new NestedIOException("Failed to read resource [" + _path + "].", _ex);
}
if (logger.isInfoEnabled()) {
logger.info("Successfully read resource [" + _path + "].");
}
}
/**
* Writes contents of the specified {@link InputStream} to the remote resource
* specified by path. Remote directories are created implicitly as required.
* @param _inputStream input stream
* @param _path remote path (of a file) to write to
* @throws IOException on error conditions returned by a CIFS server
*/
@Override
public void write(InputStream _inputStream, String _path) throws IOException {
Assert.notNull(_inputStream, "inputStream must not be empty");
Assert.hasText(_path, "path must not be null");
try {
mkdirs(_path);
SmbFile targetFile = createSmbFileObject(_path);
if (this.smbShare.isUseTempFile()) {
String tempFileName = _path + this.smbShare.newTempFileSuffix();
SmbFile tempFile = createSmbFileObject(tempFileName);
tempFile.createNewFile();
Assert.isTrue(tempFile.canWrite(), "Temporary file [" + tempFileName + "] is not writable.");
FileCopyUtils.copy(_inputStream, tempFile.getOutputStream());
if (targetFile.exists() && this.smbShare.isReplaceFile()) {
targetFile.delete();
}
tempFile.renameTo(targetFile);
}
else {
FileCopyUtils.copy(_inputStream, targetFile.getOutputStream());
}
}
catch (SmbException _ex) {
throw new NestedIOException("Failed to write resource [" + _path + "].", _ex);
}
if (logger.isInfoEnabled()) {
logger.info("Successfully wrote remote file [" + _path + "].");
}
}
/**
* Convenience method to write a local file object to a remote location.
* @param _file the local file
* @param _path the remote path to write to
* @return the {@link SmbFile} for remote file
* @throws IOException the IO exception
*/
public SmbFile write(File _file, String _path) throws IOException {
return writeAndClose(new FileInputStream(_file), _path);
}
/**
* Convenience method to write a byte array to a remote location.
* @param _contents the {@code byte[]} to write
* @param _path the remote file to write to
* @return the {@link SmbFile} for remote file
* @throws IOException the IO exception
*/
public SmbFile write(byte[] _contents, String _path) throws IOException {
return writeAndClose(new ByteArrayInputStream(_contents), _path);
}
/**
* Creates the specified remote path if not yet exists.
* If the specified resource is a file rather than a path, creates all directories leading
* to that file.
* @param _path remote path to create
* @return always true (error states are express by exceptions)
* @throws IOException on error conditions returned by a CIFS server
*/
@Override
public boolean mkdir(String _path) throws IOException {
try {
SmbFile dir = createSmbDirectoryObject(_path);
if (!dir.exists()) {
dir.mkdirs();
if (logger.isInfoEnabled()) {
logger.info("Successfully created remote directory [" + _path + "] in share [" + this.smbShare + "]" +
".");
}
}
else {
if (logger.isInfoEnabled()) {
logger.info("Remote directory [" + _path + "] exists in share [" + this.smbShare + "].");
}
}
return true;
}
catch (SmbException _ex) {
throw new NestedIOException("Failed to create directory [" + _path + "].", _ex);
}
}
/**
* Checks whether the remote resource exists.
* @param _path remote path
* @return true if exists, false otherwise
* @throws IOException on error conditions returned by a CIFS server
*/
@Override
public boolean exists(String _path) throws IOException {
return createSmbFileObject(_path).exists();
}
/**
* Checks whether the remote resource is a file.
* @param _path remote path
* @return true if resource is a file, false otherwise
* @throws IOException on error conditions returned by a CIFS server
*/
public boolean isFile(String _path) throws IOException {
SmbFile resource = createSmbFileObject(_path);
return resource.exists() && resource.isFile();
}
/**
* Checks whether the remote resource is a directory.
* @param _path remote path
* @return true if resource is a directory, false otherwise
* @throws IOException on error conditions returned by a CIFS server
*/
public boolean isDirectory(String _path) throws IOException {
SmbFile resource = createSmbFileObject(_path);
return resource.exists() && resource.isDirectory();
}
/**
* Create all directories in the given remote path reference.
* @param _path path remote path, may be a file in which case the file name is ignored
* @return the path created or null
* @throws IOException on error conditions returned by a CIFS server
*/
String mkdirs(String _path) throws IOException {
int idxPath = _path.lastIndexOf(FILE_SEPARATOR);
if (idxPath > -1) {
String path = _path.substring(0, idxPath + 1);
mkdir(path);
return path;
}
return null;
}
@Override
public void rename(String _pathFrom, String _pathTo) throws IOException {
try {
SmbFile smbFileFrom = createSmbFileObject(_pathFrom);
SmbFile smbFileTo = createSmbFileObject(_pathTo);
if (this.smbShare.isReplaceFile() && smbFileTo.exists()) {
smbFileTo.delete();
}
smbFileFrom.renameTo(smbFileTo);
}
catch (SmbException _ex) {
throw new NestedIOException("Failed to rename [" + _pathFrom + "] to [" + _pathTo + "].", _ex);
}
if (logger.isInfoEnabled()) {
logger.info("Successfully renamed remote resource [" + _pathFrom + "] to [" + _pathTo + "].");
}
}
@Override
public void append(InputStream inputStream, String destination) throws IOException {
SmbFile smbFile = createSmbFileObject(destination);
OutputStream fileOutputStream = new SmbFileOutputStream(smbFile, true);
FileCopyUtils.copy(inputStream, fileOutputStream);
}
@Override
public boolean rmdir(String directory) throws IOException {
SmbFile dir = createSmbDirectoryObject(directory);
try {
dir.delete();
}
catch (SmbException e) {
if (logger.isWarnEnabled()) {
logger.info("Failed to remove remote directory [" + directory + "]: " + e);
}
return false;
}
if (logger.isInfoEnabled()) {
logger.info("Successfully removed remote directory [" + directory + "].");
}
return true;
}
@Override
public InputStream readRaw(String source) throws IOException {
SmbFile remoteFile = createSmbFileObject(source);
if (!remoteFile.isFile()) {
throw new NestedIOException("Resource [" + source + "] is not a file.");
}
return remoteFile.getInputStream();
}
@Override
public boolean finalizeRaw() {
return true;
}
@Override
public Object getClientInstance() {
return this.smbShare;
}
@Override
public void close() {
this.smbShare.doClose();
}
/**
* Checks with this SMB session is open and ready for work by attempting
* to list remote files and checking for error conditions..
* @return true if the session is open, false otherwise
*/
@Override
public boolean isOpen() {
if (!this.smbShare.isOpened()) {
return false;
}
try {
this.smbShare.listFiles();
}
catch (Exception _ex) {
close();
}
return this.smbShare.isOpened();
}
/**
* Convenience method to write the specified input stream to a remote path and return
* the path as an SMB file object.
* @param _inputStream input stream
* @param _path remote path (of a file) to write to
* @return SMB file object
* @throws IOException on error conditions returned by a CIFS server
*/
SmbFile writeAndClose(InputStream _inputStream, String _path) throws IOException {
write(_inputStream, _path);
_inputStream.close();
return createSmbFileObject(_path);
}
/**
* Factory method for new SmbFile objects under this session's share for the specified path.
* @param path remote path
* @param isDirectory Boolean object to indicate the path is a directory, may be null
* @return SmbFile object for path
* @throws IOException in case of I/O errors
*/
private SmbFile createSmbFileObject(String path, Boolean isDirectory) throws IOException {
final String cleanedPath = StringUtils.cleanPath(path);
if (!StringUtils.hasText(cleanedPath)) {
return this.smbShare;
}
SmbFile smbFile = new SmbFile(this.smbShare, cleanedPath);
boolean appendFileSeparator = !cleanedPath.endsWith(SMB_FILE_SEPARATOR);
if (appendFileSeparator) {
try {
appendFileSeparator = smbFile.isDirectory() || (isDirectory != null && isDirectory);
}
catch (SmbException ex) {
appendFileSeparator = false;
}
}
if (appendFileSeparator) {
smbFile = createSmbFileObject(cleanedPath + SMB_FILE_SEPARATOR);
}
if (logger.isDebugEnabled()) {
logger.debug("Created new " + SmbFile.class.getName() + "[" + smbFile + "] for path [" + path + "].");
}
return smbFile;
}
/**
* Creates an SMB file object pointing to a remote file.
* @param _path the remote file path
* @return the {@link SmbFile} for remote path
* @throws IOException the IO exception
*/
public SmbFile createSmbFileObject(String _path) throws IOException {
return createSmbFileObject(_path, null);
}
/**
* Creates an SMB file object pointing to a remote directory.
* @param _path the remote directory path
* @return the {@link SmbFile} for remote path
* @throws IOException the IO exception
*/
public SmbFile createSmbDirectoryObject(String _path) throws IOException {
return createSmbFileObject(_path, true);
}
@Override
public String getHostPort() {
URL url = this.smbShare.getURL();
return url.getHost() + ":" + url.getPort();
}
@Override
public String[] listNames(String path) {
throw new UnsupportedOperationException("Not implemented yet");
}
} |
#include <stdio.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
static int _ai[1000];
int main() {
int N; int64_t K; scanf("%d %"PRId64 "\n", &N,&K); if(K >= N) K = N-1;
for(int i = 0 ; i < N ; ++i) scanf("%d\n", &_ai[i]);
// we will never need more than N-1 wins (consider strongest player) and we need at most N-1 games to find him
int shead = _ai[0];
for(int i = 0, in = 2*N-2, w = 0 ; i < in && w < K ; ++i) {
if(_ai[i] > _ai[i+1]) { ++w, _ai[i+1] = _ai[i], _ai[i+N] = _ai[i+1]; }
else { w=1, shead = _ai[i+1], _ai[i+N] = _ai[i]; }
}
printf("%d\n", shead);
return 0;
}
|
/* Search for a key specification entry. If SSH_NAME is not NULL,
search for an entry whose "ssh_name" is equal to SSH_NAME;
otherwise, search for an entry whose "name" is equal to NAME.
Store found entry in SPEC on success, return error otherwise. */
static gpg_error_t
ssh_key_type_lookup (const char *ssh_name, const char *name,
ssh_key_type_spec_t *spec)
{
gpg_error_t err;
unsigned int i;
for (i = 0; i < DIM (ssh_key_types); i++)
if ((ssh_name && (! strcmp (ssh_name, ssh_key_types[i].ssh_identifier)))
|| (name && (! strcmp (name, ssh_key_types[i].identifier))))
break;
if (i == DIM (ssh_key_types))
err = gpg_error (GPG_ERR_NOT_FOUND);
else
{
*spec = ssh_key_types[i];
err = 0;
}
return err;
} |
/**
* Reads a TemporalDataset and either tries to automatically detect the temporal
* column or use a given data format specification.
*
* <p>
* Added: 2011-09-27 / AR<br>
* Modifications: 2013-03-25 / AR / autoGranularity
* </p>
*
* @author Alexander Rind
*/
public class TextTableTemporalDatasetReader extends
AbstractTemporalDatasetReader {
private static final Logger logger = Logger
.getLogger(TextTableTemporalDatasetReader.class);
private TemporalDataColumnSpecification spec = null;
private Granularity autoGranularity = null;
/**
* Reads a TemporalDataset and tries to automatically detect the temporal
* column. Granules of the bottom granularity are assumed.
*/
public TextTableTemporalDatasetReader() {
this.spec = null;
}
/**
* Reads a TemporalDataset and tries to automatically detect the temporal
* column. The temporal elements will be instants based on the given
* granularity.
*
* @param granularity
*/
public TextTableTemporalDatasetReader(Granularity granularity) {
super();
this.autoGranularity = granularity;
}
public TextTableTemporalDatasetReader(TemporalDataColumnSpecification spec) {
super();
this.spec = spec;
}
public TextTableTemporalDatasetReader(String xmlFile) throws IOException,
JAXBException {
super();
this.spec = (TemporalDataColumnSpecification) JaxbMarshaller.loadUser(
xmlFile, TemporalDataColumnSpecification.class);
}
@Override
public TemporalDataset readData(InputStream is) throws DataIOException,
TemporalDataException {
TemporalDataColumnSpecification spec = (this.spec != null) ? this.spec
: new TemporalDataColumnSpecification();
TableReader tableReader = spec.getTableFormat().getTableReader();
// XXX hack to handle prefuse String -> Date conversion in UTC
TimeZone oldDefault = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
Table table = tableReader.readTable(is);
TimeZone.setDefault(oldDefault);
if (logger.isInfoEnabled()) {
logger.info("Metadata of raw table:");
DataHelper.printMetadata(System.out, table);
}
if (this.spec == null)
scanTableForSpecification(table, spec);
TemporalDataset tmpds = new TemporalDataset();
importTable(table, tmpds, spec);
table = null;
return tmpds;
}
// TODO should the class remember the spec or stay in auto-detection mode
private void scanTableForSpecification(Table table,
TemporalDataColumnSpecification spec) throws TemporalDataException {
String temporalColumn = null;
LinkedList<String> dataColumns = new LinkedList<String>();
for (int i = 0; i < table.getColumnCount(); i++) {
String col = table.getColumnName(i);
if (table.canGetDate(col) && temporalColumn == null)
temporalColumn = col;
else
dataColumns.add(col);
}
if (temporalColumn == null)
throw new TemporalDataException(
"Imported data table does not have a recognized temporal column.");
DateInstantEncoding enc = new DateInstantEncoding("default",
temporalColumn);
enc.setDataColumns(dataColumns.toArray(new String[0]));
enc.setGranularity(autoGranularity != null ? autoGranularity :
JavaDateCalendarManager.getSingleton().getDefaultCalendar().getBottomGranularity());
spec.addEncoding(enc);
}
public static void importTable(Table table, TemporalDataset tmpds,
TemporalDataColumnSpecification spec) throws TemporalDataException {
// 1. analyze & prepare schemata
if (logger.isDebugEnabled())
logger.debug("start import " + table);
spec.init();
// 1.2. prepare table for data elements
for (TemporalObjectEncoding encoding : spec.getEncodings()) {
try {
prepareDataColumns(tmpds, table, encoding);
} catch (TemporalDataException e) {
// this is safe if the data element table has no column
logger.fatal("Failed to build data columns on import", e);
System.exit(1);
}
}
// 2. for each data row
// map of temporal elements extracted from 1 row: specKey -> row
TreeMap<String, GenericTemporalElement> elements = new TreeMap<String, GenericTemporalElement>();
long temporalObjectId = 0;
IntIterator rows = table.rows();
while (rows.hasNext()) {
Tuple tuple = (Tuple) table.getTuple(rows.nextInt());
try {
// 2.1. for each schema
for (TemporalObjectEncoding encoding : spec.getEncodings()) {
logger.trace(encoding.getKey());
// 2.1.1. extract temporal element & append to TempDS
encoding.buildTemporalElement(tmpds, tuple, elements);
// 2.1.2. if it has data columns
if (encoding.getDataColumns().length > 0) {
if (encoding.isTemporalObjectIdIncluded()) {
temporalObjectId = tuple.getLong(TemporalObject.ID);
} else {
temporalObjectId++;
}
logger.debug("temporal object id " + temporalObjectId);
// 2.1.2.1. link temporal element with data element in TempDS
TemporalObject obj = tmpds.addTemporalObject(
temporalObjectId,
elements.get(encoding.getKey()).getId());
// 2.1.2.2. extract data element & append to TempDS
copyDataElements(obj, tuple, encoding);
}
}
} catch (TemporalDataException e) {
if (spec.isFailOnIllegalRows())
throw e;
else {
if (logger.isInfoEnabled())
logger.info("skip row import: " + tuple + " Reason: ",
e);
}
}
// 2.2 clear cached temporal elements
elements.clear();
}
}
private static void prepareDataColumns(TemporalDataset tmpds, Table table,
TemporalObjectEncoding schema) throws TemporalDataException {
Table dataElements = tmpds.getNodeTable();
for (String col : schema.getDataColumns()) {
if (dataElements.getColumnNumber(col) == -1) {
// column does not exist yet --> add it
if (logger.isDebugEnabled())
logger.debug("prepare data col \"" + col + "\" type "
+ table.getColumnType(col));
tmpds.addDataColumn(col, table.getColumnType(col), null);
} else if (dataElements.getColumnType(col) != table
.getColumnType(col)) {
// column exists but wrong data type
throw new TemporalDataException("Data column " + col
+ " already exists with a different type: is "
+ dataElements.getColumnType(col) + " expected "
+ table.getColumnType(col));
} else if (col.equals(TemporalObject.TEMPORAL_ELEMENT_ID)) {
// try to put data in foreign key column
throw new TemporalDataException("Data column " + col
+ " is reserved for TimeBench.");
} else if (logger.isDebugEnabled())
logger.debug("skip data col \"" + col + "\" type "
+ table.getColumnType(col));
}
}
private static void copyDataElements(TemporalObject obj, Tuple tuple,
TemporalObjectEncoding schema) {
for (String col : schema.getDataColumns()) {
if (logger.isTraceEnabled())
logger.trace("add data item " + col + " value "
+ tuple.get(col));
// TODO insert switch (columnType) and call setInt(getInt())
// if we are more serious about performance
obj.set(col, tuple.get(col));
}
}
public TemporalDataColumnSpecification getSpecification() {
return spec;
}
public void setSpecification(TemporalDataColumnSpecification spec) {
this.spec = spec;
}
} |
{-# LANGUAGE TemplateHaskell #-}
module Phoityne.VSCode.TH.SetBreakpointsResponseJSON where
import Data.Aeson.TH
import Phoityne.VSCode.Utility
import Phoityne.VSCode.TH.SetBreakpointsRequestJSON
import Phoityne.VSCode.TH.SetBreakpointsResponseBodyJSON
-- |
-- Response to "setBreakpoints" request.
-- Returned is information about each breakpoint created by this request.
-- This includes the actual code location and whether the breakpoint could be verified.
-- The breakpoints returned are in the same order as the elements of the 'breakpoints'
-- (or the deprecated 'lines') in the SetBreakpointsArguments.
--
data SetBreakpointsResponse =
SetBreakpointsResponse {
seqSetBreakpointsResponse :: Int -- Sequence number
, typeSetBreakpointsResponse :: String -- One of "request", "response", or "event"
, request_seqSetBreakpointsResponse :: Int -- Sequence number of the corresponding request
, successSetBreakpointsResponse :: Bool -- Outcome of the request
, commandSetBreakpointsResponse :: String -- The command requested
, messageSetBreakpointsResponse :: String -- Contains error message if success == false.
, bodySetBreakpointsResponse :: SetBreakpointsResponseBody
} deriving (Show, Read, Eq)
$(deriveJSON defaultOptions { fieldLabelModifier = rdrop (length "SetBreakpointsResponse") } ''SetBreakpointsResponse)
-- |
--
defaultSetBreakpointsResponse :: Int -> SetBreakpointsRequest -> SetBreakpointsResponse
defaultSetBreakpointsResponse seq (SetBreakpointsRequest reqSeq _ _ _) =
SetBreakpointsResponse seq "response" reqSeq True "setBreakpoints" "" defaultSetBreakpointsResponseBody
-- |
--
errorSetBreakpointsResponse :: Int -> SetBreakpointsRequest -> String -> SetBreakpointsResponse
errorSetBreakpointsResponse seq (SetBreakpointsRequest reqSeq _ _ _) msg =
SetBreakpointsResponse seq "response" reqSeq False "setBreakpoints" msg defaultSetBreakpointsResponseBody
|
With less than a week to go not only before Apple's Worldwide Developers Conference keynote, but also a forthcoming 7-for-1 stock split, investors pushed shares of the iPhone maker to a new 52-week high on Tuesday.
The New York Stock Exchange, credit Carlos Delgado via Wikipedia.
Shares of Apple closed the day at $625.71, up $11.58 from their previous close of $614.13. That marked the highest closing price for AAPL stock in the last year.Apple is still a long way off from its all-time high of just north of $700, reached in September of 2012 . Following that, shares of Apple tumbled throughout late 2012 and early 2013.The iPhone maker has mounted a major comeback in recent weeks, hot off the success of a strong second fiscal quarter of 2014, and riding high on investor anticipation for new products. Apple broke the $600 threshold earlier this month.Apple's 52-week high also comes less than a week before shares of Apple are set to undergo a 7-for-1 split next Monday. Existing shareholders who buy in before the deadline will be awarded six additional shares of AAPL stock, and split-adjusted trading will begin on June 9.June 2 is also a major day for Apple among non-investors, as the company is set to hold a keynote presentation that will kick off its annual Worldwide Developers Conference. The Monday morning keynote is expected to include the introduction of the next generations of Apple's iOS mobile operating system and OS X Mac platform. |
Association of limited valence patchy particles in two dimensions
We investigate theoretically the phase behavior of particles with limited valence in two dimensions, by solving the first-order Wertheim theory form. As previously found for three dimensions, in two dimensions also the valence has a strong impact on the phase diagram, controlling the location of the gas–liquid coexistence. On decreasing the valence, the critical density and temperature decrease while the region of gas–liquid instability shrinks and vanishes. At low temperatures, the system reaches its ground state with particles forming a fully bonded network which spans the system. |
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef DrawMode_h
#define DrawMode_h
#include "mozilla/TypedEnumBits.h"
// Options for how the text should be drawn
enum class DrawMode : int {
// GLYPH_FILL and GLYPH_STROKE draw into the current context
// and may be used together with bitwise OR.
GLYPH_FILL = 1 << 0,
// Note: using GLYPH_STROKE will destroy the current path.
GLYPH_STROKE = 1 << 1,
// Appends glyphs to the current path. Can NOT be used with
// GLYPH_FILL or GLYPH_STROKE.
GLYPH_PATH = 1 << 2,
// When GLYPH_FILL and GLYPH_STROKE are both set, draws the
// stroke underneath the fill.
GLYPH_STROKE_UNDERNEATH = 1 << 3
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(DrawMode)
#endif
|
def process(self, labels):
strings = "".join(labels)
for s in strings:
if s not in self.char2index:
self.char2index[s] = self.grapheme_count
self.index2char[self.grapheme_count] = s
self.grapheme_count += 1 |
def exclude_native_if_dot1x(self):
exclude_ports = set()
for port in self.untagged:
if port.dyn_dot1x_native_vlan is None:
continue
if port.dyn_dot1x_native_vlan != self:
exclude_ports.add(port)
return exclude_ports |
/*
==============================================================================
AdsrComponent.cpp
Created: 7 Feb 2021 2:28:49pm
Author: <NAME>
==============================================================================
*/
#include <JuceHeader.h>
#include "AdsrComponent.h"
//==============================================================================
AdsrComponent::AdsrComponent (juce::AudioProcessorValueTreeState& apvts, juce::String attackId, juce::String decayId, juce::String sustainId, juce::String releaseId)
: attack ("A", attackId, apvts, sliderWidth, sliderHeight, juce::Slider::SliderStyle::LinearVertical)
, decay ("D", decayId, apvts, sliderWidth, sliderHeight, juce::Slider::SliderStyle::LinearVertical)
, sustain ("S", sustainId, apvts, sliderWidth, sliderHeight, juce::Slider::SliderStyle::LinearVertical)
, release ("R", releaseId, apvts, sliderWidth, sliderHeight, juce::Slider::SliderStyle::LinearVertical)
{
addAndMakeVisible (attack);
addAndMakeVisible (decay);
addAndMakeVisible (sustain);
addAndMakeVisible (release);
}
AdsrComponent::~AdsrComponent()
{
}
void AdsrComponent::resized()
{
const auto startX = 15;
const auto startY = 55;
const auto width = sliderWidth;
const auto height = sliderHeight + 20;
attack.setBounds (startX, startY, width, height);
decay.setBounds (attack.getRight(), startY, width, height);
sustain.setBounds (decay.getRight(), startY, width, height);
release.setBounds (sustain.getRight(), startY, width, height);
}
|
// canExecuteConcurrently determines if the cocurrency settings allow our job
// to be started. We start jobs with a limited concurrency in order, oldest
// first. This allows us to get away without any global locking by just looking
// at the jobs in the cluster.
func (r *reconciler) canExecuteConcurrently(pj *prowv1.ProwJob) (bool, error) {
if max := r.config().Plank.MaxConcurrency; max > 0 {
pjs := &prowv1.ProwJobList{}
if err := r.pjClient.List(r.ctx, pjs, optPendingProwJobs()); err != nil {
return false, fmt.Errorf("failed to list prowjobs: %w", err)
}
running := len(pjs.Items) - 1
if running >= max {
r.log.WithFields(pjutil.ProwJobFields(pj)).Infof("Not starting another job, already %d running.", running)
return false, nil
}
}
if pj.Spec.MaxConcurrency == 0 {
return true, nil
}
pjs := &prowv1.ProwJobList{}
if err := r.pjClient.List(r.ctx, pjs, optPendingTriggeredJobsNamed(pj.Spec.Job)); err != nil {
return false, fmt.Errorf("failed listing prowjobs: %w:", err)
}
r.log.Infof("got %d not completed with same name", len(pjs.Items))
var pendingOrOlderMatchingPJs int
for _, foundPJ := range pjs.Items {
if foundPJ.UID == pj.UID {
continue
}
if foundPJ.Status.State == prowv1.PendingState {
pendingOrOlderMatchingPJs++
continue
}
if foundPJ.CreationTimestamp.Before(&pj.CreationTimestamp) {
pendingOrOlderMatchingPJs++
}
}
if pendingOrOlderMatchingPJs >= pj.Spec.MaxConcurrency {
r.log.WithFields(pjutil.ProwJobFields(pj)).
Debugf("Not starting another instance of %s, have %d instances that are pending or older, %d is the limit",
pj.Spec.Job, pendingOrOlderMatchingPJs, pj.Spec.MaxConcurrency)
return false, nil
}
return true, nil
} |
**Editorial**
Rob Franek, Editor-in-Chief
Casey Cornelius, VP Content Development
Mary Beth Garrick, Director of Production
Selena Coppock, Managing Editor
Meave Shelton, Senior Editor
Colleen Day, Editor
Sarah Litt, Editor
Aaron Riccio, Editor
Orion McBean, Associate Editor
**Penguin Random House Publishing Team**
Tom Russell, VP, Publisher
Alison Stoltzfus, Publishing Director
Jake Eldred, Associate Managing Editor
Ellen Reed, Production Manager
Suzanne Lee, Designer
The Princeton Review
555 W. 18th Street
New York, NY 10011
Email: [email protected]
Copyright © 2017 by TPR Education IP Holdings, LLC. All rights reserved.
Published in the United States by Penguin Random House LLC, New York, and in Canada by Random House of Canada, a division of Penguin Random House Ltd., Toronto.
Terms of Service: The Princeton Review Online Companion Tools ("Student Tools") for retail books are available for only the two most recent editions of that book. Student Tools may be activated only twice per eligible book purchased for two consecutive 12-month periods, for a total of 24 months of access. Activation of Student Tools more than twice per book is in direct violation of these Terms of Service and may result in discontinuation of access to Student Tools Services.
SAT is a registered trademark of the College Board, which does not sponsor or endorse this product.
The Princeton Review is not affiliated with Princeton University.
Trade Paperback ISBN 9781524710774
Ebook ISBN 9781524710934
Editor: Sarah Litt
Production Editor: Wendy Rosen
Production Artist: Deborah A. Silvestrini
Cover art by Nino Marcutti / Alamy Stock Photo
Cover design by Suzanne Lee
v5.2
a
# Acknowledgments
Special thanks to Sarah Kass and Spencer Ledoux for their contributions to this title.
Special thanks to Adam Robinson, who conceived of and perfected the Joe Bloggs approach to standardized tests and many of the other successful techniques used by The Princeton Review.
# Contents
Cover
Title Page
Copyright
Acknowledgments
Get More (Free) Content
**Part I: Orientation**
1 Introduction
What Are The SAT Subject Tests?
Overall Structure of The Test
2 General Strategy
How To Improve
**Part II: Practice Test 1**
Practice Test 1
Practice Test 1: Answers and Explanations
Practice Test 1: Answer Key
Practice Test 1: Explanations
How to Score Practice Test 1
Practice Test 1: Score Conversion Table
**Part III: Content Review and Strategies**
3 Vocabulary
Part A: Vocabulary Completions
Drill 1
If You Know The Words
If You Don't Know All The Answer Choices
Drill 2
If You Don't Understand The Sentence
Drill 3
Comprehensive Drill
Summary
4 Vocabulary Review
Boost Your Vocabulary
Vocabulary List
Summary
5 Grammar Review
Part B: Grammar
Part C: Complete the Paragraph
Know What You Are Looking For
Grammar Review
Basic Terms
Pronouns
Drill 1: Pronoun Questions
Verbs
Avoir and Être in Compound Past Tenses
Drill 2: Verb Questions
Prepositions
Drill 3: Preposition Questions
Odds and Ends
Special Points for Part C
Comprehensive Drill
Summary
6 Reading Comprehension
Part D: Reading Comprehension
Tickets/Schedules/Advertisements
Comprehensive Drill
Summary
7 French Listening
Overall Structure of the Listening Test
Listening—Part A: Pictures
Listening—Part B: Short Dialogues
Listening—Part C: Long Passages
Summary
**Part IV: Drill Answers and Explanations**
Chapter 3 Drill Answers and Explanations
Chapter 5 Drill Answers and Explanations
Chapter 6 Drill Answers and Explanations
**Part V: Practice Test 2**
Practice Test 2
Practice Test 2: Answers and Explanations
Practice Test 2: Answer Key
Practice Test 2: Explanations
How to Score Practice Test 2
Practice Test 2: Score Conversion Table
# Get More **(Free)** Content
**1** Go to **PrincetonReview.com/cracking.**
**2** Enter the following ISBN for your book: 9781524710934.
**3** Answer a few simple questions to set up an exclusive Princeton Review account. (If you already have one, you can just log in.)
**4** Click the "Student Tools" button, also found under "My Account" from the top toolbar. You're all set to access your bonus content!
## Need to report a potential **content** issue?
Contact **[email protected]**.
Include:
• full title of the book
• ISBN number
• page number
## Need to report a potential **content** issue?
Contact **[email protected]** and provide:
• your full name
• email address used to register the book
• full book title and ISBN
• computer OS (Mac/PC) and browser (Firefox, Safari, etc.)
## **Once you've registered, you can...**
• Take a full-length practice SAT and/or ACT
• Get valuable advice about the college application process, including tips for writing a great essay and where to apply for financial aid
• If you're still choosing between colleges, use our searchable rankings of _The Best 382 Colleges_ to find out more information about your dream school
• Check to see if there have been any corrections or updates to this edition
• Get our take on any recent or pending updates to the SAT Subject Test in French
## **Look For These Icons Throughout The Book**
PROVEN TECHNIQUES
APPLIED STRATEGIES
# Part I
# Orientation
1 Introduction
2 General Strategy
# Chapter 1
# Introduction
You have chosen to take the SAT Subject Test in French, and now it is time to demonstrate all you have learned during the course of your advanced study. This book will help you understand the format of the SAT Subject Test in French and will give you all the tools you need to do your best.
This book is divided into four parts. Part One gives you an orientation of the SAT Subject Test in French and reveals some basic strategies. Part Two contains a practice SAT Subject Test in French along with answers and explanations for the test. Part Three gives you the format for each section of the test and reviews key grammar and vocabulary words. Part Four contains answers and explanations for the drills found in Part Three. Part Five contains a practice SAT Subject Test in French along with answers and explanations for the test.
## **WHAT ARE THE SAT SUBJECT TESTS?**
They are a series of one-hour exams developed and administered by the Educational Testing Service (ETS) and the College Board. The SAT Subject Tests are designed to measure specific knowledge in specific areas. There are many different tests in many different subject areas, such as biology, history, French, and math. They are scored separately on a 200–800 scale.
### **How Are SAT Subject Tests Used by College Admissions?**
Because the tests are given in specific areas, colleges use them as another piece of admissions information and, often, to decide whether an applicant can be exempted from college requirements. A good SAT French score might place you in second-year French instead of first-year French, or exempt you from a foreign language requirement altogether.
Your SAT French score may be used to place you into the appropriate level of French class in college. If you score well, you may be able to take fewer semesters of language class. If you score really well, you may be exempted from the language requirement completely.
### **Should I Take the SAT Subject Tests? How Many? When?**
About one-third of the colleges that require SAT scores also require that you take two or three Subject Tests. Your first order of business is to start reading those college catalogs. College guidebooks, admissions offices, and guidance counselors should have this information as well.
As to which tests you should take, the answer is simple:
1. those Subject Tests that you will do well on
2. the tests that the colleges you are applying to may require you to take
The best possible situation, of course, is when the two overlap.
Some colleges have specific requirements; others do not. Again, start asking questions before you start taking tests. Once you find out which tests are required, if any, part of your decision making is done. The next step is to find out which of the tests will highlight your particular strengths.
Possibilities range from math, English literature, U.S. or world history, biology, chemistry, and physics to a variety of foreign languages.
As to when you should take the tests, schedule them as close as possible to your school's corresponding academic calendar. If you plan to take the SAT Subject Test in Chemistry, for example, and you are currently taking chemistry in high school, don't postpone the test until next year.
### **When Are the SAT Subject Tests Offered?**
In general, you can take from one to three Subject Tests per test date in October, November, December, January, May, and June at test sites across the country. Not all subjects are offered at each administration, so check the dates carefully. The College Board's website has tons of helpful information about all of the SAT subject tests: sat.collegeboard.org/about-tests/sat-subject-tests
### **How Do I Register for the Tests?**
To register by mail, pick up _The Paper Registration Guide for the SAT and SAT Subject Tests_ at your guidance counselor's office. You can also register at the College Board website at www.collegeboard.com. This site contains other useful information such as the test dates and fees. If you have questions, you can talk to a representative at the College Board by calling 1-866-756-7346.
You may have your scores sent to you, to your school, and to four colleges of your choice. Additional reports will be sent to additional colleges for—you guessed it—additional money. Scores are made available to students via the College Board's website. To find out about the timeline of when scores are made available, please visit sat.collegeboard.org/scores.
### **Have You Heard About Fee-Waiver?**
Are you a lower-income student whose family is unable to afford these test fees? Fear not. You may qualify for a fee waiver. Your high school counselor or an authorized community-based organization can give you a waiver if you qualify. Fee waivers can be used for the SAT and SAT Subject Tests. More information and the requirements for qualification can be found at sat.collegeboard.org/register/sat-fee-waivers.
### **A Couple of Words About Score Choice™**
The good news about the SAT Subject Test is that you can choose which test scores you want colleges to see. Why is this such good news? Well, if you take more than one SAT Subject Test on a given test date, you'll be able to choose which tests from that date you'd like to submit to colleges. So if, for example, you take the French test followed by the chemistry test, but don't think the chemistry test went very well, you can simply opt out of having that chemistry score sent to your schools.
Score Choice is optional for students. This means that you aren't required to opt in and actively choose which specific scores you would like sent to colleges. If you decide not to use the score reporting, then all of the scores on file will automatically be sent when you request score reports. You should feel fine about sending along all of your scores, since most colleges consider a student's best score.
For more information about score reporting options, go to the College Board website at www.collegeboard.com.
### **What's a Good Score?**
That's hard to say, exactly. A good score is one that fits in the range of scores the college of your choice usually looks for or accepts. However, if your score falls below the normal score range for Podunk University, that doesn't mean you won't get into Podunk University. Schools are usually fairly flexible in what they are willing to look at as a "good" score for a particular student.
Along with your score, you will also receive a percentile rank. That number tells you how you fit in with the other test takers. In other words, a percentile rank of 60 means that 40 percent of the test takers scored above you and 60 percent scored below you.
### **What Is The Princeton Review?**
The Princeton Review is a test-preparation company founded in New York City. We have branches across the country and abroad. We've developed the techniques you'll find in our books, courses, and online resources by analyzing actual exams and testing the effectiveness of those techniques with our students. What makes our techniques unique is that we base our principles on the same ones used by the people who write the tests. We don't want you to waste your time with superfluous information; we'll give you just the information you'll need to get great score improvements. You'll learn to recognize and comprehend the relatively small amount of information that's actually tested. You'll also learn to avoid common traps, to think like the test writers, to find answers to questions you're unsure of, and to budget your time effectively.
You need to do only two things: trust the techniques, and practice, practice, practice.
The College Board publishes a book called _The Official Study Guide for all SAT Subject Tests_ with practice exams for all 20 SAT subjects offered. You can also go to the College Board website for more information and practice questions. After you have worked through the review chapters and completed the practice tests in this book, try out your new skills on real SAT Subject Test questions.
### **What Makes This Book Different?**
Most prep books for foreign language tests are written by academics who ramble on about the subtleties of the syntax of their chosen language. Their cups runneth over with more rules about grammar than you could ever absorb in a limited period of time. Most of all, they take more interest in teaching you French with a capital F than in preparing you for the particular challenges of this test. Rather than waste your time rehashing every tedious rule of grammar, we'll cover only those points needed to improve your score on the test. We want you to study effectively.
Some prep books can harm you more than help you by misleading you about the types of questions or by giving you so much to review that you don't know where to begin or what's most important. In more than twenty years of test-prep experience, we've learned what you truly need to know to score your best.
### **What Is the SAT Subject Test in French?**
You can choose to take one of the two French Subject Tests: French or French with Listening. While the SAT Subject Test in French is generally offered on every SAT Subject Test date (except November), French with Listening is given only in November. It has an additional audio portion, which evaluates your ability to comprehend spoken French. You listen to a recording and answer multiple-choice questions. If you intend to continue your French language study, this is useful for placement purposes. You are not tested on your speaking or writing ability on either of these tests.
Please note that the SAT French with Listening requires you to bring a portable CD player or Diskman with you to the testing center. You will not be permitted to sit the exam if you do not have this device.
### **Will Slang or Casual Expressions Be Included on the Test?**
Only authentic and widely accepted French language is used on the test. The SAT Subject Test in French is testing what should have been taught in a minimum of two years of regular French study in high school. Of course, the more you study, the better your scores will be.
### **What Does It Test?**
The SAT Subject Test in French tests vocabulary, structure (grammar), and reading comprehension. Reading comprehension and structure each comprise between 30% and 40% of the test. Vocabulary in Context comprises 30% of the test. A strong vocabulary will help you score well on the Vocabulary and Reading Comprehension sections. Our review groups words by category for easier recall and gives you tips for learning vocabulary.
As you probably know, French grammar is complex, but the SAT Subject Test in French requires you to know only a small portion of all grammar. You do not need to know spelling, where the accents go, or correct word order in a sentence. You don't need to know how to conjugate the _passé simple_ or the imperfect of the subjunctive. We'll review only those points of grammar that serve you best on the test.
You can't master all of the French language in a few weeks or even a month. Focus on the vocabulary and grammar that helps you on the test.
### **Now for the Good News**
In the scheme of standardized tests, the SAT Subject Test in French isn't all that bad. Any standardized test provides you with a wealth of opportunity. Wouldn't you rather take a test in which you can use the Process of Elimination and guessing techniques than walk into a room and speak to a French person? By using an approach that has been developed over the years at The Princeton Review, you'll have the confidence and the ability to ace the SAT Subject Test in French.
### **How Is the SAT Subject Test in French Scored?**
The scoring system for the SAT Subject Test in French is similar to that for the SAT. You are given a raw score based on the number of questions you got right minus one-third of a point for every wrong answer. The raw score is then converted to a scaled score ranging from 200 to 800.
### **How Will I Improve My Score?**
Unfortunately, reading through this book may not be enough. It is important that you apply our techniques during the practice sections so that our approach will be second nature when you take the actual test.
Read one section of the book at a time and immediately apply what you have learned to the practice section that follows it. Then, carefully read through the explanations, looking for patterns in the mistakes that you made. If you notice that one type of question or topic is giving you trouble, go back and review the relevant section. Finally, before taking the diagnostic tests at the back of the book, review both the general test-taking strategies and the specific question strategies. Again, after taking the test, notice where your mistakes were, and use that information to adjust your pacing and intensify your review.
Although this book can be used alone, you may find it handy to have a French/English dictionary and a grammar book available as references while you read through the text. Don't use them on the practice tests, though!
This book is designed to help you focus on those points that will help you score higher. It assumes that you have a basic French vocabulary and a rough grasp of grammar. The grammar section highlights the rules that are actually tested, giving you a concise explanation of each rule and examples of test questions. If you are someone who likes detailed explanations, you may want to have your school grammar book handy to use alongside this review book.
For more information visit www.PrincetonReview.com.
## **OVERALL STRUCTURE OF THE TEST**
The SAT Subject Test in French consists of four types of multiple-choice questions. You are free to work on the sections or questions in any order that you choose. You will have 60 minutes to answer 85 questions.
The layout of each test will look something like this:
• Part A—Vocabulary Completions
(approximately 20–26 questions)
• Part B—Grammar Blanks
(approximately 15–20 questions)
• Part C—Paragraph Blanks
(approximately 12–20 questions)
• Part D—Reading Comprehension
(approximately 27 questions)
The exact breakdown of questions varies from test to test. The list above gives you the approximate number of each type of question.
If Reading Comprehension contains "schedules and tickets" questions as well as traditional passages, then Reading Comprehension will have more questions and Grammar will have slightly fewer.
Schedules and Tickets questions show timetables, advertisements, or flyers.
# Chapter 2
# General Strategy
In this chapter, we'll discuss the best way for you to approach the SAT Subject Test in French. Pacing, Process of Elimination, and knowing when or whether to guess are all important factors that can determine how many points you accumulate as you work. You will also get a first look at the structure of the exam so you can plan your study time accordingly. Good luck!
## **HOW TO IMPROVE**
As on any multiple-choice standardized test, you can learn to leverage your knowledge into the best possible score by following a few simple principles.
### **Attitude**
Do not be intimidated by the test! This is only a test that stamps you with a number so that you can be easily classified by the colleges to which you apply. It measures some vocabulary, some minor rules such as which phrases take the subjunctive, but above all, it measures how well you do on standardized tests.
We can't make up for what you did or didn't learn in school, but we can teach you to make the most of what you do know and boost your test-taking savvy. We'll teach you new ways of approaching the test: pacing yourself, spotting wrong answers, and using guessing skills that put you in control.
### **Pacing**
In school, most of us were trained to answer every question on a test. That made sense because those tests were usually written so that there was time to answer every question. On standardized tests, such thinking can lower your score. These tests are designed so that 99 percent of the population cannot finish the test without rushing and making careless mistakes. Slowing down—finding a pace at which you can work carefully and confidently—is the first step to improving your score. Remember: You are not given a negative score on a question you leave unanswered.
Standardized tests aren't like school tests. They are actually designed so that hardly anyone can finish all the questions. Don't stress about answering every question or getting through the entire test.
There is no advantage to answering all the questions on a test if you answer so hurriedly that you get most of them wrong. Think of each question as an investment in your score. Take enough time to make the work you put in pay off in terms of points. Most people don't realize that they can get a terrific score by doing fewer questions. While this philosophy holds true for all standardized tests, it is especially important for the SAT Subject Tests, in which one-third of a point is deducted for each wrong answer.
One caution: Working slowly and carefully is great. Spending five minutes to get an answer on a single question is not. Don't let your pride keep you struggling with a question that's giving you a hard time; each question has the same value. Do what you can, eliminate wrong answer choices, and guess. Then move on to a new question.
You'll have one hour to work on the entire test. You are not timed on each section. That means you can spend less time on sections that you are stronger in, or just move at a steady, careful pace through the whole test.
### **Work for Accuracy, Not for Speed**
The scoring system used by the College Board rewards you for slowing down. It is better to do fewer questions well than to do many questions badly.
The following guide tells you approximately how many questions you have to answer to get a particular score. (This is the approximate number you should answer—not counting guesses—making no more than five errors.) Keep in mind that the scale changes each year, depending on the difficulty of the exam.
**To get this score:** | **Answer this many questions (out of 85):**
---|---
500 | 25
550 | 35
600 | 45
650 | 55
700 | 65
750 | 75
800 | 85
So, to get a 600 you have to answer barely half of the test. You can skip the questions that give you the most trouble.
You could skip as many as 20 questions and still score a 700.
As you do each practice section, you can check your pacing by comparing the number you got right with the number you got wrong. If you made more than two careless errors in that section (not counting guesses), you may want to slow down and attempt fewer questions on the practice test.
### **Which Ones Should You Skip?**
On Parts A and B, the questions are arranged roughly in order of increasing difficulty, so unless you are aiming for more than a 600, you may skip the last third of each part. On Parts C and D, there is no clear order of difficulty. Skip questions or passages that are difficult for you and spend time on those that you can comprehend.
You don't have to answer the same proportion of questions on each part. For most people, reading comprehension is the most difficult and vocabulary is the easiest. If that's true for you, do extra vocabulary and fewer reading-comprehension questions.
Tailor your pacing strategy to your strengths and weaknesses. If your reading ability is strong and your grammar is weak, pace yourself accordingly.
### **Process of Elimination**
No matter how good you are at French, you may still come across a question or two that will stump you. What can you do? Look for obviously incorrect answers, and get rid of them. It is often easier to find three wrong answers than it is to find one right one. If the sentence completion has something to do with going to the beach, an answer choice that means "pincushion" is probably not what you're looking for. The College Board also has some favorite ways to trap test takers who aren't completely sure of themselves. Once you know how they trick you, you're protected from falling into that trap and you're one answer choice closer to the correct one. On some occasions, you may even be able to eliminate all but the correct choice.
### **Make Only Smart Guesses**
Eliminate as many of the wrong answer choices as possible, then guess. The way the test is scored, you get one point for each right answer but you lose one third of a point for each wrong answer. You lose nothing if you leave the question blank. Therefore, you should skip the question if you really have no clue. However, if you can eliminate even one or two answer choices, it's to your advantage to guess. If you're down to two choices and can't decide, guess and move on to the next question.
**Random vs. Educated Guessing**
Make a distinction between random guessing and educated guessing. Random guessing (when you have no clue at all) won't help your score. Educated guessing (when you know enough to eliminate at least one answer choice) boosts your score.
# Part II
# Practice Test 1
Practice Test 1
Practice Test 1: Answers and Explanations
# Practice Test 1
Click here to download the PDF.
# FRENCH SUBJECT TEST 1
SECTION 1
Your responses to the SAT French questions must be filled in on Section 1 of your answer sheet (at the back of the book). Marks on any other section will not be counted toward your score.
When your supervisor gives the signal, turn the page and begin the SAT Subject Test in French.
**FRENCH SUBJECT TEST 1**
**Part A**
**Directions:** This part consists of a number of incomplete statements, each having four suggested completions. Select the most appropriate completion and fill in the corresponding circle on the answer sheet.
. Les documents dont j'ai besoin pour mon travail sont toujours dans ma...au bureau.
(A) douche
(B) mallette
(C) fourneau
(D) pot à fleur
. Il fait beau dehors; veux-tu te...après le dîner?
(A) laver
(B) demander
(C) lever
(D) promener
. Le soldat attendait avec impatience la fin de...
(A) la route
(B) la gare
(C) la guerre
(D) l'immeuble
. Il n'est pas permis d'amener votre chien...le café; veuillez le laisser à l'extérieur.
(A) dans
(B) avec
(C) en dehors de
(D) après
. Paul a besoin d'...pour soutenir son pantalon.
(A) un bras
(B) une poche
(C) une jambe
(D) une ceinture
. Pour son anniversaire, le garçon a reçu plusieurs...
(A) jours
(B) talents
(C) jardins
(D) cadeaux
. Le tailleur nous a fait de nouveaux...
(A) pneus
(B) pains
(C) vêtements
(D) ameublements
. Le...de mon immeuble est 564.
(A) nombre
(B) guide
(C) numéro
(D) nom
. Il y a douze...dans un an.
(A) mois
(B) jours
(C) heures
(D) saisons
. La route est fermée; nous ne pouvons pas...n'importe où.
(A) conduire
(B) acheter
(C) jouer
(D) sauter
. Quand je me suis marié, j'ai placé la bague sur...de ma femme.
(A) le nez
(B) le doigt
(C) les lèvres
(D) la tête
. Je suis d'accord avec lui; je pense qu'il a...
(A) tort
(B) raison
(C) mal
(D) nécessité
. Le magasin n'est pas...de mon bureau, alors je peux y aller à pied en cinq minutes.
(A) en haut
(B) tout près
(C) sur
(D) loin
. Le héros a...une fille qui était en train de se noyer.
(A) sauvé
(B) nagé
(C) remercié
(D) traîné
. L'été, il faut porter des...de soleil pour se protéger les yeux.
(A) spectacles
(B) cheveux
(C) lunettes
(D) rayons
. Il est important de...des questions à votre enseignant si vous ne comprenez pas votre manuel.
(A) enseigner
(B) poser
(C) être ennuyé avec
(D) exiger
. Ce n'est pas gentil de...tes amis.
(A) lire
(B) remplir
(C) taquiner
(D) tolérer
. Le bruit constant m'...
(A) énerve
(B) enseigne
(C) enlève
(D) enferme
. Le boulanger avait...mon pain et a dû en faire un autre.
(A) brûlé
(B) destiné à
(C) établi
(D) couvert
. La dame a...le bras pour attraper le ballon.
(A) tendu
(B) renversé
(C) retiré
(D) perdu
. L'étudiant a écrit...sur les œuvres de Maupassant.
(A) une boulette
(B) une recette
(C) une dissertation
(D) un témoin
. Si nous ne rentrons pas vite chez nous, nous serons ratrappés par...
(A) les pleurs
(B) la pousse
(C) la pluie
(D) la peur
**Part B**
**Directions:** Each of the following sentences contains a blank. From the four choices given, select the one that can be inserted in the blank to form a grammatically correct sentence and fill in the corresponding circle on the answer sheet. Choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically correct sentence.
. Le monsieur ------- à vous suggérer.
(A) n'a quelque chose
(B) n'a pas
(C) n'a rien
(D) a rien
. À ------- est ce manteau vert?
(A) que
(B) qui
(C) lequel
(D) quoi
. Je n'aime pas cette nouvelle ------- qui habite dans mon immeuble.
(A) garçon
(B) serveur
(C) homme
(D) dame
. Aimez-vous la plage? Nous ------- allons après la classe.
(A) en
(B) où
(C) y
(D) là
. La semaine prochaine je rends visite à ma cousine à -------.
(A) Mexique
(B) France
(C) Paris
(D) Chine
. Il faut toujours savoir ------- tu veux.
(A) ce que
(B) ce dont
(C) a quoi
(D) de quoi
. Jean-Claude est venu avec -------.
(A) ils
(B) leur
(C) eux
(D) soi
. C'est une décision ------- laquelle je vais beaucoup réfléchir.
(A) à
(B) sans
(C) avec
(D) dont
. Elle est la personne la plus gentille que ------- jamais connue.
(A) a
(B) j'ai
(C) j'aie
(D) sois
. Je vais nager à la plage ------- il ne fasse nuit.
(A) après qu'
(B) puisqu'
(C) avant qu'
(D) dès qu'
. Pierre ------- dehors quand le téléphone a sonné.
(A) est
(B) était
(C) soit
(D) serait
. Nous ------- bientôt si elle a réussi son examen.
(A) saura
(B) saurons
(C) saurait
(D) savait
. \------- les mains avant de manger!
(A) Lavez
(B) Brossez-vous
(C) Serrez
(D) Lavez-vous
. Il n'a pas ------- signer les papiers.
(A) décidé
(B) le droit
(C) envie
(D) voulu
. Je me ------- du souci pour votre santé.
(A) feras
(B) fasses
(C) fait
(D) faisais
. C'est à cause de ------- que nous avons raté le train.
(A) il
(B) moi
(C) se
(D) leur
. Est-ce que ------- cette dame qui va nous montrer la chambre?
(A) c'est
(B) ce soit
(C) c'était
(D) sera
. Mon travail est ------- que le vôtre.
(A) si difficile
(B) le meilleur
(C) pire
(D) trop
. N'appuyez pas trop fort sur le crayon, ------- il peut déchirer le papier.
(A) avant que
(B) sinon
(C) durant
(D) afin de
. \------- m'a écrit.
(A) Celui qui
(B) Tu
(C) C'est lui qui
(D) Personne
**Part C**
**Directions:** The paragraphs below contain blank spaces indicating omissions in the text. For some blanks, it is necessary to choose the completion that is most appropriate to the meaning of the passage; for other blanks, to choose the one completion that forms a grammatically correct sentence. In some instances, choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically correct sentence. In each case, indicate your answer by filling in the corresponding circle on the answer sheet. Be sure to read the paragraph completely before answering the questions related to it.
Il est trois heures et demie du matin quand j' ----(43)---- avec ma femme, sur le terrain de l'aérodrome pour le grand départ. Après avoir ----(44)---- pendant plusieurs jours un temps ----(45)----, nous sommes ----(46)---- prêts à partir ----(47)---- Tokyo. Ma femme, qui ----(48)---- née ----(49)---- Japon, n'a ----(50)---- visité la capitale, Tokyo. Elle voulait ----(51)---- y aller.
. (A) arrivais
(B) arriverais
(C) arrive
(D) étais arrivé
. (A) attendu
(B) attendue
(C) attendus
(D) attendues
. (A) passé
(B) mauvais
(C) triste
(D) favorable
. (A) loin d'être
(B) jamais
(C) enfin
(D) simplement
. (A) dans
(B) sans
(C) en
(D) pour
. (A) était
(B) soit
(C) est
(D) es
. (A) en
(B) au
(C) à
(D) dans
. (A) toujours
(B) pas toujours
(C) jamais
(D) guère
. (A) souvent
(B) parfois
(C) simplement
(D) tellement
Trois ou quatre cents personnes sont là pour ----(52)---- à notre envol. Je ne sais pas comment cela se fait, ----(53)---- que nous n'avions dit à personne que nous partions. Je suis très ----(54)----, mais notre avion est très chargé et la piste est couverte de neige. Je connais bien les dangers qu'il y a à ----(55)---- dans ces conditions. Tout a été longuement ----(56)----, discuté entre nous depuis des ----(57)----, avec une très grande attention. Maintenant, j' ----(58)---- l'esprit tranquille.
. (A) assister
(B) assommer
(C) asseoir
(D) aspirer
. (A) malgré
(B) parce
(C) sans
(D) dès
. (A) fière
(B) énervé
(C) calme
(D) lourd
. (A) débarrasser
(B) déborder
(C) développer
(D) décoller
. (A) étudié
(B) étudier
(C) étude
(D) étudiant
. (A) minutes
(B) secondes
(C) moments
(D) semaines
. (A) ai
(B) avais
(C) aurais
(D) ai été
**Part D**
**Directions:** Read the following texts carefully for comprehension. Each is followed by a number of questions or incomplete statements. Select the completion or answer that is best according to the text and fill in the corresponding circle on the answer sheet.
( _La Symphonie Pastorale,_ André Gide, Folio, 1925, pages 12–13)
. Qu'est-ce que le narrateur a cru avant d'aller avec l'enfant ?
(A) L'enfant vivait dans une ferme.
(B) Le narrateur a visité tous les endroits de sa paroisse.
(C) L'enfant était perdu.
(D) Le narrateur fera un tour de la commune.
. Où se trouve le narrateur ?
(A) à Saudraie
(B) dans un village
(C) dans un parc
(D) à la campagne
. Depuis combien de temps habite le narrateur à cet endroit ?
(A) Toute sa vie
(B) Moins d'une année
(C) Pour quinze ans
(D) Depuis sa jeunesse
. Qu'est-ce que l'auteur veut dire avec l'expression « l'enchantement rose et doré » ?
(A) que le narrateur est un magicien
(B) qu'il y a beaucoup des fleurs sur la route
(C) que le narrateur voit le coucher du soleil
(D) qu'il faisait presque matin
. On comprend que le narrateur
(A) rêve du lac
(B) se sent très fatigué
(C) est étourdi
(D) se rappelle soudainement le lac
. L'auteur écrit dans un style
(A) sérieux
(B) neutre
(C) drôle
(D) scientifique
. Qu'est-ce qui fait apparaître le "champion de course automobile"?
(A) l'action de se mettre au volant de l'automobile
(B) le lever du soleil
(C) l'action de se réveiller
(D) un klaxon
. D'après le passage, Jérôme Charnelet est d'habitude
(A) un champion de course
(B) d'une disposition aimable
(C) impatient
(D) généreux
. Comment Jérôme réagit-il au signal vert?
(A) Il s'arrête.
(B) Il écrase une mouche.
(C) Il ne réussit pas à voir les couleurs.
(D) Il devient un conducteur démoniaque.
. D'après le passage, qu'est-ce qui convaincrait Jérôme de changer de position sur la chaussée?
(A) la réalisation qu'il est au milieu de la route
(B) son sens de ses obligations envers les autres conducteurs
(C) les klaxons des autres conducteurs
(D) la couleur du signal
. On comprend que Jérôme conduit d'une
manière
(A) ordonnée
(B) rangée
(C) gracieuse
(D) obsédée
. Ces appartements
(A) vont être rénovés en 2005
(B) ont été rénovés au XIXe siècle
(C) sont en train d'être rénovés
(D) sont rénovés
. Cette publicité s'adresse à
(A) des acheteurs éventuels
(B) de futurs locataires
(C) des personnes âgées
(D) des vendeurs
. Après avoir lu cette publicité, on connaît tout SAUF
(A) la proximité de Paris de la résidence
(B) les heures d'ouverture du bureau de vente
(C) l'adresse exacte de la résidence
(D) l'existence d'un appartement modèle
. Ce passage concerne
(A) le nombre d'étudiants dans le système éducatif
(B) les attitudes des adolescents français
(C) le moyen de changer l'attitude des lycéens
(D) des changements récents dans le système éducatif
. Que veut dire l'expression "ils en ont ras le bol"?
(A) qu'ils n'ont pas assez à manger
(B) qu'ils se plaignent des études
(C) qu'ils doivent se raser
(D) qu'ils ne veulent plus de quelque chose
. D'après l'avis de certains étudiants, où est-ce qu'on apprend le plus?
(A) en famille
(B) à l'école
(C) dans une hiérarchie
(D) dans la vie
. Selon les étudiants qui n'aiment pas l'école, quelle est la critique la plus forte contre le système d'éducation courant?
(A) Il y a trop de travail.
(B) Les étudiants s'ennuient.
(C) Les études n'ont rien à voir avec la vie.
(D) Il n'y a pas assez de chefs.
. Le narrateur s'attend à
(A) être grondé par son patron
(B) recevoir une augmentation de salaire
(C) discuter un projet avec le patron
(D) ennuyer le patron
. Que fait le patron?
(A) Il ennuie le narrateur.
(B) Il lui commande d'aller à Paris.
(C) Il demande ce que pense le narrateur d'une suggestion.
(D) Il refuse de laisser aller le narrateur à Paris.
. Que veut faire le patron à Paris?
(A) Il veut y habiter.
(B) Il veut travailler pour une grande compagnie.
(C) Il veut ouvrir un bureau.
(D) Il veut trahir sa compagnie.
. Selon le passage, pour quelle raison le patron a-t-il suggéré le projet au narrateur?
(A) parce que le narrateur ne travaille pas bien
(B) parce que le patron pense que le narrateur serait content de cette vie
(C) parce que le patron est trop jeune pour le faire lui-même
(D) parce que tout est égal au narrateur
. Quelle est la réaction du narrateur à l'idée d'aller à Paris?
(A) Il est énervé.
(B) Il est content.
(C) Il se sent rajeuni.
(D) Il ne s'y intéresse pas beaucoup.
. Selon le passage, qu'est-ce qui rend une rivière plus grosse?
(A) l'augmentation de l'eau qui sort de la bouche de la rivière
(B) la présence de quelque chose qui bloque le chemin
(C) la présence de pierres
(D) la liberté de l'eau
. Pourquoi l'auteur décrit-il une rivière?
(A) pour caractériser la musique de Trenet
(B) pour expliquer la nature
(C) pour montrer l'importance de Trenet
(D) pour faire une analogie avec le développement de la chanson
. D'après ce passage, on comprend qu'avant Trenet la chanson
(A) était plus comme une rivière
(B) était plus compliquée
(C) avait moins de possibilités
(D) était plus artistique
. On comprend que Trenet
(A) a introduit une nouvelle façon de présenter une chanson
(B) aimait beaucoup la nature
(C) a écrit cent chansons
(D) n'était pas aimé par les autres chanteurs
**S T O P**
**If you finish before time is called, you may check your work on this test only.**
**Do not work on any other test in this book.**
# Practice Test 1:
Answers and Explanations
## **PRACTICE TEST 1 ANSWER KEY**
Question number | Correct answer
---|---
1. | B
2. | D
3. | C
4. | A
5. | D
6. | D
7. | C
8. | C
9. | A
10. | A
11. | B
12. | B
13. | D
14. | A
15. | C
16. | B
17. | C
18. | A
19. | A
20. | A
21. | C
22. | C
23. | C
24. | B
25. | D
26. | C
27. | C
28. | A
29. | C
30. | A
31. | C
32. | C
33. | B
34. | B
35. | D
36. | D
37. | D
38. | B
39. | A
40. | C
41. | B
42. | C
43. | C
44. | A
45. | D
46. | C
47. | D
48. | C
49. | B
50. | C
51. | D
52. | A
53. | B
54. | C
55. | D
56. | A
57. | D
58. | A
59. | B
60. | D
61. | D
62. | C
63. | D
64. | C
65. | A
66. | B
67. | D
68. | C
69. | D
70. | C
71. | A
72. | C
73. | B
74. | D
75. | D
76. | C
77. | A
78. | C
79. | C
80. | B
81. | D
82. | B
83. | D
84. | C
85. | A
## **PRACTICE TEST 1 EXPLANATIONS**
The possible choices are examined for clues that should have indicated the correct answer. To help explain why a choice is right or wrong, resemblances between English and French words are noted, grammatical explanations are given, and an analysis of the Comprehension questions is provided.
### **Part A**
. **B** The sentence means, "The documents that I need for work are always in my...at the office. The key word or phrase is _pour mon travail_. Choice (A) means shower, (B) means briefcase, (C) means oven, and (D) means flower pot. The only answer that works is (B).
. **D** The sentence means, "It's nice outside; do you want to...after dinner. The key phrase is _Il fait beau_. Choice (A) means to wash, (B) means to ask, (C) means to get up, and (D) means to take a walk. Choices (A) and (B) do not logically complete the sentence, while (C) does not closely relate to the weather outside being nice. The answer is (D).
. **C** The sentence means, "The soldier was waiting impatiently for the end of the..." The key phrase is _soldat_. Choice (A) means the road, (B) means the train station, (C) means the war, and (D) means building. Choices (A) and (D) do not logically link to something a soldier would wait for. Be very careful with confusing (B) and (C) which look similar. The answer is (C).
. **A** The sentence means, "It is not permitted to bring your dog...the café; please leave him outside." The key phrases are _n'est pas permis_ and _à l'extérieur._ Choice (A) means in or inside, (B) means with, (C) means apart from, and (D) means after. Choices (B) and (D) are not things you would do with your dog and a café. Choice (C) has the word _dehors_ by itself means outside, but the sentence is negated ( _n'est pas_ ), so the opposite answer is needed. This is a trap answer. The answer is (A).
. **D** The sentence means, "Paul needs...to hold up his pants." The key phrase is _soutenir son pantalon_. Choice (A) means an arm, (B) means a pocket, (C) means a leg, and (D) means a belt. Choice (A) doesn't connect to pants. Choices (B) and (C) are things associated with pants, but are wrong since they do not relate to holding up ( _soutenir_ ) the pants. The answer is (D).
. **D** The sentence means, "For his birthday, the boy received many..." The key word is _anniversaire_. Choice (A) means days, (B) means talents, (C) means gardens, and (D) means presents. Choice (A) is tricky since the words look similar to the word for toys ( _jouets_ ). Choices (B) and (C) do not link to the key word. The answer is (D).
. **C** The sentence means, "The tailor made us new...." The key phrase is _Le tailleur_ , which looks very similar to tailor in English. Choice (A) means lungs, (B) means bread, (C) means clothes, and (D) means home furnishings. The only answer that works is (C).
. **C** The sentence means, "The...of my building is 564." The key phrases are _immeuble_ and _564_. Choice (A) means number, (B) means guide, (C) means number, and (D) means name or noun. Choices (B) and (D) don't match, but (A) and (C) have the same English translation. The difference is in the usage. In French, _nombre_ refers to a collection or group of things. For example, _un grand nombre de participants_ means a large number of participants. In contrast, _numéro_ refers to a list of digits. For example, _mon numéro_ _de telephone_ is my telephone number. Since 564 is a list of digits, the answer is (C).
. **A** The sentence means, "There are twelve...in a year." The key words are _douze_ and _dans un an_. Choice (A) means months, (B) means days, (C) means hours, and (D) means weeks. The answer is (A).
. **A** The sentence means, "The road is closed; we cannot...anywhere." The key phrase is _La route_. Choice (A) means drive, (B) means buy, (C) means play, and (D) means jump. The answer is (A).
. **B** The sentence means, "When I got married, I put a ring on the...of my wife." The key phrases are _je me suis marié_ and _la bague_. Choice (A) means nose, (B) means finger, (C) means lips, and (D) means head. If the meaning of _la bague_ was unknown, use the word _marié_ to eliminate (A) and (D). The answer is (B).
. **B** The sentence means, "I agree with him; I think he is..." The key phrase is _d'accord_. Choice (A) means wrong, (B) means right, (C) means suffers, and (D) means needed. The answer is (B).
. **D** The sentence means, "The store is not...from my office, so I can walk there in five minutes." The key phrases are _n'est pas_ and _à pied_ en cinq minutes. Choice (A) means up high, (B) means very near, (C) means on, and (D) means far. Choices (A) and (C) do not logically match the key
phrases. Choice (B) is a trap answer. Since the very is negated, the opposite word is needed. The answer is (D).
. **A** The sentence means, "The hero...a woman who was drowning." The key phrases are _Le héros_ and _en train de se noyer_. Choice (A) means saved, (B) means swam, (C) means thanked, and (D) means dragged. Even if the meaning of _se noyer_ is unknown, use the key phrases of _Le héros_ to eliminate (B) and (C). _Sauvé_ is a cognate with the English word saved and is a best guess even if the word _traîné_ is unknown. The answer is (A).
. **C** The sentence means, "In summer, you should wear...[of sun] to protect your eyes." The key phrase is _se protéger les yeux_. Choice (A) means a show or large event, (B) means hair, (C) means sunglasses in the context of _de soleil_ , and (D) means a ray of sunshine in the context of _de soleil_. Choices (B) and (D) are not items that are worn, so these can be eliminated. Choice (A) is a _faux-ami_ and is a trap answer. The answer is (C).
. **B** The sentence means, "It is important to...questions to your teacher if you do not understand your textbook." The key phrases are _à votre enseignant_ and _si vous ne comprenez pas_. Choice (A) means teach, (B) means ask, (C) means be bored with, and (D) means to demand. Choices (C) and (D) do not match the key phrases. Answer (A) is a look-alike word to a word in the sentence and is a trap. The answer is (B).
. **C** The sentence means, "It is not nice to...your friends." The key phrase is _n'est pas gentil_. Choice (A) means to read, (B) means to fill up, (C) means to tease, and (D) means to tolerate. Choice (A) doesn't match the negative tone of the sentence. Choice (B) is a possible trap since it looks like replace. Choice (D) doesn't logically mesh with the sentence. The answer is (C).
. **A** The sentence means, "The constant noise...me." The key phrase is _bruit_. Choice (A) means annoys, (B) means teaches, (C) means removes, and (D) means shuts up. The question is made challenging since all the words are similar in appearance. The answer is (A).
. **A** The sentence means, "The baker had...my bread and he had to make another one." The key phrases are _Le boulanger_ and _a dû en faire un autre_. Choice (A) means burned, (B) means destined to, (C) means established, and (D) means covered. Choice (D) can be confused with _cuit au four_ which means baked. The answer is (A).
. **A** The sentence means, "The woman...her arm to catch the ball." The key phrases are _le bras_ and _attraper_. Choice (A) means to hold out, (B) means turned around, (C) means withdrew, and (D) means lost. The answer is (A).
. **C** The sentence means, "The student wrote...on the works of Maupassant." The key phrase is _L'étudiant a écrit_. Choice (A) means a small paper ball, (B) means a recipe, (C) means an essay, and (D) means a witness. Choice (C) is a cognate with the English word dissertation, which means a very long report. The answer is (C).
. **C** The sentence means, "If we don't hurry home, we will get caught in..." The key phrase is _nous serons ratrappés par_. Choice (A) means the tears, (B) means the growth (of plants), (C) means the rain, and (D) means the fear. This question is made challenging since all the answers are very similar looking. The answer is (C).
### **Part B**
. **C** _Pronouns_
The sentence means, "The man-------to suggest to you." Choice (A) has no negation word to pair with _ne_. Choice (B) has no pronoun which would be required with this negation. Choice (C) means has nothing, which is the correct _ne_ plus a negation, and (D) is missing the _ne_ portion of the negation pair. The answer is (C).
. **B** _Pronouns_
The sentence means, "To-------belongs this green coat?" Choice (A) is wrong since _à_ is a preposition and the word _que_ is never used with a preposition. Choice (B) is correct since _qui_ is used with prepositions and can mean whom in this context. Choice (C) means which and does not match the context of the sentence. Choice (D) means what and does not match the context of the sentence. The answer is (B).
. **D** _Odds and Ends: Article agreement_
The sentence means, "I don't like this new------who lives in my building." The phrase this new ( _cette nouvelle_ ) is feminine singular. Choice (A) is masculine and would require _ce noueau_. Choice (B) is masculine and would require _ce nouveau_. Choice (C) is masculine and is a silent h, which would require _ce nouvel_. Choice (D) is a singular feminine noun. The answer is (D).
. **C** _Pronouns_
The sentence means, "Do you like the beach? We're going ------- after class." In French, the pronouns precede the verb, while in the English translation, they follow the verb. The required pronoun needs to refer to a location or place. Choice (A) could refer to a place if the verb takes _de_ ; however, _aller_ takes the pronoun _à._ Choice (B) means where but is a pronoun that is used to connect two phrases (like _qui_ or _que_ ). Choice (C) refers to place and is the proper pronoun to replace the preposition _à._ Choice (D) means there, but _là_ is an adverb and cannot be used in this location in the sentence. The answer is (C).
. **C** _Prepositions_
The sentence means, "Next week I wil visit my cousin in ------- ." The preposition _à_ can sometimes refer to a country, but more often refers to a city. Additionally, countries take a definite article
( _la/le_ ) in this context. Choice (A) would need to say _au Mexique_ since Mexico takes the masculine article. Choice (B) would need to say _en France_ rather than _à_. Choice (C) is the correct usage for a city. Choice (D) would need to say _en Chine_. The answer is (C).
. **A** _Pronouns_
The sentence means, "You always need to know ------- you want." This question is testing relative pronouns. Many times, relative pronouns connect to prepositions. It is important to note that the verb _vouloir_ does not take a preposition. Choice (A) means what and does not use a pronoun. Choice (B) would require a verb with the preposition _de_. Choice (C) would require a verb with the preposition _à._ Choice (D) does not fit the context of the sentence with the word _savoir_. The answer is (A).
. **C** _Pronouns_
The sentence means, "Jean-Claude came with ------- ." The question is testing for the correct form of the pronoun after the preposition _avec_. This requires the stressed pronoun. Choice (A) is a subject pronoun. Choice (B) is an indirect object pronoun. Choice (C) is a stressed pronoun. Choice (D) is a reflexive pronoun. The answer is (C).
. **A** _Prepositions_
The sentence means, "It's a decision ------ which I have to reflect a lot. The question is testing what the correct form of the pronoun is that matches with the verb _réfléchir_. Choice (A) is correct since the phrase is _réfléchir à_. Choice (B) would be _réfléchir sans_. Choice (C) would be _réfléchir avec_. Choice (D) is wrong since _dont_ and _laquelle_ cannot be used together. The answer is (A).
. **C** _Verbs_
The sentence means, "She is the nicest person that -------- ever known." The question is testing which form of the verb is needed and whether that verb also needs a subject. In French, the subject must always be explicit. When a sentence uses the superlative (nicest), subjunctive tense is required. Choice (A) is indicative and lacks a subject. Choice (B) is indicative with a subject. Choice (C) is subjunctive with a subject. Choice (D) is subjunctive without a subject. The answer is (C).
. **C** _Prepositions/Verbs_
The sentence means, "I'm going swimming at the beach ------- it becomes night." The question is testing which preposition would logically complete the sentence. However, the second phrase is in the form of the subjunctive, so the preposition chosen must also require the use of the subjunctive. Choice (A) means after and requires indicative. Choice (B) means since and requires indicative. Choice (C) means before and requires subjunctive. Choice (D) means as soon as and requires indicative. While all of these prepositions could logically complete the sentence, only one requires the subjunctive. The answer is (C).
. **B** _Verbs_
The sentence means, "Peter ------- outside when the telephone rang." The sentence is testing which form of the verb best matches with the past tense verb _a sonné_. Choice (A) is present tense, but the rest of the sentence is past. Choice (B) is imperfect ( _l'imparfait_ ), which is one of the past tense forms. Choice (C) is present subjunctive. There is no reason to use the subjunctive or present tense. Choice (D) is conditional. There is no conditional phrase with _si_ so eliminate (D). The answer is (B).
. **B** _Verbs_
The sentence means, "We ------- soon if she passed her exam. The key phrases here are _si_ and _a réussi_. Typically, sentences with an "if" clause in the _passé compose_ require future tense. Choice (A) is in the future tense, but is third person singular (he/she/it) so doesn't match _nous_. Choice (B) is in the future tense and is first person plural (we). Choice (C) is the conditional tense. Choice (D) is the imperfect tense. The answer is (B).
. **D** _Pronouns_
The sentence means, " ------- your hands before eating!" The sentence is testing both the correct vocabulary word and whether a reflexive pronoun is needed with this command. Choice (A) means wash but does not have a reflexive pronoun indicating who should wash what. Choice (B) means to brush and refers to teeth, not hands. Choice (C) means to shake hands and does not match eating. Choice (D) means to wash and contains the reflexive pronoun. The answer is (D).
. **D** _Prepositions_
The sentence means, "He does not have/He didn't ------ to sign the papers." At first glance this sentence is testing word choice, but each word logically completes the sentence, so consider other things the SAT tests, such as prepositions. Choice (A) means decided but requires the preposition _de_. Choice (B) means the right but requires the preposition _de_. Choice (C) means desire but requires the preposition _de_. Choice (D) means want and does not need a preposition. The answer is (D).
. **D** _Verbs_
The sentence means, "I ------- worry about your health." Choice (A) is the future tense. Choice (B) is subjunctive. Choice (C) is present third person (he/she/it). Choice (D) is imperfect first person (I). There is no reason to use future or subjunctive in this sentence. Past or present tense would both work; however, (C) does not match the subject. The answer is (D).
. **B** _Pronouns_
The sentence means, "It is ------- fault that we missed the train." A more literal translation would be, "It is the cause of -------, that we missed the train. The question is testing the correct form of the pronoun that follows the preposition _de_. Prepositions require the stressed pronoun. Choice (A) is a subject pronoun. Choice (B) is a stressed pronoun. Choice (C) is a reflexive pronoun. Choice (D) is an indirect object pronoun. The answer is (B).
. **A** _Verbs_
The sentence means, "------- the woman who is going to show us the room?" The key phrase is _va nous montrer_ which is immediate future. Choice (A) is present tense with a subject. Choice (B) is present subjunctive. Choice (C) is imperfect. Choice (D) is future but lacks a subject. There is no reason to use subjunctive. Past tense does not match the second half of the sentence. Both present and future tense would work, but there needs to be a subject _ce_. The answer is (A).
. **C** _Odds and Ends: comparatives_
The sentence means, "My work is ------- than yours is." The key phrase is _que le vôtre_ indicating the need for a comparison. Choice (A) means so difficult and is not a comparison. Choice (B) means the best and is superlative rather than a comparison. Choice (C) means worse and can be used to compare two things. Choice (D) means too much. The answer is (C).
. **B** _Prepositions_
The sentence means, "Don't push too hard on the pencil, ------- it can tear the paper." This question is testing the word that most logically connects the two phrases. Choice (A) means before and would require subjunctive. Choice (B) means otherwise. Choice (C) means during. Choice (D) means in order to. The answer is (B).
. **C** _Prepositions_
The sentence means, " ------- wrote to me." The question is testing the correct pronoun to begin the sentence. Choice (A) means he that and would leave this as an incomplete sentence. Choice (B) is a subject pronoun, but doesn't match the verb ( _tu m'as écrit_ ). Choice (C) means that is the person who and is in the correct form of the pronoun. Choice (D) matches the verb, but the negation form requires _ne_. The answer is (C).
### **Part C**
The following translation is for questions 43–51.
It is three thirty in the morning when I ---(43)--- with my wife, on the field of the airport for the grand departure. After having ---(44)--- for many days a ---(45)--- time, we are ---(46)--- ready to leave ---(47)--- Tokyo. My wife, who ---(48)--- born ---(49)--- Japan, has ---(50)--- visited the capital, Tokyo. She has ---(51)--- wanted to go there.
. **C** _Verbs_
Choice (A) is imperfect, which is an ongoing action in the past. Choice (B) is conditional and requires an "if" statement. Choice (C) is in the present tense. Choice (D) is the past perfect and is an action complete in the past before another action. The answer is (C).
. **A** _Verbs_
The question is testing when the participle requires agreement. Since the verb is _avoir_ no agreement is necessary. Choice (A) has no agreement. Choice (B) is the feminine and is not needed. Choice (C) is the plural and is not needed. Choice (D) is the feminine plural and is not needed. The answer is (A).
. **D** _Vocabulary_
The question is testing for the word that most logically completes the sentence. Choice (A) means past. Choice (B) means unpleasant weather. Choice (C) means sad. Choice (D) means favorable weather. Choices (A) and (C) are illogical. Choice (B) does not match the first sentence, which shows the couple leaving. The answer is (D).
. **C** _Vocabulary_
The question is testing for the word or phrase that most logically completes the sentence. Choice (A) means far from. Choice (B) means never. Choice (C) means finally. Choice (D) means simply. The answer is (C).
. **D** _Prepositions_
The question is testing the correct preposition to match with the verb _partir_. Choice (A) means in. Choice (B) means without. Choice (C) means to but cannot be used with cities. Choice (D) means for. The correct answer is (D).
. **C** _Verbs_
The question is testing the correct form of the verb to precede the word born ( _née_ ). The verb _naître_
is conjugated with the present tense of the verb _être_ to form the _passé composé._ Choice (A) is
imperfect. Choice (B) is the present subjunctive tense. Choice (C) is the present tense. Choice (D) is present tense but is in the second person ( _tu es_ versus _ma femme est_ ). There is no need for subjunctive in this sentence. The answer is (C).
. **B** _Prepositions_
The question is testing the correct preposition to follow _née_ and precede _Japon_. Choice (A) cannot be used with _Japon_. Choice (B) is the correct preposition to precede _Japon,_ since _Japon_ takes the masculine article. Choice (C) is missing the article ( _la/le_ ). Choice (D) is not the correct preposition in this context. The answer is (B).
. **C** _Vocabulary_
The question is testing the correct negation pair to logically complete the sentence. The key phrase is _n'a...visité_. Choice (A) is not a negation pair. Choice (B) means not always. Choice (C) means never. Choice (D) means rarely. Choices (B) and (D) do not make sense in the context of the story. The answer is (C).
. **D** _Odds and Ends: adverbs_
While this question is testing adverbs, it is also helpful to think in terms of vocabulary. The question is testing which word most logically completes the sentence. Choice (A) means often. Choice (B) means sometimes. Choice (C) means simply. Choice (D) means really (so much). In the context of the passage, (B) and (C) do not make logical sense. Choice (A) does not provide enough emphasis. The answer is (D).
The following translation is for questions 52–58.
Three or four hundred people are there to ---(52)--- our flight. I do not know how that happened, ---(53)--- we had not told anyone we were leaving. I am very ---(54)---, but our plane is heavily loaded and the runway is covered in snow. I fully understand the dangers that exist when
\---(55)--- in these conditions. All had been ---(56)--- at length, discussed among ourselves for many
\---(57)---, with great attention to detail. Now, I ---(58)--- a tranquil spirit.
. **A** _Vocabulary_
The question is testing the correct word that logically completes the sentence. Choice (A) means to attend. Choice (B) means to knock down. Choice (C) means to sit. Choice (D) means to aspire. The answer is (A).
. **B** _Vocabulary_
The question is testing the correct word to use to connect the two phrases. The second phrase explains the reason for the first phrase. Choice (A) means in spite of. Choice (B) means because. Choice (C) means without. Choice (D) means as soon as. The answer is (B).
. **C** _Vocabulary_
The question is testing the correct word to logically complete the sentence. Choice (A) means proud. Choice (B) means annoyed. Choice (C) means calm. Choice (D) means heavy. The correct answer is (C).
. **D** _Vocabulary_
The question is testing the correct word to logically complete the sentence. Choice (A) means getting rid of. Choice (B) means overflowing. Choice (C) means developing. Choice (D) means taking off. This question is made challenging since all of the answers look very similar. The answer is (D).
. **A** _Odds and Ends: Adjectives_
This question is testing which form of the word _étudier_ to use in the sentence. The key phrase is _Tout a été_ , which means Everything had been. Since the verb _être_ is used, the participle or adjective form of the verb is needed and must match the gender and number of the subject _Tout_. Choice (A) is the participle or adjective form of the word. Choice (B) is the infinitive verb form. Choice (C) is a noun meaning study. Choice (D) is a noun, meaning student. The answer is (A).
. **D** _Vocabulary_
This question is testing the correct word to logically complete the sentence. The key phrase in the sentence is _longuement_. Choice (A) means minutes. Choice (B) means seconds. Choice (C) means moments. Choice (D) means weeks. Though there is no explicit support for weeks, (A), (B), and (C) all refer to a short amount of time. The answer is (D).
. **A** _Verbs_
The question is testing the correct tense of the verb to use. The key phrase is _Maintenant_ , which means now. Also note that much of the paragraph is narrated in the present tense. Choice (A) is the present tense. Choice (B) is the imperfect tense. Choice (C), conditional. Choice (D) is the _passé compose_. The answer is (A).
### **Part D**
The following translation is for questions 59–63.
I believed that I had thoroughly known all the different parts of my community; but past the Saudrie farm, the boy took me down a road along which I had never traveled. All the same, I recognized, about two kilometers away, on the left, a little mysterious lake where I had sometimes swum as a young man. It has been fifteen years since I had last seen it, since no pastoral duty had called me to this area; I would not have been able to explain where it was and at this point in my life, I had stopped thinking about it when it seemed to me, all of a sudden, in the rose and golden enchantment of the evening, that I recognized it, having at first only seen it in a dream.
. **B** The question asks, "What did the narrator believe before going with the boy?"
(A) No. "The boy lived on a farm." These are familiar words—wrong context. The passage says the boy took him past a farm.
(B) Yes. "The narrator had visited all the parts of his parish." In line 1, the passage says " _Je croyais connaître admirablement tous les entours..._ "
(C) No. "The boy was lost." This answer confuses _prendre_ , which means to take, with _être_ _perdue_ , which means to be lost.
(D) No. "The narrator will take a tour of his community." These are familiar words—wrong context. It is also in the future tense which does not address the question of what the narrator believed _before_ going with the boy.
. **D** The question asks, "Where is the narrator?"
(A) No. "At Saudrie." These are familiar words—wrong context. This is the name of a local farm the narrator passes.
(B) No. "In a village." There is no context for this. While the narrator mentions _commune_ , which is a community, there is no evidence of a town.
(C) No. "In a park." There is no context for this. While the narrator can see a lake, there is no evidence that he is in a park of any sort.
(D) Yes. "In the countryside." The narrator mentions _commune_ , which is a territorial division similar to community in English. Likewise, he mentions _un lac_ and _une ferme_ , both of which are more likely to be found in a rural community.
. **D** The question asks, "How long has the narrator lived in this area?"
(A) No. "All his life." There is no context for this in the passage.
(B) No. "Less than a year." The narrator mentions that he went swimming in this area as a young man, and has had pastoral duties in that area for at least fifteen years.
(C) No. "For fifteen years." These are familiar words—wrong context. The narrator says that no pastoral duty has brought him to that part of his parish for fifteen years, but it does not say that he had been living there for only fifteen years.
(D) Yes. "Since he was young." This is supported by the fact that he went swimming in the lac as a young man, but hadn't visited the area for at least the last fifteen years as a pastor.
. **C** The question asks, "What does the author mean when he says 'the rose and golden enchantment'?"
(A) No. "That the narrator is a magician." These are familiar words—wrong context. There is an enchantment in a figurative rather than literal sense.
(B) No. "That there are a lot of flowers along his route." There is no context evidence for this.
(C) Yes. "That the narrator sees the sunset." The narrator says that the rose and golden enchantment were _au soir_ or "of the evening."
(D) No. "That it is nearly morning." This is contradicted by the passage. While a sunrise might make rose and golden colors, the narrator specifies _au soir_.
. **D** The question asks, "It is understood that the narrator:"
(A) No. "Dreamed of a lake." These are familiar words—wrong context.
(B) No. "Feels very tired." There is no context for this. Dreaming does not mean the narrator is sleepy.
(C) No. "Is forgetful." There is no context for this. Just because the narrator had not thought of the lake for many years does not mean that he is forgetful.
(D) Yes. "Suddenly remembers the lake." This is supported when the passage says _tout à coup...je le reconnus_ , which means suddenly I remembered.
The following translation is for questions 64–69.
There is, deep in the heart of many Frenchmen, a champion race car driver lies dormant and awakens at the simple contact of the foot against the accelerator. The peaceable citizen, who
politely invited you to join him in his car, can change into a demon driver before your eyes. Jerome
Charnelet, that kind father and family man, who would not even squash a bug on a window, is suddenly ready to run over a pedestrian a kilometer away, since he feels it is "within his rights." At a green light, he sees red. Nothing will stop him anymore, much less a yellow light. On the road, this man, who typically lives an orderly life, will never pull over to let others pass. It is only at the end of his resources, after sustained honking, that he will consent with a bad grace to abandon the middle of the road.
. **C** The question asks, "The author writes in a style that is:"
(A) No. "Serious" The author makes several jokes including a word play ( _qui passe pour rangé, ne se range pas du tout_.)
(B) No. "Neutral." The author is doing more than just describing a scene.
(C) Yes. "Humorous." This is supported by the exaggerations and word plays in the passage.
(D) No. "Scientific." There is no context for this.
. **A** The questions asks, "What makes the racecar driver appear?"
(A) Yes. "The act of getting behind the wheel." This is supported in line 2 when the passage says _que reveille le simple contact du pied_.
(B) No. "The sunrise." These are familiar words—wrong context. _Réveiller_ does not imply a sunrise.
(C) No. "The action of waking up." These are familiar words—wrong context. _Réveiller_ is used in a figurative sense here rather than a literal one.
(D) No. "A horn." These are familiar words—wrong context. _Klaxxoner_ is mentioned later in the passage but is not used to wake up the racecar driver.
. **B** The question asks, "According to the passage, Jerome Charnelet is usually:"
(A) No. "A racecar driver." These are familiar words—wrong context. Jerome is transformed into a racecar driver when he drives. This is not what he is usually like.
(B) Yes. "Of a kind disposition." This is supported by the text _ce bon père de famille_.
(C) No. "Impatient." This is how he drives, but is not what Jerome is usually like.
(D) No. "Generous." There is no support for this in the passage.
. **D** The question asks, "How does Jerome react to the green light?"
(A) No. "He stops." This is a trick question about him seeing red ( _il voit rouge_ ).
(B) No. "He swats a fly." This is familiar words—wrong context.
(C) No. "He has trouble seeing colors." This is too literal of a reading of the sentence "at a green light, he sees red."
(D) Yes. "He becomes a crazy driver." This is supported by the idiomatic expression, he sees red.
. **C** The question asks, "According to the passage, what convinces Jerome to change lanes on the road?"
(A) No. "The realization that he is in the middle of the road." These are familiar words—wrong context.
(B) No. "His sense of obligation to the other drivers." These are familiar words—wrong context.
(C) Yes. "The horns of the other drivers." This is supported by the passage _avoir subi une klaxxonade nourrie_.
(D) No. "The color of the traffic light." These are familiar words—wrong context.
. **D** The question asks, "It is understood that Jerome drives in a manner that is"
(A) No. "Orderly." There is no support for this in the text.
(B) No. "Steady." This is a familiar word—wrong context.
(C) No. "Gracious." This is the opposite of the text.
(D) Yes. "Obsessive." This is supported in the text by the phrase _pilote démoniaque_.
The following translation is for questions 70–72.
92 Seine Heights. Modern comfort, antique charm.
Residence "La Valvert." On the Parisian boat docks near to a highway access, 10 apartments are in the process of being renovated (from studio to 4 bedroom). Private parking in an enclosed garage. Near to downtown with an exceptional view of a park with hundred year old trees. Prices starting at 110,000€. Home delivery in the 3rd trimester of 2005. Sales office and model room: 01 587 45 35 12. From Mondays to Saturdays 930a to 7p, Sundays by appointment only.
. **C** The question asks, "These apartments:"
(A) No. "Will be renovated in 2005." There is no context for this.
(B) No. "Were renovated in the 19th century." These are familiar words—wrong context.
(C) Yes. "Are being renovated." This is supported by the passage _en cours de renovation_.
(D) No. "Are renovated." These are familiar words—wrong context.
. **A** The question asks, "This advertisement is aimed at:"
(A) Yes. "Prospective buyers." This is supported by the passage _bureau de vente_.
(B) No. "Future tenants." This is close but these are for sale rather than for rent.
(C) No. "Elderly people." There is no context for this.
(D) No. "Sellers." This is a familiar word—wrong context.
. **C** The question asks, "After reading this advertisement, one has learned everything EXCEPT:"
(A) No. This is learned since it is _aux portes de Paris_ and _proche de centre ville_.
(B) No. This is learned in the last line of the advertisement.
(C) Yes. The name of the building is 92 Seine Heights, but this is not the exact address. This is not something learned from the advertisement.
(D) No. This is learned since the passages mentions _appartement-témoin_.
The following translation is for questions 73–76.
In March of 1973, a Parisian newspaper asked youths aged 14-15 what was, for them, the worst moment of their day; more than half (57%) answered: "When I leave in the morning for school" and 23% said "the time I spend in school." Everyone also knows that: many high school students are bored; they've had enough, they are fed up with it [literally: they have filled their bowl]. These are phrases that one often hears and reads. Some say: "tests help you find work, to have a better job. Without a diploma, you cannot find any work." But others think that school is pointless, that they can learn more from radios, movies, television, and travel; and that school is often cut off from real life and that it is fabricated, like society, with many bosses, a massive hierarchy.
. **B** The question asks, "This passage is concerned with:"
(A) No. "The number of students in the educational system." The story does provide some percentages, but no exact numbers are mentioned.
(B) Yes. "The attitude of French youth." This is supported by the passage.
(C) No. "The way to change the attitude of French students." There is no context for this.
(D) No. "Recent changes in the educational system." There is no context for this.
. **D** The question asks, "What does the expression " _ils ont ras le bol_ " mean?
(A) No. "That they don't have enough to eat." This is a trap that ignores the figurative meaning of _le bol_.
(B) No. "That they complain about their studies." These are familiar words—wrong context.
(C) No. "That they should shave." This is a confusion of _ras_ and _raser_.
(D) Yes. "They do not want any more of something." This is supported by the phrase _ils en ont
assez_.
. **D** The question asks, "According to certain students, where does one learn the most?"
(A) No. "At home." There is no context for this.
(B) No. "At school." No, certain students are complaining about school.
(C) No. "In a hierarchy." No, these are familiar words—wrong context.
(D) Yes. "In life." This is supported by students feeling they can learn _à la radio, à la television,_ etc.
. **C** The question asks, "According to students who do not like school, what is the strongest criticism of the educational system?"
(A) No. "There is too much work." There is no context for this.
(B) No. "The students are bored." This is a problem, but one that _tout le monde_ knows. This does not come from the students.
(C) Yes. "Studies have nothing to do with real life." This is supported by the passage _l'école est souvent coupée de la vie_.
(D) No. "There aren't enough bosses." This is the opposite of the passage.
The following translation is for questions 77–81.
A little while later, my boss called me and, at that time, I was bothered since I thought he would tell me to speak less on the phone and to work more. That is not at all what happened. He told me that he would tell me about a vague project. He only wanted to get my advice on something. He was planning on opening an office in Paris that would deal with business locally, and directly, with large companies, and he wanted to know if I felt like going there. This would allow me to live in Paris and travel a bit each year. "You are young, and it would seem to me that this would give you an enjoyable life." I told him yes, but deep down, it didn't really matter to me at all.
. **A** The question asks, "The narrator expects:"
(A) Yes. "To be scolded by his boss." This is supported by the passage _j'ai été ennuyé_.
(B) No. "To get a raise." There is no context for this in the passage.
(C) No. "To discuss a project with his boss." These are familiar words—wrong context. It is what happens to the narrator, but not what he expected to happen.
(D) No. "To annoy the boss." These are familiar words—wrong context.
. **C** The question asks, "What does the boss do?"
(A) No. "He annoys the narrator." These are the right words—wrong context.
(B) No. "He orders him to go to Paris." This is too strong. The boss asks rather than orders.
(C) Yes. "He asks what the narrator thinks of a suggestion." This is supported by the passage _avoir mon avis sur la question_.
(D) No. "He refuses to let the narrator go to Paris." This is opposite of the passage.
. **C** The question asks, "What does the boss want to do in Paris?"
(A) No. "He wants to live there." There is no support for this in the passage.
(B) No. "He wants to work for a large company." These are familiar words—wrong context.
(C) Yes. "He wants to open an office." This is supported by the passage _l'intention d'installer un bureau_.
(D) No. "He wants to betray his company." There is no support for this in the passage.
. **B** The question asks, "According to the passage, why does the boss suggest the project to the narrator?"
(A) No. "Because the narrator does not work very well." No, these are familiar words—wrong context.
(B) Yes. "Because he thinks the narrator would enjoy it." This is supported by the passage _c'est une vie qui doit vous plaire_.
(C) No. "Because the boss is too young to do it himself." These are familiar words—wrong context.
(D) No. "Because it's all the same to the narrator." These are familiar words—wrong context.
. **D** The question asks, "What reaction does the narrator have to the idea of moving to Paris?"
(A) No. "He is irritated." There is no context for this.
(B) No. "He is happy." He says yes, but there is no context for his being happy.
(C) No. "He feels rejuvenated." There is no context for this.
(D) Yes. "He's not really that interested in going." This is supported by the passage _cela m'était égal_.
The following translation is for questions 82–85.
When a river is blocked by a large rock, it waits, grows, and grows some more. Suddenly, the rock is pushed aside, and the water, finally free, can continue on its way. The same thing often occurs in the history of the arts. Charles Trenet managed to push aside that which was blocking French song. He made it into an art from, but at the same time he gave it a greater freedom: freedom in the music, in the words, and even in the gestures of the singer on stage. After Trenet, there was not one song, there were ten, twenty, a hundred songs: after him artists felt freer to make, write, and sing anything they wanted.
. **B** The question asks, "What makes a river bigger?"
(A) No. "An increase in water from the mouth of the river." These are familiar words—wrong context.
(B) Yes. "The presence of something that blocks the way." This is supported by the passage _est bouchée par une grosse pierre_.
(C) No. "The presence of rocks." Careful. According to the passage, the rock must block the river. These are familiar words—wrong context.
(D) No. "The freedom of the water." These are familiar words—wrong context.
. **D** The question asks, "Why does the author describe a river?"
(A) No. "To characterize Trenet's music." This is close, but it ignores the sentence before that mentions _la même chose_.
(B) No. "To explain nature." There is no context for this in the passage.
(C) No. "To show Trenet's importance." Again, this is tricky since the author discusses his importance later. However, this ignores the sentence earlier that mentions _la même chose_.
(D) Yes. "To make an analogy with the development of song." This is supported by the passage _Il se passe souvent la même chose dans l'histoire des arts._
. **C** The question asks, "According to the passage, before Trenet songs:"
(A) No. "Were more like a river." These are familiar words—wrong context.
(B) No. "Were more complicated." There is no context for this.
(C) Yes. "Had fewer possibilities." This is supported by the passage _après lui les artistes se sentent plus libres_.
(D) No. "Were more artistic." These are familiar words—wrong context.
. **A** The questions asks, "It is understood that Trenet:"
(A) Yes. "Introduced a new way of presenting songs." This is supported by the passage _Trenet a fait sauter ce qui bouchait la chanson fran_ çaise.
(B) No. "Loved nature." There is no support for this in the passage.
(C) No. "Wrote a hundred songs." These are familiar words—wrong context.
(D) No. "Wasn't liked by other singers." There is no context for this.
## **HOW TO SCORE PRACTICE TEST 1**
When you take the real exam, the proctors will collect your test booklet and answer sheet and send your answer sheet to a processing center where a computer looks at the pattern of filled-in ovals on your answer sheet and gives you a score. We are providing you, however, with this more primitive way of scoring your exam.
### **Determining Your Score**
**STEP 1** Using the answer key, determine how many questions you got right and how many you got wrong on the test. Remember: Questions that you do not answer do not count as either right answers or wrong answers.
**STEP 2** Write the number of correct answers on line A.
(A) __________
**STEP 3** Write the number of wrong answers on line B. Divide that number by 3.
(B) _______÷ 3 = _______
**STEP 4** Subtract the number of wrong answers divided by 3 on line B from the number of correct answers on line A, and round to the nearest whole number. (C) is your **raw score**.
(A)_______– (B) _______= (C) _______
**STEP 5** To determine your **real score** , look up your raw score in the left column of the Score Conversion Table on the next page; the corresponding score on the right is the score you earned on the exam.
## **PRACTICE TEST 1 SCORE CONVERSION TABLE**
**Raw score** | **Scaled score**
---|---
85 | 800
84 | 800
83 | 800
82 | 800
81 | 800
80 | 800
79 | 800
78 | 800
77 | 800
76 | 790
75 | 790
74 | 780
73 | 780
72 | 770
71 | 770
70 | 760
69 | 760
68 | 750
67 | 740
66 | 740
65 | 730
64 | 730
63 | 720
62 | 720
61 | 710
60 | 710
59 | 700
58 | 700
57 | 690
56 | 690
55 | 680
54 | 680
53 | 670
52 | 660
51 | 660
50 | 650
49 | 650
48 | 640
47 | 640
46 | 630
45 | 630
44 | 620
43 | 620
42 | 610
41 | 610
40 | 600
39 | 600
38 | 590
37 | 580
36 | 580
35 | 570
34 | 570
33 | 560
32 | 560
31 | 550
30 | 550
29 | 540
28 | 540
27 | 530
26 | 530
25 | 520
24 | 520
23 | 510
22 | 500
21 | 500
20 | 490
19 | 490
18 | 480
17 | 480
16 | 470
15 | 470
14 | 460
13 | 460
12 | 450
11 | 450
10 | 440
9 | 430
8 | 430
7 | 420
6 | 420
5 | 410
4 | 410
3 | 400
2 | 400
1 | 390
0 | 390
–1 | 380
–2 | 380
–3 | 370
–4 | 360
–5 | 360
–6 | 350
–7 | 350
–8 | 340
–9 | 340
–10 | 330
–11 | 330
–12 | 320
–13 | 320
–14 | 310
–15 | 300
–16 | 290
–17 | 290
–18 | 280
–19 | 280
–20 | 270
–21 | 270
–22 | 260
–23 | 260
–24 | 250
–25 through –28 | 240
# Part III
# Content Review and Strategies
3 Vocabulary
4 Vocabulary Review
5 Grammar Review
6 Reading Comprehension
7 French Listening
# Chapter 3
# Vocabulary
This chapter gives you several techniques to boost your score on Part A of the SAT Subject Test in French. First, get acquainted with the format and structure of the vocabulary section of the test. If you understand how the test writers think, you can get a question right even if you don't know the answer. Then you'll learn additional strategies that will get you more points—tactics to use depending on how well you understand the question. What do you do if you are not sure of the answer? What if you do not know the meaning of the sentence? What if you do not know all the words in the answer choices? Just follow the simple steps we give you, and you'll be ready to handle any of these situations.
## **PART A: VOCABULARY COMPLETIONS**
The first part of the test consists of 20 to 26 vocabulary completions. Each question is a sentence containing a blank. Each of the four answer choices provides a word that could fill in the blank. The correct answer is the one that best completes the sentence in terms of the meaning of the word. All choices will be grammatically correct.
Here are the directions for this section as they appear on the test. Become familiar with these directions now so that you don't waste valuable time when you take the test.
**Part A**
**Directions:** This part consists of a number of incomplete statements, each having four suggested completions. Select the most appropriate completion and fill in the corresponding circle on the answer sheet.
The questions are arranged roughly in order of difficulty. Harder, more obscure vocabulary words will appear later in the section. Additionally, questions may have false cognates that make the questions trickier to get correct.
If your vocabulary needs work, short, frequent study sessions will help you more than long, infrequent ones. Your brain will be able to absorb only a small amount of information at a time. Ten minutes a day between now and the test will make a big difference.
### **What Makes the Difference in this Section?**
Vocabulary, vocabulary, vocabulary. If your vocabulary is not strong, start working on it right away. In Chapter 4, Vocabulary Review, there are several techniques designed to boost your vocabulary.
## **DRILL 1**
Test your vocabulary by writing the English translations of the following words. Answers can be found in Part IV.
Click here to download and print the PDF version of this exercise.
une usine
la honte
l'oeuvre
en vouloir à
mou
taquiner
la foule
ramasser
soutenir
repasser
se méfier de
se débarrasser de
If you missed more than three of the words, you may need to give vocabulary work extra attention (Chapter 4).
### **IF YOU KNOW THE WORDS**
#### **Fill in Your Own Word**
As you read through the sentence, fill in your own word in English **before you look** at the answer choices. Cover the answer choices with your hand, if need be.
Le film était tellement amusant qu'elle...sans cesse.
If something is funny, what does someone do?
Now let's look at the answer choices and see which one is closest to the English answer you decided on:
(A) dansait
(B) mangeait
(C) riait
(D) lisait
If you thought of the word "laughed" or "smiled," you can eliminate _dansait_ , which means "danced," _mangeait_ , which means "ate," and _lisait_ , which means "read." The correct answer is _riait_ , "laughed."
If you understand most of the words in the question, you'll have no problem filling in the blank.
Cover the answer choices and fill in a word for the following examples.
Jean-Pierre a mal...parce qu'il a trop mangé.
(A) à l'oreille
(B) au ventre
(C) aux genoux
(D) à la tête
If someone ate too much, he would probably have a pain in the "belly." You could then eliminate (A), which means "the ear," (C), which means "the knees," and (D), which means "the head." Choice (B), meaning "the abdomen," is the correct answer.
La banque se trouve...le supermarché et la poste.
(A) dans
(B) sur
(C) pendant
(D) entre
The word in the blank should give the position of the bank in relationship to the supermarket and the post office: "between" or "near." You can eliminate (A), which means "inside," (B), which means "on," and (C), which means "during." Choice (D), which means "between," is the correct answer.
#### **Watch Out for Trap Answers**
Don't immediately pick the first word that seems right. Look at all the answer choices, and leave in only those that might work. Then carefully compare the remaining choices before selecting an answer.
Si tu n'as pas assez d'argent pour acheter le livre, tu peux le trouver à...
(A) la librairie
(B) l'épicerie
(C) la bibliothèque
(D) la papeterie
If you don't have enough money to buy a book, you will probably go to a "library." If you know the vocabulary, you might immediately identify the right answer. If not, eliminate (B), which means "grocery store," and (D), which means "stationery store." Is the answer _librairie_ or _bibliothèque?_ Which means "library?" The answer in this case is the less obvious one: (C), _bibliothèque_. _Librairie_ means "bookstore." See "Common Mix-Ups."
On average, each Part A section contains one question that tests your knowledge of words for body parts and one question that tests the words for different types of stores.
### **IF YOU DON'T KNOW ALL THE ANSWER CHOICES**
Sometimes you'll be able to fill in a word, but you won't be sure which answer choice matches the word you picked. The following guessing techniques will improve your odds of picking the correct answer.
#### **Use Process of Elimination (POE)**
First, clear out the obviously wrong options. Eliminate answer choices that you are sure do not match the word you chose. With the remaining choices, try to narrow down what each means.
#### **Use Your English**
Although it is your knowledge of French that is being tested, your own native language can often help you. Many English words are derived from French, so it makes sense that some words are nearly identical in both languages (but, again, watch out for those traps). How hard is it to guess what _régulier_ means? _Transporter? Bière?_
## **DRILL 2**
Decide what English words the following French words remind you of. Answers can be found in Part IV.
Click here to download and print the PDF version of this exercise.
évaluer
sacré
retarder
fréquenter
nombre
assurer
raison
plante
attraper
servir
content
accord
cru
Using English can help you make an educated guess about the meaning of a word. Based on that guess, you can decide to keep the word or eliminate it, narrowing the field of choices and improving your odds. Don't automatically pick the first word that reminds you of the English word you are looking for.
Use this technique with caution on hard questions. On difficult questions (especially the last five questions), use this technique only to eliminate wrong choices, not to pick the right answer. On tough questions, if an answer choice reminds you strongly of the word you're looking for in English, it's practically guaranteed that it's a trap answer.
27. _____ des étudiants sortant de l'école a rompu le silence du quartier.
(A) Le martelage
(B) La chatière
(C) Le ramassage
(D) Le bavardage
On easy questions (the first third of the section), the right answer will not be a tough vocabulary word. On hard questions (the final third), the right answer will not be the answer that reminds you of the word in English that you are looking for.
This is a tough question. If you understand the sentence ("The ____ of the students leaving school broke the silence in the neighborhood."), you know you're looking for a word that means noise, talk, or chatter. Which answer is a trap?
Choice (B) looks like the English word "chatter." Since this is a hard question (from the final third), you know it's a trap. _La chatière_ actually means "the cat/pet door." The correct answer is (D), which means "the chatting." Choice (A) means "the hammering" ( _un marteau_ is a hammer), and (C) means "the gathering." On difficult questions, don't pick the answer that reminds you of the word you're looking for in English.
On hard questions, be wary of trap answers but don't psych yourself out! If you know the meaning of all the words, the right answer is still the right answer. Don't cross off the right answer because you're afraid it's too "obvious." Trap answers have a specific feel to them.
### **Look for Easier Versions of Words**
On difficult questions (or if your vocabulary isn't very strong), you can sometimes figure out an easier version of the answer choices. For example, in the verb _feuilleter_ you may see the word _feuille,_ meaning "leaf" or "sheet of paper." Could there be a verb meaning "to leaf"? Yes, just as in English, you can "leaf" through a book.
Find as many opportunities as possible to hear and speak French. Check your TV or radio guides for programs in French, watch French movies, and go to websites in French, such as
www.tv5.fr
www.rfi.fr
www.lemonde.fr
What easier words do you see in the following words?
prochainement
emporter
parapluie
retarder
Well? In _prochainement,_ you probably saw _prochain_ , which means "next," so _prochainement_ probably has something to do with being next. (It means "in a short while" or "coming up next.") You probably see _porter_ , which means "to carry," in _emporter_ , so you might be able to guess that _emporter_ has a similar meaning. It means "to carry away." And what about _parapluie?_ Recognize the word _pluie_ , "rain"? So _parapluie_ is likely to be "umbrella." _Retarder_ has the word _tard,_ or "late," in it, so it's a safe bet that _retarder_ means "to slow or delay."
### **Avoid Look-Alike Answers**
The College Board sometimes tries to trick you by providing answers that look like either the correct answer or a word that appeared in the sentence.
Je dois réparer ma montre; elle ne...plus.
(A) casse
(B) montre
(C) donne
(D) marche
If something needs to be fixed, what doesn't it do anymore? Most likely, it doesn't work. Which answer choice means "to work"? Choice (B) is a look-alike trap here. _Montre,_ meaning "show," is identical to the word _montre_ , meaning "wristwatch," in the sentence. It's a trap! Eliminate it. The correct answer is (D) _marche_. The verb _marcher_ used with an inanimate object means "to work or function correctly."
Please see Les Faux Amis for more on these look-alike trap answers.
## **IF YOU DON'T UNDERSTAND THE SENTENCE**
### **Word Association**
Even if you're shaky on the exact meaning of the sentence, you can still make an educated guess for the answer. Go through the words in the sentence that you do know and see if any of the answer choices are in some way associated with those words.
Le chevalier chimerique...au moulin.
(A) joute
(B) ratrappe
(C) ramene
(D) s'enfui
You often don't need the whole sentence to figure out what word you're looking for. Usually one or two key words in the sentence point to the answer.
The word _chimerique_ is likely unfamiliar. However, _chevalier_ means knight and moulin means windmill. The answer choices are all verbs followed by the preposition _a,_ which means to or towards. Use these context clues to figure out which answer choice is most likely related to knights moving toward something. The word in (A) is likely unfamiliar, but looks like joust. The words in (B), (C), and (D) mean catch, bring, and flee. The word that fits best is (A). Make the educated guess.
## **DRILL 3**
For the following incomplete questions, pick the answer choice that makes the most sense given the words that are shown.
Answers can be found in Part IV.
Click here to download and print the PDF version of this exercise.
. xxxxxxx xxxxxxxx _légumes_ xxxx xxxxx...vegetables
(A) cheminée
(B) jardin
(C) gazon
(D) quartier
. xxxx xxxxxxx x tombé xxx xxxx...fallen
(A) envolée
(B) échappée
(C) cassée
(D) attrapée
. xx x xxx xxxxx chaises xxxx...xxxx xx xxxxx. chairs
(A) assommer
(B) s'asseoir
(C) assurer
(D) associer
. xxxx ne se sent pas bien xxxxx xxx...doesn't feel well
(A) une fièvre
(B) une armoire
(C) un verger
(D) une annonce
. xxxx xxxxxxxxx xxxxx mangé xxx xxx...eaten
(A) soutenir
(B) emporter
(C) avaler
(D) évaluer
# Comprehensive Drill
Answers can be found in Part IV.
**Part A**
**Directions:** This part consists of a number of incomplete statements, each having four suggested completions. Select the most appropriate completion and fill in the corresponding circle on the answer sheet.
. Il fait froid dehors. Est-ce que toutes les...sont fermées?
(A) chambres
(B) cheminées
(C) fenêtres
(D) notes
. Ne fais pas de bruit; les enfants sont...
(A) venus
(B) endormis
(C) partis
(D) tristes
. Est-ce que ces fleurs sont de votre...?
(A) peinture
(B) garage
(C) jardin
(D) verger
. Ce manteau n'a pas de...où mettre mon porte-monnaie.
(A) manches
(B) portes
(C) poches
(D) monnaie
. Jeanne s'est réveillée...pour voir le lever du soleil.
(A) bas
(B) haut
(C) tard
(D) tôt
. Le train est parti...à midi.
(A) du garage
(B) du toit
(C) de l'histoire
(D) de la gare
. Au repas du dimanche, nous mangeons un...avec des pommes de terre.
(A) rôti
(B) ruban
(C) régime
(D) rôle
. Les tartes qui sont vendues dans cette...sont délicieuses.
(A) pâtisserie
(B) pharmacie
(C) épicerie
(D) librairie
. Tu peux te laver maintenant. La salle de bains est...
(A) gratuite
(B) libre
(C) livrée
(D) seule
. Mon...pour la classe est de traduire un poème de Rimbaud.
(A) destin
(B) composition
(C) droit
(D) devoir
. Le bruit dans un club peut être tellement fort qu'on a mal...
(A) aux oreilles
(B) aux orteils
(C) à l'orgueil
(D) à la gorge
. La lune est si...que je ne peux pas imaginer que l'homme y soit allé.
(A) longue
(B) fade
(C) loin
(D) immense
. Ce n'est pas nécessaire de sortir la poubelle; Jean l'a...fait.
(A) hier
(B) ce matin
(C) déjà
(D) d'un côté
. Nous passerons Noël avec mes grands-parents...
(A) cet été
(B) cet automne
(C) cet hiver
(D) ce printemps
. Vous avez déjà fait vos devoirs? Cela...
(A) m'admet
(B) me fait mal
(C) me trompe
(D) m'étonne
. N'avez-vous pas...d'avoir fait cette bêtise?
(A) courage
(B) joie
(C) hâte
(D) honte
. Ce tissu est...comme la peau d'un bébé.
(A) mouillé
(B) nu
(C) doux
(D) cru
. Le renard a...aux chasseurs.
(A) ramassé
(B) enfui
(C) échappé
(D) couru
. Le film commence à 8 heures exactement; soyez...
(A) à l'heure
(B) au courant
(C) au loin
(D) à présent
. Il y a trop de monde ici; je préfère des cafés moins...
(A) doués
(B) chargés
(C) tranquilles
(D) fréquentés
. Il n'y a pas assez de preuves pour...cet homme.
(A) indiquer
(B) inquiéter
(C) insinuer
(D) inculper
. Mon frère est...; il ne veut jamais m'aider à nettoyer la cuisine.
(A) serviable
(B) paresseux
(C) redoutable
(D) affolé
. Le vase que j'ai laissé tomber s'est...
(A) perdu
(B) tricoté
(C) évanoui
(D) brisé
. Vous pouvez trouver la robe de mariée de votre grand-mère si vous cherchez dans...
(A) le plancher
(B) le grenier
(C) l'atelier
(D) le magasin
. Elle s'est débarrassée de ses vêtements...
(A) âgés
(B) déprimés
(C) abîmés
(D) achetés
. Diane s'est coupé les...pour être plus à la mode.
(A) chevaux
(B) chiffres
(C) cheveux
(D) chemins
. Pour établir la validité de sa théorie, l'homme de science a fait...
(A) un échec
(B) une expérience
(C) un résumé
(D) un résultat
# Summary
To increase your score, keep the following tips in mind.
All incorrect answers should be eliminated before you bubble in the correct one.
If you know all the words in the sentence
• eliminate obviously wrong answer choices
• examine remaining choices (to avoid obvious traps)
• pick your answer
If you are not sure of the meaning of the sentence
• use word association
• read the question again, and see if there are any obvious traps
If you do not know all of the answer choices
• use your English to eliminate wrong answers
• try to figure out the roots of the words
If you don't know a word, staring at it will not help. Remember pacing is important. Guess after you have eliminated as many obviously wrong answers as possible.
# Chapter 4
# Vocabulary Review
At this level, your basic French vocabulary should be good. The more French you read, the better you will acquire new words and feel comfortable with what you already know. The following vocabulary list should help you review. It organizes words into logical categories. This will make memorizing them easier. Look through each category and concentrate on the words you don't know or words that seem to be cognates but in fact have very different meanings.
## **Boost your vocabulary**
If you really want to imprint new vocabulary words on your brain, passive reading is not enough. Critical reading with a dictionary at hand, as well as listening and watching French media, will increase your vocabulary significantly. Try one or more of the following techniques to help your learning.
### **Flashcards**
Put the French word on one side, the English on the other. If you want to get fancy, color-code by category or make up a symbol. This way, you can mix up words in any order and regroup them in many different ways, such as where, when, and how the words can be used. On the French side, include part of speech, gender, and the word used in a sentence. Whenever you have a few minutes, pull out your cards and test yourself. Think of this as a game.
### **Mnemonics**
If it works for you, think of a funny image or sound that corresponds to the word. The more outrageous, the easier it will be to remember. Make up your own mnemonics and add them to your flashcards.
### **Posters**
Make a list of words and definitions and hang it on your wall. As you go about your day, glance at the poster and review a few words.
These are only a few of the ways you can work on your vocabulary. Anything you do to make it more creative or colorful (literally—use colored pens, colored index cards, stickers, or markers) will increase your ability to learn and remember vocabulary.
## **VOCABULARY LIST**
This section will help you review key vocabulary words. It is not the only vocabulary you need to know for the test, however. You will find suggestions for how to continue enriching your vocabulary. Pay particular attention to the commonly mixed-up words and false cognates.
Click here to download and print the PDF version of this list.
**Vocabulary**
Color-code your vocabulary list! Use three different highlighters to keep track of words you know, words you sort of know, and words you've never seen before. Assign a different color to each category so you know which words you need to work on.
**Le Calendrier et le Temps Une Année** | **The Calendar and the Time A Year**
---|---
_un an_ | a year (always used for age)
_une décennie_ | a decade
_une année_ | a year (as in _l'année dernière_ , last year)
_un mois_ | a month
_une semaine_ | a week
_un jour_ | a day
_une journée_ | a day (as in _toute la journée_ , all day long)
_un siècle_ | a century
_un calendrier_ | a calendar
_un horaire_ | a schedule
**_Un An_ vs. _Une Année_**
What's the difference between _un an_ and _une année_? It's subtle. _Un an_ is a unit of time. For example, " _J'ai passé deux ans à Paris_." _Une année_ is used when describing not the unit, but the full span of time. For example, " _l'année que j'ai passée en France_...." The same concept is used for _un matin—une matinée, un soir—une soirée, un jour—une journée._
**Un Jour** | **A Day**
---|---
_le matin_ | the morning
_la matinée_ | the morning (as in _tout la matinée_ )
_l'après-midi (m or f)_ | the afternoon
_le soir_ | the evening
_la soirée_ | the evening
_la nuit_ | the night
_l'aube (f)_ | daybreak
_l'aurore (f)_ | dawn
_le crépuscule_ | twilight
_le lever du soleil_ | the sunrise
_le coucher du soleil_ | the sunset
_un jour férié_ | a holiday
_un jour de congé_ | a day off
_faire la grasse matinée_ | to sleep late
**_Lundi_ vs. _Le Lundi_**
Observe what happens when you use the definite article _le_. _Lundi_ means "Monday." _Le lundi_ means "on Mondays." Also, notice the following expressions: _Tous les lundis_ means "every Monday." _Lundi en huit_ means "a week from Monday." (Monday to Monday is eight days.)
**Une Heure** | **An Hour**
---|---
_minuit_ | midnight
_midi_ | noon
_une montre_ | a watch
_un réveil_ | an alarm clock
_une horloge, une pendule_ | a clock
_un minuteur_ | a timer (in the kitchen)
_un chronomètre_ | a stop watch
**Les Expressions de Temps** | **Expressions of Time**
---|---
_être à l'heure_ | to be on time
_être en retard_ | to be late
_être en avance_ | to be ahead of schedule
_tôt_ | early
_tard_ | late
_avant_ | before
_après_ | after
_le lendemain_ | the day after
_hier_ | yesterday
_désormais_ | from now on / from then on
_pendant_ | during
_arriver de bonne heure_ | to arrive early
_déjà_ | already
_bientôt_ | soon
_prochainement_ | shortly
_toujours_ | always / still
_ne...pas encore_ | not yet
_ne...jamais/jamais_ | never
_longtemps_ | for a long time
_régulièrement_ | regularly
_d'habitude_ | usually
_habituellement_ | usually
_autrefois_ | in the past
_parfois_ | sometimes
_chaque jour_ | each / every day
_se dépêcher_ | to hurry
_se précipiter_ | to rush
_Un instant!_ | Just a moment!
_Ne quittez pas!_ | Please hold (on)!
**Vocabulary**
The expressions of time are very important to have memorized when choosing a tense or a mode of conjugation.
**Les Saisons (f)** | **Seasons**
---|---
_le printemps_ | spring
_l'été (m)_ | summer
_l'automne (m)_ | autumn, fall
_l'hiver (m)_ | winter
**Phrase Check**
_Au printemps_ means "in (the) spring." For pronunciation reasons, _en_ is used in front of _hiver, été_ and _automne_ to translate "in." En _hiver;_ en _été;_ en _automne._
**La Nature et le Temps** | **Nature and the Weather**
---|---
_la météo_ | the weather forecast
_le soleil_ | the sun, the sunshine
_être bronzé_ | to be tanned
_prendre un coup de soleil_ | to get sunburnt
_attraper une insolation_ | to get sunstroke
_Quel temps fait-il?_ | What's the weather like?
_il fait beau_ | the weather is nice
_il fait chaud_ | it is hot
_avoir chaud_ | to be hot
_par beau temps_ | in good weather
_le nuage_ | the cloud
_la pluie_ | the rain
_il pleut / pleuvoir_ | it is raining / to rain
_une averse_ | a shower
_il pleut des cordes_ | it's raining hard
_être trempé(e)_ | to be soaked
_être mouillé(e)_ | to be wet
_il fait mauvais_ | the weather is bad
_par mauvais temps_ | in bad weather
_la neige_ | the snow
_la glace_ | the ice
_il neige_ | it is snowing
_il fait froid_ | it is cold
_avoir froid_ | to be cold
_un ciel couvert_ | an overcast sky
_un orage_ | a thunderstorm
_il y a des éclairs_ | there is lightning
_le tonnerre_ | thunder
_le brouillard_ | the fog
_la brume_ | light fog / a mist
_le vent_ | the wind
_une tempête_ | a storm
_un ouragan_ | a hurricane
_la rosée du matin_ | the morning dew
_une rafale de vent_ | a gust of wind
_une bourrasque_ | a squall
_briller_ | to shine
_souffler_ | to blow
_il fait noir / sombre_ | it is dark
_prédire_ | to predict
**_Pleurer_ vs. _Pleuvoir_**
A common mistake is to mix up _pleurer_ (to cry) and _pleuvoir_ (to rain).
**Le Plein Air** | **The Outdoors**
---|---
_dehors_ | outside
_un arbre_ | a tree
_un buisson_ | a bush
_l'écorce d'un arbre_ | the bark
_une feuille_ | a leaf
_une prairie_ | a meadow
_un champ_ | a field
_l'herbe (f)_ | grass
_le gazon / la pelouse_ | the lawn
_une rivière_ | a river
_un fleuve_ | a river flowing into the sea
_la mer_ | the sea
_une étoile_ | a star
_la lune_ | the moon
_un verger_ | an orchard
_le jardin_ | the garden
_une fleur_ | a flower
_la poussière_ | the dust
_récolter_ | to harvest
_ramasser_ | to gather, to pick up
_se promener / faire une promenade_ | to take a walk
_prendre l'air_ | to get some fresh air, to take a walk
_faire une randonnée_ | to go hiking
_tondre la pelouse_ | to mow the lawn
**La Maison** | **The Home**
---|---
_un toit_ | a roof
_un plafond_ | a ceiling
_une cheminée_ | a chimney, a fireplace
_un mur_ | a wall
_une fenêtre_ | a window
_un volet_ | a shutter
_en haut_ | upstairs
_en bas_ | downstairs
_les toilettes / les WC_ | the restroom (toilet)
_la salle de bains_ | the bathroom (bath)
_une baignoire_ | a bathtub
_prendre un bain_ | to take a bath
_une douche_ | a shower
_prendre une douche / se doucher_ | to take a shower
_une serviette_ | a towel
_un savon_ | a bar of soap
_un lavabo_ | a bathroom sink
_une glace / un miroir_ | a mirror
_la chambre à coucher_ | the bedroom
_un lit_ | a bed
_une armoire_ | a closet
_un meuble_ | a piece of furniture
_un tiroir_ | a drawer
_un aspirateur_ | a vacuum cleaner
_un climatiseur_ | an air conditioner
_un rideau_ | a curtain
_un oreiller_ | a pillow
_un matelas_ | a mattress
_une couverture_ | a blanket
_un drap_ | a sheet
_un plancher_ | a wooden floor
_le sol_ | the floor
_le salon / la salle de séjour_ | the living room
_une chaise_ | a chair
_un divan / un canapé_ | a couch
_un tableau_ | a painting, a picture
_un fauteuil_ | an armchair
_ouvrir_ | to open
_fermer_ | to close
_se coucher_ | to go to bed
_s'endormir_ | to fall asleep
_se réveiller_ | to wake up
_s'allonger_ | to lie down
_avoir sommeil_ | to be sleepy
_se lever_ | to get up
_s'asseoir_ | to sit down
_la salle à manger_ | the dining room
_la cuisine_ | the kitchen
_un évier_ | a kitchen sink
_un four_ | an oven
_un appareil ménager_ | an appliance
_un réfrigérateur_ | a refrigerator
_une poubelle_ | a garbage can
_un pot_ | a jar
_une casserole_ | a pan
_une poêle_ | a frying pan
_une cuisinière_ | a stove
_un cuisinier / une cuisinière_ | a cook
_le grenier_ | the attic
_la cave_ | the cellar
_un coin_ | a corner
**False Cognates**
_Un coin_ means "a corner," NOT "a coin." _Une pièce de monnaie_ is a coin. _Une cave_ means "a cellar." _Une caverne_ is a cave. _Un plat_ means "a dish" (as in part of a meal). _Une assiette_ is a plate.
_le sous-sol_ | the basement
_un atelier_ | a studio, a workshop
_le rez-de-chaussée_ | the ground floor
_un / une concierge_ | a building superintendent / a custodian
_une boîte à lettres_ | a mail box
_le courrier_ | the mail
_frotter_ | to rub
_astiquer_ | to polish
_balayer_ | to sweep
_nettoyer_ | to clean
_faire le ménage_ | to do the housework
_faire la vaisselle_ | to wash the dishes
_faire la cuisine_ | to cook
_faire la poussière_ | to dust
_ranger_ | to put away
_monter_ | to go up / to bring up
_descendre_ | to go down / to bring down
_rester_ | to stay
_se reposer_ | to rest
**False Cognates**
_Rester_ means "to stay," NOT "to rest." _Se reposer_ means "to rest." _Quitter_ means "to leave," NOT "to quit." Use _quitter_ instead of _partir_ when you mean it to be more permanent.
Examples: _Quitter son domicile; quitter son pays; quitter l'école. Abandonner_ means "to quit."
_quitter (+ un nom)_ | to leave (a place or a person)
_partir_ | to leave
_bricoler_ | to fix
**This Should "Cover" It**
Some common mix-ups are _les couvertures_ (the blankets), le couvert (the table setting), and le couvercle (the lid).
**En Ville (f)** | **In Town**
---|---
_un immeuble_ | a building
_un gratte-ciel_ | a skyscraper
_un trottoir_ | a sidewalk
_un passant_ | a passer-by
_une rue_ | a street
_un rond-point_ | a traffic circle
_une zone piétonne_ | a pedestrian zone
_un quartier_ | a neighborhood
_un endroit_ | a place
_une gare_ | a train station
_une piscine_ | a swimming pool
_une banlieue_ | a suburb
_habiter dans les environs de_ | to live on the outskirts of
_habiter en banlieue_ | to live in the suburbs
_un stade_ | a stadium
_un théâtre_ | a theater
_assister à un concert_ | to attend a concert
**False Cognates**
_Assister à_ means "to attend," NOT "to assist."
_Aider quelqu'un_ means "to assist someone."
_une foule_ | a crowd
_la boulangerie_ | the bakery
_un boulanger / une boulangère_ | a baker
_une pâtisserie_ | a pastry shop, a pastry
_un pâtissier / une pâtissière_ | a pastry cook
_une épicerie_ | a grocery store
_un épicier / une_ _épicière_ | a grocer
_une fromagerie_ | a cheese store
_une boucherie_ | a butcher shop
_un boucher / une bouchère_ | a butcher
_une charcuterie_ | a delicatessen
_un charcutier / une charcutière_ | a pork butcher
_une papeterie_ | a stationery store
_une librairie_ | a bookstore
**False Cognate**
_La librairie_ means "the bookstore," NOT "the library."
_une bibliothèque_ | a library
_un marché aux puces_ | a flea market
_une quincaillerie_ | a hardware store
_la boutique de bricolage_ | the do-it-yourself department
_un tabac / un bureau de tabac_ | a shop selling tobacco items, stamps, newspapers
_une banque_ | a bank
_un kiosque à journaux_ | a newsstand
**Faire les Courses (f)** | **Shopping for Food**
---|---
_la nourriture_ | food
_la recette_ | a recipe
_le pain_ | bread
_un croissant_ | a croissant
_les pâtisseries (f)_ | pastries
_une tarte_ | a tart
_un gâteau_ | a cake
_un chou à la crème_ | a cream-puff
_un petit gâteau / un biscuit_ | a cookie
_un biscuit salé_ | a cracker
_un éclair_ | an éclair
_les pâtes (f)_ | pasta
_le riz_ | rice
_le maïs_ | corn
_les légumes (m)_ | vegetables
_les épinards (m)_ | spinach
_les haricots verts (m)_ | green beans
_un oignon_ | an onion
_un champignon_ | a mushroom
_un poivron vert_ | a green pepper
_les pommes de terre_ | potatoes
_une pomme_ | an apple
_les petits pois_ | peas
_un avocat_ | an avocado
**Avocado!?**
The word _avocat_ means "avocado" from a word that originated in Mexico. Watch out! It also means "lawyer" from the Latin word _advocatus_. Pay attention to the context when making a vocabulary choice on the SAT Subject Test in French.
_les fruits (m)_ | fruit
_une fraise_ | a strawberry
_une framboise_ | a raspberry
_un ananas_ | a pineapple
_une myrtille_ | a blueberry
_une cerise_ | a cherry
_une pêche_ | a peach
_une poire_ | a pear
_une noix_ | a walnut
_une amande_ | an almond
_des raisins_ | grapes
_des raisins secs_ | raisins
_un pamplemousse_ | a grapefruit
_un concombre_ | a cucumber
_le fromage_ | cheese
_le beurre_ | butter
_le lait_ | milk
_la glace_ | ice cream
_un œuf_ | an egg
_la viande_ | meat
_le jambon_ | ham
_le veau_ | veal
_un rôti_ | a roast
_une boulette de viande_ | a meatball
_le sel_ | salt
_le poivre_ | pepper
_la confiture_ | jam, preserves
_le sucre_ | sugar
_l'eau_ | water
_une bière_ | a beer
_le vin_ | wine
_livrer_ | to deliver
_commander_ | to order
_vendre_ | to sell
_acheter_ | to buy
_faire les courses_ | to go shopping, to run errands
_avoir besoin de_ | to need
_avoir envie de manger_ | to feel like eating
_l'argent (m)_ | money
_retirer de l'argent_ | to withdraw money
_rendre la monnaie_ | to give back the change
_payer comptant_ | to pay cash
_économiser_ | to save money
**Au Restaurant (m)** | **At the Restaurant**
---|---
_un restaurant_ | a restaurant
_le repas_ | the meal
_le déjeuner_ | lunch
_le petit déjeuner_ | breakfast
_le dîner_ | dinner
_un plat_ | a dish
_le service est compris_ | service is included
_et comme boissons_ | and for drinks?
_un garçon, un serveur_ | a waiter
_une serveuse_ | a waitress
_un pourboire_ | a tip
_l'addition (f)_ | the bill, the check
_le couvert_ | table setting; cover charge
_une cuillère_ | a spoon
_un couteau_ | a knife
_une fourchette_ | a fork
_une assiette_ | a plate
_le verre_ | the glass
_remplir_ | to fill
_servir_ | to serve
_se servir (de)_ | to use, to help oneself (with)
_régler / payer l'addition_ | to pay the check
_emporter_ | to take away
_apporter_ | to bring
_mettre le couvert_ | to set the table
_débarrasser la table_ | to clear the table
_se débarrasser de_ | to get rid of
_fréquenter_ | to go to a place frequently
_fréquenté_ | crowded, popular
_mou / molle_ | soft
_cru / crue_ | raw
_cuit / cuite_ | cooked
_bien cuit_ | well-done
_à point_ | medium rare
_saignant / saignante_ | rare
_gras / grasse_ | greasy, fatty
**Le Monde du Travail** | **The Working World**
---|---
_le chômage_ | unemployment
_un(e) chômeur / chômeuse_ | an unemployed person
_un ouvrier_ | a worker
_la médecine du travail_ | occupational medicine
_un médecin_ | a physician
_un infirmier / une infirmière_ | a nurse
_le droit_ | law
_un(e) avocat(e)_ | a lawyer
_un(e) juge_ | a judge
_le monde artistique_ | the arts
_un chanteur / une chanteuse_ | a singer
_un acteur / une actrice_ | an actor, an actress
_un(e) metteur en scène_ | a director, a producer
_une œuvre_ | a work
_un chef-d'œuvre_ | a masterpiece
_le commerce / les affaires_ | business
_une femme / un homme d'affaires_ | a business woman / man
_un(e) comptable_ | an accountant
_un(e) patron / patronne_ | a boss
_un / une cadre_ | an executive
_l'informatique (f)_ | computer science
_un ordinateur_ | a computer
_la facture_ | the bill, the invoice
_l'usine_ _(f)_ | the factory
_l'outil (m)_ | the tool
_embaucher_ | to hire
_travailler_ | to work
**False Cognate**
_Travailler_ means to work, not to travel.
_être en grève / faire grève_ | to be on strike
_renvoyer_ | to dismiss
_mettre à la porte_ | to fire
_licencier_ | to lay off
**Le Corps Humain** | **The Human Body**
---|---
_la tête_ | the head
_la figure, le visage_ | the face
_l'œil / les yeux (m)_ | the eye / the eyes
_le nez_ | the nose
_la bouche_ | the mouth
_la lèvre_ | the lip
_la dent_ | the tooth
_la langue_ | the tongue
_l'oreille (f)_ | the ear
_le cou_ | the neck
_l'épaule (f)_ | the shoulder
_la poitrine_ | the chest
_le bras_ | the arm
_la main_ | the hand
_le doigt_ | the finger
_le coude_ | the elbow
_l'ongle (m)_ | the nail
_le poignet_ | the wrist
_la hanche_ | the hip
_la jambe_ | the leg
_le genou / les genoux_ | the knee / knees
_les cheveux_ | the hair
_la peau_ | the skin
_le poumon_ | the lung
_le cœur_ | the heart
_le ventre_ | the belly
_le talon_ | the heel
_le poing_ | the fist
_un coup de poing_ | a punch
_le rein_ | the kidney
_l'orteil_ | the toe
_le dos_ | the back
_un os_ | a bone
_le sang_ | the blood
_transpirer, suer_ | to sweat
_respirer_ | to breathe
_se faire mal à l'épaule_ | to hurt one's shoulder
_avoir mal au ventre / à l'estomac_ | to have a stomachache
**Phrase Check**
The expression _avoir mal_ should be used with the proper preposition _au, à la, à l',_ or _aux_ depending on the body part following the expression. _J'ai mal à la tête; il a mal aux jambes_.
_gros_ | fat
_mince_ | slim, thin
_maigre_ | skinny
_être en forme_ | to be in shape
_décontracté(e)_ | relaxed
_muet / muette_ | mute
_aveugle_ | blind
_sourd(e)_ | deaf
_se laver_ | to wash (oneself)
_se brosser les dents_ | to brush one's teeth
_se peigner_ | to comb one's hair
_se coiffer_ | to do one's hair
_se raser_ | to shave
_se maquiller_ | to put makeup on
_du rouge à lèvres_ | a lipstick
_une crème_ | a cream
_se sécher_ | to dry oneself
**Les Vêtements (m)** | **Clothes**
---|---
_au rayon femmes / hommes_ | in the women's / men's department
_en solde_ | on sale
_une robe_ | a dress
_une robe du soir_ | a gown
_une robe de chambre_ | a robe
_un peignoir de bain_ | a bathrobe
_une chemise de nuit_ | a nightgown
_un chemisier_ | a woman's shirt
_une chemise_ | a shirt
_un tailleur_ | a woman's suit
_un ensemble_ | a woman's suit, an outfit
_un costume_ | a man's suit
_un smoking_ | a tuxedo, dinner jacket
_une jupe_ | a skirt
_un pull_ | a sweater
_un col roulé_ | a turtleneck sweater
_un manteau_ | a coat
_un imperméable_ | a raincoat
_un parapluie_ | an umbrella
_une chaussure / un soulier_ | a shoe
_une botte_ | a boot
_une chaussette_ | a sock
_des collants (m)_ | tights
_un pantalon_ | a pair of pants
_un survêtement_ | a sweatsuit, a warmup suit
_les sous-vêtements (m. pl.)_ | underwear
_une manche_ | a sleeve
_un bouton_ | a button
_une poche_ | a pocket
_un maillot de bain_ | a swimming suit / a bathing suit
_une ceinture_ | a belt
_un chapeau_ | a hat
_une casquette_ | a cap
_un foulard_ | a scarf
_une écharpe_ | a winter scarf, a sash
_une cravate_ | a tie
_un collier_ | a necklace
_une bague_ | a ring
_une boucle d'oreille_ | an earring
_un fil_ | a thread
_la soie_ | silk
_la laine_ | wool
_le cuir_ | leather
_le caoutchouc_ | rubber
_le velours côtelé_ | corduroy
_la fourrure_ | fur
_l'aiguille_ | the needle
_la taille_ | size, waist
_la pointure_ | shoe size
_le cintre_ | the hanger
_essayer_ | to try on
_porter_ | to wear
_mettre_ | to put on
_froisser_ | to wrinkle
_repasser_ | to iron
_le repassage_ | ironing
_déchirer_ | to tear
_coudre_ | to sew
_la couture_ | sewing
_le tricot_ | knitting
_tricoter_ | to knit
_rétrécir_ | to shrink
_aller bien_ | to suit / to go well
_être à la bonne taille_ | to fit
_avoir de l'allure_ | to have style
**Vocabulary**
_Allure_ means "appearance," but it also means "speed" or "pace." _Il va à toute allure!_ "He is going at top speed!"
_propre_ | clean
_une tache_ | a stain
_taché(e)_ | stained
**_Tache_ vs. _Tâche_**
_Une tache_ means "a stain." _Une tâche_ means "a task."
|
_à la mode_ | in style, fashionable
_décontracté(e)_ | casual
_démodé(e)_ | out of style
_assorti(e) à_ | matching
_uni(e)_ | solid color
_à rayures_ | striped
_imprimé(e)_ | printed
_ecossais(e)_ | plaid
_à fleurs_ | floral
_à pois_ | polka-dotted
_à carreaux_ | checked
_délavé(e)_ | faded, washed-out
**Les Voyages/Les Transports** | **Travel/Transportation**
---|---
_un voyage_ | a trip
_faire un voyage_ | to go on a trip
_faire ses valises_ | to pack one's suitcases
_être en vacances_ | to be on vacation
_l'itinéraire_ | the itinerary, the route
_la route_ | the way / the road
_un vélo, une bicyclette_ | a bicycle
_une voiture_ | a car, a carriage, a wagon
_une voiture d'occasion_ | a second-hand car
_une ceinture de sécurité_ | a seatbelt
_une autoroute_ | a highway
_un bouchon / un embouteillage_ | a traffic jam
Vocabulary
_Un bouchon_ also means "a cork." _Un embouteillage_ comes from the word une bouteille, "a bottle."
|
_l'heure de pointe / d'affluence_ | rush hour / peak hour
_rouler_ | to move forward, to roll, to drive
_conduire_ | to drive
_doubler une voiture_ | to pass a car
_klaxonner_ | to honk
_interdiction de stationner_ | no parking
_tourner à gauche / à droite_ | turn left / right
_défense de tourner à gauche_ | no left turn
_se garer_ | to park
_démarrer_ | to start driving, to start a car
_un permis de conduire_ | a driving license
_l'essence_ | gas
_faire le plein_ | to fill up the tank
_avoir une panne d'essence_ | to run out of gas
_une roue_ | a wheel
_un pneu_ | a tire
_un pneu crevé_ | a flat tire
_un volant_ | a steering wheel
_un frein_ | a brake
_un rétroviseur_ | a rearview mirror
_un phare_ | a headlight
_une station-service_ | a gas station
_s'arrêter_ | to stop
_reculer_ | to back up
_un train_ | a train
_le chemin de fer_ | the railroad
_une gare_ | a train station
_un guichet_ | a ticket booth
_demander un renseignement_ | to ask for information
_composter_ | to punch in (tickets)
_rater (le train)_ | to miss (the train)
_une correspondance_ | a train connection, a transfer
_le prochain arrêt_ | the next stop
_un contrôleur_ | a ticket inspector
_changer_ | to transfer
_monter_ | to get on
_descendre_ | to get off
_un bateau_ | a boat
_une voile_ | a sail
_une bouée de sauvetage_ | a life preserver
_un gilet de sauvetage_ | a life jacket
_avoir le mal de mer_ | to be seasick
_une croisière_ | a cruise
_un avion_ | a plane
_atterrir / se poser_ | to land
_l'atterrissage_ | the landing
_enregistrer les bagages_ | to check in (one's luggage)
_décoller_ | to take off
_le décollage_ | takeoff
_une escale_ | a stop, a stopover
_une aile_ | a wing
_avoir le mal de l'air_ | to feel airsick
_voler_ | to fly
_un vol_ | a flight
_l'embarquement_ | boarding
_la douane_ | customs
_un billet_ | a ticket
_un aller simple_ | a one-way ticket
_un aller-retour_ | a roundtrip ticket
_une agence de voyages_ | a travel agency
_traverser_ | to cross
_transporter_ | to transport
_proche_ | near
_loin_ | far
_le décalage horaire_ | the time difference, jet lag
_une fusée_ | a rocket
_complet_ | full
_il y a de la place_ | there is room
_une place libre_ | an empty seat
_annulé(e)_ | cancelled
**Les Accidents et les Urgences** | **Accidents and Emergencies**
---|---
_le dégât_ | the damage
_la faute_ | the mistake, the fault
_grave_ | serious
_le témoin_ | the witness
_une blessure_ | an injury
_une brûlure_ | a burn
_l'assurance (f)_ | the insurance
_la prison_ | the jail
_un incendie_ | a wildfire, a fire
_un feu_ | a fire
_une piqûre d'insecte_ | a sting / an insect bite
_enfermer_ | to lock up
_se couper_ | to cut oneself
_brûler_ | to burn
_saigner_ | to bleed
_se casser (la jambe)_ | to break (one's leg)
_être témoin de_ | to witness
_assurer_ | to ensure, to assure
_arrêter_ | to stop, to arrest
_renverser quelqu'un_ | to hit somebody (with a vehicle)
_soutenir_ | to hold up, to support
_secourir, aider_ | to help
| to save / to rescue
**Aidez-moi!**
You call for help in French by yelling _"Au secours!"_
_avoir tort_ | to be wrong
_avoir raison_ | to be right
_échapper à_ | to escape (from)
_attraper_ | to catch
_éviter_ | to avoid
_blesser_ | to injure
**False Cognates**
_Blesser_ means "to hurt"; _se blesser_ means "to get hurt," NOT "to bless."
_Sauver_ means "to save" or "to rescue." If you mean "to save money," you must use the word _économiser,_ and _se sauver_ means "to run away."
_assommer_ | to knock out (a person)
_faire tomber_ | to knock down (something)
_tomber_ | to fall
_glisser_ | to slip
_faire un plâtre / plâtrer_ | to put a cast on
_faire un pansement_ | to put a bandage / a dressing on
_s'étrangler_ | to choke
_la réanimation_ | resuscitation
_sortir indemne_ | to come out unharmed
_heureusement_ | fortunately
_malheureusement_ | unfortunately
**La Maladie** | **Illness**
---|---
_un rhume_ | a cold
_une angine_ | a throat infection
_des vertiges_ | dizzy spells
_la nausée_ | nausea
_une crampe_ | a cramp
_la douleur_ | pain
_une baisse de tension_ | a drop in blood pressure
_la rougeole_ | measles
_la varicelle_ | chicken pox
_la chirurgie_ | surgery
_la salle d'attente_ | the waiting room
_un rendez-vous_ | an appointment
_une ordonnance_ | a prescription
_un comprimé_ | a pill
_un cachet_ | a tablet
_prendre des médicaments_ | to take medicines or medication
_une analyse de sang_ | a blood test
_avaler_ | to swallow
_avoir mal au cœur_ | to feel nauseated
_avoir des boutons_ | to have a rash
_être enrhumé(e)_ | to have a cold
_avoir de la fièvre_ | to have a fever
_avoir la grippe_ | to have the flu
_avoir de la tension_ | to have high blood pressure
_avoir des palpitations_ | to have palpitations
_s'évanouir_ | to faint
_vomir_ | to throw up
_éternuer_ | to sneeze
_tousser_ | to cough
_avoir mal à la gorge_ | to have a sore throat
_avoir mal à la tête_ | to have a headache
_le traitement_ | the treatment
_soigner_ | to treat
_se soigner_ | to take care of oneself
_vacciner contre_ | to vaccinate against
_faire une piqûre_ | to give a shot
_faire une radio_ | to take an X-ray
_aller / se porter bien...mal / mieux_ | to be well / ill / better
_être en bonne santé / bien portant_ | to be in good health
_être en pleine forme_ | to be in top shape
_déprimé(e)_ | depressed
_malade_ | sick, ill
_Avoir and Emotions_
Many expressions with _avoir_ describe an emotion:
_avoir confiance (en)_ | to trust
---|---
_avoir peur (de)_ | to be afraid
_avoir honte (de)_ | to be ashamed of
_avoir de la peine_ | to be sad
_avoir hâte (de)_ | to be eager to, to be impatient to
**L'émotion (f)** | **Emotion**
---|---
_la confiance_ | confidence or trust
_le plaisir_ | pleasure
_la hâte_ | haste
_la honte_ | shame
_la méfiance_ | mistrust
_l'agrément (m)_ | pleasure; approval
_un caprice_ | a whim
_une larme_ | a tear
_un baiser_ | a kiss
_combler (quelqu'un)_ | to gratify / to satisfy
_être d'accord_ | to agree
_s'occuper (de)_ | to take care of
_éprouver_ | to feel, to experience
**_"Félicitations!"_**
You congratulate someone in French by saying _"Félicitations!"_ or _"Je te félicite!"_
_étonner_ | to astonish
_s'étonner de_ | to be amazed by
_estimer_ | to hold in esteem; to estimate
_tolérer_ | to tolerate
_surprendre_ | to surprise
_se méfier (de)_ | to distrust
_faire de la peine (à)_ | to hurt someone's feelings
_avoir de la peine_ | to feel bad
The verb _manquer_ has a few meanings:
_Tu me manques,_ or _vous me manquez_. | I miss you.
---|---
_Il a manqué le train et son rendez-vous._ | He missed the train and his appointment.
_Elle a manqué son gateau._ | She ruined her cake.
_tromper_ | to trick, to deceive
---|---
_se tromper_ | to make a mistake
_changer d'avis_ | to change one's mind
_s'amuser_ | to have fun
_rire_ | to laugh
_sourire_ | to smile
_pleurer_ | to cry
**False Cognate**
_Crier_ means "to shout," NOT "to cry."
_s'embêter / s'ennuyer_ | to be bored
_s'énerver_ | to get upset
_jurer_ | to swear
_j'en ai marre / j'en ai assez_ | I am fed up, I have had enough
A great idiom (very colloquial) for expressing frustration is _J'en ai ras-le-bol!_ which means roughly, "I've had it up to here!"
_taquiner_ | to tease
_se quereller_ | to quarrel
_se disputer_ | to have an argument / to argue
_se réconcilier avec_ | to make up with
_se réjouir_ _de_ | to be delighted by
_prévoir_ | to predict
_se souvenir de_ | to remember
_soutenir_ | to give support
_rompre (avec)_ | to break up (with)
_se fâcher_ ( _avec)_ | to get upset (at)
_se douter de quelque chose_ | to suspect something
_sembler_ | to seem
_craindre_ | to fear, to be afraid of
_menacer_ | to threaten
_avoir le coup de foudre pour_ | to fall in love at first sight
_tomber amoureux de_ | to fall in love (with)
_s'entendre_ | to get along
_plaindre_ | to feel sorry for
_en vouloir à_ | to be angry at, to have a grudge against
_Ne t'en fais pas!_ | Don't worry!
_Ça va s'arranger!_ | It's going to get better!
_profiter de_ | to take advantage of
_convaincre_ | to convince
_ennuyeux / ennuyeuse_ | boring
_ennuyé(e)_ | bored,embarrassed, in trouble
_joyeux / joyeuse_ | joyful
_heureux / heureuse_ | happy
_content(e)_ | glad, pleased, happy, content
_de bonne humeur_ | in a good mood
_de mauvaise humeur_ | in a bad mood
It Seems to Me...
**_Avoir l'air_** means "to appear" or "to look."
_Elle a l'air fatigué._
She looks tired.
_Sentir_ means "to smell" (having an odor or noticing an odor).
_Elle sent quelque chose de bon dans le four._
She can smell something nice in the oven.
_Ce poulet sent bon._
This chicken smells good.
_**Se sentir**_ means "to feel."
_Comment te sens-tu aujourd'hui?_
How do you feel today?
_Je me sens seul._
I feel lonely.
_**Ressentir (+ noun)**_ means "to feel" (a pain or an emotion).
_triste_ | sad
---|---
_fier / fière_ | proud
_énervé(e)_ | on edge, annoyed
_énervant(e)_ | irritating
_comblé(e)_ | fortunate, happy
**Vocabulary**
If you want to tell someone to be happy, good, proud, etc., use the imperative of the verb _être_ plus an adjective.
_Soyez sages!_ | Be good!
---|---
_Sois confiant!_ | Have faith! or Be confident!
_Sois fier!_ | Be proud!
_Sois content!_ | Be happy!
_méchant(e)_ | mean, nasty
---|---
_bassement_ | meanly, nastily
_malheureux / malheureuse_ | unhappy
_savant(e)_ | learned, knowledgeable
_en colère, fâché(e)_ | angry
_honteux / honteuse_ | shameful, ashamed
_sage_ | wise
_profond(e)_ | profound or deep
_inquiet / inquiète_ | worried
_préoccupé(e)_ | worried
_déçu(e)_ | disappointed
_tendu(e)_ | uptight, tense
_ravi(e)_ | delighted
_étonné(e)_ | astonished
_ému(e)_ | moved, touched
_fou / folle_ | crazy
_dévoué(e) à_ | devoted to
_exquis(e)_ | exquisite
_bouleversé(e)_ | overwhelmed
_vaniteux / vaniteuse_ | vain
Work on your memorization: Regroup the verbs, nouns, and adjectives that carry the same meaning. Example: la dévotion; se dévouer; dévoué.
**Les Expressions de Quantité** | **Expressions of Quantity**
---|---
_le numéro_ | number (as in digits)
_le nombre_ | number (as in quantity)
_le compte_ | count, account
_la somme_ | sum
_les chiffres_ | figures, numerals, digits
_évaluer_ | to evaluate
_l'augmentation (f)_ | increase / raise
_la croissance_ | growth
_la subvention_ | the subsidy
_le manque_ | lack
_rien_ | nothing
_tout_ | everything
_tout le monde_ | everybody
_beaucoup de_ | a lot of, many
_un peu de_ | a little of, a few
_peu de_ | little / few
_trop de_ | too many, too much
_moins de_ | fewer, less than
_quelques_ | some, a few
_aucun / aucune_ | none, not any
_un tas de_ | a stack of, many
_plein de_ | full of
_le taux_ | the rate
_les frais (m,pl.)_ | expenses, costs
The French school system is quite different from that of the U.S. By high school ( _le lycée_ ), students have been divided into categories, each of which has a learning specialty: sciences, languages, economics, literature, etc. At the end of _le lycée_ , students must pass a comprehensive exam in their specialty, _le baccalauréat (le bac),_ to graduate.
**L'école (f)** | **School**
---|---
_une bourse d'études_ | a scholarship
_une sortie scolaire_ | a field trip
_une moyenne_ | a grade point average
_un carnet de notes_ | a report card (elementary school)
_un bulletin scolaire_ | a report card (secondary school)
_une interrogation_ | a quiz, a test
_un dossier_ | a file
_un débouché_ | a career prospect
_une agrafeuse_ | a stapler
_la colle_ | glue
_un rapporteur_ | a protractor
_un panneau d'affichage_ | a bulletin board
_une bonne note_ | a good grade
_une erreur_ | a mistake
_feuilleter_ | to leaf through
_permettre_ | to permit, to allow
_traduire_ | to translate
_écrire_ | to write
_enseigner_ | to teach
_parler couramment_ | to speak fluently
_une dissertation_ | an essay, a paper
_admettre_ | to admit
_noter_ | to grade
_suivre / prendre des cours_ | to take classes
_souligner_ | to underline
_faire une erreur / se tromper_ | to make a mistake
_corriger_ | to correct
_constater une erreur_ | to notice a mistake
_passer un examen_ | to take an exam
**False Cognate**
_Passer un examen_ means "to take an exam," NOT "to pass an exam."
_rater_ | to flunk / to fail
_sécher sur un sujet_ | to draw a blank in
_sécher un cours_ | to skip a class
_échouer à_ | to fail
_être reçu(e) à un examen_ | to pass an exam
_coller un(e) élève_ | to give a detention to a student
_recaler_ | to fail a student
_être recalé(e) à un examen_ | to fail a test
_doué(e)_ | gifted
_futé(e)_ | smart
_perturbateur / perturbatrice_ | disruptive
**Les Sports (m)** | **Sports**
---|---
_l'escrime_ | fencing
_l'équitation_ | horseback riding
_la natation_ | swimming
_le parapente_ | parasailing
_l'entraînement_ | practice, training
_le vestiaire_ | a locker room
_un but_ | a goal
_la course_ | a race
_le filet_ | the net
_le cerceau_ | the hoop
_une piste_ | a trail, a track, a rink
_un terrain_ | a ground, a field, a course
_un sifflet_ | a whistle
_un arbitre_ | a referee, an umpire
_une médaille_ | a medal
_un exploit_ | a feat
_le football_ | soccer
_la Coupe du Monde_ | the World Cup
_le poids_ | weight
_tenter_ | to attempt, to tempt
_atteindre_ | to reach
_étendre le bras_ | to stretch out one's arm
_entraîner_ | to train, to coach
_s'entraîner_ | to practice, to train
_attraper_ | to catch
_lancer_ | to throw
_accomplir_ | to achieve
_sauter_ | to jump
_s'assouplir_ | to limber up, to become supple
_repousser_ | to push back
_monter_ | to go up
_escalader, grimper_ | to climb
_être ex aequo / faire match nul_ | to tie (as in scoring)
_souple_ | flexible
_vif / vive_ | quick, lively
_un coup déloyal(e)_ | a foul
Les Faux Amis: words that look like an English word but mean something different!
Only two or three questions on Part A will have tricky mix-ups.
**Vocabulary**
Vocabulary questions on Part C will often have mix-ups. Usually you will be given four words that are close in meaning or look alike.
# Summary
Use the study techniques that work best for you and review the following categories of vocabulary:
_Le calendrier et le temps_
_Les expressions de temps_
_La nature_
_Le plein air_
_La maison_
_En ville_
_Faire les courses_
_Au restaurant_
_Le monde du travail_
_Le corps humain_
_Les vêtements_
_Les voyages / Les transports_
_Les accidents et les urgences_
_La maladie_
_L'émotion_
_Les expressions de quantité_
_L'école_
_Les sports_
# Chapter 5
# Grammar Review
Grammar is tested in Parts B and C of the SAT Subject Test in French. Part B tests only grammar, while Part C tests both grammar and vocabulary. The same points of grammar are tested in Parts B and C. The SAT Subject Test in French contains questions about very specific aspects of French grammar. Therefore, grammar is one of the easiest test topics on which to improve. If you can remember and master a few rules, you'll easily get more points. This chapter will explain exactly what you need to know. First, look at the point-by-point summary of the question types you can expect. Then, keep the question style in mind as you review your French grammar. Not all that you have learned in school will be included in the test, but you may find it helpful to go back to your textbooks for more examples on the topics we suggest. We focus on the grammatical topics and difficulties most often encountered on the SAT: pronouns, verbs, prepositions, and adverbs.
## **PART B: GRAMMAR**
Part B will consist of approximately 15 to 20 questions, arranged in order of difficulty. The first third of the questions will be considered easy, the next third will be of intermediate difficulty, and the final third will be the most challenging.
SAT difficulty is determined by the percentage of students who are expected to get the question wrong. You may find some of the difficult questions quite easy. You may also find some of the easy questions to be challenging. It is important to remember your POOD and Pacing as you work through this section.
In these questions, there will be a sentence with a blank. You will choose the answer that is grammatically correct.
Become familiar with these directions that appear on the real test:
**Part B**
**Directions:** Each of the following sentences contains a blank. From the four choices given, select the one that can be inserted in the blank to form a grammatically correct sentence and fill in the corresponding circle on the answer sheet. Choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically correct sentence.
Jean-Claude est venu avec -------.
(A) ils
(B) leur
(C) eux
(D) soi
The correct answer is (C).
## **PART C: COMPLETE THE PARAGRAPH**
Part C tests both grammar and vocabulary. In this section, there are approximately 12 to 20 questions in no clear order of difficulty.
On this part of the test, several questions are combined in one paragraph. You may have three or four mini-paragraphs with three to five blanks within each, or you may have one long paragraph. You are asked to select the answers that best complete the sentences on the basis of either vocabulary or grammar.
Become familiar with these directions:
**Part C**
**Directions:** The paragraph below contains blank spaces indicating omissions in the text. For some blanks it is necessary to choose the completion that is most appropriate to the meaning of the passage; for other blanks, to chose the one completion that forms a grammatically correct sentence. In some instances, choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically complete sentence. In each case, indicate your answer by filling in the corresponding circle on the answer sheet. Be sure to read the paragraph completely before answering the questions related to it.
This section combines the characteristics of Parts A and B. The small differences between the two are discussed at the end of this chapter.
## **KNOW WHAT YOU ARE LOOKING FOR**
All the grammar questions on the SAT Subject Test in French will fall into one of the following four categories.
1. pronouns
2. verbs
3. prepositions
4. odds and ends
The best way to improve in these areas is to learn the grammatical rules that are tested again and again. These rules are covered in the following grammar review.
## **GRAMMAR REVIEW**
Grammar is a great area to focus your attention for this test. Why? Because to do well on the grammar review you need to review only a limited number of rules. Those rules will lead you to the right answer again and again. Unlike vocabulary, where luck determines whether the words you've learned will show up, grammar rules—and therefore, the content of these test questions—stay the same.
**Good News**
Only a minuscule number of grammar questions (around two) will test you on whether a noun is masculine or feminine.
You'll be tested primarily on three things: pronouns, verbs, and prepositions. Each question will address only one grammatical point. We'll cover each of these categories, giving you the rules that get you right answers. We'll also give practice questions for each category. Finally, we'll cover some odds and ends that occasionally show up on the test.
## **BASIC TERMS**
You won't be tested on this material directly, but take a quick look through to make sure that you understand what the following terms mean. We'll be using them in this grammar review.
### **Parts of Speech**
**1. Noun**—a person, place, thing, quality, or action. It can be either a subject or an object
**2. Verb**—the action that is being performed by the subject
**3. Pronoun**—a word that takes the place of a noun
**4. Preposition**—a word that expresses the relationship of one word to another in terms of direction, motion, or position
**5. Adjective**—a descriptive word that gives more information about a noun
**6. Adverb**—a word that modifies a verb, an adjective, or another adverb
**7. Article**—a small word that gives a little information about a noun
None of this terminology is needed for the test. Understanding these terms, however, will help you comprehend the explanations in the grammar review that follows.
### **Sentence Structure**
**1. Subject**—the person or thing in the sentence that is performing the action
**2. Compound subject**—two or more subjects joined by _and, or,_ or _but_
**3. Object**—the person or thing that is on the receiving end of the action
**4. Direct object**—the word or phrase that receives the direct action of the verb. These do not take a preposition to be objects.
**5. Indirect object**—a word or phrase that precedes the direct object and answers the questions "to whom" or "for whom" the action of the verb is done. These take prepositions.
**6. Infinitive**—the form of a verb that uses "to," as in "to go" or "to speak"
**7. Auxiliary verb—**a helper verb, either _avoir_ or _être,_ that loses its own meaning to help form the compound past tense for other verbs, such as the _passé composé_. It is followed by the past participle of the conjugated verb.
**8. Semi-auxiliary verb**—a verb, such as _aller_ or _venir_ , that helps express a different aspect of the verbal action, such as the near future or the recent past
**9. Past participle**—in the past tense, the form of the verb that teams up with the auxiliary or "helper" verb
## **PRONOUNS**
A quarter of all grammar questions on the SAT French test will challenge your knowledge of pronouns. Unlike English, which uses mainly subject and object forms of pronouns (he and him, for example), French uses four important forms of pronouns: subject pronouns, direct object pronouns, indirect object pronouns, and stressed pronouns.
There are two kinds of pronoun questions on the test: one asks you to choose among the five main kinds of pronouns (subject, direct object, reflexive, indirect object, and stressed), and the other asks you to choose among pronouns like _qui, que, dont_ , and _lequel_.
### **What Is a Pronoun?**
A pronoun takes the place of a noun. It stands in for the full name or description of a person, place, or thing. In French, a pronoun will take different forms depending on what type of noun it replaces. Half of the pronoun questions on the test ask you to choose among subject pronouns, direct or indirect object pronouns, and stressed pronouns.
The following are the pronouns you should know. **You're most likely to be tested on third-person singular and plural,** since these are the forms that change the most.
Once you recognize each of these four main types of pronouns, you will find it easy to use Process of Elimination on the answer choices.
Because this is a multiple-choice test, you will be asked which of four pronouns goes into the blank. Notice that some pronouns are always the same: _nous_ and _vous._
_nous_ or _vous_ can be:
subject
direct object
indirect object
reflexive
stressed
### **1. Subject Pronouns**
Subject pronouns replace the subject of the sentence.
_**Jean** a montré son dessin à Edith._
**Jean** showed his drawing to Edith.
_**Il** a montré son dessin à Edith._
**He** showed his drawing to Edith.
**Vocabulary**
The subject pronouns _il, ils, elle,_ and _elles_ are used for objects and people. _Il_ signifies "he" or "it." _Elle_ signifies "she" or "it." The subject pronoun _il_ can be neutral or impersonal: _il est sept heures, il pleut, il faut que_...The subject pronoun _ils_ is used for a group of males and for mixed groups, even if there are more females than males.
**_je_** or _**j**_ ' = I | **_nous_** = we
---|---
**_tu_** = you | **_vous_** = you (plural or formal singular)
**_il_** = he | **_ils_** = they (masculine)
**_elle_** = she | **_elles_** = they (feminine)
These pronouns are usually the wrong answer choices. Why? Because these are the pronouns with which everyone is most familiar and comfortable.
### **2. Direct Object Pronouns**
These pronouns replace the direct object of a sentence. The direct object answers the question "what?"
_Jean a montré **son dessin** à Edith._
Jean showed **his drawing** to Edith.
_Jean **l'a** montré à Edith._
Jean showed **it** (the drawing) to Edith.
Notice that the direct object pronoun is placed before the verb.
**_me_** or **_m'_** = me | **_nous_** = us
---|---
**_te_** or **_t'_** = you | **_vous_** = you (plural or formal)
**_le_** or **_l'_** = him or it | **_les_** = them (person or thing both masculine and feminine)
**_la_** or **_l'_** = her or it |
**Pronouns**
When a direct object pronoun comes before a verb that starts with a vowel, the vowel in the pronoun is dropped and replaced with an apostrophe. For example, _me_ becomes _m´_ and _le_ or _la_ becomes _l´_.
### **3. Indirect Object Pronouns**
These pronouns replace the indirect object of a sentence. The indirect object answers the questions "to what?" or "to whom?" Notice that the pronoun replaces both the indirect object and the preposition that goes with it.
_Jean a montré son dessin **à Edith.**_
Jean showed his drawing **to Edith**.
_Jean **lui** a montré son dessin._
Jean showed **her** his drawing.
**Pronouns**
Notice that the indirect object pronoun is placed before the verb.
**_me_** or **_m'_** = me | **_nous_** = us
---|---
**_te_** or **_t'_** = you | **_vous_** = you (plural or formal)
**_lui_** = him or her | **_leur_** = them
Review the list of verbs that take the prepositions _de_ or _à_ (or both), and their meaning. Some of them are listed on here.
Pay particular attention to the following verbs:
The verbs _écouter_ (to listen to), _regarder_ (to look at), and _attendre_ (to wait for) are verbs that always take a **direct object** in French.
_Il m'écoute._
He listens (to) me.
_Je l'ai regardé._
I looked (at) him.
_Nous les attendons._
We are waiting (for) them.
**Pronouns**
Note that the only differences between direct and indirect object pronouns occur in the third person singular and plural forms: _le/la/l'_ vs. _lui_ and _les_ vs. _leur_. You are more likely to be tested on these, as you have to know the rules in order to figure out which pronoun is correct.
The verbs _téléphoner à_ (to call on the phone), _répondre à_ (to answer), _demander à_ (to ask), and _rendre visite à_ (to visit someone), take an **indirect object** in French, unlike in English.
_Ton père télephone à ses parents._
Your father is calling his parents.
_Ton père leur télephone._
_Ton père te téléphone._
Your father is calling you.
_Sa mère lui demande de nettoyer sa chambre._
Her mother is asking her to clean her room.
_Cette semaine, il rends visite à son grandpère._
He is visiting his grandfather this week.
_Cette semaine, il lui rends visite._
The direct and indirect object pronouns are placed before the verb even when you use the negative form.
_Je ne **te** donne pas mon nouveau pull._
I will not give you my new sweater.
_Il ne **leur** parle pas._
He does not speak to them.
### **4. Reflexive Pronouns**
The reflexive pronoun shows that the action is being performed both by and to the subject. Only certain verbs have reflexive forms. Most often reflexives will show up as incorrect answer choices.
**Pronouns**
Reflexive pronouns are used in French in situations in which they are not used in English. For example, _Je me lave les mains_ (I wash my hands).
_Tu te laves._
You wash yourself. | _Tu te laves les mains._
You wash your hands.
---|---
**_me_** myself | **_nous_** ourselves
---|---
**_te_** yourself | **_vous_** yourselves or yourself (formal)
**_se_** himself/herself | **_se_** themselves
You might also see _moi-même, toi-même, lui-même/elle-même, soi-même_ (oneself) _, nous-mêmes, vous-même(s), eux-mêmes / elles-mêmes._ They would be used as stressed pronouns would be.
_Tu te coupes **toi-même** les cheveux!_
You cut your hair **yourself**!
All reflexive verbs take the auxiliary **_être_** in the compound tenses. If the verb has no object, the past participle always agrees with the subject:
_Elles se sont dépêch **ées.**_ | They hurried.
---|---
_Elle s'est coup **ée**._ | She cut herself.
However, there is no agreement in the sentence when the body part, or direct object, comes after the reflexive verb. We'll talk more about this later in the review.
_Elles se sont lavé les mains._ | They washed their hands.
---|---
### **Pronoun Order**
If the sentence contains both a direct and an indirect pronoun, order the pronouns as shown in the chart below.
_Tu donnes le cadeau à ta sœur. Tu **le lui** donnes maintenant._
You give the present to your sister. You give **it to her** now.
_Tu écris cette lettre à ton frère. Oui, je **la lui** écris._
You write a letter to your brother. Yes, I write **it to him**.
_Je vous prête mes livres. Je **vous les** prête._
I lend my books to you. I lend **them to you**.
### **Pronoun Order with Commands**
In negative commands, the order of pronouns follows the same rule:
_Ne **le lui** rends pas!_
Don't give **it** back **to him**!
_Ne **me les** donne pas!_
Don't give **them to me**!
In affirmative commands, the _me_ becomes _moi_ , and the direct or indirect pronoun ( _moi, nous_...) is placed after the verb.
_Appelle- **moi** ce soir!_
Call **me** tonight.
_Répondez- **nous** tout de suite._
Give **us** an answer right away.
When the command contains a direct pronoun and an indirect pronoun, both pronouns come after the verb. Follow the order below:
Direct Object | before | Indirect Object
---|---|---
_le_ | | _moi_
_la_ | before | _lui_
_les_ | | _nous_
| | _leur_
_Donne- **les-moi**!_
Give them to me!
_Rends _-le-lui_!_
Give **it** back **to her**!
### **Pronouns _y_ and _en_**
These are adverbial pronouns. Remember that _y_ comes before _en,_ and that indirect objects always precede both.
_Il **y** a beaucoup de fraises au marché ce matin. Il **y en** a beaucoup._
**There** are lots of strawberries at the market this morning. **There** are lots **of them**.
_Il rend visite à sa tante à l'hôpital. Il **lui y** rend visite tous les jours._
He visits his aunt at the hospital. He visits **her there** every day.
_Nous rencontrons souvent nos amis au cinéma. Nous **les y** rencontrons souvent._
We often meet our friends at the movies. We meet **them there** often.
_Tu **m'y** retrouves à six heures._
You meet **me there** at six o'clock.
These pronouns are often seen in negative and affirmative commands:
_Achète- **lui-en**!_
Buy **him/her some**!
_Ne **leur en** prête pas!_
Don't lend **them any**!
_Occupe _-t'en_ tout de suite!_
[ **You** ] Take care **of it** right away!
### **5. Stressed Pronouns**
Stressed pronouns are used only to replace nouns representing people or animals.
**_moi_** = me or I | **_nous_** = us or we
---|---
**_toi_** = you | **_vous_** = you (plural or formal)
**_lui_** = him or he | **_eux_** = them or they (masculine or including both masculine and feminine)
**_elle_** = her or she | **_elles_** = them or they (feminine)
### **Uses of the Stressed Pronoun**
#### **A. After a preposition such as _à, pour, avec, sans, chez_...**
_Elle pense à **sa sœur**. Elle pense à **elle**._
She thinks of **her sister**. She thinks of **her**.
_Je travaille pour **mes patrons**. Je travaille pour **eux.**_
I work for **my bosses**. I work for **them.**
_Je vis avec **mon père**. Je vis avec **lui**._
I live with **my father**. I live with **him**.
_Tu vas au cinéma sans **ton frère**. Tu vas au cinéma sans **lui**._
You go to the movies without **your brother**. You go to the movies without **him**.
_Tu peux rester chez **mes tantes**. Tu peux rester chez **elles**._
You can stay at **my aunts'** house. You can stay at **their** house.
#### **B. To reinforce a subject pronoun. There is no real English equivalent.**
_**Moi** , je parle très bien le français._
[Myself], I speak French very well.
_**Vous** , vous êtes parfait!_
[Yourself], You are perfect!
#### **C. After the expressions _c'est_ and _ce n'est pas_ and, of course, their various conjugated forms.**
_C'est **ton frère** qui est avec cette fille? Non, ce n'est pas **lui**._
Is it **your brother** who is with this girl? No, it is not **(he)**.
#### **D. Before and after _et_ and _ou_.**
_**Toi** et **lui** , vous allez bien vous amuser._
**You** and **he** are going to have fun.
#### **E. In short sentences with no verb.**
_Qui a demandé un chocolat? M **oi**._
Who asked for a chocolate? **Me**. (I did.)
### **6. Demonstrative Pronouns**
The demonstrative pronoun **_celui_** (this / the one) is used instead of **_ce_** \+ noun or **_le_** \+ noun.
It agrees in gender and number with the noun it replaces: _celui, celle, ceux, celles._
There are a few combinations to keep in mind:
a. In a composed form
_celui-ci, celui-là, ceux-ci, celles-ci, celle-là_...
_Voilà les robes blanches. Ce sont **celles** -ci que j'aime._
Here are the white dresses. **These** are the ones I like.
b. With the preposition _de_
_Ce ne sont pas mes sandales. Ce sont **celles** de Sophie._
These are not my sandals. **These** are Sophie's.
c. With _qui, que,_ or _dont_. (See the use of these pronouns in the next section.)
_J'aime les robes blanches, surtout **celles** qui sont à la mode._
I like white dresses, especially the trendy **ones**.
d. **_Ce_** is the neutral simple form and is used with the verb _être._
_ **C'est** toujours bon de se revoir!_
**It's** always nice to see each other again.
e. _**Ceci**_ and **_cela_** are the compound neutral forms.
_ **Cela** me donne une idée._
**This** gives me an idea.
**Keep These In Mind**
### **7. Interrogative Pronouns**
The interrogative pronoun **_lequel_** (which one) is used sometimes to replace **_quel_** \+ noun.
_**Quel livre** préfères-tu?_
**Which book** do you prefer?
_**Lequel** préfères-tu?_
**Which one** do you prefer?
It agrees in gender and number with the noun it replaces: _lequel, laquelle, lesquels, lesquelles._
See the table below for the use of these pronouns with prepositions _à_ and _de:_
of (which one) | about (which one)
---|---
_à + laquelle = à laquelle_ | _de + laquelle = de laquelle_
_à + lequel = auquel_ | _de + lequel = duquel_
_à + lesquels = auxquels_ | _de + lesquels = desquels_
_à + lesquelles = auxquelles_ | _de + lesquelles = desquelles_
_J'ai deux frères. **Duquel** me parles-tu? (= de quel frère?)_
I have two brothers. **Which one** are you talking about?
_Il y a plusieurs classes à choisir pour ce niveau. **Auxquelles** voulez-vous participer? (= à quelles classes?)_
There are several classes to choose from at this level. **Which ones** do you want to attend?
Let's practice our pronoun skills.
Paul voulait ------- faire peur.
(A) elle
(B) la
(C) lui
(D) les
Here's How to Crack It
Does the missing pronoun here serve as a subject or object? It serves as an object, so we can eliminate (A). _Elle_ serves only as a subject pronoun or a stressed pronoun. We won't use a stressed pronoun because a preposition is not being used.
Does the verb _faire peur_ take a direct or indirect object? Indirect. In English, "to frighten someone" takes a direct object, but in French the expression is _faire peur_ **à** _quelqu'un._
Often, three choices will refer to one person, the fourth to more than one person. In most cases, the one that is different will be wrong.
Let's cross out (D) _les,_ which is a direct object pronoun as well as the only plural pronoun.
So, which choice is an indirect object pronoun?
_Lui,_ (C), is the indirect pronoun for third person singular. It is the right answer. _La,_ (B), is the direct object pronoun.
Je suis allé au concert sans -------.
(A) leur
(B) tu
(C) le
(D) eux
Here's How to Crack It
What type of pronoun would come after _sans_? A stressed pronoun comes after a preposition. Which of the answer choices is a stressed pronoun? Only (D). _Eux_ is the stressed pronoun meaning "them." Choice (A) is an indirect object pronoun. Choice (B) is a subject pronoun. Choice (C) is a direct object pronoun. Choice (D) is the correct answer: _Je suis allé au concert sans eux._
### **More Types of Pronouns**
You also want to be familiar with some other types of pronouns that may show up. The following are most likely to appear on the real test as incorrect answer choices.
### **Possessive Pronouns**
Possessive pronouns agree in gender and number with the noun that they replace.
_Ce livre est à Nathalie._
This book is Nathalie's. | _C'est le sien._
It is hers.
(use of possessive pronoun)
---|---
_Cette montre est à Pierre._
This watch is Pierre's. | _C'est la sienne._
It is his.
### **Singular Pronouns**
_le mien / la mienne_ | _le nôtre / la nôtre_
---|---
_le tien / la tienne_ | _le vôtre / la vôtre_
_le sien / la sienne_ | _le leur / la leur_
_Ce livre est à toi._
This book is yours. | _C'est le tien._
It is yours.
### **Plural pronouns**
_les miens / les miennes_ | _les nôtres_
---|---
_les tiens / les tiennes_ | _les vôtres_
_les siens / les siennes_ | _les leurs_
_Ces chaussures sont à elles._
These shoes are theirs. | _Ce sont les leurs._
They are theirs.
Possessive pronouns must always be used with an article ( _le, la, les)_.
*These represent both the masculine and the feminine forms.
### **Still More Types of Pronouns**
About half of the pronoun questions revolve around the use of other types of pronouns (adverbial pronouns, demonstrative pronouns, relative pronouns, indefinite pronouns, etc.). Don't worry—you don't need to know the terminology.
Example:
Je n'ai pas le temps de faire les courses ------- ma mère m'a demandé de faire.
(A) qui
(B) que
(C) dont
(D) lesquelles
Which pronoun is correct?
Let's take a look at each in turn and see what rules govern their use.
### **_Qui_ —Who or Which or That**
_Qui_ is the equivalent of the English "who," except that _qui_ can also be used to refer to things ("that"). **The _qui_ refers to the subject of the phrase**.
_la dame **qui** danse là-bas..._
the lady **who** is dancing over there...
_la table **qui** est cassée..._
the table **that** is broken...
_Qui_ can also be used with a preposition. In this case, it can only refer to a person.
_l'homme sans **qui** je n'aurais rien accompli..._
the man without **whom** I would have accomplished nothing...
_**Qui vs. Que**_
Don't use your ear to determine if _**qui**_ or _**que**_ is right. Learn a few rules that will help you choose: 1. Is the noun before the blank the subject or object of the phrase? 2. Is there a preposition involved?
### **_Ce qui_ —What**
_Ce qui_ is used as the subject of the sentence or clause.
_Qu'est- **ce qui** se passe?_
**What** is happening?
_Je ne sais pas **ce qui** la fait pleurer!_
I do not know **what** 's making her cry!
### **_Que_ —Whom or That**
_Que_ is used in a number of ways in the French language. On the SAT French Test, however, it usually shows up as a relative pronoun. Roughly the equivalent of the English "whom," it refers to the person or thing that is **the object** of the action. **_Que_ is never used with a preposition.**
_l'enfant **que** j'ai puni..._
(i.e., _j'ai puni l'enfant_ )
the child **whom** I punished...
_la bicyclette **que** j'ai reçue pour mon anniversaire..._
(i.e., _j'ai reçu la bicyclette pour mon anniversaire_ )
the bicycle **that** I received for my birthday...
### **_Ce que_ —What**
_Ce que_ is used as a direct object in a sentence or clause.
_Je ne comprends pas **ce qu'** il dit._
I do not understand **what** he is saying.
_Je préfère **ce que** tu viens d'acheter._
I prefer **what** you have just bought.
### **When Do You Use _Qui_ and When Do You Use _Que_?**
Unless there is a preposition involved, this is similar to the English use of "who" or "whom." In English, one test is to see if the "who" or "whom" would be replaced by "he" or "him."
the man________is smoking over there...
"He" is smoking, so you would use "who."
the man________I hugged...
I hugged "him," so you would use "whom."
If you understand "who/whom" in English, you may want to translate and decide if "who" or "whom" is correct. If "who" is correct, use _qui;_ if "whom" is correct, use _que_.
_l'homme **qui** fume là-bas..._
the man **who** is smoking over there...
_l'homme **que** j'ai embrassé..._
the man **whom** I hugged...
### **What If a Preposition Is Involved?**
If a preposition is involved and the pronoun refers to a person, use **_qui_** or the correct form of **_lequel._**
_l'homme **à qui** j'ai donné de l'argent..._
the man **to whom** I gave money...
_l'ami **pour lequel** j'ai acheté un chapeau..._
the friend **for whom** I bought a hat...
_la jeune fille **pour laquelle** j'ai fait une robe..._
the girl **for whom** I made a dress...
If there is a preposition before the blank, you use _qui_ if referring to a person, and the correct form of _lequel_ if referring to a thing or a person. You never use _que_ immediately following a preposition.
**_Lequel_** is used with a preposition if the pronoun refers to people or things. The form of _lequel_ agrees in gender and number with the person(s) or thing(s) it refers to.
_Lequel, laquelle, lesquels,_ and _lesquelles,_ are always used after the prepositions _entre, sans, parmi,_ and _avant._
Note that if a preposition is involved and the pronoun refers to a thing, use only **_lequel_** (in its correct form).
_l'argent **avec lequel** j'ai payé la facture..._
the money **with which** I paid the bill...
### **_Quoi_ —Which or What**
**_Quoi_** is used to refer to things only. It is usually used with a preposition when asking a question.
_À **quoi** pensez-vous?_
**What** are you thinking of?
_De **quoi** parlez-vous?_
**What** are you talking about?
**_De quoi_** is also used in many idiomatic expressions, such as:
_avoir de quoi faire_
to have a lot to do
_avoir de quoi manger_
to have something to eat
_avoir de quoi vivre_
to have enough to live on
_Merci beaucoup! Il n'y a pas de quoi!_
Many thanks! Don't mention it!
### **_Ce à quoi_ —What**
**_Ce à quoi_** is used to emphasize an idea, but it is mostly avoided otherwise.
_**Ce à quoi** il faut toujours faire attention, c'est l'utilisation des pronoms._
**What** you must always pay attention to is the use of pronouns.
### **_Avec quoi_ —With What**
_Je voudrais savoir **avec quoi** il a fait cela._
I would like to know **with what** he did this.
### **_Sans quoi_ —Otherwise, If Not**
_Si tu fais tes devoirs tu pourras sortir; **sans quoi** tu resteras ici._
If you do your homework, you can go out; **otherwise** , you'll stay here.
### **_Dont_ —Of Whom or Of Which**
**_Dont_** is correct only if the verb in the phrase is one that takes _de_ as a preposition. _Dont_ is always placed directly after the noun it replaces.
_Le livre **dont** j'ai besoin est dans ma chambre._
The book **that** I need is in my room.
_L'ami **dont** elle a parlé viendra chez nous ce soir._
The friend **of whom** she spoke will come to our house this evening.
When it is separated by a preposition, use _duquel, de laquelle, desquels, desquelles_.
_L'homme à côté **duquel** le chien attend nous a salués._
The man next to **whom** the dog waits greeted us.
_Les gens à côté **desquels** nous étions assis n'ont pas arrêté de parler._
The people next to **whom** we were sitting did not stop talking.
### **_Ce dont_ —What**
**_Ce dont_** is used as an object with a verb that takes the preposition _de._
_Il ne comprend pas **ce dont** j'ai besoin._
He does not understand **what** I need.
_J'ai oublié **ce dont** elle m'a parlé._
I forgot **what** she talked to me about.
Now let's go back to our example first given on this page.
Je n'ai pas le temps de faire les courses ------- ma mère m'a demandé de faire.
(A) qui
(B) que
(C) dont
(D) lesquelles
Here's How to Crack It
Is a preposition involved? No. Get rid of (D) _lesquelles_. You can also get rid of (A) _qui_ , because where objects are concerned, _qui_ is used only with a preposition.
Does _faire_ take _de_ as a preposition? No. Eliminate (C) _dont_. The answer must be (B) _que_.
Voilà l'ami ------- j'ai passé l'été.
(A) chez qui
(B) à qui
(C) que
(D) dont
Here's How to Crack It
Can _de_ be used as a preposition following _passer l'été_? No. Eliminate (D).
Can _passer l'été_ be used without a preposition? No. Eliminate (C) _que_.
You can use _à_ with _passer l'été_ , but in that case it would be used with a place, not with a person. Eliminate (B).
Can _passer l'été_ be used with _chez_? Yes. _Passer l'été_ _chez_ means "to spend the summer at the home of." Choice (A) is the right answer.
### **_Où_ —Where**
_Voilà la bibliothèque **où** j'ai passé beaucoup de temps._
There is the library **where** I spent a lot of time.
_J'ai vu l'hôpital **où** je suis né._
I saw the hospital **where** I was born.
**_Où_** can in many cases be replaced by _dans lequel_ ( _laquelle/lesquels/lesquelles_ ).
**_Où_** means **when** after the expressions _au moment, à l'époque, au temps,_ and _le jour._ Use this carefully and only when it could be replaced by _pendant lequel._
_Les jours **où** il n'y avait plus de pain, ils mangeaient du riz._
On the days **when** there was no more bread, they ate rice.
_Où_ and _dans lequel_ sometimes mean the same thing. You'll never be asked to choose between the two.
### **_En_ —Of It/Of Them**
**_En_** replaces a noun that is used with a verb that takes the preposition _de_. It can be used for people or things. It is often used in sentences that refer to a number or quantity of things.
_Nous parlons du livre._
We are speaking about the book.
_Nous **en** parlons._
We are speaking **about** it.
Think of _en_ as meaning "of it" or "of them." You can use it in some cases where the _de_ is understood but not actually used.
_J'ai des cassettes._
I have some tapes.
_J'ai cinq cassettes._
I have five tapes.
_J' **en** ai cinq._
I have five **of them**.
While _en_ will usually refer to some kind of possession, it can also be used to indicate place or location if the verb in question uses _de_.
_Il vient de Rome._
He comes from Rome.
_Il **en** vient._
He's coming **from there**.
### **_Y_ —There**
**_Y_** often refers to place or location. _Y_ replaces phrases that begin with prepositions that indicate place ( _à, chez, dans, sur_ ).
_Est-ce que tu vas à la fête?_
Are you going to the party?
_Oui, j' **y** vais._
Yes, I am going **there**.
_Y_ , an indirect object pronoun, also replaces a thing or an idea that is preceded by the preposition _à_.
_Tu crois au Père Noël?_
You believe in Santa?
_Oui, j'y crois!_
Yes, I do!
_Jouez-vous au tennis?_
Do you play tennis?
_Oui, j'y joue._
Yes, I do.
_As-tu réfléchi à ta dissertation?_
Have you thought about your essay?
_Oui, j'y ai réfléchi._
Yes, I have.
### **_Chacun_ —Each One**
_Chacun à son tour!_
Wait your turn!
_On a trois euros chacun._
We each have three euros.
### **_Quelques-uns/unes (de)_ —Some (Of)**
_**Quelques-uns** de ces livres sont à lire avant la fin du semestre._
**Some of** those books are to be read before the end of the semester.
_Je peux goûter ces bonbons?_
May I taste these candies?
_Oui, prends en **quelques-uns.**_
Yes, take **some of** them.
### **_Aucun/Aucune_ —Not One, None**
_Je n'en aime **aucun**!_
I like **none** of them!
_Aucun_ and _aucune_ are always used with _ne._
_**Aucune** de ces réponses n'est correcte._
**None** of these answers is correct.
Both _aucun_ and _personne_ must be used with _ne_ in a sentence.
### **_Quelqu'un_ —Someone**
_**Quelqu** 'un a volé ma moto!_
**Someone** stole my motorcycle!
### **_Personne_ —No One**
_Est-ce que quelqu'un a vu le voleur?_
Did anyone see the thief?
_Non, **personne** ne l'a vu._
No, **no one** saw him.
Like _aucun, personne_ is used with _ne. Personne_ can be used without the _ne_ only if it is a one-word answer to a question.
_Qui a cassé ce vase?_
Who broke this vase?
_**Personne**_.
**No one.**
### **_Quelque chose_ —Something**
_Je vous ai acheté **quelque chose** à la pâtisserie._
I bought you **something** at the pastry shop.
### **_Ne...rien_ —Nothing**
_Est-ce que tu as acheté quelque chose à la pâtisserie?_
Did you buy something at the pastry shop?
_Non, je **n'** ai **rien** acheté._
No, I did **not** buy **anything**.
Avez-vous des stylos? -------.
(A) Oui, lesquels.
(B) Oui, j'ai quelques.
(C) Non, je n'en ai aucun.
(D) Non, je n'ai pas.
Here's How to Crack It
(A) _lesquels_ cannot stand by itself in a sentence unless it is an answer to a question ( _Apporte-moi les stylos_. _Lesquels_?). Eliminate it.
(B) _quelques_ , meaning "some," is an adjective and can only be used to modify a noun _(j'ai quelques stylos_ or _j'en ai quelques-uns)_. Eliminate it.
(C) _aucun_ is used with _ne_. This is correct.
(D) By itself, _je n'ai pas_ does not work. It lacks a reference to what it is that I do not have. To be correct, you would need to say either _je n'en ai pas_ or _je n'ai pas de stylos_.
Qui va chercher le paquet à la poste? ------- vais.
(A) A quoi
(B) J'y
(C) Personne
(D) J'en
Here's How to Crack It
(A), _A quoi_ does not work and makes no sense. It refers to things and is usually used with a preposition.
(B) is correct. The _y_ replaces the expression _à la poste._
(C) has two problems. First, _personne_ needs to be used with _ne_. Second, _personne_ takes the third person singular form of the verb (in this case, _va_ ).
(D) _En_ is used to show either possession or to replace a noun that works with a verb that takes _de_. Here the verb is _aller_ and it takes the preposition _à_. So _en_ is not correct.
### **_Quand + Futur_ —When**
In French, "quand" takes the future tense whereas in English, "when" takes the present tense.
_Quand j'irai à l'école, je prendrai mes cahiers._
When I go to school, I take my notebooks.
## **DRILL 1: PRONOUN QUESTIONS**
Answers can be found in Part IV.
Click here to download and print the PDF version of this exercise.
. \------- est arrivé à Paul hier?
(A) Quel
(B) Quoi
(C) Qu'
(D) Qu'est-ce qui
. C'est -------.
(A) eux
(B) il
(C) lui
(D) le
. C'est grâce à ------- que nous avons pu venir.
(A) eux
(B) les
(C) leur
(D) ils
. La chose la plus difficile est de ------- réveiller le matin.
(A) lui
(B) il
(C) le
(D) moi
. \------- a sorti la poubelle.
(A) Il n'
(B) Personne n'
(C) Aucun
(D) Qui
. Le livre ------- je suis l'auteur est une histoire d'Amérique pendant le 19ème siècle.
(A) lequel
(B) dont
(C) que
(D) qui
. La femme ------- Isabelle est assise est le chef de la compagnie.
(A) à côté de laquelle
(B) à côté auquel
(C) à côté qui
(D) à côté
. J'ai interviewé beaucoup de célébrités, mais ------- ne me fait cet effet.
(A) personne
(B) jamais
(C) quelque chose
(D) aucun
. \------- d'extraordinaire est arrivé aujourd'hui. J'ai reçu mon doctorat.
(A) Quelqu'un
(B) Quelque fois
(C) Quelque chose
(D) Aucun
. On comprend très bien ------- les citoyens avaient peur pendant la premiere guerre mondiale.
(A) que
(B) pourquoi
(C) qui
(D) ce dont
## **VERBS**
There are three areas that verb questions tend to test: use of the subjunctive, agreement of the past participle, and tense.
### **Know the Subjunctive**
About 25 percent of the grammar questions on the test deal with verb use. Over half of them ask you to decide whether or not to use the subjunctive.
Roughly 4–5 questions on Parts B & C will test the use of subjunctive. Knowing these rules can help you snag several crucial points!
### **What Is the Subjunctive?**
Like the indicative, the subjunctive is not a tense; it is a mode or mood. While it is not often used in English, it is used very frequently in French. This is why it is always found on the SAT Subject Test in French.
### **When Do You Use the Subjunctive?**
In French and on the SAT French, you will use the subjunctive in phrases that follow expressions of doubt, suggestion, preference, desire, improbability, or emotion. The subjunctive is also used with certain conjunctions. All phrases that require use of the subjunctive will contain the word _que_.
You must use the **indicative mode** with verbs expressing an opinion, such as _penser que, croire que, espérer que,_ _être sûr que, être certain que_ when they are used in the affirmative form.
_Je crois que vous avez raison._
I believe you are right.
_Nous pensons que tes parents seront contents de te revoir._
We think your parents will be happy to see you again.
_J'espère que vous allez bien._
I hope you are well.
Compare the above examples to the following examples, which display these verbs used in the negative form. The negative form makes a difference since it requires subjunctive!
_Je ne crois pas qu'il **ait** raison._
I don't think he's right.
_Nous ne pensons pas que tes parents **soient** contents._
We don't think your parents are happy.
### **Expressions That Take the Subjunctive**
### **Doubt or Uncertainty**
_**Je doute qu** 'il réussisse son examen._
**I doubt that** he will pass his exam.
_**J'ai peur qu** 'il rate son examen._
**I am afraid that** he will fail his exam.
_**Je ne crois pas que** vous ayez raison._
**I don't believe that** you are right.
_**Il est douteux qu** 'elle vienne ce weekend._
**It's doubtful that** she will come this weekend.
_**Il est possible que**_ j'aie tort.
I may be wrong. ( **It is possible that** I am wrong.)
### **Suggestion or Preference**
_**Je préfère que** vous rentriez tout de suite._
**I prefer that** you return at once.
_**Je tiens à ce que** tu sois à l'heure._
**I insist that** you be on time.
_**Il vaut mieux que** vous ne sortiez pas ce soir._
**It is better that** you do not go out tonight.
_**Il est important que** vous étudiiez l'emploi du subjonctif._
**It is important that** you study the use of the subjunctive.
_**Il faut que** je prenne un rendez-vous chez le dentiste._
**It is necessary that** I make an appointment at the dentist's.
All phrases that require use of the subjunctive will contain the word _que_.
### **Desire**
_**Je veux que** tu travailles plus sérieusement._
**I want** you to work more seriously.
_**Je souhaite que** tout se passe bien._
**I wish that** everything goes well.
_**Je désire qu** 'il soit heureux._
**I want** him to be happy.
### **Improbability**
_**Il est peu probable** qu'il neige demain._
**It is unlikely that** it will snow tomorrow.
### **Emotion**
_**Je suis étonné qu** 'il ne soit pas encore là._
**I am surprised** that he is not yet here.
_**Je suis content que** tout se soit bien passé._
**I am happy that** everything went well.
_**Je regrette que** le temps passe si vite._
**I am sorry that** time goes by so quickly.
The subjunctive is used with expressions of doubt, preference, or emotion.
### **Superlative**
_**Cet homme est le seul qui** sache encore travailler de ses mains._
**This man is the only one who** still knows how to work with his hands.
_**C'est la meilleure nouvelle que** vous puissiez lui donner._
**It is the best news that** you can give him.
### **Expressions That DO NOT Take the Subjunctive**
The following expressions do not take the subjunctive when they are used in the **affirmative form only:**
_il est probable que_ | it is likely
---|---
_espérer_ | to hope
_se demander_ | to wonder
_croire_ | to believe
_penser_ | to think
_se douter que_ | to suspect
_Il est probable qu'il neigera demain._
It is probably going to snow tomorrow.
_Je me demande s'il viendra._
I wonder if he will come.
**Pay Attention to Probability vs. Improbability**
"It's likely it will rain tomorrow" would use the indicative in French. "It is unlikely to be beautiful tomorrow" would take the subjunctive.
Beware of _ne_ used as an expletive after _avant que, de peur que, de crainte que, avoir peur que, craindre que,_ and _à moins que_. **It is not a negative form, but only substantiates an already-negative main clause, such as in expressions of fear, warning, or doubt.**
_Je vais aller me promener avant qu'il ne pleuve._
I will go for a walk before it rains.
_Je crains qu'il ne pleuve._
I am afraid it might rain.
### **Conjunctions That Take the Subjunctive**
_pour que, de manière (à ce) que_ | so that
---|---
_de sorte que, afin que_ | so that
_quoique, bien que_ | although
_pourvu que, à condition que_ | provided that, so long as
_à moins que_ | unless
_jusqu'à ce que_ | until
_en attendant que_ | waiting for
_avant que_ (but not _après que_ ) | before
_de crainte que,_ _de peur que_ | for fear that
_sans que_ | without
_malgré que_ | even though, in spite of
_pour autant que_ | as far as
### **Conjunctions That DO NOT Take the Subjunctive**
_après que_ | after
---|---
_dès que, aussitôt que_ | as soon as
_pendant que_ | during
_parce que_ | because
_puisque_ | since
_étant donné que_ | given that _/_ with the understanding that
_tandis que_ | while _/_ whereas
### **So Now What?**
You won't have to construct the subjunctive of a given verb; you only need to recognize it among the four answer choices. In addition to the present subjunctive, you may also see the past of the subjunctive. You'll recognize it because the auxiliary or helper verb ( _avoir_ or _être_ ) will be in the subjunctive. Note that with avoir, _il_ _a_ becomes _il ait_ and with _être, il est_ becomes _il soit_.
### **Present Tense**
_Certain:_ | _Je sais qu'il vient ce soir._
I know that he is coming tonight.
---|---
_Uncertain:_
(Pres. Subj.) | _Je doute qu'il vienne ce soir._
I doubt that he is coming tonight.
### **Past Tense**
_Certain:_ | _Je sais qu'il est venu hier._
I know that he came yesterday.
---|---
_Uncertain:_
(Past Subj.) | _Je doute qu'il soit venu hier._
I doubt that he came yesterday.
Now you try it:
Jean-Paul ne m'a pas téléphoné; j'ai peur qu'il ------- oublié notre rendez-vous.
(A) a
(B) avait
(C) ait
(D) aura
Here's How to Crack It
Does the expression _J'ai peur que_...take the subjunctive? Yes! It shows doubt, fear, or uncertainty. The answer is (C).
Try another one:
Ma mère m'a grondée quand elle ------- ma robe déchirée.
(A) voit
(B) a vu
(C) voie
(D) ait vu
Here's How to Crack It
Does the expression _Ma mère m'a grondée quand_...take the subjunctive?
No. The verb in this case ( _voir_ ) is an actual event. Eliminate (C) and (D). This sentence requires the past, so the answer is (B). Also, note that we have _quand_ here and not _que_.
Détruisez les preuves avant qu'il n'------- ce que nous avons fait.
(A) apprendra
(B) apprenne
(C) apprendrait
(D) apprend
Here's How to Crack It
Is _avant que_ a conjunction that takes the subjunctive?
Yes. The answer is (B). Choice (A) is the future. Choice (C) is the conditional. Choice (D) is the present.
### **Tense**
You remember all those fancy verb tenses you learned in French class: the _passé simple_ , the future perfect, the pluperfect subjunctive? Well, for the purposes of this test, you can forget them.
For the SAT French, you need to recognize the present, the imperfect, the _passé composé_ , the _plus-que-parfait_ , the future, the conditional, the past of the conditional, and you must know when to use them. The subjunctive, actually a mode or mood rather than a tense, is the verb form most frequently tested. The conditional, also a mode or mood, is the next most frequently tested verb form.
**English** | **French**
---|---
Present | Présent
Past | Passé Composé
Imperfect | Imparfait
Past Perfect | Plusque-parfait
Future | Futur simple
Conditional | Conditionnel
Past Conditionnel | Conditional Passé
### _**Le Présent**_
This is pretty straightforward. It's the form of the verb you're most used to seeing.
_Il part._
### _**L'Imparfait**_
The imperfect tense is a form of the past that indicates something was ongoing: either something that went on for a period of time in the past or something that happened repeatedly in the past.
_**présent**_
_Il part._ | _**imparfait**_
_Il partait_
---|---
### _**Le Passé Composé**_
This tense indicates that a past action (or state) is now complete. It is made up of an auxiliary verb (either _avoir_ or _être_ in the present tense) and a past participle. It indicates something that started and ended in the past and is now over.
_**présent**_
_Il part._ | _**passé composé**_
_Il est parti._
---|---
**The _Passé Composé_ vs. the _Imparfait_**
Notice the difference between the _passé composé_ and the _imparfait._ The _passé composé_ describes a one-time action that is now complete, while the _imparfait_ describes an action that was ongoing in the past.
### **_Le Plus-Que-Parfait_ (Past Perfect)**
The past perfect indicates that something happened in the past prior to another action in the past. It is made up of an auxiliary verb ( _avoir_ or _être_ in the perfect tense) and a past participle.
_**présent**_
_Il part._ | _**plus-que-parfait**_
_Il était parti avant qu'il ait plu._
---|---
### _**Le Futur**_
This indicates that something will happen.
_**présent**_
_Il part._ | _**futur**_
_Il partira._
---|---
### _**Le Conditionnel**_
The conditional mode or mood is used to describe what people would do or what would happen if a set of conditions were met. In most cases it is used with another clause starting with _si._
_**présent**_
_Il part._ | _**conditionnel**_
_Si cela arrivait, il partirait._
_Il partirait si cela arrivait._
---|---
The conditional is also used as a polite way to request things.
_Je voudrais une baguette, s'il vous plaît, madame._
I would like a baguette please, madame.
The conditional is actually a mode or mood, not a tense. It is used to describe if/then situations.
### **Use of the Conditional**
Almost half of the questions that relate to verb sequence test you on the use of the conditional. The conditional is used in a sentence if there is a clause that begins with _si_ and uses the imperfect tense.
**_si_** \+ **_imparfait_** → **_conditionnel_**
_Si j'avais le temps, je le ferais moi-même._
If I had the time, I would do it myself.
You will use the conditional before or after clauses that start with _si_ and contain the imperfect.
If the past imperfect is used, then the past conditional will be used.
**_si_** \+ **_plus-que-parfait_** → **_conditionnel passé_**
_Si j'avais eu le temps, je l'aurais fait moi-même._
If I had had the time, I would have done it myself.
_Présent_ | _Aujourd'hui, il fait ses devoirs._
---|---
_Imparfait_ | _Quand il était petit, il faisait ses devoirs._
_Passé composé_ | _Hier il a fait ses devoirs._
_Plus-Que-Parfait_ | _J'avais déjà fini mes devoirs quand il est parti._
_Futur_ | _Demain, il fera ses devoirs._
_Conditionnel_ | _S'il avait des devoirs, il les ferait._
### **Sequence of Tenses**
In questions with several verbs, the tenses and mode must follow a logical sequence.
• Sentences with a _si_ clause:
**_Si_ clause** | **Result**
---|---
_impartfait_ | _conditionnel présent_
_Si j'avais de l'argent_ | _j'achèterais un bateau._
_plus-que-parfait_ | _conditionnel passé_
_Si j'avais eu de l'argent_ | _j'aurais fait ce voyage en Afrique._
• Conjunctions referring to time such as _quand, une fois que, après que, lorsque, aussitôt que,_ and _dès que_ often require the use of the _futur antérieur_ (future perfect) instead of the _futur simple_. You must consider whether:
1. In the sequence of future events, one action must be finished before the other can take place.
_Je pourrai répondre à ta question quand j'aurai parlé à mon frère._
I will be able to answer your question when I have talked to my brother.
2. In the future, the actions in both clauses will take place at the same time.
_Je vous appellerai quand il arrivera à la maison._
I will call you as soon as he arrives.
Je sortirai aussitôt que mon travail -------.
(A) finira
(B) serait fini
(C) sera fini
(D) finirait
Here's How to Crack It
What tense is correct? It is not a _si_ clause or any form of politeness; therefore, it cannot be conditional mode. Eliminate (B) and (D). The conjunction _aussitôt que_ indicates that one action has to take place before the other. Eliminate (A). Choice (C) is the correct answer.
Si j'étais riche, je ------- un yacht.
(A) m'achète
(B) m'achèterai
(C) m'achetais
(D) m'achèterais
Here's How to Crack It
What tense is correct here? Because _si_ is used with the imperfect, the following verb must be the conditional.
How do we recognize the conditional? It combines the structure of the future with the endings of the imperfect ( _ais, ait_ , etc.). Choice (D) is the correct choice.
Avant d'entrer au restaurant, il m'a demandé si j' ------- assez d'argent pour payer le dîner.
(A) ai
(B) avais
(C) ai eu
(D) aurai
Here's How to Crack It
What tense is correct here? Choice (A) cannot be correct. It is the present tense, and the previous clause, _il m'a demandé_ , tells us the action is in the past. Since (D) is the future, we can eliminate it as well.
Do we use the imperfect or the past? Choice (C) implies that having enough money was an event or action that occurred once prior to the question. Because we have the phrase, _avant d'entrer_ , we know that the state of having money is an ongoing one, preceding and presumably continuing throughout dinner. Choice (B) is the correct answer.
Make sure you can identify which tense (or mood) is which.
It is important that you recognize what each tense or mood looks like when you see it. Usually the ending of the verb will give you a clue.
With _donner_ , as in all regular " _er_ " verbs, the singular forms of the subjunctive present are identical to the indicative present.
## **AVOIR AND ÊTRE IN COMPOUND PAST TENSES**
### **What Is an Auxiliary Verb?**
It is a verb that loses its own meaning to help form a compound past tense for other verbs such as the _passé composé, plus-que-parfait, passé du subjonctif, conditionnel passé,_ and _futur antérieur_. All verbs take either _avoir_ or _être_. To make a sweeping generalization, **most verbs take _avoir_** **,** but verbs that indicate a **change of place** ( _aller, venir, partir_ ) **or state** ( _naître, mourir, devenir_...) **and all reflexive verbs** ( _se laver, se lever_...) take **_être_**. Sound tricky? Just remember Dr. and Mrs. Vandertramp.
You're probably familiar with the _avoir_ vs. _être_ auxiliary verb divide from French class, but let's review just in case. When you are writing a sentence in _passé composé,_ you must use either _avoir_ or _être_ as your helper verb before the past participle. Most of the time, the auxiliary verb that you'll use is _avoir_ ("to have") but sometimes it will be _être_ ("to be"). To help you remember what verbs pair up with _être,_ let me introduce you to my trusted friends, Dr. and Mrs. Vandertramp. Who are Dr. and Mrs. Vandertramp? They're a couple that every French student should know, even if doctors make you anxious. Memorize that pneumonic and it will help you recall a list of the verbs that use _être_ as their auxiliary verb in _passé composé:_
Meet your new BFFs, Dr. and Mrs. Vandertramp!
**D** evenir | to become | **V** enir | to come
---|---|---|---
**R** evenir | to come back | **A** ller | to go
& | | **N** aître | to be born
**M** onter | to climb | **D** escendre | to go down
**R** ester | to stay | **E** ntrer | to enter
**S** ortir | to go out | **R** entrer | to come back
| | **T** omber | to fall
| | **R** etourner | to return
| | **A** rriver | to arrive
| | **M** ourir | to die
| | **P** artir | to leave
### **What Is a Past Participle?**
A past participle is the form of the verb that combines with "to have" (in English), or _être_ or _avoir_ (in French), in order to make the past tense.
_Je mange mon petit déjeuner._
I eat my breakfast. (present) | _J'ai **mangé** mon petit déjeuner._
I have eaten my breakfast. (past)
---|---
You'll most likely be given the choice of four different forms of the past participle—masculine singular, feminine singular, masculine plural, and feminine plural—with an occasional infinitive thrown in to confuse you. You must decide which is correct.
### **When Does the Past Participle Agree, and with What?**
The past participle **agrees with the subject** of the sentence when:
• The verb takes **_être_** as its auxiliary verb and there is **no direct object placed after the verb.**
_Pauline et Chantal sont parties hier pour l'Afrique._
Pauline and Chantal left for Africa yesterday.
• The verb is **reflexive** and therefore takes **_être,_** and there is **no direct object**.
_Elle s'est évanouie quand elle a entendu la nouvelle._
She fainted when she heard the news.
The past participle will agree with the _subject_ if the verb takes **_être_** or is reflexive.
It will agree with the _object_ of the sentence if the verb takes **_avoir_** and the direct object is before the verb.
The past participle **agrees with the direct object** of the sentence when:
• The **reflexive** verb has a **direct object placed before the verb**.
_La jambe qu'elle s'est cassée en skiant lui fait toujours mal._
The leg she broke skiing is still painful.
• The verb takes _avoir_ and has a **direct object placed before the verb**.
_La fille que nous avons vue au café est ma meilleure amie._
The girl we saw in the café is my best friend.
### **When Is There No Agreement?**
• The **reflexive** verb has a **direct object** (usually a body part) **placed after the verb**.
_Elle s'est piqué le doigt en cousant._
She pricked her finger while sewing.
_Elle s'est lavé les cheveux ce matin._
She washed her hair this morning.
• The verb takes _avoir_ and has a **direct object placed after the verb**.
_J'ai vu ma meilleure amie au café aujourd'hui._
I saw my best girlfriend in the café today.
Since questions in Part C often contain several sentences, information about the gender and number may come earlier than the sentence in which the blank appears.
Try this:
Les deux sœurs ont très bien ------- à l′université.
(A) réussi
(B) réussie
(C) réussis
(D) réussies
Here's How to Crack It
The verb _réussir_ (to succeed, to be successful) uses the auxiliary verb _avoir_. Is there a direct object that precedes the verb? No. There is no direct object in this sentence. The correct answer is (A).
La fille à côté de moi m'a donné les renseignements dont j'avais besoin. Je l'ai ------.
(A) remercié
(B) remerciée
(C) remerciées
(D) remercier
Here's How to Crack It
The verb _remercier_ (to thank) also takes _avoir_ as its helper verb. Is there a direct object before the verb? Yes, " _l"_ refers to _la fille_. The correct answer is (B).
### **Oddball Verb Forms: Other Participles**
There is a small chance that you will have a question or two on other participles: the present participle, the gerund, or the perfect participle. You don't need to know these terms—just be able to recognize how they work in a sentence. This type of question is most likely to appear on Part C, where you choose the appropriate form of the verb based on the sequence of tenses in the paragraph.
### **The Present Participle**
The present participle is a verb form that ends in "-ing" in English. It shows that one action is happening at the same time as another.
_J'ai vu les enfants courant sur la pelouse._
I saw the children running on the lawn.
The present participle "running" is also acting as an adjective, describing something about the children.
### **The Gerund**
The gerund is also like an "-ing" verb form in English, but in this case, it is acting as a noun rather than an adjective. In French, it is always accompanied by the preposition _en_. It can show:
#### **• That one action is happening at the same time as another**
_Elle montait l'escalier en chantant._
She climbed the stairs while singing.
#### **•That one action is part of a process**
_En lisant, nous découvrons de nouveaux mondes._
In reading, we discover new worlds.
#### **• That one action is part of a cause and effect**
_Eric apprend à danser en regardant des vidéos._
Eric learns how to dance by watching videos.
## **The Perfect Participle**
The perfect participle (made up of _ayant_ or _étant_ \+ the past participle) is the past tense of the present participle. An example in English would be "Having won the war, the army celebrated." This form is used to show that one action was completed before another began.
_**Ayant fini** le repas, nous avons débarrassé la table._
Having finished the meal, we cleared the table.
If the verb takes _être_ , you will see _étant_ instead of _ayant_ :
_**Étant montée** , elle ne pouvait plus entendre la discussion._
Having gone upstairs, she could no longer hear the discussion.
Since you're an expert by now, let's try tackling a full paragraph:
Hier, j'étais en train de ----(1)---- la maison quand j'ai vu à travers la fenêtre un lapin sur la pelouse. Son corps ----(2)---- brun, mais il avait de grandes oreilles blanches. Je l'----(3)---- regardé pendant quelques instants, puis en entendant un bruit il a ----(4)---- et en un clin d'œil il a disparu.
1. (A) rouler
(B) ranger
(C) nager
(D) hausser
2. (A) est
(B) a été
(C) serais
(D) était
3. (A) aie
(B) ai
(C) aura
(D) aurais
4. (A) choisi
(B) établi
(C) bondi
(D) dormi
Here's How to Crack It
1. Which verb describes something that can be done in a house ( _maison_ )? _Rouler_ means to roll, _ranger_ means to tidy up, _nager_ means to swim, and _hausser_ means to raise. Only (B) makes sense in this context.
2. Which form of the verb _être_ is correct here? Since the entire paragraph takes place in the past, we can eliminate both the present tense in (A), _est_ , and the conditional in (C), _serais_. Now we have to choose between the _passé composé_ in (B) or the imperfect in (D). Because the sentence is describing specific characteristics of the rabbit ( _lapin_ ), we need to use the imperfect, which is used to describe states of being that are ongoing. The fact that the other verb in the sentence is also imperfect ( _avait_ ) is another hint that (D), _était_ , is the right answer.
3. Which form of the verb _avoir_ is correct here? Again, all action is taking place in the past, and the other verbs in the sentence both appear to use the _passé composé_. Eliminate the future, (C), and the conditional, (D). In (A) we have the subjunctive form, but since there isn't any uncertainty or emotion here, it's incorrect, which leaves (B) as the correct answer.
4. Which past participle has the correct meaning for the sentence? Translating the second half of the sentence, we learn that upon hearing a noise ( _en entendant un bruit_ ), it (the rabbit) does something and in the blink of an eye, it disappears ( _en un clin d'œil il a disparu_ ). Choice (A) means the rabbit chose something, which doesn't fit. Choice (B) doesn't work either, as the rabbit didn't establish anything. Choice (C) is the past participle of _bondir_ , which means to leap; this would be a logical thing for the rabbit to do. Choice (D) suggests the rabbit slept, which isn't correct. Choice (C) is the right answer.
## **DRILL 2: VERB QUESTIONS**
Answers can be found in Part IV.
Click here to download and print the PDF version of this exercise.
. Si -------, je préparerais le dîner.
(A) vous en avez envie
(B) on me le demande
(C) j'avais le temps
(D) tu seras d'accord
. Paul regrette que nous ------- pas réussi.
(A) n'avons
(B) n'avions
(C) n'ayons
(D) n'aurons
. \------- une lettre quand on a sonné à la porte.
(A) J'écris
(B) J'écrirais
(C) J'écrive
(D) J'écrivais
. Elle n'a jamais oublié ce que nous ------- au moment de son départ.
(A) disons
(B) ayons dit
(C) avons dit
(D) aurions dit
. Est-ce que vous ------- contents si je n'avais pas accepté l'invitation?
(A) êtes
(B) soyez
(C) étiez
(D) auriez été
. Nous doutons ------- leur rendre visite chez eux.
(A) qu'il ait le temps de
(B) qu'il voudrait
(C) qu'il peut
(D) qu'elle avait envie de
. \-------, elle est partie pour le long trajet chez elle.
(A) Disait au revoir
(B) Dire au revoir
(C) Ayant dit au revoir
(D) Avoir dit au revoir
. Tu pourras regarder la télé une fois que tu --------- ton travail.
(A) aurais fini
(B) finissais
(C) auras fini
(D) finisses
. Quand j'avais quatre ans, --------- un enfant très difficile.
(A) j'étais
(B) je suis
(C) j'ai été
(D) je suis été
. Il aimerait aller avec toi au musee, mais il --------- travailler.
(A) doive
(B) devra
(C) devais
(D) doit
## **PREPOSITIONS**
Below is a list of the most important prepositions for you to know.
**Common Prepositions**
---
_à_ | = to
_de_ | = from, of
_sur_ | = on
_sous_ | = under
_pour_ | = for
_avant (+ nom)_ | = before
_avant de (+ verbe)_ | = before
_après_ | = after
_chez_ | = at, to (location)
_en_ | = of, in, from, to
_dans_ | = in, into
_entre_ | = between
_pendant_ | = during
_vers_ | = toward
_sans_ | = without
_sauf_ | = except, unless
_selon_ | = according to
_durant_ | = during
_malgré, en dépit de_ | = in spite of
_afin de_ | = in order to
Just as in English, certain verbs or expressions in French require prepositions while others require none. Memorization is the key here.
These questions will ask you for the preposition required. Some verbs can take more than one preposition depending on the meaning. In some questions, you will have the option of no preposition, denoted by a dash in the answer choice (–––).
Il a refusé ------- faire son lit.
(A) \---
(B) à
(C) de
(D) sur
Out of context, _refuser_ could take the preposition _à_ or _de_ , or no preposition at all. Each has a different meaning.
_refuser quelque chose_ —to refuse something
_Il a refusé l'offre._
He refused the offer.
_refuser quelque chose à quelqu'un_ —to deny something to someone
_Le juge a refusé les droits de visite à la mère._
The judge denied visitation rights to the mother.
_refuser de faire quelque chose_ —to refuse to do something
_L'enfant a refusé de manger ses carottes._
The child refused to eat her carrots.
Which is appropriate for this question? Because someone is refusing to do something in this sentence, the correct answer is _de_ , (C).
Prepositions are tested on Parts A and B of your SAT Subject Test in French. As parts of grammar, prepositions join words and have specific meanings, and certain verbs can be used only with certain prepositions (also known as "idioms").
### **Back to Pronouns**
Keep in mind that the verb's appropriate preposition may determine your choice of pronoun. If a verb requires a preposition in a given circumstance, for example, then you know that it takes an indirect and not a direct object. Or, if a given verb requires _de_ , the relative pronoun used with it will reflect that.
C'est la robe ------- j'ai envie.
(A) que
(B) qui
(C) dont
(D) à qui
Here's How to Crack It
The verb _avoir envie_ takes the preposition _de_. Choice (A) can be eliminated because _que_ is never used with a preposition. Choice (B) can also be eliminated because _qui_ cannot be a subject here ( _j'_ is the subject). _Avoir envie_ takes _de_ , so (D), which is used with _à_ , cannot be right. Choice (C) _dont_ is correct because _dont_ in a sense means _de_ \+ _que_.
Your knowledge of prepositions will affect your choice of pronouns. For example, _dont_ will be a correct choice only if the verb takes _de_ as a preposition.
Your experience studying French will probably provide you with a good sense of which verb takes which preposition, if you take the time to think about it. To refresh your memory, here is a partial list of verbs. Some never take a preposition, others sometimes take a preposition, and still others always take a preposition.
### **Verbs That Don't Take a Preposition**
Verbs that don't take prepositions will be used with either the infinitive (the "to" form of a verb) or a direct object. Some verbs can be used with both.
**_pouvoir_ \+ infinitive** |
_Je peux faire n'importe quoi._
I can do anything I want.
---|---
**_espérer_ \+ infinitive** |
_J'espère venir demain._
I hope to come tomorrow.
**_vouloir_ \+ infinitive** |
_Je veux chanter._
I want to sing.
**_vouloir_ \+ object** |
_Je veux cette chemise._
I want this shirt.
**_mettre_ \+ object** |
_Il a mis le vase sur la table._
He put the vase on the table.
**_faire_ \+ object** |
_Marie a fait la vaisselle._
Marie washed the dishes.
**_acheter_ \+ object** |
_Il a acheté trois pantalons._
He bought three pairs of pants.
### **Verbs That Sometimes Take Prepositions and Sometimes Don't**
**_aller_ \+ infinitive** |
_Je vais chercher ma sœur à l'école._
I am going to get my sister at school.
---|---
**_aller à_** |
_Je vais aux États-Unis._
I am going to the United States.
**_refuser_ \+ object** |
_Je refuse l'offre._
I refuse the offer.
**_refuser de_** |
_Je refuse de faire mes devoirs._
I refuse to do my homework.
**_oublier_ \+ noun** |
_J'ai oublié mon stylo._
I forgot my pen.
**_oublier de_** |
_J'ai oublié de dire au revoir._
I forgot to say good-bye.
**_accepter_ \+ object** |
_J'accepte votre invitation._
I accept your invitation.
**_accepter de_** |
_J'accepte de nettoyer la cuisine._
I agree to clean the kitchen.
**_compter_ \+ object** |
_Je compte ma monnaie._
I am counting my change.
**_compter sur_** |
_Nous comptons sur vous pour nous aider._
We count on you to help us.
A good resource to have on hand is a verb book. A good verb book will tell you how to conjugate a given verb and which prepositions are used with that verb.
### **Verbs That Always Take Prepositions**
**_réfléchir à_** |
_Je réfléchis à mon avenir._
I am thinking of my future.
---|---
**_penser à_** |
_Je pense à ma mère._
I am thinking of my mother.
**_penser de_** |
_Que pensez-vous du nouveau président?_
What do you think of (about) the new president?
**_participer à_** |
_Je participe aux Jeux Olympiques._
I am in the Olympic games.
**_assister à_** |
_Est-ce que vous allez assister au concert?_
Are you going to attend the concert?
**_faire attention à_** |
_Faites attention aux assiettes en porcelaine!_
Be careful with the porcelain plates!
**_répondre à_** |
_Les élèves répondent aux questions du professeur._
The students answer the teacher's questions.
**_obéir à_** |
_Le soldat obéit aux ordres._
The soldier obeys the orders.
**_parler de_** |
_De quoi parlez-vous? Du chat?_
What are you talking about? About the cat?
**_avoir peur de_** |
_J'ai peur des araignées._
I am afraid of spiders.
**_risquer de_** |
_Il risque de tomber._
He may fall.
**_venir de_** |
_Je viens du supermarché._
I come from the supermarket.
**_avoir envie de_** |
_J'ai envie d'un café._
I feel like having a coffee.
**_avoir besoin de_** |
_J'ai besoin d'un crayon pour écrire._
I need a pencil to write.
### **Set Expressions**
Certain rules govern the use of some prepositions.
### **When Discussing Going to a Country:**
_Je passe mes vacances..._
**Use _en_ for feminine, singular countries.**
_en France_
_en Italie_
**Use _au_ ( _à + le_ ) for masculine, singular countries.**
_au Canada_
_au Brésil_
**Use _aux_ ( _à + les_ ) for multi-state countries, whether feminine or masculine.**
_aux États-Unis_
_aux Bermudes_
### **When Discussing Being in or Going to a Town or City:**
_Je reste..._
_Je vais..._
**Use _à_ :**
_à Paris_
_à New York_
_à Londres_
You always use the preposition _à_ when referring to being in or going to a city.
### **When Discussing Coming from a Country or Town:**
_Il est venu..._
**Use _de_ or _des_ for feminine countries.**
_de Russie_
_d'Allemagne_
_des Bermudes_
**Use _du_ or _des_ for masculine countries.**
_du Japon_
_des États-Unis_
**Use _de_ for all towns.**
_de Paris_
_de Lyon_
When discussing being in or going to the mountains or many American states, use _dans_ \+ the definite article:
• dans les Alpes
• dans les Rocheuses
• dans le Vermont
• dans le Mississippi
**List of Some Countries with Their Genders**
---
**Feminine** | **Masculine** | **Multi-State**
_la Russie_ | _le Canada_ | _les États-Unis (masc.)_
_la France_ | _le Japon_ | _les Pays-Bas (masc.)_
_l'Italie_ | _le Brésil_ | _les Bermudes (fem.)_
_l'Autriche_ | _le Maroc_ | _les Bahamas (fem.)_
_l'Allemagne_ | _le Pérou_ | _les Philippines (fem.)_
_la Belgique_ | _le Viêt-Nam_ |
_la Grèce_ | _le Luxembourg_ |
_la Roumanie_ | _le Mexique_ |
_l'Espagne_ | _le Chili_ |
_l'Angleterre_ | _le Liban_ |
_l'Algérie_ | _le Sénégal_ |
### **Use of _en_ and _de_ \+ Name of Materials**
To describe the material an object is made of, use either **_de_** or **e _n_** \+ the name of the material.
_un sac en cuir_ | a leather purse
---|---
_un pot de terre_ | an earthenware pot
_un mur de pierre_ | a stone wall
_un pantalon en velours côtelé_ | corduroy pants
_un collier de diamants_ | a diamond necklace
_un bracelet en argent_ | a silver bracelet
_une maison en brique_ | a brick house
_une chaise en bois_ | a wooden chair
_un fil de fer_ | a wire
### **Adverbs**
You will want to be able to recognize French adverbs and not get confused by their various forms.
In English, most adverbs are formed with an adjective + the suffix **–ly**.
In French, most adverbs are formed with the feminine form of the adjective and the suffix – ** _ment_**.
_active_ | → | _activement_
---|---|---
_ponctuelle_ | → | _ponctuellement_
_calme_ | → | _calmement_
When the adjectives end with _–i, –ai, –u,_ and _–é,_ the adverbs are formed with the masculine form of the adjective.
_vrai_ | → | _vraiment_
---|---|---
_assidu_ | → | _assidûment_
_poli_ | → | _poliment_
When the adjectives end with _–ant_ or _–ent,_ the endings of the adverbs change to _–mment._
_prudent_ | → | _prudemment_
---|---|---
_négligent_ | → | _négligemment_
_savant_ | → | _savamment_
Also remember that some irregular adverbs are different from the adjectives:
_bon_ | → | _bien_
---|---|---
_rapide_ | → | _vite_
_meilleur_ | → | _mieux_
_mauvais_ | → | _mal_
Be aware of certain adverbs placed as attributive adjectives. They do not agree with the nouns, of course, but you might mistakenly think they need to be eliminated because of their position in the sentence. Take a look at a few examples:
_Il y a encore des places_ **debout** _dans la salle de spectacle._
_Les roues_ **avant** _sont à changer._
## **DRILL 3: PREPOSITION QUESTIONS**
Answers can be found in Part IV.
Click here to download and print the PDF version of this exercise.
. Marie ------- les résultats de ses examens.
(A) pense
(B) attend
(C) compte
(D) a envie
. Je ------- de leur écrire.
(A) suis obligé
(B) espère
(C) veux
(D) réfléchis
. Je n'ai jamais eu l'occasion ------- voir ce film.
(A) \---
(B) à
(C) de
(D) sur
. \------- le concert, elles bavardaient sans cesse.
(A) Pendant
(B) Dans
(C) Avec
(D) En
. Je la vois souvent à -------.
(A) France
(B) ville
(C) la boulangerie
(D) loin
. Elle n'a pas réfléchi ------- de refuser l'offre.
(A) \---
(B) avant
(C) après
(D) à
. Nous pensons toujours ------- leurs parents.
(A) les
(B) de
(C) à
(D) aux
. Ils viennent ------- l'aéroport.
(A) pendant
(B) de
(C) à
(D) après
. Elle a assisté au concert ------- les objections de ses parents.
(A) sauf
(B) malgré
(C) selon
(D) pendant
. Passez-vous votre vacances ------- Canada?
(A) au
(B) à
(C) en
(D) de
## **ODDS AND ENDS**
At most, these topics will come up once or twice on the test.
Odds and ends are just that: small, picky questions that show up from time to time but don't appear on every test.
### **Adjective Versus Adverb**
Adjectives modify nouns. Adverbs modify verbs, adjectives, and other adverbs. In French, adverbs often end in - _ment_.
Elle a remplacé le vase -------.
(A) doux
(B) brusquement
(C) difficile
(D) ennuyeuse
Choices (A), (C), and (D) are all adjectives. Choice (B) is the right answer.
When modifying an adjective, use the adverbs _trop, plus, très, si,_ or _moins_.
_Mieux_ , like _pire_ , cannot be used to modify an adjective.
Ce cassoulet est ------- bon.
(A) mieux
(B) sans
(C) si
(D) pas
_Bon_ is an adjective. The word in the blank must be an adverb. Only _si_ is an adverb that can be used to modify an adjective. Choice (C) is the right answer.
### **Active Versus Passive**
If you use _être_ with the past participle of a verb that normally takes _avoir_ , you are forming the passive tense of the verb.
**Active (present)** | **Passive (present)**
---|---
_Le facteur distribue le courrier._ | _Le courrier est distribué par le facteur._
The postman delivers the mail. | The mail is delivered by the postman.
### **Possessive Adjectives**
Possessive adjectives (not pronouns) show that a given noun belongs to a given person. But, unlike in English, French possessive adjectives agree with the gender and number of what is owned, not who owns it. The form of the adjective also changes depending on whether the noun begins with a vowel or a silent "h."
_Son_ is the masculine singular and _sa_ is the feminine singular. However, if a feminine noun begins with a vowel or a silent "h," the possessive adjective that goes with it will be _son. Sa_ does not shorten to _s_ '.
Elle avait de la soupe dans ------- assiette.
(A) son
(B) sa
(C) s'
(D) ses
Is _assiette_ masculine or feminine? Singular or plural?
_Assiette_ is feminine, but the word begins with a vowel; you can't say _sa assiette,_ so eliminate (B). Possessive adjectives don't contract, so eliminate (C). _Assiette_ is singular; cancel (D), which is plural. Choice (A) is the right answer.
Even though _amie_ is feminine, you can't say _sa amie_ or _s'amie_. When you have a feminine noun that begins with a vowel, it will take the masculine version of the possessive adjective—in this case, _son amie_. The College Board loves to ask this kind of question.
## **SPECIAL POINTS FOR PART C**
### **1. Is It Vocabulary or Grammar?**
How can you tell? **A vocabulary question** will have **four words with clearly different meanings**. **A grammar question** will usually have **one word in four different forms** (for example, the same verb in four different tenses or with four different prepositions). When you see practice examples, the difference will be obvious.
### **2. Think of the Paragraph as a Whole**
The paragraph is telling a story, so all sentences are connected. The key to this section is realizing that the correct answer can be based on both the sentence with the blank and on the sentences that precede it. You may even need to read past the blank sometimes in order to get a better understanding of what's going on. **Don't think of each sentence as a separate question**.
### **3. Special Grammar Points**
Some grammatical points are tested more frequently in Part C than in Part B. All the following points are thoroughly discussed earlier in this chapter.
### **Verb Sequence**
**The action** described in the paragraph must unfold **in a logical sequence. Make sure all the verbs** that you choose as answers **match the tense of the story**. Pay special attention to the rules for use of the imperfect and the conditional.
### **Agreement of the Past Participle**
As we discussed earlier in this chapter, a past participle will agree with the _subject_ if the verb takes _être_. If the verb takes _avoir_ and the direct object comes before the verb, it will agree with the _object_ of the sentence. In some cases, whether the direct object is masculine or feminine is revealed in a previous sentence.
# Comprehensive Drill
Answers can be found in Part IV.
**Part B**
**Directions:** Each of the following sentences contains a blank. From the four choices given, select the one that can be inserted in the blank to form a grammatically correct sentence. Choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically correct sentence.
. Marie a ------- à m'offrir.
(A) quelque chose
(B) rien
(C) plusieurs
(D) quelque
. Claude ------- de faire les courses.
(A) a rejeté
(B) a aimé
(C) est obligé
(D) a voulu
. C'est grâce à son ------- qu'il a réussi.
(A) talents
(B) amie
(C) gentillesse
(D) oncles
. Je ferai la vaisselle -------.
(A) avant de partir
(B) à tout à l'heure
(C) hier
(D) jamais
. C'est ------- qui a gagné!
(A) personne
(B) je
(C) leur
(D) elle
. Nos voisins ------- aller à la piscine.
(A) préfèrent
(B) rêvent
(C) plaisent
(D) insistent
. Je ------- demande s'il est temps de partir.
(A) elle
(B) moi
(C) se
(D) vous
. Les dames sont arrivées avec -------.
(A) leur
(B) il
(C) eux
(D) les
. La voiture verte est -------.
(A) les leurs
(B) la vôtre
(C) à aucun
(D) ma
. L'année dernière j'ai voyagé en -------.
(A) Russie
(B) États-Unis
(C) New York
(D) Canada
. La réussite de ce projet est -------.
(A) certainement
(B) peu
(C) probable
(D) malgré
. \------- ce soit fini.
(A) Nous savons que
(B) Il regrette que
(C) Elle a oublié que
(D) C'est lui qui a décidé que
. C'est le collègue ------- j'ai beaucoup parlé.
(A) dont
(B) de quoi
(C) sauf qui
(D) avant que
. \------- est le metteur en scène de ce film?
(A) Quelle
(B) Qu'est-ce qui
(C) Où
(D) Quoi
. \------- avez-vous envie?
(A) Quel
(B) Y
(C) Dont
(D) De quoi
. Le gouvernement ------- de négocier un accord.
(A) va
(B) espère
(C) essaie
(D) peut
. \------- qu'il sache les nouvelles d'hier.
(A) Sans doute
(B) Je sais
(C) Je crains
(D) C'est à cause de Michel
. Jean a réussi à trouver du travail ------- la grève.
(A) afin de
(B) lorsque
(C) en dépit de
(D) à moins de
. \-------, nous partirions.
(A) Si elle en avait envie
(B) Si tu peux
(C) S'ils voudront
(D) Si vous l'aviez permis
. C'est le gâteau le plus délicieux -------.
(A) que vous avez jamais mangé
(B) qu'elle a jamais acheté
(C) que nous avons jamais fait
(D) que tu puisses jamais imaginer
**Part C**
**Directions:** The paragraphs below contain blank spaces indicating omissions in the text. For some blanks it is necessary to choose the completion that is most appropriate to the meaning of the passage; for other blanks, to choose the one completion that forms a grammatically correct sentence. In some instances, choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically correct sentence. In each case, indicate your answer by filling in the corresponding circle on the answer sheet. Be sure to read each paragraph completely before answering the questions related to it.
Si j'avais su, ----(21)---- aller avec Marie et Christine. Trop tard, j'ai essayé de ----(22)---- téléphoner chez ----(23)---- mais ----(24)---- n'était là. ----(25)----, j'ai tenté de les retrouver au café. Quand ----(26)---- suis arrivé, je les ai ----(27)---- entrer ----(28)---- cinéma.
. (A) je pouvais
(B) j'avais pu
(C) je peux
(D) j'aurais pu
. (A) elles
(B) leur
(C) eux
(D) la
. (A) elles
(B) tu
(C) leur
(D) ils
. (A) personne
(B) une personne
(C) rien
(D) nulle
. (A) Finalement
(B) Terminé
(C) Maintenant
(D) Afin de
. (A) j'en
(B) j'y
(C) je le
(D) je me
. (A) vu
(B) vue
(C) vus
(D) vues
. (A) à la
(B) au
(C) par la
(D) par le
Avant ----(29)---- partir en vacances, Jean et Camille ont ----(30)---- à l'aéroport ----(31)---- demander ----(32)---- l'avion partait ----(33)----.
. (A) \---
(B) à
(C) de
(D) que
. (A) téléphoné
(B) téléphonée
(C) téléphonés
(D) téléphonées
. (A) \---
(B) à
(C) de
(D) pour
. (A) si
(B) quand
(C) quel
(D) qui
. (A) en temps
(B) chaque heure
(C) à l'heure
(D) de temps en temps
# Summary
Questions in Parts B and C of the SAT Subject Test in French evaluate your ability to choose correct words or expressions based on your understanding of French grammar. Here are the main grammar points you should review before the test:
**Pronouns**
Check which pronoun should be used in the sentence. Is it subject, direct object, reflexive, indirect object, or stressed? How about demonstrative, interrogative, relative, indefinite, or even another type of pronoun?
• Check its gender and number if needed (masculine, feminine, plural).
• Check whether it is also replacing a preposition.
• Check where it is placed in the sentence relative to the verb.
**Verbs**
Can you figure out the tense or mode, the use of the auxiliary verb, the agreement with the past participle, the tense sequence, or the specific use of certain verbs?
• Check the subject of the sentence.
• Check the tense sequence by looking at the meaning of the main clause.
• Check whether the verb takes _être_ or _avoir_ in compound past tense.
• Look at prepositions and conjunctions to help you decide what verb form or mode you should use.
**Prepositions**
Can you specify which one to use with which verb? What is the meaning when the preposition is combined with certain verbs and other words? How could it be replaced by a pronoun in a sentence?
• Check whether the verb takes _de_ or _à._
• Check whether the general meaning of the sentence indicates a place, a time, a cause, or something else.
• Check if the preposition is included in a pronoun form or if it should be transformed ( _dont, auquel, duquel_ , etc.).
**Adverbs**
Can you see the difference between adjectives and adverbs?
• Check the word's position in the sentence.
• Check the ending of the word and memorize the irregular adverb forms so you don't get tricked.
# Chapter 6
# Reading Comprehension
For Reading Comprehension, Part D of the SAT Subject Test in French, you will have to read passages in French and answer critical questions.
You will have anywhere from 4 to 6 literary or journalistic passages, each about 20 to 30 lines. In addition, you may see 1 to 3 ticket/schedule/advertisement-type texts; these may or may not be accompanied by pictures.
There is no clear order of difficulty in this section, so you will have to use your judgment to determine which questions you are going to attempt first.
It is best to preview the questions first so you have a better sense of what to look for as you read the passages. The passages are generally quite short. Read them through at a moderate pace to get the general idea of what the passage is about. Do not become obsessed if you don't understand every word or sentence; however, keep an eye out for trap answers.
Get acquainted with the format of the test. Follow the suggestions we give you and then try the practice section at the end of this chapter.
## **PART D: READING COMPREHENSION**
### **Pace Yourself**
Do not be anxious about this section. There is no clear order of difficulty, so just go to the next question if you find something too difficult and then go back if you have time. Hard questions and easy questions give you the same number of points for each correct answer, so get points where you can without wasting too much time on hard questions. The short passages are not necessarily easier than the long ones, so make sure you choose wisely.
### **The Questions Are in Order**
Reading the questions first will give you an idea of what you are about to read and what to look for. Use the fact that the questions are in roughly chronological order to help you find the answers in the passage.
The questions on reading comprehension go in order of the text. The early questions relate to information early in the passage. Later questions refer to information that appears later in the passage.
### **Go Back**
Once you have an idea of what the answer is, go back to the passage and make sure you are not falling for a trap answer. Reread the entire sentence or group of sentences that relate to the question to make sure you have evidence for your answer. A best practice is to underline the evidence you find in the passage. This will ensure you fall for fewer trap answers.
### **The Answer Is In There**
Remember that reading comprehension multiple-choice questions are always asking you about the specifics of the text, not your opinions or interpretations. The correct answer is ALWAYS supported by evidence in the text.
### **Use Process of Elimination: POE**
#### **Common Sense**
You can eliminate answers that don't make sense in the context of the passage.
#### **Familiar Words—Wrong Context**
Sometimes the words in an answer choice will be strongly reminiscent of the words used in the passage. If a word or phrase is directly lifted from the passage, be careful—you may be falling into a trap.
#### **Misleading Look-Alikes**
Sometimes, instead of repeating words verbatim, the College Board will take a word and twist it subtly. For example, if the word _errer_ appears, they might have a trap answer choice containing the word _erreur_.
### **What Is This Weird Tense?**
In formal French, literary writing uses a tense called the _passé simple_ (or past historic) instead of the _passé composé_. You don't need to know how to conjugate it or when to use it. You simply need to recognize which verb is being used.
You should be able to recognize the _passé simple_ forms of some commonly used French verbs, such as _aller, avoir, dire, être, faire, lire, mettre, pouvoir, prendre, savoir, venir, vouloir._
You will usually recognize the verb in the _passé simple_ since it is usually (except in the case of irregular verbs) formed by taking off the last two letters of the infinitive and adding the appropriate endings.
Try the following passage, looking for the types of trap answers mentioned above.
**Part D**
**Directions:** Read the following selections carefully for comprehension. Each selection is followed by a number of questions or incomplete statements. Select the completion or answer that is BEST according to the selection and fill in the corresponding circle on the answer sheet.
The best way to get the right answer is to take the time to go back and carefully reread the sentence or sentences that relate to the question.
1. Ce passage nous décrit
(A) une ville idéale
(B) un marché en ville
(C) le changement des saisons
(D) les attributs principaux d'une cité
2. Qu'est-ce qui rend la cité différente des autres villes?
(A) la présence des pigeons
(B) la latitude
(C) le manque de verdure et d'oiseaux
(D) la couleur du ciel
3. Aux lignes 13–14, "c'est un printemps qu'on vend sur les marchés" veut dire
(A) qu'on peut tout acheter au marché
(B) qu'on sait que le printemps est arrivé quand on peut acheter des fleurs
(C) qu'on voit mieux le printemps dans les banlieues
(D) que le printemps est comme un marché
4. Comment réagissent les habitants de la ville à l'arrivée de l'été?
(A) Ils font des feux.
(B) Ils se plaignent.
(C) Ils restent à l'intérieur.
(D) Ils deviennent des voleurs.
Don't be afraid to eliminate answer choices that don't make sense.
Here's How to Crack It
1. Ce passage nous décrit
(A) une ville idéale
(B) un marché en ville
(C) le changement des saisons
(D) les attributs principaux d'une cité
You are asked to choose what the passage describes:
(A) "an ideal town" is a misunderstanding of the first sentence. The first sentence tells us that the city is ugly, and the passage goes on to list primarily negative qualities. Eliminate this choice.
(B) "a marketplace in town" is an example of familiar words / wrong context. The word _marché_ appears, as does the word _vendeurs_ ; however, the passage as a whole is not about the market. This choice is too specific. Eliminate it.
(C) "the changing of the seasons" is another example of familiar words—wrong context. The change of seasons is discussed, but again, it is too specific for this question.
**(D) "the principal attributes of a town" is the correct answer.** The passage discusses several distinctive features of a city.
2. Qu'est-ce qui rend la cité différente des autres villes?
(A) la présence des pigeons
(B) la latitude
(C) le manque de verdure et d'oiseaux
(D) la couleur du ciel
You are asked to choose what makes the city different from other cities. The answer is in the section that starts with the second sentence of the passage.
(A) "the presence of pigeons" is an example of familiar words—wrong context. Pigeons are mentioned, but what is significant is their absence.
Watch out for answers that use familiar words from the passage out of context.
(B) "the latitude" is another example of familiar words—wrong context. The word "latitude" appears in the second sentence, but it is used to describe the location of other cities, in any latitude.
**(C) "the lack of greenery and birds" is the correct answer**. Notice that it paraphrases part of the third sentence: _sans pigeons, sans arbres et sans jardins._
(D) "the color of the sky" takes the word _ciel_ out of context. It is a misunderstanding of the sentence: _Le changement des saisons ne s'y lit que dans le ciel._
3. Aux lignes 13–14, "c'est un printemps qu'on vend sur les marchés" veut dire
(A) qu'on peut tout acheter au marché
(B) qu'on sait que le printemps est arrivé quand on peut acheter des fleurs
(C) qu'on voit mieux le printemps dans les banlieues
(D) que le printemps est comme un marché
You are asked to interpret the sentence "it is a spring that is sold in the marketplace" within the context of the passage.
(A) "that one can buy everything at the market" is too literal and does not relate to the passage.
**(B) "that one knows spring has arrived when one can buy flowers" is the correct answer**. It corroborates the meaning, connecting it to the previous sentence about how few signs there are of the change of seasons.
(C) "that it is easier to see the spring in the suburbs" takes the word _banlieues_ out of context.
(D) "that spring is like a marketplace" is a literal interpretation.
4. Comment réagissent les habitants de la ville à l'arrivée de l'été?
(A) Ils font des feux.
(B) Ils se plaignent.
(C) Ils restent à l'intérieur.
(D) Ils deviennent des voleurs.
"How do the inhabitants of the town react to the arrival of summer?" This topic is discussed in the third-to-last sentence of the passage.
(A) "They make fires" misinterprets the phrase _"le soleil incendie les maisons."_
(B) "They complain" comes out of the blue. Complaining is not discussed anywhere in the passage.
**(C) "They stay indoors" is the correct answer.** This is what the sentence " _on ne peut plus vivre alors que dans l'ombre des volets clos_ ," implies—"then one can only live in the shade of closed shutters."
(D) "They become thieves" is an example of a misleading look-alike. Here the word _volets_ (shutters) has been twisted into the word _voleurs_.
## **TICKETS/SCHEDULES/ADVERTISEMENTS**
These graphical passages can be a blessing because you have less to read and because common sense works so well. **Pay special attention to the small print.**
• Read through the schedule or advertisement.
• Get a sense of the layout. Read all sizes of print.
• Use your common sense.
• Eliminate misleading look-alike words.
**The Small Print**
On ticket/schedule/
advertisement-type questions, pay special attention to the small print and the titles!
1. Selon la publicité, les services "Président" et "Brantôme"
(A) sont d'une collection classique
(B) coûtent beaucoup d'argent
(C) sont très réputés
(D) sont d'un style contemporain
2. Le bon à découper vous offre
(A) des produits gratuits
(B) un choix de catalogues
(C) des adresses
(D) une description de nouvelles lignes
Here's How to Crack It
1. Selon la publicité, les services "Président" et "Brantôme"
(A) sont d'une collection classique
(B) coûtent beaucoup d'argent
(C) sont très réputés
(D) sont d'un style contemporain
"According to the advertisement, the ' _Président_ ' and ' _Brantôme_ ' collections..."
(A) "are from a classic collection" takes a phrase out of context. The company produces a traditional line, but these styles, in contrast, are modern.
(B) "cost a lot of money" is also out of context. _Argent_ is used here to mean "silver," not "money." This answer could be true, but there is no evidence of it in the ad.
(C) "have a good reputation" is also out of context. Again, the company is renowned, but we don't know about these specific lines.
**(D) "are of a contemporary design" is the correct answer**. Notice that it paraphrases the actual description _des créations de notre temps._
2. Le bon à découper vous offre
(A) des produits gratuits
(B) un choix de catalogues
(C) des adresses
(D) une description de nouvelles lignes
"The coupon offers you..."
_Le bon à découper vous offre_ refers to the coupon in the corner.
(A) "free products" is a familiar word, but it's in the wrong context. The catalog is free; the products are not.
**(B) "a choice of catalogs" is the correct answer.** The two boxes name two types of catalogs.
(C) "addresses" is a familiar word—wrong context. _Adresser_ is part of a request to the company to send or address a catalog to the reader.
(D) "a description of new lines" is not terrible, but is not as good as (B). The coupon itself is not providing an actual description of the contemporary lines.
# Comprehensive Drill
Answers can be found in Part IV.
**Part D**
**Directions:** Read the following selections carefully for comprehension. Each selection is followed by a number of questions or incomplete statements. Select the completion or answer that is best according to the text and fill in the corresponding circle on the answer sheet.
. Etienne n'avait pas l'énergie de
(A) dormir
(B) se déshabiller
(C) manger
(D) mettre ses habits
. Selon le passage, pour quelle raison Etienne est-il fatigué?
(A) Il a trop mangé.
(B) Il n'a pas dormi du tout depuis deux jours.
(C) Il s'est couché à quatre heures du matin.
(D) Il n'a dormi que quelques heures en 48 heures.
. A quel moment de la journée s'est-il réveillé?
(A) tôt le matin
(B) à midi
(C) tôt le soir
(D) à minuit
. Comment réagit-il au moment de se réveiller?
(A) Il ne se souvient pas où il est.
(B) Il ne trouve pas ses habits.
(C) Il se sent en retard.
(D) Il a faim.
. Que voulait-il faire avant de dîner?
(A) respirer
(B) se promener
(C) s'éveiller
(D) courir
. Quand Morissot partait-il pour l'île?
(A) après le coucher du soleil
(B) au moment du coucher du soleil
(C) au moment du lever du soleil
(D) l'après-midi
. Comment gagnait-il l'île?
(A) en autobus et à pied
(B) en bateau
(C) en voiture et à pied
(D) en train et à pied
. A quel moment commençait-il à pêcher?
(A) pratiquement au moment où il arrivait
(B) au moment où il commençait à rêver
(C) à la tombée de la nuit
(D) quand son ami arrivait
. Qu'est-ce qui se trouvait dans la rue Notre-Dame-de-Lorette?
(A) l'île Marante
(B) l'endroit où les deux amis se rencontraient
(C) le magasin de M. Sauvage
(D) la gare
. Les parents de Guillaume
(A) lui conseillent de ne jamais aller au cinéma
(B) ne sont pas concernés par ce qu'il fait
(C) n'aiment pas le cinéma
(D) lui donnent leur avis sur les films qu'il choisit
. A la question de Gilles, Claire répond
(A) qu'elle ne va jamais au cinéma
(B) qu'elle va au cinéma si ses parents sont d'accord
(C) qu'elle va au cinéma sans le dire à ses parents
(D) qu'elle va souvent au cinéma
. Quelle raison Guillaume donne-t-il pour ne pas mentir à ses parents?
(A) Ses parents le laissent faire n'importe quoi.
(B) Ses parents lui donnent la responsabilité de décider que faire.
(C) Il vaut mieux ne pas le faire.
(D) Ses parents n'aiment pas le cinéma.
. L'auteur réagit au changement sur le boulevard Saint-Michel et sur la place Saint-André-des-Arts avec
(A) impatience
(B) regret
(C) indifférence
(D) plaisir
. Qu'est-ce qu'on trouve près du Luxembourg?
(A) des petits restaurants anonymes
(B) des cafés sympathiques
(C) des librairies prétentieuses
(D) des établissements américains
. D'après le passage, on comprend que "Gibert" est
(A) un film
(B) un café
(C) une librairie
(D) un musée
. Que font les jeunes au lieu d'aller au boulevard Saint-Michel?
(A) Ils fréquentent la place Saint-André-des-Arts.
(B) Ils sont pressés d'aller voir des films américains.
(C) Ils cherchent des bars sympathiques dans un autre endroit.
(D) Ils résistent à l'envie d'aller dans les librairies.
. La narratrice donne à entendre qu'elle
(A) travaillait beaucoup
(B) était invalide
(C) avait beaucoup de soucis
(D) s'était mariée avec l'ami de son père
. Le frère de la narratrice
(A) a vécu avec elle pendant six ans
(B) était plus jeune qu'elle
(C) était soldat
(D) n'aimait pas son mari
. Le passage nous donne l'impression
(A) qu'elle voulait défendre ses actions
(B) que son mari lui manquait
(C) que son frère était guéri
(D) qu'elle aimait le beau temps
. Après six ans, qu'est-ce qui s'est passé?
(A) Le mari de la narratrice est parti.
(B) Le beau temps a changé.
(C) La narratrice a décidé de partir.
(D) La narratrice a trouvé un amant.
. On comprend qu'Antoine Lemurier
(A) est mort
(B) a raté le train
(C) a quitté son bureau
(D) a failli succomber à une maladie
. Qu'est-ce que les voisins pensaient de la maladie de Lemurier?
(A) Ils attendaient une fin intéressante à la tragédie.
(B) Ils étaient tristes.
(C) Ils étaient fâchés contre Lemurier.
(D) Ils tombaient malades.
. Selon les voisins, qu'est-ce qui serait "un dénouement...digne" de la situation?
(A) M. Lemurier perd son travail.
(B) M. Lemurier récupère complètement.
(C) Mme Lemurier est sans abri.
(D) Mme Lemurier vend la maison.
# Summary
For Part D, Reading Comprehension, practice is the best way to improve your score. Make sure you do the following:
Memorize the instructions to save time on test day.
Read the questions first so you know what to look for in the passage.
Read and eliminate wrong answer choices.
Do not get stuck on difficult passages or questions. Move on and come back later if you have the time.
# Chapter 7
# French Listening
The SAT Subject Test in French with Listening evaluates your reading and listening skills of spoken French. It is about one hour long: 20 minutes for listening and 40 minutes for reading questions.
The test is only administered in November at designated test centers. You will need to fill out a special registration form and find the testing center nearest to you. **On test day, you must take an appropriate CD player with earphones.**
In this chapter, we explore the overall structure and describe each part of the listening test.
## **OVERALL STRUCTURE OF THE LISTENING TEST**
The SAT Subject Test in French with Listening consists of **40 minutes of reading (written questions)** and **20 minutes of listening (oral questions)** , with 85 to 90 questions in all. This means that about two-thirds of the SAT Subject Test in French with Listening consists of questions we've already discussed. You will have 40 minutes to work on those. There are, however, fewer of each type.
• Part A—Vocabulary Completions: 12–16 questions
• Part B—Grammar Blanks: 12–16 questions
• Part C—Paragraph Blanks: 15–17 questions
• Part D—Reading Comprehension: 20–25 questions
In addition to those regular questions, you will have 20 minutes to work on the listening part of the test. There will be three parts with a total of about 40 questions covering pictures (8–12 questions), short dialogues (6-12 questions), and long dialogues (10-15 questions).
• Listening—Part A: Pictures
• Listening—Part B: Short Dialogues
• Listening—Part C: Longer Dialogues
Samples of each type of question are available on the College Board's website, www.collegeboard.com.
### **Should You Sign Up for the French Subject Test with Listening?**
The results of your test will give colleges a more complete picture of your French language proficiency. Your aim should be to give them the best picture of your abilities for the purpose of class placement.
You do not have to speak French on either of the SAT Subject Tests in French. Therefore, do not feel anxious about the listening portion of the test. Many students tend to do better on this section than they do on the written portion. There are fewer grammar and reading questions, which will benefit students who are better at spoken French than at grammar or reading comprehension. To prepare for the listening test you may want to visit www.laguinguette.com. You'll also find it helpful to watch and listen to French TV news and as many French movies as you can get your hands on.
If you decide to take the French Subject Test with Listening, you must provide your own portable CD player and headphones. This CD player must be portable and battery powered. CD players that plug in or that have a radio function are not permitted. **Any student who arrives at the test without an appropriate listening device will be asked to leave the test.** You will not be permitted to sit any portion of the French test, even though listening is only 20 minutes long.
## **LISTENING—PART A: PICTURES**
The first part of the Listening Test consists of choosing which spoken phrase best matches the provided picture. Each sentence will be designated (A), (B), (C), or (D).
**Directions:** For each item in this part, you will hear four sentences designated (A), (B), (C), and (D). They will not be printed in your test booklet. As you listen, look at the picture in your test booklet and select the choice that best reflects what you see in the picture or what someone in the picture might say. Then fill in the corresponding circle on the answer sheet. You will hear the choices only once. Now look at the following example.
Look at the picture before the answer choices are played. Get a general idea of what is going on.
### **Make a Decision as You Hear Each Choice**
As each answer choice is read to you, decide if that choice is at all appropriate. If it is not, cross out that choice on your answer sheet. You may not be allowed to write in your book. If the choice is good or possible, make a small mark inside the bubble. Probably only one will make any sense. If not, guess. **Don't wait to hear all the choices before deciding about** **each of them.** Decide "yes" or "no" as you go, for you will hear each choice only one time, so you must think quickly. Erase all stray marks once you select an answer.
Don't forget: if you're taking the Listening Test you MUST bring your own CD player and headphones or you will not be allowed into the testing room.
## **LISTENING—PART B: SHORT DIALOGUES**
On this section you will hear either a dialogue between two people, or a monologue. It will be followed by three answer choices labeled (A), (B), or (C). The answer choices will be heard only once. Again, listen closely because nothing is repeated.
**Directions:** In this part of the test you will hear several short selections. A tone will announce each new selection. The selections will not be printed in your test booklet, and will be heard only once. At the end of each selection, you will be asked one or two questions about what was said, each followed by three possible answers, (A), (B), and (C). The answers are not printed in your test booklet. You will hear them only once. Select the BEST answer and fill in the corresponding circle on the answer sheet. Now listen to the following example, but do not mark the answer on your answer sheet.
### **Make a Decision as You Hear Each Choice**
As you hear each answer choice, decide if it is appropriate or not. Eliminate it or keep it on your answer sheet. Once you've selected an answer, erase all stray marks. Do not mark (D) or (E) as choices.
## **LISTENING—PART C: LONG PASSAGES**
This section consists of longer monologues or dialogues that will be heard only once. In this section, the questions and the four answer choices will be in the test booklet.
**Directions:** You will now hear some extended dialogues or monologues. You will hear each only once. After each dialogue or monologue, you will be asked several questions about what you have just heard. These questions are also printed in your test booklet. Select the best answer to each question from among the four choices printed in your test booklet and fill in the corresponding circle on the answer sheet. There is no sample question for this part.
**Hear Ye, Hear Ye**
On Part C of the listening part of the test, answer the questions as you hear the information being presented. Don't wait to hear the whole thing!
### **Forewarned, Forearmed**
The great thing about this question type in Part C is that the questions and answer choices are printed in your booklet. As the instructions are being read (familiarize yourself with them now so that you don't waste time on test day) and before the passage is read, read the questions and their answers to get a sense of the topic.
As in reading comprehension, the questions are in chronological order. Don't wait for the entire passage to be read before answering the questions. (It would be hard for even a native speaker to remember all those details for very long.) As the passage is being read, look at each question and mark the correct answer as soon as you hear it. The questions will either ask you to repeat specific details or paraphrase them. You are not required to interpret or infer.
# Summary
Practice is the number one way to improve your score on the SAT French Listening Test. In order to get your best score, make sure you do the following:
Memorize the instructions to save time on test day.
**Bring the required CD player and fresh batteries.**
Go to the test rested and well fed.
Follow the pace of the recording.
Make your decision as you hear the choices because you won't remember them if you wait.
If there is a picture, look at all the details.
On the Long Passages section, do not wait for the entire passage to be read. Answer as soon as you figure out the right choice.
# Part IV
# Drill Answers and Explanations
## **CHAPTER 3 DRILL ANSWERS AND EXPLANATIONS**
### **Drill 1**
_une usine_ | a factory
---|---
_la honte_ | the shame
_l'œuvre_ | the work
_en vouloir à_ | to be angry at, to have a grudge against
_mou_ | soft, limp, looseness
_taquiner_ | to tease
_la foule_ | the crowd
_ramasser_ | to gather, to pick up
_soutenir_ | to support, to sustain
_repasser_ | to come back, to cross again, to iron
_se méfier de_ | to distrust, to be suspicious
_se débarrasser de_ | to get rid of
### **Drill 2**
_évaluer_ | to evaluate
---|---
_sacré_ | sacred
_retarder_ | to delay, to slow down
_fréquenter_ | to go somewhere frequently, to see someone on a regular basis
_nombre_ | number
_assurer_ | to assure
_raison_ | reason
_plante_ | plant
_attraper_ | to catch, to trap
_servir_ | to serve
_content_ | content or happy
_accord_ | accord or harmony
_cru_ | crude or raw
### **Drill 3**
**Question** | **Answer** | **Explanation**
---|---|---
1. xxxxx xxxxxxxx légumes xxxx xxxxx...vegetables
| B |
(A) _cheminée_
chimney
**(B)** _jardin_
**garden**
(C) _gazon_
lawn
(D) _quartier_
quarter or neighborhood
2. xxxx xxxxxxx x _tombée_ xxx xxxx...fallen
| C |
(A) _envolée_
taken flight
(B) _échappée_
escaped
**(C)** **_cassée_**
**broken**
(D) _attrapée_
caught
3. xx x xxx xxxxx _chaises_ xxxx...xxxx xx xxxxx. chairs
| B |
(A) _assommer_
to knock out
**(B)** **_s'asseoir_**
**to sit down**
(C) _assurer_
to assure
(D) _associer_
to associate
4. xxx xxxx _ne se sent pas bien_ xxxxx xxx...doesn't feel well
| A |
**(A)** **_une fièvre_**
**a fever**
(B) _une armoire_
a wardrobe
(C) _un verger_
an orchard
(D) _une annonce_
an announcement
5. xxxxx xxxx xxxxxxxxx xxxxx _mangé_ xxx xxx...eaten
| C |
(A) _soutenir_
to support
(B) _emporter_
to take or carry away
**(C)** **_avaler_**
**to swallow**
(D) _évaluer_
to evaluate
## **Comprehensive Drill**
### **Part A**
**Question** | **Answer** | **Key Word or Phrase** | **Fill In**
---|---|---|---
1 | It's cold outside. Are all the...closed? | C | _fait froid_ | windows
2 | Don't make any noise; the children are... | B | _bruit, enfants_ | asleep
3 | Are these flowers from your...? | C | _fleurs_ | garden
4 | This coat lacks...where I can put my wallet. | C | _manteau, porte-monnaie_ | pockets
5 | Jeanne woke up...in order to see the sunrise. | D | _lever du soleil_ | early
6 | The train left the...at noon. | D | _train_ | station
7 | For Sunday's meal, we eat a...with potatoes. | A | _repas_ | a roast
8 | The tarts that are sold in this...are delicious. | A | _tartes_ | pastry shop
9 | You can wash yourself now. The bathroom is... | B | _salle de bains_ | open, empty
10 | My...for class is to translate a poem of Rimbaud's. | D | _classe_ | homework, assignment
11 | The noise in a club can be so loud that it hurts one's... | A | _bruit_ | ears
12 | The moon is so...that I cannot imagine that man has gone there. | C | _lune_ | far away
13 | It's not necessary to take out the garbage; Jean did it... | C | _l'a...fait_ | already
14 | We are spending Christmas with my grandparents this... | C | _Noël_ | winter
15 | You've already done your homework? That... | D | _déjà_ | surprises me, pleases me
16 | Aren't you...of doing that stupid thing? | D | _bêtise_ | ashamed, embarrassed
17 | This fabric is...like the skin of a baby. | C | _peau d'un bébé_ | soft
18 | The fox...the hunters. | C | _renard, chasseurs_ | escaped from
19 | The film starts at exactly
8 o'clock; be... | A | _commence_ | on time, early
20 | There are too many people here; I prefer cafés that are less... | D | _trop de monde_ | crowded
21 | There is not enough evidence...this man. | D | _pas assez de preuves_ | to convict, charge, indict
22 | My brother is...; he never wants to help me clean the kitchen. | B | _il ne veut jamais m'aider_ | lazy, selfish
23 | The vase that I dropped... | D | _laissé tomber_ | broke, shattered
24 | You can find your grandmother's wedding dress if you look in... | B | _la robe de mariée de votre grand-mère_ | the attic
25 | She got rid of her...clothing. | C | _s'est débarrassée_ | unwanted, messed up
26 | Diane cut her...so she would be more fashionable. | C | _s'est coupé_ | hair
27 | To establish the validity of his theory, the scientist conducted... | B | _établir la validité_ | an experiment, study
## **CHAPTER 5 DRILL ANSWERS AND EXPLANATIONS**
### **Drill 1: Pronoun Questions**
**Question** | **Answer** | **Explanation**
---|---|---
1 |
_\------- est arrivé à Paul hier?_
What happened to Paul yesterday?
| D |
(A) _Quel_
_Quel_ means "which" and is used to modify a noun ( _Quelle voiture est la vôtre?_ ). We need something that means "what."
(B) _Quoi_
In questions, _quoi_ is used only with a preposition ( _À quoi sert cet exercice?_ ).
(C) _Qu'_
_Qu'_ is a shortened form of _que_. Since the "what" of the question is the subject (what happened), it cannot be _que_.
**(D) _Qu'est-ce qui_ is correct. You cannot use _qui_ alone because that would mean "who happened to Paul yesterday?" And you need _qui_ here because it is directly followed by a verb.**
2 |
_C'est_ \-------.
It is he.
| C |
With _c'est_ or _ce sont_ you use either a noun or a stressed pronoun.
(A) _eux
Eux_ is a stressed pronoun, which is proper, but since it is plural, the correct sentence would be _Ce sont eux_.
(B) _il
Il_ is a subject pronoun. No good here.
**(C) _lui
Lui_ can be a singular stressed pronoun. This is the correct answer.**
(D) _le
Le_ is a direct object pronoun. Cancel it.
3 |
_C'est grâce à ------- que nous avons pu venir._
It is thanks to them that we could come.
| A |
Because the pronoun is being used with a preposition (but not as an indirect object), we want a stressed pronoun.
**(A) _eux_**
**_Eux_ is a stressed pronoun, so this is the correct choice.**
(B) _les
Les_ is the direct object pronoun.
(C) _leur_
_Leur_ is the indirect object pronoun.
(D) _ils_
_Ils_ is the subject pronoun.
4 |
_La chose la plus difficile est de_ \------- _réveiller le matin._
The most difficult thing is to wake him up in the morning.
| C |
The verb in this sentence is _réveiller_ , a verb that takes a direct object. The correct answer must serve as a direct object pronoun.
(A) _lui_
_Lui_ can be an indirect object pronoun or a stressed pronoun.
(B) _il_
_Il_ is the subject pronoun.
**(C) _le_**
**_Le_ is the direct object pronoun, so this is the correct answer.**
(D) _moi_
_Moi_ is the stressed pronoun.
5 |
\------- _a sorti la poubelle._
No one took out the garbage.
| B |
(A) _Il n'_
This choice does not work because the sentence lacks the _pas_ that must be used with _ne_ ( _n'_ ) to make a negative.
**(B) _Personne n'_**
**This is the correct answer. _Personne_ must be used with _ne_ and does not need the _pas_.**
(C) _Aucun_
Like _personne, aucun_ must be used with _ne_.
(D) _Qui_
_Qui_ can begin the sentence in a question, but not in a statement.
6 |
_Le livre ------- je suis l'auteur est une histoire d'Amérique pendant le 19ème siècle._
The book of which I am the author is a history of America during the 19th century.
| B |
(A) _lequel_
Is an interrogative pronoun meaning "which one"
**(B) _dont_**
**Use _dont_ if the verb takes an object introduced by _de_ or _d'._**
(C) _que_
Is never used when the object takes a preposition
(D) _qui_
Is used when there is no subject— _qui_ replaces the subject.
7 |
_La femme_ \------- _Isabelle est assise est le chef de la compagnie._
The woman next to whom Isabelle is sitting is the head of the company.
| A |
**(A) _à côté duquel_**
**Use _de + lequel/laquelle/lesquels/lesquelles_ when the preposition takes _de._**
(B) _à côté auquel_
Use _a + lequel/laquelle/lesquels/lesquelles_ when the preposition takes _à._
(C) _côté qui_
The expression requires the _a_ in front of _cote_ and the _de_ following it.
(D) _à côté_
The expression requires the _de_ following it.
8 |
_J'ai interviewé beaucoup de célébrités, mais_ \------- _ne me fait cet effet._
I've interviewed a lot of celebrities, but none has (had) this effect on me.
| D |
(A) _personne_
A subtle difference in context, but personne refers to no one, as opposed to not a single one, as in not one of those celebrities had an effect on me, rather than no one (celebrities or others) had an effect.
(B) _jamais_
Never (does not make sense in context)
(C) _quelque chose_
Something (does not make sense in context). Does not take "ne" before it.
**(D) _aucun_**
**Use _aucun_ (the negative of chacun) to mean "none" or "not one."**
9 |
\------- _d'extraordinaire est arrivé aujourd'hui. J'ai reçu mon doctorat._
Something extraordinary happened today. I received my doctorate.
| C |
(A) _Quelqu'un_
_Quelqu'un_ is used to refer to a person.
(B) _Quelque fois_
_Quelque fois_ is used to refer to a point in time.
**(C) _Quelque chose_**
**Used in the affirmative or interrogative to refer to a thing, while _quelqu'un_ is used to refer to a person.**
(D) _Aucun_
"Not one"; requires a "ne" in any construction.
10 |
_On comprend très bien_ \------- _les citoyens avaient peur pendant la premiere guerre mondiale._
One easily understands what citizens feared during the first world war.
| D |
(A) _que_
Make sense if you are translating directly from English. However, the idiom "avoir peur" requires "de," which means that "ce dont" is correct.
(B) _pourquoi_
Make sense if you are translating directly from English. However, the idiom "avoir peur" requires "de," which means that "ce dont" is correct.
(C) _qui_
Use _qui_ when there is no object.
**(D) _ce dont_**
**Use _ce dont_ when the subordinate clause needs an object with _de._**
### **Drill 2: Verb Questions**
**Question** | **Answer** | **Explanation**
---|---|---
1 |
_Si -------, je préparerais le dîner._
If I had time, I would make dinner.
| C |
Since the conditional tense is used in the portion of the sentence following the blank, the verb that precedes it must be in the **imperfect**. Only (C) has a verb in the imperfect.
(A) _vous en avez envie_ —present
(B) _on me le demande_ —present
**(C) _j'avais le temps_ —imperfect**
(D) _tu seras d'accord_ —future
2 |
_Paul regrette que nous ------- pas réussi._
Paul regrets that we have not succeeded.
| C |
What mode is used with verbs like _regretter que_? The subjunctive. Only (C) has the subjunctive.
(A) _n'avons_ —present
(B) _n'avions_ —imperfect
**(C) _n'ayons_ —subjunctive (present)**
(D) _n'aurons_ —future
3 |
_\------ une lettre quand on a sonné à la porte._
I was writing a letter when the doorbell rang.
| D |
The use of the _passé composé_ indicates that the sentence takes place in the past, so you can eliminate (A), (B), and (C). The answer is (D). The use of the imperfect indicates that the action of letter writing was ongoing when the doorbell rang.
(A) _J'écris_ —present
(B) _J'écrirais_ —conditional
(C) _J'écrive_ —subjunctive (present)
**(D) _J'écrivais_ —imperfect**
4 |
_Elle n'a jamais oublié ce que nous ------- au moment de son départ._
She never forgot what we said at the moment of her departure.
| C |
Does the expression _ce que_ take the subjunctive? No. Eliminate (B). The use of the _passé composé_ in the first part of the sentence indicates that the sentence takes place in the past and the verb does not need to be in the subjective or conditional mood. Eliminate (A) and (D). The correct answer is (C).
(A) _disons_ —present
(B) _ayons dit_ —past of the subjunctive
**(C) _avons dit—passé composé_**
(D) _aurions dit_ —past of the conditional
5 |
_Est-ce que vous ------- contents si je n'avais pas accepté l'invitation?_
Would you have been happy if I had not accepted the invitation?
| D |
Since a form of the imperfect is being used with _si_ , the other verb must be in the conditional. Choice (D) is the only verb in the conditional. Since one part of the sentence has the past form of the imperfect (the _plus-que-parfait_ ), it makes sense that the conditional verb would also be in a past form.
(A) _êtes_ —present
(B) _soyez_ —subjunctive
(C) _étiez_ —imperfect
**(D) _auriez été_ —past of the conditional**
6 |
_Nous doutons ------- leur rendre visite chez eux._
We doubt that he has time to visit them.
| A |
Does the verb _douter que_ take the subjunctive? Yes, so (B), (C), and (D) must be wrong. Choice (A) is the correct answer because the subjunctive is used.
**(A) _qu'il ait le temps de_ —subjunctive**
(B) _qu'il voudrait_ —conditional
(C) _qu'il peut_ —present
(D) _qu'elle avait envie de_ —imperfect
7 |
_\------- , elle est partie pour le long trajet chez elle._
Having said goodbye, she left for the long journey home.
| C |
We need a verb form that shows when she said goodbye (the verb is in all the answer choices). We can eliminate (B), since it is the infinitive and the sentence is in the past. To show that she said goodbye either before or as she left, we need either the perfect or the present participle. The only participle here is (C), the perfect participle, "having said goodbye." This is our answer. Choices (A) and (D), cannot be used by themselves in a phrase.
(A) _Disait au revoir_ —imperfect
(B) _Dire au revoir_ —infinitive
**(C) _Ayant dit au revoir_ —perfect participle**
(D) _Avoir dit au revoir_ —past infinitive
8 |
_Tu pourras regarder la télé une fois que tu --------- ton travail._
You will be allowed to watch TV once you have finished your homework.
| C |
Does the conjunction _une fois que_ take the subjunctive? No. Eliminate (D). We need a verb form that shows that your homework must be finished in the future before you may watch TV. Choice (B) is the imperfect so it does not work. Choice (A) is the past form of the conditional, so it does not work either. The correct answer is (C), _futur antérieur,_ future perfect tense.
(A) _aurais fini_ —past conditional
(B) _finissais_ —imperfect
**(C) _auras fini_ —future perfect**
(D) _finisses_ —subjunctive
9 |
_Quand j'avais quatre ans, --------- un enfant très difficile._
When I was four years old, I was a very difficult child.
| A |
**(A)** **_j'etais_ —use the imperfect when the action started in the past and continues in the past.**
(B) _je suis_ —present tense
(C) _j'ai été_ —passe compose
(D) _je suis été_ —incorrect form of passe compose
10 |
_Il aimerait aller avec toi au musee, mais il --------- travailler._
He would like to go to the museum with you, but he has to work.
| D |
(A) _doive_ —subjunctive form (there is no wish or mood or indefinite stance).
(B) _devra_ —future tense (does not work with the conditional as it states something definite).
(C) _devais_ —imperfect tense (not appropriate following a wish in the conditional form).
**(D) _doit_ —use the present tense following "aimer" in the conditional form, which indicates a wish.**
### **Drill 3: Preposition Questions**
**Question** | **Answer** | **Explanation**
---|---|---
1 |
_Marie ------- les résultats de ses examens._
Marie is waiting for the results of her exams.
| B |
(A) _pense_
Penser requires the preposition _à_ or _de_.
**(B) _attend_**
**_Attendre_ requires no preposition. This is the correct answer.**
(C) _compte_
_Compter_ requires the preposition _sur_. Without a preposition, it means "to count" and makes no sense here.
(D) _a envie_
_Avoir envie_ requires the preposition _de_.
2 |
_Je ------- de leur écrire._
I am compelled to write them.
| A |
**(A) _suis obligé_**
**This is the correct answer. _Être obligé_ requires the preposition _de_.**
(B) _espère_
_Espérer_ takes no preposition in French.
(C) _veux_
_Vouloir_ takes no preposition. It cannot be used with _de_.
(D) _réfléchis_
_Réfléchir_ takes the preposition _à_. It cannot be used with _de_.
3 |
_Je n'ai jamais eu l'occasion ------- voir ce film._
I have never had the opportunity to see this film.
| C |
The expression _avoir l'occasion_ takes the preposition _de_.
**(C) is the correct answer.**
4 |
_\------- le concert, elles bavardaient sans cesse._
During the concert, they chattered endlessly.
| A |
**(A) _Pendant_**
**_Pendant_ means "during." This is the correct answer.**
(B) _Dans_
_Dans_ means "in." You cannot say _dans le concert_.
(C) _Avec_
_Avec_ means "with." You might find a context in which _avec_ works with _le concert_ , but in this context, it does not.
(D) _En_
There might be a context in which _en concert_ is acceptable, but _en le concert_ is never correct.
5 |
_Je la vois souvent à -------._
I see her often at the bakery.
| C |
(A) _France_
The correct expression would be _en France_.
(B) _ville_
You can say either _à la ville_ or _en ville_.
**(C) _la boulangerie_**
**This is the correct answer. You can say _à la boulangerie_.**
(D) _loin_
_Loin_ is never used with _à_.
6 |
_Elle n'a pas réfléchi ------- de refuser l'offre._
She did not think before refusing the offer.
| B |
(A) ---
_Réfléchir_ must be used with a preposition.
**(B) _avant_**
**This is the correct answer.**
(C) _après_
You cannot say _après de. Après_ is used with the infinitive (e.g., _après avoir réfléchi_ ).
(D) _à_
You cannot have these two prepositions, _à_ and _de_ , following each other.
7 |
_Nous pensons toujours ------- leurs parents._
We always think of their parents.
| C |
(A) _les_
The idiomatic expression is _penser a quelqu'un,_ so the definite article is not appropriate.
(B) _de_
_De_ is the wrong preposition in this expression.
**(C) _à_**
**Penser takes the preposition "à" when one is thinking of someone else.**
(D) _aux_
_Aux (a + les)_ is not appropriate since we do not need a definite article thanks to the pronoun _leurs_.
8 |
_Ils viennent ------- l'aéroport._
They're coming from the airport.
| B |
(A) _pendant_
Wrong preposition that makes no sense in context.
**(B) _de_**
**_Venir_ takes the preposition "de" when one is coming from somewhere**
(C) _à_
Wrong preposition for this expression—it would imply you are coming to a place.
(D) _après_
Wrong preposition—changes the meaning by implying they are coming after the airport.
9 |
_Elle a assisté au concert ------- les objections de ses parents._
She attended the concert despite the objections of her parents.
| B |
(A) _sauf_
Means without, and is the wrong preposition.
**(B) _malgré_**
**_Malgré_ means despite and is the most appropriate preposition for this sentence.**
(C) _selon_
Means according to, and is also the wrong preposition.
(D) _pendant_
Means during, and is also the wrong preposition.
10 |
_Passez-vous votre vacances ------- Canada?_
Are you spending your vacation in Canada?
| A |
**(A) _au_**
**Masculine, singular countries take _au_ when you are going to that country.**
(B) _à_
Used for cities or towns.
(C) _en_
Used for feminine, singular countries.
(D) _de_
Refers to coming from a country.
### **Comprehensive Drill**
### **Part B**
**Question** | **Category** | **Answer** | **Explanation**
---|---|---|---
1 | Odds and Ends | A |
**(A)** **_quelque chose_ is correct**
(B) _rien_ must be used with _ne—n'a rien_
(C) _plusieurs_ must modify a noun
(D) _quelque_ must modify a noun
2 | Prepositions | C |
(A) _rejeter_ cannot be followed by a verb
(B) _aimer_ takes the infinitive
**(C)** **_être obligé_ takes _de_** , **so it is correct**
(D) _avoir voulu_ takes the infinitive
3 | Odds and Ends | B |
(A) plural
**(B)** **_amie_ is feminine, but it's correct because _amie_ begins with a vowel**
(C) feminine
(D) plural
4 | Odds and Ends | A |
**(A)** **_avant de partir_ works with the future tense**
(B) _tout à l'heure_ is okay, but not with _à_
(C) _hier_ does not work with the future
(D) _jamais_ must be used with _ne_
5 | Pronouns | D |
(A) _personne_ requires _ne_
(B) subject pronoun
(C) indirect object
**(D) stressed pronoun is correct with _c´est_**
6 | Prepositions | A |
**(A)** **_préférer_ takes the infinitive—correct**
(B) _rêver_ takes _de_ and then the infinitive
(C) _plaire_ takes no direct object
(D) _insister_ takes _pour_ and the infinitive
7 | Pronouns | D |
(A) subject or stressed pronoun
(B) stressed pronoun
(C) reflexive, but wrong person
**(D)** **_demander quelque chose à quelqu'un_** **—indirect object is correct**
8 | Pronouns | C |
(A) indirect object pronoun
(B) subject pronoun
**(C) stressed pronoun is correct with _avec_**
(D) direct object pronoun
9 | Pronouns | B |
(A) plural
**(B) singular and feminine possessive pronoun—correct**
(C) _aucun_ requires _ne_
(D) possessive adjective
10 | Prepositions | A |
**(A)** **_Russie_ is feminine—correct with _en_**
(B) _États-Unis_ is plural ( _aux_ )
(C) New York takes _à_
(D) Canada is masculine ( _au_ )
11 | Odds and Ends | C |
(A) adverb
(B) adverb
**(C) adjective—correct**
(D) preposition
12 | Verbs | B |
(A) _savoir que_ doesn't take the subjunctive
**(B)** **_regretter que_ takes the subjunctive—correct**
(C) _oublier que_ doesn't take the subjunctive
(D) nothing hypothetical, so no subjunctive
13 | Pronouns/Prepositions | A |
**(A)** **_parler_ takes _de_** **—therefore _dont_ is correct**
(B) _quoi_ is used with things
(C) _parler_ cannot work with _sauf_
(D) _avant que_ is a conjunction, not a pronoun
14 | Pronouns | C |
(A) _quelle_ is feminine
(B) _qu'est-ce qui_ is used to refer to things
**(C)** **_où_ means "where"—correct**
(D) _quoi_ is used with things
15 | Pronouns | D |
(A) _quel_ must modify something
(B) _y_ refers to place or location
(C) _dont_ cannot be used to begin a question
**(D)** **_avoir envie_ takes _de_** **—correct**
16 | Prepositions | C |
(A) _aller_ does not take _de_
(B) _espérer_ takes either the infinitive or _que_
**(C)** **_essayer_ takes _de_** **—correct**
(D) _pouvoir_ does not take _de_
17 | Verbs | C |
(A) _sans doute_ means "probably"
(B) certain, so no subjunctive
**(C)** **_Je crains_ means "I fear." This expression takes the**
**subjunctive—correct**
(D) no doubt or uncertainty, so no subjunctive
18 | Prepositions | C |
(A) in order to
(B) when
**(C) in spite of—correct**
(D) unless
19 | Verbs | A |
**(A) imperfect followed by conditional—correct**
(B) present, so following clause can't be conditional
(C) future cannot follow _si_
(D) past imperfect would take past conditional
20 | Verbs | D |
(A) _passé composé_
(B) _passé composé_
(C) _passé composé_
**(D) subjunctive is used with superlatives—correct**
#### **Part C**
**Question** | **Category** | **Answer** | **Explanation**
---|---|---|---
21 | Verbs | D |
(A) imperfect
(B) past imperfect
(C) present
**(D) past conditional follows a clause with _si_ and the past imperfect—correct**
22 | Pronouns | B |
(A) subject or stressed pronoun
**(B) indirect object—correct**
(C) stressed pronoun and masculine
(D) direct object and singular
23 | Pronouns | A |
**(A) stressed pronoun with _chez_ —correct**
(B) subject
(C) indirect object
(D) subject and masculine
24 | Vocabulary | A |
**(A) no one—correct**
(B) a person
(C) nothing
(D) _nulle_ is an adjective
25 | Vocabulary | A |
**(A) Finally—correct**
(B) _Terminé_ is not an adverb, but a past participle
(C) Now
(D) In order to
26 | Pronouns | B |
(A) _arriver de_ makes no sense in this context
**(B) _y_ indicates place: in this case, the café—correct**
(C) _le_ is a direct object pronoun
(D) _arriver_ cannot be reflexive
27 | Verbs | D |
(A) no agreement or masculine singular
(B) feminine singular
(C) masculine plural
**(D) feminine plural: requires agreement because direct object precedes verb—correct**
28 | Prepositions | B |
(A) _cinéma_ is masculine
**(B) _au_ is correct because _cinéma_ is masculine**
(C) _entrer par_ doesn't make sense in this context and _cinéma_ is masculine
(D) _entrer par_ doesn't make sense in this context
29 | Prepositions | C |
(A) you cannot use _avant_ and a verb without a preposition
(B) _avant à_ does not exist
**(C) the correct expression is _avant de_**
(D) _avant que_ would have to be followed by a clause using the subjunctive
30 | Verbs | A |
**(A) no agreement required—correct**
(B) feminine
(C) masculine plural
(D) feminine plural
31 | Prepositions | D |
(A) needs a preposition to make sense
(B) _à demander_ makes no sense
(C) _de demander_ makes no sense
**(D) _pour demander_ : in order to ask—correct**
32 | Conjunctions | A |
**(A) _si—_ if or whether—correct**
(B) when
(C) which
(D) who
33 | Vocabulary | C |
(A) _en temps_ does not exist; _à temps_ (on time) would be correct
(B) every hour
**(C) on time—correct**
(D) from time to time
## **CHAPTER 6 DRILL ANSWERS AND EXPLANATIONS**
### **Comprehensive Drill**
### **Part D**
**Question** | | **Answer** | **Explanation**
---|---|---|---
1 | Etienne lacked the energy to | B |
(A) "sleep": familiar word—wrong context
**(B) "undress": see phrase _tout vêtu_ (fully dressed)**
(C) "eat"
(D) "put on his clothes"
2 | According to the passage, why is Etienne tired? | D |
(A) "He ate too much." familiar words—wrong context
(B) "He did not sleep at all in two days." Too extreme; he did get some sleep.
(C) "He went to sleep at four in the morning." familiar words—wrong context
**(D) "He has slept only for a few hours in 48 hours": see _En deux jours, il n'avait pas dormi quatre heures._**
3 | At what time of day did he get up? | C |
(A) "early in the morning"
(B) "noon"
**(C) "early in the evening": see _au crépuscule, avant de...se coucher pour la nuit_**
(D) "midnight"
4 | How does he react at the moment he wakes up? | A |
**(A) "He doesn't remember where he is": see _sans reconnaître le lieu où il se trouvait_**
(B) "He can't find his clothes."
(C) "He feels that he is late."
(D) "He is hungry."
5 | What did he want to do before eating dinner? | B |
(A) "breathe"
**(B) "go for a walk": see _prendre l'air_**
(C) "wake up": familiar words—wrong context
(D) "run"
6 | When did Morissot leave to reach the island? | C |
(A) "after sunset"
(B) "at sunset"
**(C) "at sunrise": see _dès l'aurore_**
(D) "in the afternoon"
7 | How did he reach the island? | D |
(A) "by bus and on foot"
(B) "by boat"
(C) "by car and on foot"
**(D) "by train and on foot": see _chemin de fer_ (railway) _, à pied_**
8 | At what point did he start fishing? | A |
**(A) "at almost the moment he arrived": see _à peine arrivé_**
(B) "at the moment he started to dream"
(C) "at nightfall"
(D) "when his friend arrived"
9 | What is located on Notre-Dame-de-Lorette Street? | C |
(A) "the island": makes no sense
(B) "the place the two friends would meet"
**(C) "Mr. Savage's shop": see _mercier_ (dealer in sewing wares)**
(D) "the train station"
10 | The parents of Guillaume | D |
(A) "advise him never to go to the movies"
(B) "don't concern themselves with what he does"
(C) "don't like the movies"
**(D) "give their opinion about the films he chooses": see _je leur demande ce qu'ils en pensent_**
11 | To Gilles's question, Claire replies | C |
(A) "that she never goes to the movies"
(B) "that she goes to the movies if her parents agree"
**(C) "that she goes to the movies without telling her parents": see _en cachette_ (secretly)**
(D) "that she goes to the movies often"
12 | What reason does Guillaume give for not lying to his parents? | B |
(A) "His parents let him do anything.": familiar words—wrong context
**(B) "His parents let him decide what to do.": see _Je crois que je me sens libre_**
(C) "It is better not to do it."
(D) "His parents don't like the movies."
13 | The author reacts to the change in Boulevard St. Michel and Place Saint-André-des-Arts with | B |
(A) "impatience"
**(B) "regret"**
(C) "indifference"
(D) "pleasure": makes no sense
14 | What does one find near Luxembourg? | D |
(A) "small, anonymous restaurants": familiar words—wrong context
(B) "pleasant cafés": familiar words—wrong context
(C) "pretentious bookstores"
**(D) "American establishments": _McDonald's_**
15 | According to the passage, "Gibert" is | C |
(A) "a film"
(B) "a café"
**(C) "a bookstore": see _cinémas et librairies semblent résister_**
(D) "a museum"
16 | What do young people do instead of going to Boulevard St. Michel? | C |
(A) "They go to Place Saint-André-des-Arts."
(B) "They are in a rush to see American films."
**(C) "They look for cool bars in another area.": see _autour du Panthéon_**
(D) "They resist going to bookstores."
17 | The narrator lets it be understood that she | D |
(A) "worked a lot"
(B) "was an invalid"
(C) "had many worries"
**(D) "married her father's friend": see _Un vieil ami de mon père m'a demandé ma main_.**
18 | The brother of the narrator | B |
(A) "lived with her for six years": familiar words—wrong context
**(B) "was younger than she": _cadet_**
(C) "was a soldier"
(D) "didn't like her husband"
19 | The passage gives us the impression | A |
**(A) "that she wanted to defend her actions": see _Qu'auriez-vous fait à ma place?_**
(B) "that she missed her husband"
(C) "that her brother was cured"
(D) "that she liked good weather": misunderstanding, as _sans un nuage_ is not literal
20 | After six years, what happened? | D |
(A) "The husband of the narrator left."
(B) "The good weather changed.": _sans un nuage_ is not literal
(C) "The narrator decided to leave."
**(D) "The narrator found a lover.": see _j'ai rencontré celui que je devais aimer._**
21 | It is understood that Antoine Lemurier | D |
(A) "is dead"
(B) "missed the train"
(C) "left his work"
**(D) "nearly succumbed to an illness": see _avait manqué mourir_ (almost died)**
22 | What did the neighbors think of Lemurier's illness? | A |
**(A) "They expected an interesting end to the tragedy.": see _ils vivaient anxieusement dans l'attente d'un dénouement qui fût digne de la pièce_**
(B) "They were sad."
(C) "They were angry with Lemurier."
(D) "They fell ill."
23 | According to the neighbors, what would have been a fitting end to the situation? | C |
(A) "Mr. Lemurier loses his job."
(B) "Mr. Lemurier completely recovers."
**(C) "Mrs. Lemurier is without shelter.": see _la femme à la rue_**
(D) "Mrs. Lemurier sells the house.": close, but the phrase is _le mobilier être vendu_
# Part V
# Practice Test 2
Practice Test 2
Practice Test 2: Answers and Explanations
# Practice Test 2
Click here to download the PDF.
# FRENCH SUBJECT TEST 2
SECTION 2
Your responses to the SAT French questions must be filled in on Section 2 of your answer sheet (at the back of the book). Marks on any other section will not be counted toward your score.
When your supervisor gives the signal, turn the page and begin the SAT Subject Test in French.
**FRENCH SUBJECT TEST 2**
**Part A**
**Directions:** This part consists of a number of incomplete statements, each having four suggested completions. Select the most appropriate completion and fill in the corresponding circle on the answer sheet.
. Les étudiants sont...avec l'enseignant sur l'explication de l'examen.
(A) en retard
(B) d'accord
(C) a l'heure
(D) avant de
. N'oublie pas ton parapluie; il va...ce soir.
(A) pleurer
(B) faire froid
(C) ouvrir
(D) pleuvoir
. Il n'y a plus rien dans le réfrigérateur. Il faut que j'aille...
(A) prendre une douche
(B) tondre le gazon
(C) faire les courses
(D) mettre le couvert
. J'ai mal à...d'avoir tapé à l'ordinateur toute la journée.
(A) la main
(B) le pied
(C) l'oreille
(D) la barbe
. Sa voiture est toujours en panne et il en a vraiment...
(A) marre
(B) mer
(C) miel
(D) dégoûté
. Au crépuscule, le ciel...de mille feux.
(A) éteignait
(B) disparaissait
(C) tombait
(D) brillait
. Les engagements...doivent être honores; sinon les gens ne vont pas faire confiance en vous.
(A) être pauvre
(B) reçu
(C) pris
(D) recueillir
. Jean va acheter des livres à la...
(A) boucherie
(B) librairie
(C) pâtisserie
(D) bibliothèque
. Elle est si allergique à la poussière qu'elle...sans arrête.
(A) éclate
(B) salue
(C) éternue
(D) respire
. J'ai ouvert une nouvelle...dans le centre de la ville où je vends des gâteaux.
(A) entreprise
(B) gare
(C) chambre
(D) voiture
. Il s'est évanoui en apprenant...
(A) la nouvelle
(B) la leçon
(C) le fauteuil
(D) la poubelle
. Personne ne répond à la porte; elle n'est probablement pas...
(A) là
(B) dessus
(C) dessous
(D) à côté
. Je suis très...que le garçon prend tellement de temps avec ma commande.
(A) heureux
(B) satisfait
(C) fâché
(D) ravi
. Ils ont choisi d'habiter...avec leurs trois petits enfants.
(A) en banlieue
(B) en chemin
(C) en cachette
(D) en retard
. Ils sont pleins d'énergie et sont...tous les matins à 6 heures.
(A) étendus
(B) assis
(C) debout
(D) fâchés
. Je n'ai pas...d'acheter une nouvelle voiture; je peux me déplacer à vélo en ville.
(A) hésiter
(B) espoir
(C) hésiter
(D) besoin
. Pour son entrevue avec son futur employeur demain, elle va mettre...
(A) un soulier
(B) un tailleur
(C) un costume
(D) un portemanteau
. Elle a...beaucoup d'argent pour acheter sa maison.
(A) prêté
(B) renversé
(C) emprunté
(D) vendu
. Je suppose que vous...parce que la journée a été très chaude.
(A) avez soif
(B) avez progreseé
(C) avez détruit
(D) avez évoqué
. Il est exténué; il a...travaillé.
(A) peu
(B) bientôt
(C) souvent
(D) trop
. Les trains passent moins souvent les jours...
(A) normaux
(B) libres
(C) fériés
(D) courants
. Cette ancienne carte va nous...où le trésor est enterré.
(A) masquer
(B) montrer
(C) rappeler
(D) demander
. Des années d'usage vont...le cuir de ces bottes.
(A) assiéger
(B) réduire
(C) assouplir
(D) surprendre
. Si je pars maintenant, je peux...les embouteillages.
(A) estimer
(B) revoir
(C) arranger
(D) éviter
**Part B**
**Directions:** Each of the following sentences contains a blank. From the four choices given, select the one that can be inserted in the blank to form a grammatically correct sentence and fill in the corresponding circle on the answer sheet. Choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically correct sentence.
. Le paquet ------- mon père a signé est sur la table de la cuisine.
(A) que
(B) à qui
(C) pour lequel
(D) dont
. Je suis passée à la maison ------- prendre mon parapluie.
(A) à
(B) pour
(C) parce que
(D) après
. Mon père revenait toujours ------- à la maison entre midi et deux heures.
(A) déjeuner
(B) déjeuné
(C) déjeunait
(D) déjeunant
. Les chocolats ------- Belgique sont les meilleurs au monde.
(A) de la
(B) dans
(C) aux
(D) du
. Elle dessine beaucoup ------- que son frère.
(A) bien
(B) meilleur
(C) mal
(D) mieux
. La robe qu'elle a ------- hier n'est vraiment pas à la mode.
(A) mise
(B) acheté
(C) mis
(D) enfiler
. Je vais faire des courses -------- tu aimerais mieux.
(A) avant que
(B) puisque
(C) selon que
(D) à moins que
. Regarde ------- tu mets les pieds quand tu marches.
(A) là
(B) où
(C) vers
(D) près de
. Appelle-moi ------- prendre une décision.
(A) en
(B) pendant
(C) avant de
(D) à
. \------- mieux prendre des vacances plutôt que de rester à la maison en hiver.
(A) Je vais aimer
(B) J'aimais
(C) J'aimerais
(D) Que j'aime
. Est-ce que tu veux un bonbon? Oui, j'en veux bien -------.
(A) quelque
(B) peu
(C) un peu
(D) un
. Est-ce que Marie est déjà partie à la poste? Non, mais elle va ------- aller tout de suite.
(A) y
(B) en
(C) toujours
(D) demain
. Il ------- tous les jours avant de dejeuner quand il etait en vacances.
(A) va nager
(B) avait nagé
(C) a nagé
(D) serait nager
. Il faut que ------- à la banque demain matin pour retirer de l'argent.
(A) j'allais
(B) j'aille
(C) j'irai
(D) j'irais
**Part C**
**Directions:** The paragraphs below contain blank spaces indicating omissions in the text. For some blanks, it is necessary to choose the completion that is most appropriate to the meaning of the passage; for other blanks, to choose the one completion that forms a grammatically correct sentence. In some instances, choice (A) may consist of dashes that indicate that no insertion is required to form a grammatically correct sentence. In each case, indicate your answer by filling in the corresponding circle on the answer sheet. Be sure to read the paragraph completely before answering the questions related to it.
In n'avait pas mangé ---(39)--- le matin. Les cafés qu'il rencontrait à ---(40)--- pas l'intimidaient et le ---(41)--- , à cause de la foule qui ---(42)--- était ---(43)--- . Il s'adressa ---(44)--- un gendarme. Mais il était si lent à ---(45)--- ses mots que l'autre ne se donna même pas la peine de l'écouter ---(46)--- bout et ---(47)--- tourna le dos au milieu de la phrase, en ---(48)--- les épaules. Il continua machinalement ---(49)--- marcher.
. (A) après
(B) depuis
(C) pour
(D) dans
. (A) tous
(B) chacun
(C) chaque
(D) quelque
. (A) discutaient
(B) salivaient
(C) dégoûtaient
(D) aimaient
. (A) en
(B) y
(C) dans
(D) où
. (A) entassé
(B) entasser
(C) entassées
(D) entassée
. (A) à
(B) vers
(C) avec
(D) pour
. (A) trouvé
(B) trouver
(C) trouvés
(D) trouvait
. (A) à travers
(B) jusque-là
(C) au
(D) jusqu'au
. (A) leur
(B) lui
(C) le
(D) la
. (A) tirant
(B) portant
(C) haussant
(D) passant
. (A) \-------
(B) pour
(C) à
(D) en
Cher Monsieur,
La lettre ----(50)---- je vous ----(51)---- adressée le 1er juillet ----(52)---- restée sans réponse, je me permets de vous écrire pour ----(53)---- prier de prendre ma requête ----(54)---- considération.
. (A) \-------
(B) laquelle
(C) dont
(D) que
. (A) aie
(B) ai
(C) aurai
(D) avait
. (A) ayant
(B) avant
(C) étant
(D) était
. (A) te
(B) me
(C) vous
(D) le
. (A) en
(B) avec
(C) par
(D) comme
Quand j'étais petit, mes parents ----(55)---- emmenaient ----(56)---- nager à la piscine municipale de Roubaix.
. (A) leur
(B) te
(C) s'
(D) m'
. (A) peut-être
(B) pourtant
(C) une fois
(D) souvent
**Part D**
**Directions:** Read the following texts carefully for comprehension. Each is followed by a number of questions or incomplete statements. Select the completion or answer that is best according to the text and fill in the corresponding circle on the answer sheet.
. Quand arrivait la pluie d'automne, la grand-mère était
(A) énervée
(B) triste
(C) contente
(D) fière
. Pendant les mois d'été, Jacques
(A) travaillait beaucoup
(B) passait son temps à lire
(C) s'amusait sans arrêt
(D) ne savait pas comment se distraire
. Quand elle était petite, la grand-mère
(A) avait de moins longues vacances que Jacques
(B) dessinait pendant ses loisirs
(C) passait tout son temps au travail
(D) ne faisait jamais rien
. D'après le texte, on comprend que
(A) Jacques poursuit ses études
(B) la grand-mère ne veut pas que Jacques aille encore à l'école
(C) la grand-mère refuse que Jacques travaille pendant l'été
(D) Jacques est le troisième de sa classe
. La grand-mère veut que Jacques ait un emploi pour qu'il
(A) ait un peu d'argent de poche
(B) puisse payer ses études
(C) contribue aux dépenses de la famille
(D) apprenne un métier
. L'enfant de trois ans pleure parce qu'
(A) il a perdu son morceau de chocolat
(B) il s'est fait mal
(C) il ne sait pas où est sa famille
(D) il fait nuit
. Les rideaux de la boutique sont
(A) ouverts
(B) levés
(C) descendus
(D) déchirés
. La femme "se précipite sur lui" veut dire qu'elle va vers l'enfant
(A) en courant
(B) à pas lents
(C) en pleurant
(D) avec nonchalance
. Elle "le serre contre elle" signifie qu'elle
(A) le repousse
(B) l'embrasse
(C) lui sourit
(D) le frappe
. A qui la femme pense-t-elle en emportant l'enfant?
(A) à son propre fils
(B) au fils d'une des refugiées
(C) au fils du lecteur
(D) au fils d'un garde
. Les bouchons dont il est question dans le texte
(A) servent à boucher les bouteilles
(B) sont des embouteillages
(C) retardent les trains
(D) évitent de perdre du temps
. D'après le texte, la solution Train + Location de Voitures
(A) revient plus cher
(B) coûte trop cher
(C) n'est guère pratique
(D) est une bonne affaire
. D'après cet article, l'établissement
(A) reçoit 10 000 dons chaque jour
(B) ne reçoit jamais 10 000 dons dans un seul jour
(C) a besoin immédiat du sang
(D) a assez sang pour le futur imminent
. Les appels réguliers aux dons
(A) sont nécessaires pour plusieurs raisons.
(B) prennent rendez-vous pour téléphone
(C) n'ont guère d'intérêt
(D) font dons du sang chaque 42 jours
. Cette journée mondiale des donneurs du sang est important parce que
(A) il y'a eu un bon fête
(B) il y'a eu moins de donneurs au printemps comme d'habitude
(C) les donneurs du sang ont chuchoté l'un aux autres
(D) c'était durant les mois d'avril et de mai
. «...n'y pensent pas » signifie que les gens
(A) n'organisent pas souvent leur vacances
(B) sont souvent blessé en vacances
(C) visitent les endroits étrangers.
(D) ne se souviennent pas de faire un don
. « La phénomène » représente
(A) une chose extraordinaire
(B) les vacances de Noël
(C) une baisse de dons au décembre et janvier
(D) les maladies fréquentes dans l'hiver
Voici la recette des madeleines, ces petits gâteaux de forme ovale au ventre bombé, si chers à Marcel Proust:
. Quand faut-il préparer la pâte des madeleines?
(A) le lendemain
(B) le jour précédent
(C) deux heures à l'avance
(D) hier
. D'après la recette, le pastis est un ingrédient
(A) indispensable
(B) sucré
(C) optionnel
(D) parfumé
. "Je vous ai déjà laissé entendre" signifie "je vous ai déjà"
(A) dit
(B) répété
(C) suggéré
(D) menti
. Le bossu a de "vastes projets" parce qu'il
(A) a besoin d'argent tout de suite
(B) pense à l'avenir de sa fille
(C) est philosophe
(D) aime beaucoup l'argent
. Du discours du bossu, Ugolin se souvient
(A) uniquement des derniers mots
(B) peut-être des premiers mots
(C) toujours de la dernière phrase
(D) de tout sauf de la fin
. Aux lignes 18–23, apres l'annonce des projets du bossu, Ugolin est
(A) amusé
(B) très inquiet
(C) rempli de joie
(D) rassuré
. Ugolin cherche à savoir si le bossu
(A) va planter des vignes
(B) va sauver les oliviers et les amandiers
(C) compte vendre des chardons
(D) connaît l'existence de la source
. "En tous lieux" signifie
(A) nulle part
(B) partout
(C) ailleurs
(D) quelque part
. Le convalescent risque de se casser l'autre jambe parce que le sol est
(A) mouillé
(B) inégal
(C) plein de trous
(D) glissant
. La cour entre chaque salle est
(A) inondée de soleil
(B) privée d'ombre
(C) ensoleillée
(D) privée de soleil
. En hiver les repas sont servis aux malades
(A) brûlants
(B) tièdes
(C) à point
(D) très froids
. Le ton de Flaubert dans ce passage est
(A) sarcastique
(B) sérieux
(C) enjoué
(D) tragique
**S T O P**
**If you finish before time is called, you may check your work on this test only.**
**Do not work on any other test in this book.**
# Practice Test 2:
Answers and Explanations
## **PRACTICE TEST 2 ANSWER KEY**
Question number | Correct answer
---|---
1. | B
2. | D
3. | C
4. | A
5. | A
6. | D
7. | C
8. | B
9. | C
10. | A
11. | A
12. | A
13. | C
14. | A
15. | C
16. | D
17. | B
18. | C
19. | A
20. | D
21. | C
22. | B
23. | C
24. | D
25. | C
26. | B
27. | A
28. | A
29. | D
30. | A
31. | D
32. | B
33. | C
34. | C
35. | D
36. | A
37. | B
38. | B
39. | B
40. | C
41. | C
42. | B
43. | D
44. | A
45. | B
46. | D
47. | B
48. | C
49. | C
50. | D
51. | B
52. | C
53. | C
54. | A
55. | D
56. | D
57. | C
58. | D
59. | C
60. | A
61. | C
62. | C
63. | C
64. | A
65. | B
66. | A
67. | B
68. | D
69. | D
70. | A
71. | B
72. | D
73. | C
74. | B
75. | C
76. | C
77. | B
78. | A
79. | B
80. | D
81. | B
82. | D
83. | D
84. | D
85. | A
## **PRACTICE TEST 2 EXPLANATIONS**
The possible choices are examined for clues that should have indicated the correct answer. To help explain why a choice is right or wrong, resemblances between English and French words are noted, grammatical explanations are given, and an analysis of the comprehension questions is provided.
### **Part A**
. **B** The sentence says, "The students are...with the teacher's explanation of the test." The key phrase is _avec l'enseignent_. A proper vocabulary word should show agreement with the teacher. Choice (A) means behind. Choice (B) means in agreement with. Choice (C) means on time. Choice (D) means ahead of. The answer is (B).
. **D** The sentence says, "Don't forget your umbrella; it's going to...tonight." The key phrase is _parapluie_. A proper vocabulary word is rain. Choice (A) means to cry. Choice (B) means be cold. Choice (C) means to open. Choice (D) means to rain. The answer is (D).
. **C** The sentence says, "There is nothing in the refrigerator. I have to go..." The key phrase is _rien dans le réfrigérateur_. A proper vocabulary word would be buy some food. Choice (A) means take a shower. Choice (B) means mow the lawn. Choice (C) means go shopping. Choice (D) means set the table. The answer is (C).
. **A** The sentence says, "My...hurts from having typed on the computer all day." The key phrase is _d'avoir tapé à l'ordinateur_. A proper vocabulary word would be finger. Choice (A) means hand. Choice (B) means foot. Choice (C) means ear. Choice (D) means beard. The correct answer is (A).
. **A** The sentence says, "His car is always broken down, and he has really..." The key phrase is _est toujours en panne_. A proper vocabulary word would be annoyed or fed up. Choice (A) is part of the idiomatic expression _en avoir marre_ , which means to be fed up with. Using process of elimination helps with idiomatic expression. Choice (B) means ocean. Choice (C) means honey. Choice (D) means disgusted. Choice (D) might work, but _dégoûté_ requires the verb être _(il est dégouté_ ) rather than the verb _avoir_ ( _il a..._ ). The answer is (A).
. **D** The sentence says, "At dusk, the sky...with a thousand lights." The key phrase is _de mille feux_. A proper vocabulary word would be glows. Choice (A) means turned off. Choice (B) means disappeared. Choice (C) means fell. Choice (D) means shined. The answer is (D).
. **C** The sentence says, "Meetings...must be honored; otherwise people will not trust you." The key phrase is _sinon les gens ne vont pas faire confiance en vous_. A proper vocab word would explain what kind of non-honored meetings would cause people to mistrust someone, such as scheduled. Choice (A) means to be poor. Choice (B) means received. Choice (C) means made or scheduled. Choice (D) means to collect. The answer is (C).
. **B** The sentence says, "John is going to buy books at the..." The key phrase is _va acheter des livres_. A proper vocabulary word would be bookstore. Choice (A) means butcher. Choice (B) means bookstore. Choice (C) means baker (of desserts). Choice (D) means library. Be careful to not eliminate (B): _librarie_ and _bibliothèque_ are _faux-amis_. The answer is (B).
. **C** The sentence says, "She is so allergic to dust that she...without stopping." The key phrase is _si allergique_. A proper vocabulary word would be something that indicated an allergic reaction, such as sneezed or itched. Choice (A) means burst. Choice (B) means greeted. Choice (C) means sneezed. Choice (D) means breathed. The answer is (C).
. **A** The sentence says, "I opened a new...in the center of town where I sell cakes. The key phrase is _où je vends des gâteaux_. A proper vocabulary word would be bakery. Choice (A) means business. Choice (B) means a train station. Choice (C) means a bedroom. Choice (D) means a car. The answer is (A).
. **A** The sentence says, "He fainted upon learning..." The key phrase is _apprenant_. A proper vocabulary word would be news or information. Choice (A) means the news. Choice (B) means the lesson. Choice (C) means the armchair. Choice (D) means the trashcan. The answer is (A).
. **A** The sentence says, "Nobody is answering the door; she is probably not..." The phrase is _Personne ne répond_. A proper vocabulary phrase would be not home. Choice (A) means there. Choice (B) means above. Choice (C) means below. Choice (D) means to the side. The answer is (A).
. **C** The sentence says, "I am very...that the waiter is taking so long with my order." The key phrase is _prend tellement de temps_. A proper vocabulary word would be upset. Choice (A) means happy. Choice (B) means satisfied. Choice (C) means angry. Choice (D) means delighted. The answer is (C).
. **A** The sentence says, "They have chosen to live...with their three young children." The key phrase is _habiter_. A proper vocabulary word would be a word that describes a place a family lives, such as in the countryside. Choice (A) means in a suburb. Choice (B) means on the way. Choice (C) means in a hiding place. Choice (D) means late. The answer is (A).
. **C** The sentence says, "They are full of energy and are...every morning at 6." The key phrase is _pleins d'enérgie_. A proper vocabulary word would be awake. Choice (A) means heard. Choice (B) means seated. Choice (C) means up. Choice (D) means angry. The answer is (C).
. **D** The sentence says, "I don't have...to buy a new car; I can ride my bicycle into town." The key phrase is _n'ai pas...d'acheter_. A proper vocabulary word would be a desire. Choice (A) means hesitation. Choice (B) means hope. Choice (C) means hesitation. Choice (D) means a need. The answer is (D).
. **B** The sentence says, "For her interview with her future boss tomorrow, she is going to wear..." The key phrases are _son entrevue_ and _elle va mettre_. A proper vocabulary word would be business clothes. Choice (A) means flat-heeled shoes. Choice (B) means a woman's business suit. Choice (C) means a man's business suit. Choice (D) means a coatrack. The answer is (B).
. **C** The sentence says, "She has...a lot of money to buy her house." The key phrase is _pour acheter sa maison._ A proper vocabulary word would explain what action the woman took with money to buy her house, such as paid or borrowed. Choice (A) means lent. Choice (B) means returned. Choice (C) means borrowed. Choice (D) means sold. Be careful about the trap in (D). Selling is something one does with one's house, but not with the money for the house. The answer is (C).
. **A** The sentence says, "I suppose that you...since the day was very hot." The key phrase is _la journée a été très chaude_. A proper vocabulary word would be thirsty. Choice (A) means are thirsty. Choice (B) means have progressed. Choice (C) means have destroyed. Choice (D) means have evoked. The answer is (A).
. **D** The sentence says, "He is exhausted; he has worked..." The key phrase is _exténué_. A proper vocabulary word would be too much. Choice (A) means little. Choice (B) means soon. Choice (C) means often. Choice (D) means too much. Choice (C) is close, but often working does not necessarily mean he will be exhausted. Working too much better matches the tone of the sentence. The answer is (D).
. **C** The sentence says, "Trains run less often on...days." The key phrase is _passent moins souvent_. A proper vocabulary word would describe a type of day on which a train schedule would be less regular, such as holidays. Choice (A) means normal. Choice (B) means free. Choice (C) means festival. Choice (D) means current. The answer is (C).
. **B** The sentence says, "This ancient map is going to...us where the treasure is buried." The key phrase is _où le trésor est enterré._ A proper vocabulary word would be show. Choice (A) means hide. Choice (B) means show. Choice (C) means remind. Choice (D) means ask. Choice (C) is possible, but there is no evidence in the sentence that the speakers had once known the location of the treasure. The answer is (B).
. **C** The sentence says, "Years of use will...the leather of these boots." The key phrase is _Des années d'usage_ and _cuir_. A proper vocabulary word would describe what might happen to leather after years of use, such as wear out. Choice (A) means to besiege. Choice (B) means to reduce. Choice (C) means to soften leather or to make supple. Choice (D) means to surprise. Choice (B) is close, but does not mean the same thing as wear out. The answer is (C).
. **D** The sentence says, "If I leave now, I can...the traffic jams." The key phrase is _les embouteillages_. A proper vocabulary word would be avoid. Choice (A) means praise. Choice (B) means see again. Choice (C) means arrange. Choice (D) means avoid. The answer is (D).
### **Part B**
. **C** _Pronouns_
The sentence says, "The parcel-------my dad signed is on the kitchen table." The question is testing the best pronoun that logically completes the sentence. Since the pronoun follows the subject, a pronoun that can refer to a thing is needed. Choice (A) means which but is only used as a direct object pronoun. Choice (B) means to whom and refers to a person. Choice (C) means for which, and _lequel,_ can refer to parcel. Choice (D) means of which or of what, but sign for is _signer pour._ The answer is (C).
. **B** _Prepositions_
The sentence says, "I went by the house--------to get my umbrella. This question is testing the correct way to describe why the person went by the house. Choice (A) means at. Choice (B) means in order to. Choice (C) means because. Choice (D) means after. Choice (C) must be followed by a subject ( _parce que je..._ ) in order to be correct. The answer is (B).
. **A** _Verbs_
The sentence says, "My father returned home every day -------between noon and 2pm. The question is testing the correct form of the verb _déjeunner_ that follows _revenait_. Choice (A) means to eat lunch and is infinitive, which is typically required when one verb follows another. Choice (B) is the past participle which would require an auxiliary verb. Choice (C) means was eating in the imperfect. While it matches the verb tense of _revenir_ , it is not the correct form since there is no linking word, such as _et_. Choice (D) means eating and is the gerund form. The answer is (A).
. **A** _Prepositions_
The sentence says, "Chocolates-------Belgium are the best in the world. The question is testing the best preposition to describe that the chocolates are from Belgium. Choice (A) means from and is feminine. Most European countries take the feminine article. Choice (B) means in. Choice (C) means to the. Choice (D) means from but is masculine. The answer is (A).
. **D** _Odds and Ends: Adverbs_
The sentence says, "She draws much-------than her brother." The question is testing the best way to compare how she draws. Choice (A) means good and is not a comparison. Choice (B) means best and is superlative, not comparative. Choice (C) means bad and is not a comparison. Choice (D) means better and is a comparison. The answer is (D).
. **A** _Verbs_
The sentence says, "The dress that she-------yesterday is not really fashionable." The question is testing the proper word to complete the sentence and whether the participle should agree. In general, when the _passé compose_ is made with the verb _avoir_ , participles do not agree. However, one exception to this rule is when the direct object comes before the verb. In this sentence, the direct object, the dress, comes before the verb, so the participle form must match gender and number. _La robe_ is singular feminine, so the participle must be also. Choice (A) means put on and is singular feminine. Choice (B) means bought and is singular masculine. Choice (C) means put on and is singular masculine. Choice (D) means to slip into (some clothes) and is infinitive form. The answer is (A).
. **D** _Prepositions_
The sentence says, "I am going to go shopping-------you'd rather go." The question is testing for the word that logically connects the two phrases. Choice (A) means before. Choice (B) means since. Choice (C) means according to. Choice (D) means unless. Choice (A) might work, but _avant que_ would require the subjunctive tense rather than the conditional. The answer is (D).
. **B** _Prepositions/Pronouns_
The sentence says, "Watch------you put your feet when you walk." The question is testing which is the best preposition or pronoun to logically complete the sentence. Choice (A) is a pronoun and means there. Choice (B) is a pronoun and means where. Choice (C) is a preposition and means toward. Choice (D) is a preposition and means near. The answer is (B).
. **C** _Prepositions_
The sentence says, "Call me-------making the decision." The question is testing which preposition would most logically complete the sentence. Choice (A) means in. Choice (B) means while. Choice (C) means before. Choice (D) means at. Choice (B) might seem possible, but in order to link two verbs, the phrase would need a subject and verb ( _pendant que tu prends_ ) The answer is (C).
. **C** _Verbs_
The sentence says, "-------better to take vacation than to remain at the house all winter." The question is testing what the correct form of the verb is when discussing a hypothetical situation. In this case, the conditional tense is used. Choice (A) means I will like and is proximate (near) future. Choice (B) means I liked and is in the imperfect tense. Choice (C) means I would like and is in the conditional tense. Choice (D) means that I like. It is the present tense and adds an unnecessary word. The answer is (C).
. **D** _Pronouns_
The sentence says, "Would you like a candy? Yes, I would like-------of them." The question is testing the correct way to refer to a specific number of things when using the pronoun _en_. Here, the number of things follows the verb. Since _un bonbon_ is singular masculine, the number one is needed and must be masculine. Choice (A) means some. Choice (B) means little. Choice (C) means a little. Choice (D) means one and is masculine singular. While the English translation would make it appear that all of these would work, the correct expression requires a number. The answer is (D).
. **A** _Pronouns_
The sentence says, "Did Marie already leave for the post office? No, but she is going to go-------
soon." The question is testing the correct pronoun for referring to a location. Choice (A) means there and is used for location when the original phrase used the pronoun _à._ Choice (B) could mean there but can only replace phrases that begin with _de_. Choice (C) means always. Choice (D) means tomorrow. The answer is (A).
. **B** _Verbs_
The sentence says, "He-------every day before lunch when he was on vacation." The question is testing the correct form of the verb that would describe a past action done before another past action. This is known as the past perfect or _plus-que-parfait_ in French. Choice (A) means will swim and is future tense. Choice (B) means had swum and is past perfect. Choice (C) means swam and is _passé compose_. Choice (D) means would swim and is conditional. The answer is (B).
. **B** _Verbs_
The sentence says, "It's necessary that-------to the bank tomorrow to withdraw some money." The question is testing the correct form of the verb _aller_ that follows the phrase _il faut que_. This phrase requires the use of the subjunctive. Choice (A) means I went and is the imperfect. Choice (B) means I (will) go and is the subjunctive. Choice (C) means I will go and is future tense. This may seem correct when translated, but the French phrase requires subjunctive. Choice (D) means I would go and is conditional. The answer is (B).
### **Part C**
The following translation is for questions 39–49.
He had not eaten ---(39)--- morning. The cafés that he came across with ---(40)--- step intimidated him and ---(41)--- him, due to the crowd that ---(42)--- was ---(43)--- . He spoke ---(44)--- a watchman. However, he was so slow to ---(45)--- his words that the other did not even bother to listen to him ---(46)--- end and ---(47)--- turned his back, in the middle of the sentence, while ---(48)--- his shoulders. He continued ---(49)--- march mechanically.
. **B** _Vocabulary_
The question is testing the word that most logically completes the phrase. Choice (A) means after. Choice (B) means since. Choice (C) means for. Choice (D) means in, but _dans_ is not used before _le matin_. The answer is (B).
. **C** _Vocabulary_
The question is testing which pronoun can be used to describe his steps. Choice (A) means all, but would require the article _les_. Choice (B) means each one. Choice (C) means each. Choice (D) means some. The answer is (C).
. **C** _Vocabulary_
The question is testing which word best completes the phrase intimidated. Choice (A) means discussed. Choice (B) means drooled. Choice (C) means disgusted. Choice (D) means liked. The answer is (C).
. **B** _Pronouns_
The question is testing which pronoun can be used to refer to _les cafés_ and can be used with the verb être. Choice (A) means from there. Choice (B) means there. Choice (C) means in. Choice (D) means where. The answer is (B).
. **D** _Verbs_
The question is testing the correct form of the verb _entasser_ , which means crowded into. The word will follow the verb _être,_ so the past participle must match the number and gender of _la foule_ , which is singular feminine. Choice (A) is the singular masculine participle. Choice (B) is the infinitive form. Choice (C) is the plural feminine. Choice (D) is the singular feminine. The answer is (D).
. **A** _Prepositions_
The question is testing the word that most logically completes the sentence. Choice (A) means to. Choice (B) means toward, but indicates movement. Choice (C) means with, but in French the preposition _à_ is used when addressing a person. Choice (D) means for. The answer is (A).
. **B** _Verbs_
The question is testing the correct form of _trouver_ , to find. The verb will follow the preposition _à_ and so needs to be in the infinitive form. Choice (A) is the past participle. Choice (B) is the infinitive. Choice (C) is the plural past participle. Choice (D) is the imperfect form. The answer is (B).
. **D** _Prepositions_
The question is the testing the word that most logically completes the phrase. Choice (A) means through. Choice (B) means up to there. Choice (C) means at the. Choice (D) means until the. The answer is (D).
. **B** _Pronouns_
The question is testing the correct form of the pronoun. Since the watchman turned his back on the man, a singular indirect object pronoun is needed. Choice (A) is the plural indirect object pronoun. Choice (B) is a singular indirect object pronoun. Choice (C) is the masculine direct object pronoun. Choice (D) is the feminine direct object pronoun. The answer is (B).
. **C** _Vocabulary_
The question is testing the word that most logically describes what the watchman does with his shoulders. Choice (A) means pulling. Choice (B) mean carrying. Choice (C) means shrugging. Choice (D) means passing. The answer is (C).
. **C** _Prepositions_
The question is testing the correct preposition to follow _continuer_ and precede _marcher_. Choice (A) is null but _continuer_ needs a pronoun. Choice (B) means for. Choice (C) means to. Choice (D) means in. The answer is (C).
The following translation is for questions 50–54.
The letter ---(50)--- I ---(51)--- you, addressed July 1st, ---(52)--- remained unanswered, I am thus writing you to implore ---(53)--- to take my request ---(54)--- consideration.
. **D** _Pronouns_
This question is testing which relative pronoun most logically completes the phrase. Choice (A) omits the pronoun, which is not permissible in French. Choice (B) means that which and should not follow a noun directly. Choice (C) is an indirect object pronoun meaning for which. The verb _adresser_ takes a direct object pronoun. Choice (D) means that and is a direct object pronoun. The answer is (D).
. **B** _Verbs_
This question is testing the correct form of _avoir_ to logically complete the sentence. The context of the letter shows that the first letter was written in the past. Choice (A) is the subjunctive. Choice (B) is the _passé compose_. Choice (C) is the future tense. Choice (D) is imperfect, but it is in the third person ( _il avait_ instead of _j'avais_ ). The answer is (B).
. **C** _Verbs_
This question is testing both the correct verb to combine with the participle _restée_ and the form that verb should take. In the participle form, _rester_ needs _être._ Choice (A) is the gerund form of _avoir_. Choice (B) means before. Choice (C) is the gerund form of _être._ Choice (D) is the imperfect form; however, when combined with the participle forms the past perfect ( _plus-que-parfait_ ) tense. This tense does not make sense in this context. The answer is (C).
. **C** _Pronouns_
This question is testing the correct pronoun to use to refer to the addressee of the letter. All the pronouns are in the direct object case, so this is more of a vocabulary question. Choice (A) is the informal you. Choice (B) is me. Choice (C) is the formal you. Choice (D) is him. Since this is a business letter, formal language is needed, as has already been used earlier in the letter. The answer is (C).
. **A** _Prepositions_
This question is testing which pronoun correctly matches with the verb _prendre_. This is an idiomatic expression. Choice (A) is _prendre en_ , which means take into. Choice (B) means with. Choice (C) means by. Choice (D) means as. The answer is (A).
The following translation is for questions 55–56.
When I was young, my parents took ---(55)--- swimming ---(55)--- at Roubaix municipal pool.
. **D** _Pronouns_
This question is testing the correct form and use of pronouns with the verb _emmener_. This verb requires a direct object pronoun. Choice (A) is an indirect object pronoun. Choice (B) is a direct object pronoun meaning you. Choice (C) is a reflexive pronoun meaning himself. Choice (D) is a direct object pronoun meaning me. The answer is (D).
. **D** _Odds and Ends: Adverbs_
This question is testing the adverb that best matches the context of the sentence. Choice (A) means maybe. Choice (B) means yet. Choice (C) means once. Choice (D) means often. Choice (C) might seem plausible, but the verb _emmener_ is in the imperfect form, which indicates ongoing action in the past. The phrase _une fois_ would require the use of _passé compose_.
### **Part D**
The following translation is for questions 57–61.
"Summer is too long" said the grandmother who welcomed the autumn rain with the same sigh of relief as she did when Jacques left, whose stampings of boredom in rooms with closed shutters during the long sweltering days added to her annoyance.
Besides, she had never understood why a period of each year was specially designed for doing nothing. "I myself never had vacations," she said, and this was true, she had not known either school or free time, she had worked from infancy, and worked without ceasing. She had accepted that, for a greater good, her grandson would not bring money into the house for several years. But from the first day of summer, she had begun grumbling about these three lost months, and, ever since Jacques had begun 9th grade, she had deemed that it was time for him to find work during vacation. "You are going to work this summer," she told him at the end of the school year, "and bring a little bit of money back into this household." You cannot lie around like that doing nothing.
. **C** The question asks, "When the autumn rain arrived, the grandmother was:"
(A) No. "Annoyed." This is a familiar word—wrong context. She was annoyed at Jacques during the summer.
(B) No. "Sad." There is no evidence of this in the text.
(C) Yes. "Glad." According to the text the grandmother _du même soupir soulagé...le depart de Jacques_.
(D) No. "Proud." There is no evidence of this in the text.
. **D** The question asks, "During the summer months, Jacques:"
(A) No. "Worked a lot." These are familiar words—wrong context.
(B) No. "Spent his time reading." There is no support for this in the text."
(C) No. "Never stopped having fun." This is opposite the passage which says _les piétinements d'ennui_.
(D) Yes. "Did not know how to entertain himself." This is supported by the passage which says _les piétinements d'ennui_.
. **C** The question asks, "When she was a little girl, the grandmother:"
(A) No. "Had a shorter vacation than Jacques." Careful with the negation in the French. According to the passage, the grandmother never had vacation: _je n'ai jamais eu de vacances_.
(B) No. "Used to draw pictures during her free time." There is no evidence for this in the passage. Additionally, the grandmother _n'avait connu...le loisir_.
(C) Yes. "Spent all her time working." This is supported by the passage which says _elle avait travaillé enfant, et travaillé sans rel_ âche.
(D) No. "Never did anything." This is directly contradicted by the passage which mentions that she was working all the time.
. **A** The question asks, "According to the passage, it is understood that:"
(A) Yes. "Jacques is attending school." This is supported by the passage which says _Jacques entra en troisième_.
(B) No. "The grandmother does not want Jacques to return to school." This is contradicted by the text, which says _Elle admettait, pour un benefice plus grand._
(C) No. "The grandmother is opposed to Jacques having a summer job." This is contradicted by the text, which says _tu vas travailler cet_ été.
(D) No. "Jacques is the third in his class." These are familiar words—wrong context.
. **C** The question asks, "The grandmother wants Jacques to have a job so that he:"
(A) No. "Might have some spending money." These are familiar words—wrong context.
(B) No. "Might be able to pay for his studies." These are familiar words—wrong context.
(C) Yes. "Might contribute to the family expenses." This is supported by the text, which says _rapporter un peu d'argent à la maison_.
(D) No. "Might learn a trade." There is no evidence for this in the passage.
The following translation is for questions 62–66.
Before coming to Central, he read, I had witnessed a scene of atrocious beauty.
We found that night near the Puerta del Sol a lost three-year-old child who was crying in the shadows. Now, one of the refugee women living in the basement of the Gran Via had no idea what had happened to her own son, a little boy of the same age, blonde like the child found in the Puerta del Sol. We tell her the news. She runs to the house where we were keeping the boy, on Calle Montera. In the half-dark of a store with lowered blinds, the boy sucks on a piece of chocolate. The woman approaches him, her arms outstretched, but her eyes grow large, taking on a terrible, demented stare.
This isn't her son.
She stays very still for several minutes. The lost boy smiles at her. Then she rushes at him, clutches him to her, and takes him away, thinking about the child whom we never found.
. **C** The question asks, "The three year old child is crying because:"
(A) No. "He has lost his piece of chocolate." These are familiar words—wrong context.
(B) No. "He has hurt himself." There is no evidence of this in the text.
(C) Yes. "He does not know where his family is." This is supported by the text that says _qui pleurait perdu_.
(D) No. "It is dark." These are familiar words—wrong context. There is no explanation of why there are shadows ( _ténèbres_ ).
. **C** The question asks, "The shutters of the store are:"
(A) No. "Open." This is contradicted by the passage that says _baissés_.
(B) No. "Up." This is contradicted by the passage that says _baissés_.
(C) Yes. "Lowered." This is supported by the passage that says _baissés_.
(D) No. "Torn." There is no evidence of this in the passage.
. **A** The question asks, "The woman 'rushes toward him' means that she goes toward the child:"
(A) Yes. "Running." This is the meaning of _se précipite sur lui_.
(B) No. "Slowly." No this is contradicted by the passage.
(C) No. "Crying." This is a familiar word—wrong context.
(D) No. "Unconcerned." There is no evidence of this in the text.
. **B** The question asks, "She 'clutches him to her' means that she:"
(A) No. "Pushes him away." This is contradicted by the passage that says _l'emporte_.
(B) Yes. "Hugs him." This is supported by the passage that says _l'emporte_.
(C) No. "Smiles at him." These are familiar words—wrong context.
(D) No. "Hits him." There is no evidence of this in the text.
. **A** The question asks, "Who does the woman think of as she carries the child away?"
(A) Yes. "Her own son." This is supported by the passage that says _en pensant à l'enfant qu'on n'a pas retrouvé_.
(B) No. "The son of one of the refugees." These are familiar words—wrong context.
(C) No. "The reader's son." These are familiar words—wrong context.
(D) No. "The son of a guard." This is a misunderstanding of _on garde_ which means we kept.
The following translations is for questions 67–68.
Train + Car: in complete liberty
Avoid the traffic delays of long trips! Choosing the formula "Train + Car Rental" will guarantee that you can benefit from all the advantages: the comfort of the train, the freedom of the car...All while getting genuine savings! Practical: When you get off the train, a car is right there waiting in the station. Economical: you will benefit from a great reduction of rental costs. Efficient: you will reserve your car at the same time as your train ticket. To take advantage of this offer: make a reservation for the train, at the purchase click on "ADD A CAR", and choose the offer "Train + Car Rental."
. **B** The question asks, "The delays mentioned in the text:"
(A) No. "Are used to cork a bottle." This is a second definition of _boucher_.
(B) Yes. "Are traffic jams." In the context of the text _les bouchons_ is synonymous with _les embouteillages_.
(C) No. "Delay the trains." This is not supported by the passage.
(D) No. "Avoid wasting time." This is not supported by the passage.
. **D** The question asks, "According to the text, the combination Train + Car Rental:"
(A) No. "Is more expensive." This is contradicted by the text that says _tout en réalisant varies économies_.
(B) No. "Is too expensive." This is not supported by the text.
(C) No. "Is not very convenient." This is contradicted by the passage that says _tous les avantages_.
(D) Yes. "Is a good deal." This is supported by the text that says _tout en réalisant de vraies économies_.
The following translation is for questions 69–73.
Happily, (the French blood bank) we are never in desperate need of blood supplies for the short term. We need about 10,000 donations every day, which enable us to see to the needs of a million people each year. Some 500,000 are helped directly by the products we collect and 500,000 more are saved thanks to medications that are derived from blood products. Our repeated appeals to donors are due to the fact that the shelf life of blood products is limited to five days for platelets due to coagulation and to 42 days for blood cells.
This worldwide day of blood donors is even more important since the number of donors has fallen, as it does every year, during the months of April and May, due to the many holidays. It is also necessary to prepare for a decreased frequency of donations during summer vacations. At this time, people are often far from home and don't think about it. For this reason, we try to organize mobile operations, notably at the beach, to remind them of the importance of donating blood. The phenomenon is the same in winter, especially during the Christmas holidays. However, the decrease in donations during this period can be attributed to illness, such as flu and gastrointestinal problems.
. **D** The question asks, "According to the article, the organization:"
(A) No. "Receives 10,000 donations every day." These are familiar words—wrong context. The organization needs that many, but there is no proof that they get that many.
(B) No. "Has never received 10,000 donations in a single day." These are familiar words—wrong context.
(C) No. "Has an immediate need for blood." This is contradicted by the passage that says _nous ne manquons jamais de stocks de sang à court terme._
(D) Yes. "Has enough blood for the immediate future." This is supported by the passage that says _nous ne manquons jamais de stocks de sang à court terme._
. **A** The question asks, "The regular appeals to donors:"
(A) Yes. "Are necessary for several reasons." This is supported by the text that says _la durée de vie des produits sanguins est limitée_.
(B) No. "Make appointments over the telephone." This is confusion over the meaning of _les appels_ in the context of the passage.
(C) No. "Are of little interest." This is not supported by the passage.
(D) No. "Give blood every 42 days." These are familiar words—wrong context.
. **B** The question asks, "This worldwide blood donor's day is important because:"
(A) No. "There was a big festival." These are familiar words—wrong context.
(B) Yes. "As usual, there are fewer donors in springtime." This is supported by the passage that says, _le nombre de dons a chuté, comme chaque année, durant les mois d'avril et de mai_.
(C) No. "Blood donors have whispered to one another." This is confusion between the words _chuter_ and _chuchoter_.
(D) No. "It was during the months of April and May." These are familiar words—wrong context."
. **D** The question asks, "The phrase 'don't think about it' means that people:"
(A) No. "Don't often plan their vacations." These are familiar words—wrong context.
(B) No. "Are often wounded on vacation." These are familiar words—wrong context.
(C) No. "Travel to foreign countries." These are familiar words—wrong context.
(D) Yes. "Don't remember to give blood." This is supported by the pronoun _y_ which refers to that which people think about ( _penser à_ ).
. **C** The question asks, "'The phenomenon' refers to:"
(A) No. "An extraordinary thing." This is a different meaning of the word.
(B) No. "The Christmas holidays." These are familiar words—wrong context.
(C) Yes. "A decrease in donations in December and January." This is supported by the passage that says, _est le même en hiver_.
(D) No. "The frequent illnesses of winter." These are familiar words—wrong context.
The following translation is for questions 74–75.
Here is the recipe for Madeleines, those little oval cookies with a plump center, so dear to Marcel Proust.
The day before, carefully mix the following ingredients until obtaining a perfectly smooth dough:
Madeleines
Flour 90g
Sugar 90g
Yeast 2g
Natural Honey 10g
Eggs 2
Melted Butter 90g
Lemon Zest
Anise (optional) 1 clove
Store the dough in the refrigerator.
The next day, distribute the dough into 12 buttered madeleine molds. Bake in an oven on medium heat until the cookies reach a beautiful golden color. Place them on a cooling rack as soon as you remove them from the oven, let them cool, and enjoy!
. **B** The question asks, "When do you have to prepare the dough for the madeleines?"
(A) No. "The next day." These are familiar words—wrong context.
(B) Yes. "The day before." This is supported by the text that says _la veille_.
(C) No. "Two hours ahead of time." There is no support for this in the passage.
(D) No. "Yesterday." This is too literal.
. **C** The question asks, "According to the recipe, anise is an ingredient which is:"
(A) No. "Necessary." This is contradicted by the passage that says _facultatif_.
(B) No. "Sweet." This is not supported by the passage.
(C) Yes. "Optional." This is a synonym of the word _facultatif_.
(D) No. "Fragrant." While this may be true, this is not supported by the passage.
The following translation is for questions 76–80.
The hunchback reappeared, a brochure in his hands. He settled himself comfortably, elbows on the table, his chin in his hands.
"I already hinted to you," he said, "that I had some really large projects in the works."
"Huge projects."
"It is that exact thing, and I'm going to reveal it to you today." He took on a confidential tone.
"That which brought me here is, above all else, my love of nature. But even though I don't lack money at the moment, I have a family to feed, and I must think about the future of my little girl: this is why, the philosopher in me wanted to reconcile its desire for a natural life and the obligation of figuring out how to earn a fortune.
Throughout this discourse, Ugolin remembered only the last few words. He had the intention of "earning a fortune." Leave earning fortunes to the Romarins! With what? Surely not with these half dead olive trees, nor these agonized almond trees; nor with the vegetables, the wheat, or the wine. Thus he knew about the spring, and he wanted perhaps to plant carnations! That is why, as a hopeless counterattack, he said, "You know, these flowers here, even if you have a good artesian spring..."
"What flowers?" said the hunchback in a surprised tone. You think I want to make it rich selling wild roses and thistles? And what spring? You know that mine is pretty far from here.
. **C** The question asks, "I already hinted to you" means that "I have already":
(A) No. "Told you." This is too explicit.
(B) No. "Repeated to you." This is too explicit.
(C) Yes. "Suggested to you." This is supported by the passage _je vais vous le révéler_.
(D) No. "Lied to you." There is no support for this in the passage.
. **B** The question asks, "The hunchback has big plans because:"
(A) No. "He needs money right away." This is contradicted by the passage that says _je ne manque pas d'argent en ce moment_.
(B) Yes. "He thinks about his daughter's future." This is supported by the passage that says _je dois assurer l'avenir de ma fillette_.
(C) No. "He is a philosopher." These are familiar words—wrong context.
(D) No. "He loves money." These are familiar words—wrong context.
. **A** The question asks, "From the hunchback's speech, Ugolin remembers:"
(A) Yes. "Only the last words." This is supported by the passage that says _De ce discours, Ugolin ne retint que les derniers mots_.
(B) No. "Maybe the first words." This is contradicted in the passage that says _que les derniers mots_.
(C) No. "Always the last sentence." These are familiar words—wrong context.
(D) No. "Everything but the end." These are familiar words—wrong context.
. **B** The question asks, "In lines 18-23, after hearing the hunchback's plans, Ugolin is:"
(A) No. "Amused." This is not supported by the passage.
(B) Yes. "Very worried." This is supported by the passage _Avec quoi?...par une contreattaque d_ és _espérée_.
(C) No. "Full of joy." This is contradicted by the passage that says _désespérée_.
(D) No. "Reassured." This is contradicted by the passage that says _désespérée_.
. **D** The question asks, "Ugolin is trying to find out whether the hunchback:"
(A) No. "Is going to plant a vineyard." These are familiar words—wrong context.
(B) No. "Will save the olive trees and the almond trees." These are familiar words—wrong context.
(C) No. "Is planning to sell thistles." These are familiar words—wrong context.
(D) Yes. "Knew about the existence of the spring." This is supported by the passage that says _il connaissait donc la source_.
The following translation is for questions 81–85.
You understand all of a sudden that the real city is the naval docks, that the city does not exist except to serve it, that the docks overflow into it. Under all forms, in all places, and in all corners reappears the administration, the discipline, the sheet of lined paper, the framework, the rules. One greatly admires the artificial symmetry and the idiotic cleanliness. At the maritime hospital, for example, the rooms are polished to such an extent that a convalescent, trying to walk on his still healing leg, would break the other by falling down. But it's beautiful, it shines, and one gazes at oneself in it. Between each room is a courtyard, but one in which the sun never shines and where the grass is carefully pulled up. The kitchens are truly superb, but at a distance, such that in winter, everything must be icy cold by the time it gets to the patients. It is really all about them! Aren't the casseroles shiny? We saw a man who had cracked his skull by falling from a frigate and who still had not been treated after eighteen hours; but the linens were very white because the linen closet is very well kept.
. **B** The question asks, "'In every place' means:"
(A) No. "Nowhere." This is opposite what the phrase means.
(B) Yes. "Everywhere." This is a synonym of _en tous lieux_.
(C) No. "Somewhere else." This is not supported by the passage.
(D) No. "Somewhere." This is not supported by the passage.
. **D** The question asks, "The convalescent runs the risks of breaking his other leg because the floor is:"
(A) No. "Wet." This is a misunderstanding of the passage. It is slippery due to wax, not liquid.
(B) No. "Uneven." This is not supported by the passage.
(C) No. "Full of holes." This is not supported by the passage.
(D) Yes. "Slippery." This is supported by the passage that says _les salles sont cirées de telle façon...doit se casser l'autre_.
. **D** The question asks, "The courtyard between every room is:"
(A) No. "Full of sun." This is contradicted by the passage that says _le soleil ne vient jamais_.
(B) No. "Without any shade." This is contradicted by the passage that says _le soleil ne vient jamais_.
(C) No. "Sunny." This is contradicted by the passage that says _le soleil ne vient jamais_.
(D) Yes. "Without any sun." This is supported by the passage that says _le soleil ne vient jamais_.
. **D** The question asks, "In winter the patients' meals are served:"
(A) No. "Piping hot." This is contradicted by the passage that says _glacé_.
(B) No. "Lukewarm." This is contradicted by the passage that says _glacé_.
(C) No. "At the right temperature." This is contradicted by the passage that says _glacé_.
(D) Yes. "Very cold." This is supported by the passage that says _glacé_.
. **A** The question asks, "Flaubert's tone in this passage is:"
(A) Yes. "Sarcastic." This is supported throughout the passage, such as when it says _la symétrie factice_ or _la propret_ é _imb_ écile.
(B) No. "Serious." This is opposite the tone of the passage.
(C) No. "Playful." This is not strong enough.
(D) No. "Tragic." There is no evidence of this in the passage.
## **HOW TO SCORE PRACTICE TEST 2**
When you take the real exam, the proctors will collect your test booklet and bubble sheet and send your answer sheet to a processing center where a computer looks at the pattern of filled-in ovals on your answer sheet and gives you a score. We are providing you, however, with this more primitive way of scoring your exam.
### **Determining Your Score**
**STEP 1** Using the answer key, determine how many questions you got right and how many you got wrong on the test. Remember: Questions that you do not answer do not count as either right answers or wrong answers.
**STEP 2** Write the number of correct answers on line A.
(A) __________
**STEP 3** Write the number of wrong answers on line B. Divide that number by 3.
(B) _______÷ 3 = _______
**STEP 4** Subtract the number of wrong answers divided by 3 on line B from the number of correct answers on line A, and round to the nearest whole number. (C) is your **raw score**.
(A)_______– (B) _______= (C) _______
**STEP 5** To determine your **real score** , look up your raw score in the left column of the Score Conversion Table on the next page; the corresponding score on the right is the score you earned on the exam.
## **PRACTICE TEST 2 SCORE CONVERSION TABLE**
**Raw score** | **Scaled score**
---|---
85 | 800
84 | 800
83 | 800
82 | 800
81 | 800
80 | 800
79 | 800
78 | 800
77 | 800
76 | 790
75 | 790
74 | 780
73 | 780
72 | 770
71 | 770
70 | 760
69 | 760
68 | 750
67 | 740
66 | 740
65 | 730
64 | 730
63 | 720
62 | 720
61 | 710
60 | 710
59 | 700
58 | 700
57 | 690
56 | 690
55 | 680
54 | 680
53 | 670
52 | 660
51 | 660
50 | 650
49 | 650
48 | 640
47 | 640
46 | 630
45 | 630
44 | 620
43 | 620
42 | 610
41 | 610
40 | 600
39 | 600
38 | 590
37 | 580
36 | 580
35 | 570
34 | 570
33 | 560
32 | 560
31 | 550
30 | 550
29 | 540
28 | 540
27 | 530
26 | 530
25 | 520
24 | 520
23 | 510
22 | 500
21 | 500
20 | 490
19 | 490
18 | 480
17 | 480
16 | 470
15 | 470
14 | 460
13 | 460
12 | 450
11 | 450
10 | 440
9 | 430
8 | 430
7 | 420
6 | 420
5 | 410
4 | 410
3 | 400
2 | 400
1 | 390
0 | 390
–1 | 380
–2 | 380
–3 | 370
–4 | 360
–5 | 360
–6 | 350
–7 | 350
–8 | 340
–9 | 340
–10 | 330
–11 | 330
–12 | 320
–13 | 320
–14 | 310
–15 | 300
–16 | 290
–17 | 290
–18 | 280
–19 | 280
–20 | 270
–21 | 270
–22 | 260
–23 | 260
–24 | 250
–25 through –28 | 240
# _What's next on
your reading list?_
[Discover your next
great read!](http://links.penguinrandomhouse.com/type/prhebooklanding/isbn/9781524710934/display/1)
* * *
Get personalized book picks and up-to-date news about this author.
Sign up now.
## Contents
1. Cover
2. Title Page
3. Copyright
4. Acknowledgments
5. Contents
6. Get More (Free) Content
7. Part I: Orientation
1. 1: Introduction
1. What Are The SAT Subject Tests?
2. Overall Structure of The Test
2. 2: General Strategy
1. How To Improve
8. Part II: Practice Test 1
1. Practice Test 1
2. Practice Test 1: Answers and Explanations
1. Practice Test 1: Answer Key
2. Practice Test 1: Explanations
3. How to Score Practice Test 1
4. Practice Test 1: Score Conversion Table
9. Part III: Content Review and Strategies
1. 3: Vocabulary
1. Part A: Vocabulary Completions
2. Drill 1
3. If You Know The Words
4. If You Don't Know All The Answer Choices
5. Drill 2
6. If You Don't Understand The Sentence
7. Drill 3
8. Comprehensive Drill
9. Summary
2. 4: Vocabulary Review
1. Boost Your Vocabulary
2. Vocabulary List
3. Summary
3. 5: Grammar Review
1. Part B: Grammar
2. Part C: Complete the Paragraph
3. Know What You Are Looking For
4. Grammar Review
5. Basic Terms
6. Pronouns
7. Drill 1: Pronoun Questions
8. Verbs
9. Avoir and Être in Compound Past Tenses
10. Drill 2: Verb Questions
11. Prepositions
12. Drill 3: Preposition Questions
13. Odds and Ends
14. Special Points for Part C
15. Comprehensive Drill
16. Summary
4. 6: Reading Comprehension
1. Part D: Reading Comprehension
2. Tickets/Schedules/Advertisements
3. Comprehensive Drill
4. Summary
5. 7: French Listening
1. Overall Structure of the Listening Test
2. Listening--Part A: Pictures
3. Listening--Part B: Short Dialogues
4. Listening--Part C: Long Passages
5. Summary
10. Part IV: Drill Answers and Explanations
1. Chapter 3 Drill Answers and Explanations
2. Chapter 5 Drill Answers and Explanations
3. Chapter 6 Drill Answers and Explanations
11. Part V: Practice Test 2
1. Practice Test 2
2. Practice Test 2: Answers and Explanations
1. Practice Test 2: Answer Key
2. Practice Test 2: Explanations
3. How to Score Practice Test 2
4. Practice Test 2: Score Conversion Table
1. i
2. ii
3. iii
4. iv
5. v
6. vi
7. vii
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
1. Cover
2. Cover
3. Title Page
4. Table of Contents
5. Start
|
<reponame>Sheldan/abstracto
package dev.sheldan.abstracto.core.service;
import dev.sheldan.abstracto.core.listener.ListenerService;
import dev.sheldan.abstracto.core.listener.async.entity.AsyncCacheClearingListener;
import dev.sheldan.abstracto.core.models.listener.VoidListenerModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Slf4j
public class CacheServiceBean {
@Autowired(required = false)
private List<AsyncCacheClearingListener> listeners;
@Autowired
private ListenerService listenerService;
@Autowired
@Qualifier("cacheClearedExecutor")
private TaskExecutor cacheClearedExecutor;
public void clearCaches() {
if(listeners == null) return;
log.info("Executing {} cache cleared listeners.", listeners.size());
VoidListenerModel model = VoidListenerModel.builder().build();
listeners.forEach(asyncCacheClearingListener ->
listenerService.executeListener(asyncCacheClearingListener, model, cacheClearedExecutor));
}
}
|
<gh_stars>1-10
package com.github.seratch.jslack.api.model;
import com.github.seratch.jslack.api.model.block.LayoutBlock;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Data
public class MatchedItem {
private String iid;
private String id;
private String team;
private String type;
private Channel channel;
private String user;
private String username;
private String ts;
private String title;
private String text;
private List<Attachment> attachments;
private List<LayoutBlock> blocks;
private String permalink;
private String name;
private String subject;
private String preview;
private String plainText;
private String previewPlainText;
private boolean hasMore;
private boolean sentToSelf;
private boolean noReactions;
private String botId;
private String fileId;
private String externalId;
private String externalUrl;
private String timestamp;
private String created;
@SerializedName("is_intro")
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private boolean intro;
@SerializedName("is_public")
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private boolean _public;
public boolean isPublic() {
return _public;
}
public void setPublic(boolean isPublic) {
this._public = isPublic;
}
private boolean publicUrlShared;
private String urlPrivate;
private boolean urlPrivateDownload;
private boolean permalinkPublic;
private String editLink;
private String previewHighlight;
private Integer lines;
private Integer linesMore;
@SerializedName("preview_is_truncated")
private boolean previewTruncated;
private boolean hasRichPreview;
private String mimetype;
private String filetype;
private String prettyType;
@SerializedName("is_mpim")
private boolean mpim;
@SerializedName("is_external")
private boolean external;
@SerializedName("is_starred")
private boolean starred;
private String externalType;
private boolean editable;
private boolean displayAsBot;
private Integer size;
private String mode;
private String comment;
@SerializedName("previous_2")
private OtherItem previous2;
private OtherItem previous;
private OtherItem next;
@SerializedName("next_2")
private OtherItem next2;
private File.Shares shares;
private List<String> channels;
private List<String> groups;
private List<String> ims;
@SerializedName("thumb_64")
private String thumb64;
@SerializedName("thumb_64_gif")
private String thumb64Gif;
@SerializedName("thumb_64_w")
private String thumb64Width;
@SerializedName("thumb_64_h")
private String thumb64Height;
@SerializedName("thumb_80")
private String thumb80;
@SerializedName("thumb_80_gif")
private String thumb80Gif;
@SerializedName("thumb_80_w")
private String thumb80Width;
@SerializedName("thumb_80_h")
private String thumb80Height;
@SerializedName("thumb_160")
private String thumb160;
@SerializedName("thumb_160_gif")
private String thumb160Gif;
@SerializedName("thumb_160_w")
private String thumb160Width;
@SerializedName("thumb_160_h")
private String thumb160Height;
@SerializedName("thumb_360")
private String thumb360;
@SerializedName("thumb_360_gif")
private String thumb360Gif;
@SerializedName("thumb_360_w")
private String thumb360Width;
@SerializedName("thumb_360_h")
private String thumb360Height;
@SerializedName("thumb_480")
private String thumb480;
@SerializedName("thumb_480_gif")
private String thumb480Gif;
@SerializedName("thumb_480_w")
private String thumb480Width;
@SerializedName("thumb_480_h")
private String thumb480Height;
@SerializedName("thumb_720")
private String thumb720;
@SerializedName("thumb_720_gif")
private String thumb720Gif;
@SerializedName("thumb_720_w")
private String thumb720Width;
@SerializedName("thumb_720_h")
private String thumb720Height;
@SerializedName("thumb_800")
private String thumb800;
@SerializedName("thumb_800_gif")
private String thumb800Gif;
@SerializedName("thumb_800_w")
private String thumb800Width;
@SerializedName("thumb_800_h")
private String thumb800Height;
@SerializedName("thumb_960")
private String thumb960;
@SerializedName("thumb_960_gif")
private String thumb960Gif;
@SerializedName("thumb_960_w")
private String thumb960Width;
@SerializedName("thumb_960_h")
private String thumb960Height;
@SerializedName("thumb_1024")
private String thumb1024;
@SerializedName("thumb_1024_gif")
private String thumb1024Gif;
@SerializedName("thumb_1024_w")
private String thumb1024Width;
@SerializedName("thumb_1024_h")
private String thumb1024Height;
private String thumbTiny;
private String thumbPdf;
@SerializedName("thumb_pdf_w")
private String thumbPdfWidth;
@SerializedName("thumb_pdf_h")
private String thumbPdfHeight;
private Integer imageExifRotation;
@SerializedName("original_w")
private String originalWidth;
@SerializedName("original_h")
private String originalHeight;
private String score;
private boolean topFile;
private String deanimateGif;
private String channelActionsTs;
private Integer channelActionsCount;
@Data
public static class OtherItem {
private String iid;
private String type;
private String user;
private String username;
private String ts;
private String text;
private List<Attachment> attachments;
private List<LayoutBlock> blocks;
private String permalink;
}
private List<Address> to;
private List<Address> from;
private List<Address> cc;
@Data
public static class Address {
private String address;
private String name;
private String original;
}
}
|
/**
* Shows all of the applications by playing an animation on the grid.
*/
private void showApplications(boolean animate) {
if (mBlockAnimation) {
return;
}
mBlockAnimation = true;
if (mShowLayoutAnimation == null) {
mShowLayoutAnimation = AnimationUtils.loadLayoutAnimation(
this, R.anim.show_applications);
}
if (animate) {
}
mRcRecyclerView.setVisibility(View.VISIBLE);
if (!animate) {
mBlockAnimation = false;
}
} |
/**
* Serve a read request of arbitrary size at an arbitrary offset.
* Stitches together multiple blocks to serve large requests, drops
* data from the front of the first block if the request is not aligned.
* Always requests aligned data of the size of one block or less from the
* lower layer.
* Returns the number of bytes read, or -errno in case of failure.
*/
ssize_t BlockFileIO::read(const IORequest &req) const {
CHECK(_blockSize != 0);
int partialOffset =
req.offset % _blockSize;
off_t blockNum = req.offset / _blockSize;
ssize_t result = 0;
if (partialOffset == 0 && req.dataLen <= _blockSize) {
return cacheReadOneBlock(req);
}
size_t size = req.dataLen;
MemBlock mb;
IORequest blockReq;
blockReq.dataLen = _blockSize;
blockReq.data = nullptr;
unsigned char *out = req.data;
while (size != 0u) {
blockReq.offset = blockNum * _blockSize;
if (partialOffset == 0 && size >= _blockSize) {
blockReq.data = out;
} else {
if (mb.data == nullptr) {
mb = MemoryPool::allocate(_blockSize);
}
blockReq.data = mb.data;
}
ssize_t readSize = cacheReadOneBlock(blockReq);
if (readSize < 0) {
result = readSize;
break;
}
if (readSize <= partialOffset) {
break;
}
size_t cpySize = min((size_t)readSize - (size_t)partialOffset, size);
CHECK(cpySize <= (size_t)readSize);
if (blockReq.data != out) {
memcpy(out, blockReq.data + partialOffset, cpySize);
}
result += cpySize;
size -= cpySize;
out += cpySize;
++blockNum;
partialOffset = 0;
if ((size_t)readSize < _blockSize) {
break;
}
}
if (mb.data != nullptr) {
MemoryPool::release(mb);
}
return result;
} |
def getNext(s):
l=len(s)-1
lg=len(s)
while(l>=0 and s[l]=='Z'):l=l-1
if l<0 : return 'A'*(lg+1)
s=s[:l]+chr(ord(s[l])+1)+'A'*(lg-l-1)
return s
def isRC(s):
ct=0
for i in range(1,len(s)):
if(s[i].isdigit() and s[i-1].isalpha()):ct=ct+1
if(ct>1):return True
return False
def com(s1,s2):
if (s1==s2):return 0
if(len(s1)>len(s2)):return 1
if(len(s1)<len(s2)):return -1
if(s1>s2):return 1
return -1
def bsearch(Array,s,l,r):
c=(l+r)/2
if(com(s,Array[c])==0):return c
if(com(s,Array[c])>0):return bsearch(Array,s,c+1,r)
if(com(s,Array[c])<0):return bsearch(Array,s,l,c-1)
#main
ToA=[0]*1000002
s='A'
for i in range(1,1000002):
ToA[i]=s
s=getNext(s)
n=int(raw_input())
for i in range(0,n):
s=raw_input()
if(isRC(s)):
numbers=[int(x) for x in s.split('R')[1].split('C')]
print ToA[numbers[1]]+str(numbers[0])
else:
Aindex=0
while(s[Aindex].isalpha()):Aindex=Aindex+1
print 'R'+s[Aindex:]+'C'+str(bsearch(ToA,s[:Aindex],1,1000001))
|
/*
!==========================================================================
elemental function gsw_pt_from_pot_enthalpy_ice (pot_enthalpy_ice)
!==========================================================================
!
! Calculates the potential temperature of ice from the potential enthalpy
! of ice. The reference sea pressure of both the potential temperature
! and the potential enthalpy is zero dbar.
!
! pot_enthalpy_ice = potential enthalpy of ice [ J/kg ]
!
! pt0_ice = potential temperature of ice (ITS-90) [ deg C ]
!--------------------------------------------------------------------------
*/
double
gsw_pt_from_pot_enthalpy_ice(double pot_enthalpy_ice)
{
int iteration;
double df_dt, f, mod_pot_enthalpy_ice, pt0_cold_ice, recip_df_dt,
pt0_cold_ice_old, pt0_ice, pt0_ice_old, ptm_cold_ice, ptm_ice;
double h00 = -6.320202333358860e5,
p0 = 0.0;
mod_pot_enthalpy_ice = max(pot_enthalpy_ice,h00);
if (mod_pot_enthalpy_ice >= -5.1e5) {
pt0_ice = gsw_pt_from_pot_enthalpy_ice_poly(mod_pot_enthalpy_ice);
recip_df_dt =
gsw_pt_from_pot_enthalpy_ice_poly_dh(mod_pot_enthalpy_ice);
pt0_ice_old = pt0_ice;
f = gsw_pot_enthalpy_from_pt_ice(pt0_ice_old)
- mod_pot_enthalpy_ice;
pt0_ice = pt0_ice_old - f*recip_df_dt;
ptm_ice = 0.5*(pt0_ice + pt0_ice_old);
recip_df_dt = 1.0/gsw_cp_ice(ptm_ice,p0);
pt0_ice = pt0_ice_old - f*recip_df_dt;
} else {
pt0_cold_ice = gsw_pt0_cold_ice_poly(mod_pot_enthalpy_ice);
df_dt = gsw_cp_ice(pt0_cold_ice+0.02,p0);
for (iteration = 1; iteration <= 6; iteration++) {
pt0_cold_ice_old = pt0_cold_ice;
f = gsw_pot_enthalpy_from_pt_ice(pt0_cold_ice_old)
- mod_pot_enthalpy_ice;
pt0_cold_ice = pt0_cold_ice_old - f/df_dt;
ptm_cold_ice = 0.5*(pt0_cold_ice + pt0_cold_ice_old);
df_dt = gsw_cp_ice(ptm_cold_ice+0.02,p0);
pt0_cold_ice = pt0_cold_ice_old - f/df_dt;
}
pt0_ice = pt0_cold_ice;
}
return (pt0_ice);
} |
/**
* This call will do validation for all incoming request data.
*
* @author Manzarul
*/
public final class RequestValidator {
private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();
private RequestValidator() {}
/**
* This method will validate bulk user upload requested data.
*
* @param reqObj Request
*/
public static void validateUploadUser(Map<String, Object> reqObj) {
if (StringUtils.isBlank((String) reqObj.get(JsonKey.ORGANISATION_ID))
&& (StringUtils.isBlank((String) reqObj.get(JsonKey.ORG_EXTERNAL_ID))
|| StringUtils.isBlank((String) reqObj.get(JsonKey.ORG_PROVIDER)))) {
throw new ProjectCommonException(
ResponseCode.mandatoryParamsMissing.getErrorCode(),
ProjectUtil.formatMessage(
ResponseCode.mandatoryParamsMissing.getErrorMessage(),
(ProjectUtil.formatMessage(
ResponseMessage.Message.OR_FORMAT,
JsonKey.ORGANISATION_ID,
ProjectUtil.formatMessage(
ResponseMessage.Message.AND_FORMAT,
JsonKey.ORG_EXTERNAL_ID,
JsonKey.ORG_PROVIDER)))),
ERROR_CODE);
}
if (null == reqObj.get(JsonKey.FILE)) {
throw new ProjectCommonException(
ResponseCode.mandatoryParamsMissing.getErrorCode(),
ProjectUtil.formatMessage(
ResponseCode.mandatoryParamsMissing.getErrorMessage(), JsonKey.FILE),
ERROR_CODE);
}
}
public static void validateSyncRequest(Request request) {
if (request.getRequest().get(JsonKey.OBJECT_TYPE) == null) {
throw new ProjectCommonException(
ResponseCode.dataTypeError.getErrorCode(),
ResponseCode.dataTypeError.getErrorMessage(),
ERROR_CODE);
}
List<String> list =
new ArrayList<>(
Arrays.asList(new String[] {JsonKey.USER, JsonKey.ORGANISATION, JsonKey.LOCATION}));
if (!list.contains(request.getRequest().get(JsonKey.OBJECT_TYPE))) {
throw new ProjectCommonException(
ResponseCode.invalidObjectType.getErrorCode(),
ResponseCode.invalidObjectType.getErrorMessage(),
ERROR_CODE);
}
}
public static void validateSendMail(Request request) {
if (StringUtils.isBlank((String) request.getRequest().get(JsonKey.SUBJECT))) {
throw new ProjectCommonException(
ResponseCode.emailSubjectError.getErrorCode(),
ResponseCode.emailSubjectError.getErrorMessage(),
ERROR_CODE);
}
if (StringUtils.isBlank((String) request.getRequest().get(JsonKey.BODY))) {
throw new ProjectCommonException(
ResponseCode.emailBodyError.getErrorCode(),
ResponseCode.emailBodyError.getErrorMessage(),
ERROR_CODE);
}
if (CollectionUtils.isEmpty((List<String>) (request.getRequest().get(JsonKey.RECIPIENT_EMAILS)))
&& CollectionUtils.isEmpty(
(List<String>) (request.getRequest().get(JsonKey.RECIPIENT_USERIDS)))
&& MapUtils.isEmpty(
(Map<String, Object>) (request.getRequest().get(JsonKey.RECIPIENT_SEARCH_QUERY)))
&& CollectionUtils.isEmpty(
(List<String>) (request.getRequest().get(JsonKey.RECIPIENT_PHONES)))) {
throw new ProjectCommonException(
ResponseCode.mandatoryParamsMissing.getErrorCode(),
MessageFormat.format(
ResponseCode.mandatoryParamsMissing.getErrorMessage(),
StringFormatter.joinByOr(
StringFormatter.joinByComma(
JsonKey.RECIPIENT_EMAILS,
JsonKey.RECIPIENT_USERIDS,
JsonKey.RECIPIENT_PHONES),
JsonKey.RECIPIENT_SEARCH_QUERY)),
ERROR_CODE);
}
}
public static void validateFileUpload(Request reqObj) {
if (StringUtils.isBlank((String) reqObj.get(JsonKey.CONTAINER))) {
throw new ProjectCommonException(
ResponseCode.storageContainerNameMandatory.getErrorCode(),
ResponseCode.storageContainerNameMandatory.getErrorMessage(),
ERROR_CODE);
}
}
/**
* Method to validate not for userId, title, note, courseId, contentId and tags
*
* @param request
*/
@SuppressWarnings("rawtypes")
public static void validateNote(Request request) {
if (StringUtils.isBlank((String) request.get(JsonKey.USER_ID))) {
throw new ProjectCommonException(
ResponseCode.userIdRequired.getErrorCode(),
ResponseCode.userIdRequired.getErrorMessage(),
ERROR_CODE);
}
if (StringUtils.isBlank((String) request.get(JsonKey.TITLE))) {
throw new ProjectCommonException(
ResponseCode.titleRequired.getErrorCode(),
ResponseCode.titleRequired.getErrorMessage(),
ERROR_CODE);
}
if (StringUtils.isBlank((String) request.get(JsonKey.NOTE))) {
throw new ProjectCommonException(
ResponseCode.noteRequired.getErrorCode(),
ResponseCode.noteRequired.getErrorMessage(),
ERROR_CODE);
}
if (StringUtils.isBlank((String) request.get(JsonKey.CONTENT_ID))
&& StringUtils.isBlank((String) request.get(JsonKey.COURSE_ID))) {
throw new ProjectCommonException(
ResponseCode.contentIdError.getErrorCode(),
ResponseCode.contentIdError.getErrorMessage(),
ERROR_CODE);
}
if (request.getRequest().containsKey(JsonKey.TAGS)
&& ((request.getRequest().get(JsonKey.TAGS) instanceof List)
&& ((List) request.getRequest().get(JsonKey.TAGS)).isEmpty())) {
throw new ProjectCommonException(
ResponseCode.invalidTags.getErrorCode(),
ResponseCode.invalidTags.getErrorMessage(),
ERROR_CODE);
} else if (request.getRequest().get(JsonKey.TAGS) instanceof String) {
throw new ProjectCommonException(
ResponseCode.invalidTags.getErrorCode(),
ResponseCode.invalidTags.getErrorMessage(),
ERROR_CODE);
}
}
/**
* Method to validate noteId
*
* @param noteId
*/
public static void validateNoteId(String noteId) {
if (StringUtils.isBlank(noteId)) {
throw createExceptionInstance(ResponseCode.invalidNoteId.getErrorCode());
}
}
private static ProjectCommonException createExceptionInstance(String errorCode) {
return new ProjectCommonException(
ResponseCode.getResponse(errorCode).getErrorCode(),
ResponseCode.getResponse(errorCode).getErrorMessage(),
ERROR_CODE);
}
} |
def geo_file_info(self):
if not libFile.exists(self.geoListPath):
raise RuntimeError("No geo has been exported to this path")
return libFile.load_json(self.geoListPath) |
/**
* Simple logger for gRPC outgoing calls before they are dispatched by a {@link Channel}.
*/
@Slf4j
public class LogClientInterceptor implements ClientInterceptor {
@Override
public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT, RespT> method,
CallOptions callOptions, Channel next) {
logger.info("gRPC outgoing call to {}", method.getFullMethodName());
return next.newCall(method, callOptions);
}
} |
/**
* prepare some tables for testing.
*/
public void registerTables() {
registerTable("create table MyTable (a int, b bigint, c varchar(32)) " +
"with ('connector' = 'filesystem', 'path' = '/non')");
registerTable("create table MyOtherTable (a int, b bigint) " +
"with ('connector' = 'filesystem', 'path' = '/non')");
registerTable("create table MySink (a int, c varchar(32)) with ('connector' = 'COLLECTION' )");
registerTable("create view MyView as select * from MyTable");
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.