Q:

incomplete download of file from url in java - using java NIO

I used the code provided in accepted solution of below thread to download a 500kb zip file
How to download and save a file from Internet using Java?
public static File  downloadFile(String fileURL, String saveDir)
        throws IOException {

    File downloadFolder = null;
    String saveFilePath = null;

    URL url = new URL(fileURL);
   ReadableByteChannel rbc = Channels.newChannel(url.openStream());
   String    fileName = fileURL.substring(fileURL.lastIndexOf("/") + 1, fileURL.length());
   FileOutputStream fos = new FileOutputStream(fileName);

   saveFilePath = saveDir + File.separator + fileName;
   downloadFolder = new File(saveDir);

   downloadFolder.deleteOnExit();
   downloadFolder.mkdirs();

   FileOutputStream outputStream = new FileOutputStream(saveFilePath);
   outputStream.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);

   outputStream.close();
  rbc.close();
    return new File(saveFilePath);
}

The code is able to identify the file but the the problem is , the download is incomplete. It always downloads 5KB and stops there after.
I dont want to use apache commons file untils.

A:

The problem was that I didn't set authentication. I set the authentication and it worked. code below
public static File  downloadFile(String fileURL, String saveDir)
    throws IOException {

File downloadFolder = null;
String saveFilePath = null;

String username = "guest";
String password = "guest";

String usepass = username + ":" + password;
String basicAuth = "Basic "+  javax.xml.bind.DatatypeConverter.printBase64Binary(usepass.getBytes());

URL url = new URL(fileURL);
HttpURLConnection httpConn = (HttpURLConnection) website.openConnection();
httpConn.setRequestProperty("Authorization", basicAuth);

ReadableByteChannel rbc = Channels.newChannel(httpConn.getInputStream());
String    fileName = fileURL.substring(fileURL.lastIndexOf("/") + 1,fileURL.length());
FileOutputStream fos = new FileOutputStream(fileName);

saveFilePath = saveDir + File.separator + fileName;
downloadFolder = new File(saveDir);

downloadFolder.deleteOnExit();
downloadFolder.mkdirs();

FileOutputStream outputStream = new FileOutputStream(saveFilePath);
outputStream.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);

outputStream.close();
rbc.close();
return new File(saveFilePath);

}


Fuel pressure regulators have been disposed in various portions of vehicle fuel delivery systems to regulate the pressure of fuel delivered to an operating engine. In return type fuel systems, a fuel pressure regulator is typically disposed downstream of the engine fuel injectors and often on the engine fuel rail and fuel delivered in excess of the engine's fuel demand is returned by the fuel pressure regulator to the fuel tank through a return fuel line. In "return less" or no return type fuel systems, a fuel pressure regulator is disposed upstream of the engine and usually within the fuel tank immediately downstream of the fuel pump to bypass excess fuel delivered from the fuel pump into the fuel tank.
Fuel filters may be disposed downstream of the fuel pump as well to remove contaminants from the fuel delivered to the engine. Generally, fuel flow through the filter results in a pressure loss the magnitude of which increases as the fuel filter becomes increasingly clogged during use. Thus, it is preferable to regulate the pressure of the fuel downstream of any in-line fuel filter to remove the affects of the fuel filter on the pressure of fuel supplied to the engine.
One fuel system, as disclosed in U.S. Pat. No. 5,520,156, disposes an annular fuel filter in a depending skirt of a body attached to the fuel tank such that the fuel filter is immediately downstream of the fuel pump and the fuel delivered from the fuel pump flows through the fuel filter before being discharged from the fuel tank to an engine through a fuel line. In this fuel system, a fuel line connector and filter housing cap is removably received in the body and releasably retained by a ring threadably received on the body.
U.S. Pat. No. 5,433,241 discloses a module mounted on a fuel tank with an outer body receiving a fuel pressure regulator downstream of a fuel pump in the fuel tank. An inner body having an outlet through which fuel flows to a fuel line for delivery to the engine is disposed within the outer body to enclose a fuel filter therein. The inner body is press fit into the outer body with an O-ring between them to provide a seal.
Despite disposing one or more O-rings between the various members of these multiple piece assemblies, fuel vapors permeate the seals and escape from the fuel tank through the assemblies. The leaking hydrocarbon fuel vapors are hazardous to the environment and unacceptable under increasingly strict governmental regulations. Further, the multiple piece assemblies have a reduced strength and are subject to leaking liquid fuel as well as fuel vapors upon impact, such a during a vehicle accident.


I[NTRODUCTION]{.smallcaps} {#sec1-1}
==========================

Cholecystitis can occur suddenly, with symptoms such as fever along with intense pain in the right upper quadrant.\[[@ref1]\] Laparoscopic cholecystectomy (LC) has now become the gold standard for the treatment of symptomatic gallstones.\[[@ref2][@ref3]\] LC may be rendered difficult by various challenges encountered during surgery such as difficulties in accessing the peritoneal cavity, creating a pneumoperitoneum, dissecting the gallbladder, or extracting the excised gallbladder.\[[@ref4]\] Various parameters have been studied extensively to analyze their effects on LC, starting from a single variable to up to 34 parameters which include age, sex, acute attack requiring hospitalization, previous abdominal surgeries, presence of palpable gallbladder mass, presence of an abdominal scar, and BMI of the patient. Age is recognized as a risk factor for conversion, perhaps due to a long history of gallstone and increased number of cholecystitis attacks.\[[@ref5]\] It has been observed that surgeons encountered difficulties while performing LC when there are dense adhesions at Calot\'s triangle, fibrotic and contracted gallbladder, acutely inflamed or gangrenous gallbladder and cholycystoenteric fistula, etc.\[[@ref6]\] Various available literature suggest that male gender is a high-risk factor for difficult LC. Previous upper abdominal surgery has been listed as a poor predictor for safe LC because of adhesion formations. It may also pose a problem in creating pneumoperitoneum, thus making LC difficult.\[[@ref7][@ref8][@ref9]\]

Abdominal ultrasound has become a reliable, quick, and noninvasive tool to diagnose gallstone disease.\[[@ref10]\] Apart from its value in diagnosis, its findings may also predict the degree of difficulty involved in the procedure. One of the important ultrasonographic findings is maximum gallbladder wall thickness of \>4 mm which indicates a contracted fibrotic gallbladder which is difficult to grasp. Apart from this, ultrasound also demonstrates a porcelain gall bladder, gallbladder-containing large impacted stone, especially in Hartmann\'s pouch. Pericholecystic collection implies inflammation around the gallbladder which makes LC difficult.\[[@ref11]\]

History of previous attacks, nonvisualization of the gallbladder, pericholecystic, and peripancreatic fluid are associated with a significant inflammatory process that causes difficulty in the dissection of Calot\'s triangle and adhesiolysis.\[[@ref12]\]

Abnormal liver function tests and elevated amylase may signify ongoing hepatitis, cholangitis, and pancreatitis that pose difficulty in dissection due to edema.\[[@ref13]\]

This study was designed to know the preoperative safe predictors for LC based on various parameters which include age, sex, acute attack requiring hospitalization, deranged liver functions, and ultrasonographic findings. The level of difficulty predicted preoperatively based on these parameters was compared with the actual challenges encountered during the laparoscopic procedure. During the procedure, the level of difficulty encountered was categorized by developing a scoring system \[[Table 1](#T1){ref-type="table"}\], which is expected to help surgeons in making unbiased standard predictions.

######

Local grading

  Grading                           Parameters
  --------------------------------- ---------------------
  Easy                              Time taken \<60 min
  No injury to duct or artery
  No conversion to open
  Reasonably easy                   Time taken \>60 min
  No Injury to duct or artery
  No conversion to open
  Moderately difficult              Time taken \<60 min
  Injury to duct or artery
  No conversion to open
  Difficult                         Time taken \>60 min
  Injury to duct or artery
  No conversion to open
  Very difficult                    Time taken \>60 min
  No Injury to duct or artery
  Conversion to an open procedure
  Severely difficult                Time taken \>60 min
  Injury to duct or artery
  Conversion to an open procedure

M[ATERIALS AND]{.smallcaps} M[ETHODS]{.smallcaps} {#sec1-2}
=================================================

This prospective study was conducted on 100 patients of either sex and of all age groups with a diagnosis of cholecystitis, over a 2-year period from January 1, 2017, to December 31, 2018. Preoperatively, a thorough history and physical examination were done in all patients. All required investigations, including Complete Blood Count (CBC), liver function tests, renal function tests, coagulation profile, serum amylase, serum lipase, and ultrasonography (USG), were carried out. LC was carried out, and intra-operative details were observed. Scores were given \[[Table 1](#T1){ref-type="table"}\], based on various parameters, which included time taken for the procedure, biliary or stone spilling, injury to the duct or artery, and conversion to open cholecystectomy, were recorded on a predesigned pro forma.

Inclusion criteria {#sec2-1}
------------------

Patients with cholecystitis confirmed by USG for the presence of gallstones.

Exclusion criteria {#sec2-2}
------------------

Patients with mass formation after an attack of acute cholecystitisPatients having coagulation disordersPregnant patientsPatients not giving consent or unfit for general anesthesia.

Various parameters {#sec2-3}
------------------

Various parameters such as age, sex, previous attacks, previous surgery, deranged liver function tests, contracted or distended gallbladder, pericholecystic fluid, multiple stones, and gangrenous gallbladder were analyzed for predicting safe LC.

Chi-square test and *P* value were used to determine the statistical significance.

R[ESULTS]{.smallcaps} {#sec1-3}
=====================

Age {#sec2-4}
---

Minimum age of the patient undergoing LC was 22 years, and the maximum was 70 years. In the present study, 75% were in the age group of 31--60 years and the mean age was 43.44 ± 1.13 years \[[Table 2](#T2){ref-type="table"}\]. On analyzing the age data statistically \[[Table 3](#T3){ref-type="table"}\], it was observed that the preoperative prediction was correct in 100.0% of cases predicted as easy in the age group of ≤65 years, whereas 25.0% of the cases were correctly predicted as difficult in the age group of \>65 years.

######

Age-wise distribution of patients

  Age groups (years)   Number of patients (%)
  -------------------- ------------------------
  21-30                18 (18.0)
  31-40                31 (31.0)
  41-50                27 (27.0)
  51-60                15 (15.0)
  61-70                9 (9.0)
  \>70                 0 (0.0)
  Total                100 (100.0)
  Mean age             43.44±1.13
  Range                22-70

######

Correlation of age with peroperative outcome

  Age group (years)   Outcome, *n* (%)   Total, *n* (%)
  ------------------- ------------------ ------------------ ---------- ---------- --------- --------- -----------
  ≤65                 71 (100)           11 (78.6)          5 (83.3)   3 (75.0)   3 (100)   2 (100)   95 (95.0)
  \>65                0 (0.0)            3 (21.4)           1 (16.7)   1 (25.0)   0 (0.0)   0 (0.0)   5 (5.0)
  Total               71 (100)           14 (100)           6 (100)    4 (100)    3 (100)   2 (100)   100 (100)

  ***χ*^2^**          ***P***            **Significance**

  17.043              0.004              HS

HS: Highly significant

Sex {#sec2-5}
---

In the present study, 79.0% were female \[[Table 4](#T4){ref-type="table"}\]. It was observed that of 79 females, 4 cases were found to be moderately difficult, 2 cases were found to be difficult, and 1 case was found to be very difficult as per the criteria in this study. While in males, of 21 cases, 2 were found to be moderately difficult, 2 were found to be difficult, and 2 were found to be very difficult.

######

Sex distribution of patients

  Sex distribution   Number of patients (%)
  ------------------ ------------------------
  Male               21 (21.0)
  Female             79 (79.0)
  Total              100 (100)

Previous attacks of cholecystitis {#sec2-6}
---------------------------------

Twenty-four cases had a history of previous attacks of cholecystitis ranging from mild-to-moderate intensity lasting for 1--2 days. Eight patients were hospitalized and treated with parenteral medications for 2--3 days. On analyzing the data statistically \[[Table 5](#T5){ref-type="table"}\], of 24 cases who had previous attacks, 5 came out to be moderately difficult; whereas of 76 cases that never had any previous attack, one came out to be moderately difficult.

######

Previous attacks of cholecystitis

  Previous attacks   Outcome, *n* (%)   Total, *n* (%)
  ------------------ ------------------ ------------------ ---------- ---------- ---------- ---------- -----------
  Yes                4 (5.6)            11 (78.6)          5 (83.3)   2 (50.0)   1 (33.3)   1 (50.0)   24 (24.0)
  No                 67 (88.2)          3 (21.4)           1 (16.7)   2 (50.0)   2 (66.7)   1 (50.0)   76 (76.0)
  Total              71 (100)           14 (100)           6 (100)    4 (100)    3 (100)    2 (100)    100 (100)

  ***χ*^2^**         ***P***            **Significance**

  49.935             \<0.001            HS

HS: Highly significant

Deranged liver function tests {#sec2-7}
-----------------------------

About 83.3% of the patients predicted as moderately difficult and 66.7% of the patients predicted as very difficult peroperatively had deranged liver function tests \[[Table 6](#T6){ref-type="table"}\].

######

Deranged liver function tests

  Deranged LFT   Outcome, *n* (%)   Total, *n* (%)
  -------------- ------------------ ------------------ ---------- --------- ---------- --------- -----------
  Yes            2 (2.8)            12 (85.7)          5 (83.3)   4 (100)   2 (66.7)   2 (100)   27 (27.0)
  No             69 (97.2)          2 (14.3)           1 (16.7)   0 (0.0)   1 (33.3)   0 (0.0)   73 (73.0)
  Total          71 (100)           14 (100)           6 (100)    4 (100)   3 (100)    2 (100)   100 (100)

  ***χ*^2^**     ***P***            **Significance**

  73.831         \<0.001            HS

LFT: Liver function test, HS: Highly significant

Ultrasonographic findings {#sec2-8}
-------------------------

On analyzing the data statistically \[[Table 7](#T7){ref-type="table"}\], 25.0% of the patients predicted as difficult peroperatively and 66.7% of the patients predicted as very difficult peroperatively had contracted gallbladder on ultrasound and 25.0% of the patients predicted as difficult peroperatively and 33.3% of the patients predicted as very difficult peroperatively had distended gallbladder on ultrasound, whereas 85.9% of the patients predicted as easy preoperatively had normal gallbladder distension. On analyzing the data statistically \[[Table 8](#T8){ref-type="table"}\], 33.3% of the patients predicted as moderately difficult peroperatively had pericholecystic fluid on ultrasound and 66.7% of the patients predicted as moderately difficult peroperatively had no pericholecystic fluid on ultrasound.

######

Ultrasonographic findings

  Ultrasonographic findings   Outcome, *n* (%)   Total, *n* (%)
  --------------------------- ------------------ ------------------ ---------- ---------- ---------- ---------- -----------
  Contracted                  4 (5.6)            6 (42.9)           1 (16.7)   1 (25.0)   2 (66.7)   1 (50.0)   15 (15.0)
  Distended                   6 (8.5)            7 (50.0)           4 (66.7)   1 (25.0)   1 (33.3)   0 (0.0)    19 (19.0)
  No                          61 (85.9)          1 (7.1)            1 (16.7)   2 (50.0)   0 (0.0)    1 (50.0)   66 (66.0)
  Total                       71 (100)           14 (100)           6 (100)    4 (100)    3 (100)    2 (100)    100 (100)

  ***χ*^2^**                  ***P***            **Significance**

  53.880                      \<0.001            HS

HS: Highly significant

######

Pericholecystic fluid

  Pericholecystic fluid   Outcome, *n* (%)   Total, *n* (%)
  ----------------------- ------------------ ------------------ ---------- ---------- --------- --------- -----------
  Yes                     4 (5.6)            11 (78.6)          2 (33.3)   2 (50.0)   3 (100)   2 (100)   24 (24.0)
  No                      67 (94.4)          3 (21.4)           4 (66.7)   2 (50.0)   0 (0.0)   0 (0.0)   76 (76.0)
  Total                   71 (100)           14 (100)           6 (100)    4 (100)    3 (100)   2 (100)   100 (100)

  ***χ*^2^**              ***P***            **Significance**

  53.590                  \<0.001            HS

HS: Highly significant

D[ISCUSSION]{.smallcaps} {#sec1-4}
========================

In the present study, 75% of patients were in the age group of 31--60 years and the mean age was 43.44 ± 1.13 years. This can be explained by the fact that the study was conducted on patients of symptomatic cholelithiasis undergoing LC, which is a disease of the middle age. On analyzing the age data statistically \[[Table 3](#T3){ref-type="table"}\], it was observed that the preoperative prediction was correct in 100.0% of cases predicted as easy in the age group of ≤65 years, whereas 25.0% of the cases were correctly predicted as difficult in the age group of \>65 years. It was observed that older age (\>65 years) was a significant risk factor for difficult LC (*P* = 0.004). The increase in difficulty with age has been reported by many authors. Kanaan *et al.*\[[@ref14]\] gave older male as one of the main factors of conversion of LC to open cholecystectomy. Our results were similar in comparison to the other studies by Kanaan *et al.*\[[@ref14]\] and Gabriel *et al.*\[[@ref15]\] with age \> 65 years being a significant risk factor. However, Gupta *et al.*\[[@ref16]\] and Fried *et al.*\[[@ref17]\] in their study had found that age was not a significant factor.

In our study, 79.0% of the patients were female. This higher incidence in females can be attributed to the fact that cholelithiasis is more common in females. In analyzing the data, it was found that the preoperative prediction in females was correct in 88.7% of the cases predicted as easy, whereas in males, preoperative prediction for difficulty was correct for 50.0% of cases and for a very difficult challenge was correct for 66.7% of cases. Although cholelithiasis is more common in females, males had higher risks of having difficult LC due to more intense inflammation or fibrosis to result into a difficult dissection in the Calot\'s triangle and the gallbladder bed as was reported by Lein and Huang.\[[@ref7]\]

We found that of 24 cases who had previous attacks, 5 came out to be moderately difficult. A significant correlation was seen between previous attacks of cholecystitis and some difficulties encountered during LC. Like the present study, many researchers such as Gabriel *et al.*,\[[@ref17]\] Gupta *et al.*\[[@ref16]\] and Nachnani and Supe\[[@ref18]\] had found that the history of the previous hospitalization was a predictor for difficult cholecystectomy and higher conversion rate due to dense fibrotic adhesions, bleeding, and ductal injuries.

The deranged liver function tests and elevated serum amylase (ongoing cholangitis, hepatitis, and pancreatitis) were significant predictors for difficult LC (Chi-square = 73.831) and (*P* \< 0.001), due to difficult dissection because of edema, and this finding was in accordance with the study of Alponat *et al.*\[[@ref13]\]

The USG findings such as contracted gallbladder, distended gallbladder, multiple stones, and pericholecystic collection were observed significant risk factors (Chi-square = 53.880), (*P* \< 0.001), because these factors caused significant difficulty in grasping of gallbladder, adhesiolysis as well as dissection of Calot\'s triangle and dissection of gallbladder from liver bed. These findings are consistent with observations of Singh and Ohri.\[[@ref19]\]

C[ONCLUSIONS]{.smallcaps} {#sec1-5}
=========================

LC has become the gold standard in the treatment of symptomatic gallstone disease. Elderly patients are more likely to have a difficult LC. Cholecystitis is more common in females, but difficulties are encountered more frequently while performing LC in males. Patients with recurrent cholecystitis tend to have more difficulties during surgery. Abnormal serum hepatic and pancreatic enzyme profiles are associated with difficulty in surgery. The preoperative USG can well predict difficulties during LC. Features like distended or contracted gallbladder are associated with subsequent difficulties during the surgery.

LC though mostly safe and uneventful can be difficult at times. What an inexperienced laparoscopic surgeon may consider difficult, the experienced laparoscopic surgeon may consider that to be very simple. With increasing experience selection criteria for LC has become more liberal, it is being used in more and more earlier contraindicated situations. In these circumstances, a lot of problems can be avoided by correct preoperative prediction of difficult cholecystectomy.

Financial support and sponsorship {#sec2-9}
---------------------------------

Nil.

Conflicts of interest {#sec2-10}
---------------------

There are no conflicts of interest.


-7/2
((-5)/10)/(3375/(-900))
2/15
(932/(-4893))/(4*4/12)
-1/7
What is 34/(((-2516)/(-518))/17)?
119
What is the value of 9/(-15)*(10/22)/(402/737)*-46?
23
What is ((1*(-1)/(-3))/((-1104)/(-2484)))/(168/(-288))?
-9/7
(166/(-3))/((-98)/42*110/77)*5
83
Evaluate (5904/(-1312))/((-6)/172)*(-6)/(-18).
43
Evaluate (-32)/16*(-540)/(-324)*(-27)/10.
9
What is the value of (54/(10692/(-3069)))/(1/(-2))?
31
((-1)/((-13)/22))/(222372/481806)
11/3
Calculate (((-5)/6)/(-5))/((-21890)/(-998184)).
38/5
What is (((-56)/224)/(1/36))/(3/2)*-9?
54
Evaluate (-402)/268*4*-3*(-2)/(-102).
6/17
What is 164/(-21402)*-58*(-297)/(-42)?
22/7
(-7)/(693/132)*((-4)/74)/(220/33)
2/185
(-108*70/(-14175))/(((-117)/(-90))/((-2)/(-8)))
4/39
What is the value of ((-1)/2)/(((-1)/2)/((-77)/7))?
-11
((1128/(-1034))/(2/(-77)))/(((-63)/12)/7)
-56
What is the value of ((-820)/(-574))/((-385)/(-735))?
30/11
Evaluate (1/(-6))/(29*(-54)/(-98658)*7/(-10)).
15
Evaluate (-638)/(-44)*2/(-3)*3*-1.
29
Evaluate (-73)/(143664/128)*(-90)/120.
2/41
Evaluate -1*5/2*28/(-2940)*-63.
-3/2
What is the value of ((-795)/(-689))/((144/(-12))/156)?
-15
Calculate 7*5/(-15)*(-63)/105.
7/5
(70/7)/(116/(-290))*2/2
-25
(-265)/530*6/37
-3/37
(((-3485)/2788)/((-30)/(-32)))/(3/((-441)/4))
49
(-10)/14*80360/(-3357900)
2/117
3/(((-42315)/4420)/(-217))
68
((-1)/(-26))/((-894)/10728)
-6/13
What is (-45)/(-378)*(18/21)/((-71)/(-994))?
10/7
(((48/(-15))/(-16))/((-4)/10))/((-13)/1274)
49
What is 27/675*(-4)/((-20)/125)*(-10)/(-72)?
5/36
What is the value of (15/(-18)*60/(-25))/((12/(-33))/(-4))?
22
(-8404)/573*3078/(-627)
72
Calculate 16296/(-19012)*-14*(-22)/4.
-66
Calculate ((-3250)/520)/((-10)/(-4))*30/(-3).
25
What is the value of ((-104)/((-14976)/216))/((40/28)/((-20)/(-385)))?
3/55
Evaluate ((-370)/(-1776))/(14/2744*-35).
-7/6
Evaluate 1029/882*(-1890)/(-245).
9
Calculate (16/(-196))/(((-540)/(-54))/140).
-8/7
Evaluate ((-13)/117*9)/(14/224).
-16
Calculate (-11*8/40)/(931/60515).
-143
What is the value of (-17)/((-357)/(-280))*(-2388)/398?
80
What is (27*(-945)/(-14580))/(1/(-4)*-14)?
1/2
Evaluate (((-88)/40)/(-11))/(161/34615).
43
(0*38/1748)/17
0
Evaluate ((-68)/(-5))/(1333/(-6665)).
-68
What is (3/69)/((-8)/264*-11)?
3/23
Evaluate (((-281010)/(-456))/493)/((75/(-12))/5).
-1
What is (3321/(-54))/(((-270)/(-84))/15*7)?
-41
Evaluate (248/25575)/((-181)/(-4525)).
8/33
Evaluate 6740/3707*(-3)/(-4).
15/11
Calculate (3675/(-750)*3/((-126)/15))/((-6)/3).
-7/8
What is (-15)/(-1105)*(-91)/7?
-3/17
What is the value of (4655/11970)/((-84)/(-81))*20/(-18)?
-5/12
What is the value of 1*((-160)/416)/(-5)*-1*3?
-3/13
Evaluate ((-6)/2*((-234)/22923)/(-13))/((-90)/(-270)).
-2/283
What is (-2)/(-26)*9*611/(-846)*2/25?
-1/25
Calculate (-27)/(-72)*-10*416/(-240).
13/2
Evaluate (-183)/(193248/(-192))*418.
76
Evaluate ((28/(-35))/(2/5))/((-1661)/6644).
8
What is the value of (-12)/(55/((-8525)/30))*9/(-6)?
-93
Evaluate 5/(-520)*13767/706.
-3/16
What is the value of 10*6/4*97/(4365/228)?
76
What is (-41101)/493212*2*2*2?
-2/3
Evaluate 58/((-2436)/315)*(-14)/(-12).
-35/4
14*(-76)/1938*34*((-351)/(-24))/3
-91
Evaluate 24075/(-30)*(-112)/140*4/(-72)*3.
-107
Evaluate (6/(144/(-88)))/((-29)/(-261)).
-33
(-53703)/9477*63/51
-7
Calculate (((-162)/5)/3)/(64980/541500).
-90
(((-528)/11)/12)/1*136/17
-32
Evaluate ((240/18)/4)/(((-8)/(-78))/((-760)/190)).
-130
What is (-11*24/(-550))/(12/(-135))?
-27/5
What is 16/(-2)*((-15)/4*(-76)/190)/(-75)?
4/25
Evaluate (-37*11502/(-39405))/((4/(-30))/(-1)).
81
Evaluate 51*-3*(-4)/12*(-11)/(-11).
51
Evaluate ((-289)/5780*2*-12)/((-6)/200).
-40
What is the value of (-3582)/(-199)*-2*(-2)/(-64)?
-9/8
Evaluate (152/(34352/(-1017)))/(4/(2368/(-36))).
74
What is the value of (3/7)/(180/5670)*-2?
-27
What is 2295/918*(-16)/(-40)*-24?
-24
What is the value of -46*(-134)/562465*2*15/(-12)?
-2/73
What is (-25)/(150/4)*(-2736)/(-128)*-4?
57
-41*(-938)/(-19229)*2/(-4)*-97
-97
8/((-32)/30)*3600/(-1000)
27
(4/(4/(-1)))/(430/13416*8/10)
-39
What is the value of ((-525)/84)/(-1*4/16)?
25
What is (-690)/23*352/(-264)?
40
Evaluate ((-16)/(-2))/(-88)*561/(-51).
1
What is ((-15)/27)/((-2*22/88)/((-9)/(-30)))?
1/3
(((-1220)/480)/(-61))/(174/(-1856))
-4/9
Evaluate 14/(-16)*(-60636)/601307.
3/34
Calculate 15275/(-130)*19/190*-2.
47/2
What is the value of 23/(-3)*31806/(-6417)?
38
Evaluate 15144/(-251769)*2/16*-14.
2/19
(-1668)/(-7367)*1/(-6)
-2/53
Evaluate (856/18)/(28944/65124).
107
6/(-705)*((-12555)/(-54))/(-31)
3/47
Evaluate (-135)/(-9720)*-90*(-8)/(2/(-2)).
-10
What is ((-6230)/3738)/((-20)/(-564))?
-47
Evaluate 8338/1516*16/308.
2/7
Calculate ((-13)/4)/((-1079)/166)*-16*4.
-32
What is (-6)/8*11/66*6*272172/(-1839)?
111
(3204/587400)/(6/25)
1/44
Evaluate ((-4)/(-3)*(-48)/32)/((-17934)/(-854)).
-2/21
Evaluate (-176)/(-264)*((-3)/7)/((-14)/(1568/1328)).
2/83
What is the value of (32422/(-203))/43*168/16?
-39
What is the value of ((3/(-8))/(2/(72/(-9))))/(114/(-1292))?
-17
Calculate 4/(-5*136/340).
-2
((-6)/(96/40))/(-54*(-40)/11880)
-55/4
Calculate 6/2*-3*84*25/53550.
-6/17
Calculate ((-46)/(-115))/((-4)/(-6)*324/30).
1/18
Evaluate (-71)/(-213)*270/(-12)*2.
-15
Calculate -1*(1368/135)/76*-690.
92
Evaluate 2691/(-966)*7*8/(-26).
6
Evaluate ((1/2)/(-1))/((-10)/(-240))*357/102.
-42
14801/722*(-5)/(100/8)
-41/5
What is the value of 5/(-3)*(-5937)/19790?
1/2
What is 198/(-49665)*-5*91/(-39)?
-2/43
Calculate (26/12)/13*(-1)/(2/28*-14).
1/6
Evaluate (12/24)/(15/(-3))*576/16.
-18/5
What is the value of 136/(-2448)*9*(-1)/((-1)/44)?
-22
What is the value of 6/(((28*5/15)/2)/((-4)/12))?
-3/7
(-5*20/(-25))/((-164)/24)*(-5)/(-20)
-6/41
(((-60)/(-10))/(-42))/((-3496)/(-2576))
-2/19
What is the value of (6/(-200))/(68/(-43860)*-129)?
-3/20
17*440/(-15)*918/(-6936)
66
Calculate (((-6)/5)/(88/110))/(25/750).
-45
1/2*-2*244/(-244)*30/(-3)
-10
What is (-3)/(-135)*30*9/132*-6?
-3/11
Calculate 7/((-665)/1520)*15/4.
-60
What is ((-829)/(-32331))/((-3)/26)?
-2/9
Evaluate (-180)/(-35)*(-2723)/(-3501).
4
Calculate (-10*1)/(((-1185)/12087)/(4/12)).
34
(4/4)/(2/(-10))*(-2)/(-12)
-5/6
What is (((-180)/2241)/(-20))/((-8)/(-12))*-4?
-2/83
Evaluate (-50)/(-70)*(-889)/(-16510).
1/26
What is the value of (80/(-130))/((-2156)/15288)?
48/11
What is the value of ((-28535)/(-210))/(-439)*8/(-52)?
1/21
What is the value of (420/20)/126*((-448)/12)/(-4)?
14/9
What is 127/9906*-195*(-296)/(-10)?
-74
What is ((-1)/(-9))/(97/((-2720268)/38))?
-82
5*(-15)/((-165)/33)*-5
-75
Evaluate -17*(-85)/(99705/1656).
24
What is the value of (8/(-30)*5/1)/(45*(-136)/(-110160))?
-24
Calculate (12/1)/6*-119*8/(-56).
34
(392/840)/(406/464)
8/15
Calculate (((-405)/1050)/(-3)*7)/(4/(-24)).
-27/5
Evaluate 6885/1360*(2/24*2)/(352/(-1408)).
-27/8
Evaluate (3/162*3)/(-10*7/(-420)).
1/3
What is (16/4)/((-18)/210*448/384)?
-40
(2067/(-3445))/(((-256)/(-60))/8)
-9/8
Calculate -18*(-6)/(-195)*860/258*1.
-24/13
Evaluate (-30)/5*126/18.
-42
What is the value of ((-14)/(-34))/(42770/(-1090635))?
-21/2
Evaluate 16*(6*9/12)/8.
9
What is the value of (-182)/((-168)/(-12))*15/((-33150)/20)?
2/17
What is ((-1)/50)/(312/780*(-5)/(-24))?
-6/25
Calculate (-6180)/(-139050)*45/(-8).
-1/4
8/(-10)*(-9)/414*-46
-4/5
Evaluate (-21)/(84/(-8))*(-41)/14*938/(-134).
41
Evaluate (-2)/((-96)/(-225))*20/(-25).
15/4
Calculate (27/3)/(-3)*53*(-128)/172992.
2/17
What is the value of (-14)/((-1512)/(-81))*20?
-15
(3/(-6)*-1)/(((-55)/65)/((-252)/(-1092)))
-3/22
15861/232628*(-220)/(-195)
1/13
Evaluate -72*(-16)/320*135/(-18).
-27
What is 4/((250/175)/(-8*(-4)/(-56)))?
-8/5
((-8721)/(-58140))/((-6)/32)
-4/5
Evaluate (6*(-1364)/8928)/((-1)/((-8)/2)).
-11/3
Evaluate 8/(-3920)*5*(3/(12/16))/(-1).
2/49
What is (-2016)/(-720)*(-750)/(-350)?
6
What is (-13)/975*-10*15*(700/110)/(-14)?
-10/11
What is the value of (((-225)/20)/(-9))/(-7*37/1036)?
-5
What is the value of ((-19)/(-57))/((-2)/20*-3*403/1116)?
40/13
5460/(-455)*6/8
-9
Evaluate 67/((-758574)/370)*12/(-10).
2/51
What is the value of (6/(-41))/2*(-77)/(-44)*(-24)/63?
2/41
What is the value of ((-6)/(-63))/(45/(-420))*666/(-37)?
16
What is 15/((-27)/(-48)*(1840/60)/(-23))?
-20
Calculate (27*42/(-315))/((220/(-25))/2).
9/11
What is 3/(-75*(-56)/40600)?
29
Evaluate (((-13804)/(-102))/(-29))/((-3)/(27/1)).
42
Evaluate ((-574002)/(-1115))/(-66)*(-25)/3.
65
Evaluate ((-3


After Donald Trump's shocking meltdown on Tuesday afternoon, it's even clearer that progressives need effective strategies to blunt the effect of having a conspiracy-theory-driven, racist authoritarian in the Oval Office, backed by a congressional majority that is still too afraid to offer meaningful checks on his worst behavior. The good news is that some of the nation's biggest cities and states remain controlled by Democrats. Activists and politicians in those states are looking for meaningful ways to throw wrenches in the Trump agenda.

At the top of that list is California, which not only has the largest population of any state but is controlled by progressive Democrats (relatively speaking) who seem ready and eager to fight Trump, especially on the issues of climate change and immigration. (New York is the next biggest state controlled by Democrats, but intra-party warfare has crippled the ability of progressives to get much done.)

Advertisement:

California fired a significant shot across the bow at Trump on Monday, when state Attorney General Xavier Becerra declared that the state would sue the Trump administration over threats to withdraw law enforcement grants if the local and state police refuse to cooperate with federal efforts to deport immigrants. The lawsuit will be joined with an earlier one filed by the city of San Francisco.

"It’s a low blow to our men and women who wear the badge, for the federal government to threaten their crime-fighting resources in order to force them to do the work of the federal government when it comes to immigration enforcement," Becerra said during a press conference announcing the suit. California received $28 million in law enforcement grants from the federal government this year, money it could lose if the police prioritize actual crime-fighting over federal demands that they focus their resources on deporting people.

“The government’s plan for deporting millions of people in this country is to coerce local law enforcement to be their force-multipliers," explained Jennie Pasquarella, director of immigrants' rights for the ACLU of California.

Advertisement:

Pasquarella noted that most deportations currently occur because of an encounter with local law enforcement. By resisting pressure to step up efforts to persecute undocumented immigrants, she said, California can make it safe for people to "access basic services that are vital to our state and communities without fear of deportation, like schools and hospitals and libraries and health clinics.”

Some Democrats in the state are trying to take this idea even further, backing SB 54, titled the California Values Act. According to The Los Angeles Times, the bill would prohibit "state and local law enforcement agencies, including school police and security departments, from using resources to investigate, interrogate, detain, detect or arrest people for immigration enforcement purposes."

While SB 54 is still being worked over in the legislature, California has already made progress in resisting the Trump administration's efforts to repeal Obama-era actions to fight climate change. In July, Gov. Jerry Brown signed a bill extending a cap-and-trade program to reduce carbon emissions until 2030. The bill passed by a two-thirds majority in both the State Assembly and Senate.

Advertisement:

Many environmentalist groups have come out against the bill, arguing that it doesn't go far enough. Still, compared to the federal government's evident retreat, it's progress in the right direction. California has the largest state economy in the country, and demonstrating that climate action does not have to undermine economic growth could go a long way towards convincing other states to take similar action. This, in turn, could help the country meet the goals set by the Paris Accords, defying Trump's efforts to pull the United States out of the historic climate change agreement.

This strategy to resist right-wing policies and protect California residents predates Trump, to be clear. While much of the country was experiencing an unprecedented rollback of reproductive rights — with numerous red states passing alarming new abortion restrictions while anti-choice activists fought insurance coverage of contraception in the courts — California moved to make birth control and abortion easier and safer to get.

Advertisement:

In 2013, responding to research showing that abortions provided by nurse practitioners and midwives are safe, Brown signed a law giving those groups authority to offer abortion services. Brown has also signed off on three provisions to make it easier for women to get birth control: Letting pharmacists dispense it without a doctor's prescription, requiring that health care plans cover contraception without a co-pay, and allowing women to get a full year's worth of birth-control pills at a time.

These policies were already in place before Trump's election, but they are all the more necessary now that the president is backing conservative efforts to make contraception more expensive and harder to get. It has also helped create a model for progressive cities and states to resist reactionary policies pushed by the federal government, which is already inspiring Democrats in other states. Chicago, for instance, is also suing the federal government over the threat to sanctuary cities.

There's a deep philosophical irony here, because for decades now conservatives have claimed they wanted to reduce the power of the federal government and hand more decision-making authority to the states. That was always a disingenuous pose, of course. This conservative "principle" was largely invented to justify state resistance to Supreme Court decisions and federal legislation legalizing abortion, desegregating schools and protecting voting rights.

Advertisement:

Still, it's nice to see states like California calling the Republican bluff and showing that their supposed devotion to "small government" dries up the second states and cities move to protect human rights, instead of to attack them. Trump's attorney general, Jeff Sessions, has always held himself out to be a small-government conservative, for instance. But his reaction to state and local officials who claim the power to set law enforcement priorities for themselves has been to accuse those officials of being law-breakers. This hypocrisy is already obvious, and it may soon be exposed in court.


g 1 y, 1 t, and 1 r when three letters picked without replacement from {b: 1, r: 2, y: 1, p: 2, t: 2}.
1/14
Two letters picked without replacement from {l: 3, c: 1, k: 2, s: 3, g: 1, h: 2}. Give prob of picking 2 s.
1/22
Calculate prob of picking 1 d and 3 e when four letters picked without replacement from {j: 3, e: 6, g: 7, d: 1, y: 2}.
5/969
Two letters picked without replacement from {u: 1, q: 1, m: 1, z: 2, g: 1, l: 2}. What is prob of picking 2 z?
1/28
What is prob of picking 1 c and 3 t when four letters picked without replacement from {t: 2, c: 2, b: 1}?
0
What is prob of picking 1 v and 1 m when two letters picked without replacement from vmvmmv?
3/5
Four letters picked without replacement from yoyyvoyoyvyyoy. What is prob of picking 1 v and 3 y?
16/143
What is prob of picking 1 c and 1 e when two letters picked without replacement from leelceeejllee?
7/78
Two letters picked without replacement from rneenrmreeeneferm. Give prob of picking 1 n and 1 r.
3/34
Calculate prob of picking 4 h when four letters picked without replacement from {d: 1, z: 8, h: 4}.
1/715
What is prob of picking 2 o, 1 h, and 1 f when four letters picked without replacement from hhohohooohhhhohhfhh?
15/323
Two letters picked without replacement from {q: 2, o: 1, h: 1, d: 1, p: 2, y: 1}. Give prob of picking 1 d and 1 q.
1/14
What is prob of picking 1 j and 1 x when two letters picked without replacement from {j: 9, x: 4, f: 2, k: 2, v: 2, e: 1}?
18/95
What is prob of picking 1 d, 1 y, and 1 f when three letters picked without replacement from {f: 4, b: 5, d: 5, y: 6}?
2/19
Two letters picked without replacement from {a: 1, x: 1, c: 1, s: 2, m: 1, n: 1}. What is prob of picking 1 s and 1 x?
2/21
What is prob of picking 2 e when two letters picked without replacement from {x: 2, u: 1, m: 6, e: 2}?
1/55
Calculate prob of picking 3 m and 1 q when four letters picked without replacement from {q: 2, f: 3, m: 3, i: 1, b: 1}.
1/105
Three letters picked without replacement from cqgccqgqccqcc. What is prob of picking 3 q?
2/143
Four letters picked without replacement from {b: 4, p: 3, l: 4, k: 1, e: 2, m: 1}. Give prob of picking 2 p, 1 e, and 1 m.
2/455
What is prob of picking 2 z when two letters picked without replacement from ugzegiggzzgg?
1/22
Calculate prob of picking 1 z and 1 s when two letters picked without replacement from ooozoosssssoos.
6/91
Four letters picked without replacement from {l: 8, c: 5}. Give prob of picking 3 l and 1 c.
56/143
What is prob of picking 3 c when three letters picked without replacement from cccpcccpc?
5/12
Three letters picked without replacement from {o: 2, n: 4, t: 2, l: 8}. What is prob of picking 1 o, 1 l, and 1 t?
2/35
What is prob of picking 2 h when two letters picked without replacement from {h: 9, k: 3}?
6/11
Calculate prob of picking 2 x when two letters picked without replacement from xxhdhxxxhdxdhhh.
1/7
Three letters picked without replacement from {v: 5, w: 1, k: 1, l: 4}. What is prob of picking 1 l and 2 v?
8/33
Calculate prob of picking 1 o and 1 n when two letters picked without replacement from nnnnnnonnnon.
10/33
Calculate prob of picking 1 z and 2 n when three letters picked without replacement from {n: 3, z: 12}.
36/455
Calculate prob of picking 3 t and 1 y when four letters picked without replacement from {t: 5, y: 2}.
4/7
Two letters picked without replacement from {a: 1, h: 2, q: 1, y: 2}. Give prob of picking 1 h and 1 y.
4/15
Two letters picked without replacement from {q: 1, i: 2, d: 1, t: 1}. What is prob of picking 1 d and 1 i?
1/5
Four letters picked without replacement from {e: 10, d: 2, v: 5, n: 3}. Give prob of picking 1 e and 3 v.
20/969
Four letters picked without replacement from myymmjyytytt. What is prob of picking 1 m, 1 j, 1 t, and 1 y?
1/11
What is prob of picking 3 k and 1 r when four letters picked without replacement from kvlrlkkvwkvq?
4/495
Two letters picked without replacement from xlmxxxllxxxxxxx. What is prob of picking 2 l?
1/35
What is prob of picking 3 b when three letters picked without replacement from bvbvvbbyvybybvbbv?
7/85
Calculate prob of picking 1 y and 1 g when two letters picked without replacement from {g: 7, y: 1}.
1/4
Calculate prob of picking 1 y and 1 x when two letters picked without replacement from yudux.
1/10
Three letters picked without replacement from {u: 1, d: 3, a: 5, p: 3, l: 1, x: 1}. Give prob of picking 1 d, 1 p, and 1 x.
9/364
Two letters picked without replacement from {e: 3, q: 2, d: 5, j: 7}. What is prob of picking 1 d and 1 e?
15/136
Calculate prob of picking 2 t and 1 i when three letters picked without replacement from {i: 3, t: 13, p: 2}.
39/136
Calculate prob of picking 3 c when three letters picked without replacement from cdcdccdcdccdcccccccc.
91/228
Two letters picked without replacement from lllllrxlxlllllrlllrl. What is prob of picking 2 x?
1/190
Three letters picked without replacement from bsqsohqoobhsqhqo. What is prob of picking 2 b and 1 q?
1/140
What is prob of picking 1 e and 1 j when two letters picked without replacement from mewjmja?
2/21
Four letters picked without replacement from lllnsssnnsslllslsn. What is prob of picking 2 n and 2 l?
7/170
Calculate prob of picking 2 e and 1 c when three letters picked without replacement from qqceeeqe.
3/28
Three letters picked without replacement from {w: 1, l: 1, n: 8, v: 1, x: 9}. What is prob of picking 3 n?
14/285
Three letters picked without replacement from wnqwoxi. What is prob of picking 1 n, 1 q, and 1 w?
2/35
Two letters picked without replacement from {d: 1, w: 2, a: 1, l: 1, c: 2}. Give prob of picking 2 c.
1/21
What is prob of picking 2 q and 1 s when three letters picked without replacement from awaqqwiiiqqiqwiqsa?
5/272
Four letters picked without replacement from {q: 5, k: 4, f: 1}. What is prob of picking 4 f?
0
What is prob of picking 2 v when two letters picked without replacement from {t: 4, u: 3, m: 3, v: 3}?
1/26
What is prob of picking 2 r and 1 s when three letters picked without replacement from {s: 1, t: 2, r: 1}?
0
What is prob of picking 1 t, 1 q, and 1 o when three letters picked without replacement from {s: 7, a: 5, j: 2, o: 1, q: 1, t: 1}?
1/680
What is prob of picking 2 v and 1 c when three letters picked without replacement from cupvuvmuvmv?
2/55
Three letters picked without replacement from {y: 1, q: 2, b: 11, t: 1, u: 5}. What is prob of picking 2 q and 1 b?
11/1140
Three letters picked without replacement from ccpppppppcppppp. What is prob of picking 1 p and 2 c?
36/455
Calculate prob of picking 2 b when two letters picked without replacement from {b: 3}.
1
Four letters picked without replacement from {m: 2, h: 18}. What is prob of picking 1 m and 3 h?
32/95
Four letters picked without replacement from {h: 14, p: 4}. What is prob of picking 4 p?
1/3060
What is prob of picking 3 r when three letters picked without replacement from rqqqrqqrqqqq?
1/220
What is prob of picking 1 n, 2 b, and 1 m when four letters picked without replacement from bgbnbggbnbmbbbgjnb?
3/85
What is prob of picking 1 c and 1 d when two letters picked without replacement from {d: 1, c: 3, j: 2, v: 1}?
1/7
Three letters picked without replacement from {a: 1, q: 2, x: 2}. What is prob of picking 2 x and 1 a?
1/10
Calculate prob of picking 1 f, 1 u, and 1 v when three letters picked without replacement from {v: 6, h: 3, u: 3, f: 1, j: 2}.
18/455
Calculate prob of picking 2 e when two letters picked without replacement from {z: 3, e: 5}.
5/14
Calculate prob of picking 3 c when three letters picked without replacement from cobfoeocfhc.
1/165
Calculate prob of picking 1 w and 1 h when two letters picked without replacement from wwha.
1/3
Calculate prob of picking 3 n when three letters picked without replacement from {b: 4, n: 6}.
1/6
What is prob of picking 2 z when two letters picked without replacement from {n: 10, z: 1, f: 1, b: 2}?
0
What is prob of picking 3 i and 1 z when four letters picked without replacement from izizzii?
12/35
Two letters picked without replacement from mwmwwwwwxfwwwfww. Give prob of picking 1 x and 1 w.
11/120
Calculate prob of picking 1 r and 2 w when three letters picked without replacement from wwkrwrkrrrrkr.
21/286
Two letters picked without replaceme


Accelerated clearance of intravenously administered theophylline and phenobarbital by oral doses of activated charcoal in rats. A possibility of the intestinal dialysis.
The effect of oral administration of activated charcoal on the clearance of theophylline and phenobarbital following their intravenous administration was studied in rats. Oral administration of multiple doses of activated charcoal significantly decreased the serum half-life and AUC (area under the curve) and increased the total body clearance of both theophylline and phenobarbital as compared with their respective controls. The volume of distribution was not significantly different between treatments. A single dose of activated charcoal showed only a slight enhancement of clearance of theophylline. Accelerated clearance of both drugs by oral activated charcoal was rationalized in terms of adsorption of exsorbed drugs and inhibition of their reabsorption by activated charcoal in the gastrointestinal tract.


Is it too late to make fanart based on this crossover episode?Uuh whatever, there is allways a good reason to draw Lady Legasus.For the crossover itself, I actually quiet enjoyed it. Yes the story was quiet generic and certainly waaaaaayyy to short, but damn the nostalgia train hit hart on that one and certainly had some fun moments ^^Still I think if they had a bit more time, Legasus probably would have made a cameo, but hey, at least they acknowledged her strong legs.


A federal judge says the former president of the truck stop chain Pilot Flying J disparaged black people, women and the city of Cleveland in secret recordings that have been kept under seal in his fraud trial.

The Knoxville News Sentinel reports U.S. District Judge Curtis Collier said Thursday that Mark Hazelwood used "vile, despicable, inflammatory racial epithets," and disparaged Cleveland and its football team. Pilot Flying J is controlled by the family of Cleveland Browns owner Jimmy Haslam and Tennessee Gov. Bill Haslam.

The company issued a statement calling the behavior in the recordings "not acceptable, tolerated or reflective" of its values.

Collier has recessed the trial of the chain's former executives and sales representatives until January.

Pilot Flying J CEO Jimmy Haslam has not been charged with any wrongdoing.

Update: Dec. 6, 2017

A federal judge is setting a monthlong break in the fraud trial of former executives and sales representatives at the truck stop chain controlled by the family of Cleveland Browns owner Jimmy Haslam and Tennessee Gov. Bill Haslam.

The Knoxville News Sentinel reports U.S. District Judge Curtis Collier announced that after Thursday's proceedings, the trial will be put on hold until Jan. 8.

Jimmy Haslam, the CEO of Pilot Flying J, has not been charged with any wrongdoing and has said he had no prior knowledge of the fraud scheme before federal agents raided on the company's headquarters in 2013.

Fourteen members of the Pilot sales department have pleaded guilty, and the company has paid an $85 million settlement to scammed customers and a $92 million penalty to the government.

Update: Nov. 15, 2017

A former truck stop company executive boasted in a secretly recorded conversation that Cleveland Browns owner Jimmy Haslam "loved it" when the sales team ripped off customers.

The Knoxville News Sentinel reports the jury in the federal fraud trial of former Pilot Flying J executives and sales representatives heard a recording of former vice president John "Stick" Freeman saying Haslam was aware of the scheme to deprive trucking customers of the diesel discounts they had negotiated.

In Freeman's words: "He knew - absolutely."

Pilot, which is controlled by the Haslam family, issued a statement reiterating that "Jimmy Haslam was not aware of any wrongdoing."

Haslam hasn't been charged in the investigation that has resulted in 14 guilty pleas among former Pilot employees. Four others are on trial in Chattanooga.

The trial was in session Monday and Tuesday, but is on hold until next week. Testimony will resume Monday.

Update: Nov. 10, 2017

The fraud trial of former executives and sales representatives at the truck stop chain run by Cleveland Browns owner Jimmy Haslam is wrapping up its first week.

The attorney for the company's onetime president has signaled the relationship between Haslam and one of the chief conspirators will become a focus of the defense.

The Knoxville News Sentinel reports that the lawyer for former Pilot Flying J President Mark Hazelwood raised the issue Thursday in the cross-examination of a former director. The ex-director is one of 14 executives and sales representatives who have pleaded guilty in the case.

Haslam has denied any prior knowledge about the scheme to defraud unsophisticated trucking company customers and has not been charged in the case.

Hazelwood and three others are on trial in Chattanooga, Tennessee.

Update: Nov. 7, 2017

Attorneys for two former executives at the Pilot Flying J truck stop chain say their clients shouldn't be found guilty by association with 14 members of the company's sales team who pleaded guilty in a scheme to defraud customers through diesel fuel rebates.

Former Pilot President Mark Hazelwood, former vice president Scott "Scooter" Wombold and two former saleswomen, Heather Jones and Karen Mann, entered their second day of trial Tuesday. Federal prosecutors say some of their colleagues will testify against them.

The rebate scam caused Pilot to pay an $85 million settlement and a $92 million penalty. The company is controlled by the family of Cleveland Browns owner Jimmy Haslam and Tennessee Gov. Bill Haslam, who have denied any prior knowledge of the scheme and have not been charged.

Original story: Nov. 6, 2017

Federal prosecutors have outlined their case against former executives at Pilot Flying J as the result of an "infection of fraud" within the sales department of the truck stop chain controlled by the family of Cleveland Browns owner Jimmy Haslam and Tennessee Gov. Bill Haslam.

Assistant U.S. Attorney David Lewen told jurors on Monday that the four defendants participated in a widespread scheme to undercut competitors, boost company profits and reap the rewards in terms of personal compensation.

Lewen said several of 14 former Pilot colleagues who have already pleaded guilty in the investigation will be called to testify, though he warned jurors that their role in the scheme to rip off unsuspecting trucking company customers may give them pause. In Lewen's words: "There are no swans in the sewer."

The trial comes after a 2013 raid by federal agents on the Knoxville headquarters of privately held Pilot Flying J. Fourteen former members of the sales team pleaded guilty to participating in a scheme to rip off trucking company customers they deemed too unsophisticated to realize they weren't receiving the rebates they had negotiated. The company's former president is among those facing trial Monday.


Q:

Height of water layer on flat surface

Let's consider some flat surface which extends to infinity in all directions.
Suppose we slowly spill some water near some point of the surface. Due to surface tension, the water doesn't spread out indefinitely. If done properly, the water will spread essentially uniformly over a section of the surface, and within this section there won't be any "holes" where the surface isn't covered by water.
If we add some more water, the water will redistrubte itself to maintain a nearly constant height $h$. Furthermore experimentally it seems that $h$ doesn't depend on the amount of water spilled.
Is this true, and how might we calculate the height of the water layer?

A:

I believe this is a standard question in undergraduate physics. The height of the puddle on a flat smooth hydrophobic surface will be given by the following equation:
$h= \sqrt{\frac{2 \gamma (1- cos( \theta)}{g \rho}}$, where $\rho$ is the density of the liquid, $\gamma$ is the surface tension of the liquid, and $\theta$ is the contact angle, that ranges from $\frac{\pi}{2}$ to $\pi$.
For a formal derivation see :

Pierre-Gilles de Gennes; Françoise Brochard-Wyart; David Quéré (2002). Capillarity and Wetting Phenomena—Drops, Bubbles, Pearls, Waves. Alex Reisinger. Springer. ISBN 978-0-387-00592-8.

EDIT: As I defined above, $\theta$ is within that range for hydrophobic surface. If the surface is hydrophillic, $\theta$ will be less than $\frac{\pi}{2}$. You can take these angles as the definition of hydrophobic/hydrophillic surfaces.


Manea Senior College Year 12 student Chloe Barber is kicking some major goals in life at the moment, having been reserved a place at UWA and being selected into the Department of Human Service’s Indigenous Apprenticeship Program.

Her place at UWA was reserved via the school of Indigenous Studies after attending the UWA Year 12 Leadership Seminar for Aboriginal students earlier this year.

In May this year she applied for the Indigenous Apprenticeship program with the Department of Human Services and was selected as one of the 250 successful applicants out of more than 2400.

Not only is Barber studying Year 12, but she is also completing two VET qualifications on top her school studies as well as working two casual jobs. The secret is organisation.

“I’m quite an organised person and committed to everything I do,” she said.

“I just find time each day to get every single thing done while of course keeping an eye on my wellbeing — there is always time in the day.

“I’m passionate about what I do and that definitely makes things a lot easier.”

All of this commitment and passion will be put to good use in 2019 when Barber will be both studying and working full time, with her sights firmly set on a career in advanced medicine.

“I really want to get into something like neurosurgery or cardiothoracic surgery — something that effects a lot of people and to be the person to make a big medical breakthrough.”


346 So.2d 816 (1977)
Rose J. HENDERSON
v.
TRAVELERS INSURANCE COMPANY et al.
No. 11284.
Court of Appeal of Louisiana, First Circuit.
May 9, 1977.
Rehearing Denied June 13, 1977.
John G. Fontenot, Eunice, for plaintiff Rose J. Henderson, appellant.
Don L. Broussard, Lafayette, for defendant Travelers Ins. Co., et al., appellee.
Before SARTAIN, COVINGTON and LOTTINGER, JJ.
LOTTINGER, Judge.
Plaintiff-appellant, Rose J. Henderson, has filed this appeal from the judgment of *817 the Trial Court dismissing her suit for workmen's compensation benefits, and judgment against her on defendant's reconventional demand to return certain workmen's compensation benefits paid in the amount of $9,655.85.
George E. Henderson, decedent, was employed by Fred A. Settoon, doing business as Settoon Oil Field Contracting Company, as a heavy equipment operator. On November 30, 1971, while in the course and scope of his employment, he received injuries to his skull and as a result thereof died on December 7, 1971. Decedent was making approximately $450.00 per week at the time of the accident, and plaintiff sued for workmen's compensation benefits of $49.00 per week for 400 weeks under LSA-R.S. 23:1232, Section 1 and alternatively under Section 8, subject to a credit for benefits previously paid to her. At the time of decedent's injury and death, plaintiff was not legally married to him but they had lived together as though man and wife in excess of eleven years. Plaintiff had raised her children by a legal marriage in decedent's home; decedent had supported plaintiff and her children; plaintiff was totally dependent on decedent for support.
LSA-R.S. 23:1232, in part provides:
"Payment to dependents shall be computed and divided among them on the following basis:
(1) If the widow or widower alone, thirty-two and one-half per centum of wages.
* * * * * *
(8) If there are neither widow, widower, nor child, nor dependent parent entitled to compensation, then to one brother or sister, thirty-two and one-half per centum of wages with eleven per centum additional for each brother or sister in excess of one. If other dependents than those enumerated, thirty-two and one-half per centum of wages for one, and eleven per centum additional for each such dependent in excess of one, subject to a maximum of sixty-five per centum of wages for all, regardless of the number of dependents."
Plaintiff's first argument is that she should be decedent's "widow" under LSA-R.S. 23:1232(1) and allowed to recover just as though she were legally married to the decedent at the time of his injury and death. As a basis for her argument, plaintiff cites Levy v. Louisiana, 391 U.S. 68, 88 S.Ct. 1509, 20 L.Ed.2d 436 (1968) and Glona v. American Guaranty & Liability Insurance Co., 391 U.S. 73, 88 S.Ct. 1515, 20 L.Ed.2d 441 (1968). The Levy case held that under LSA-C.C. art. 2315, illegitimate children could recover for the loss of their mother. The Glona case held that under Louisiana law a mother could recover for the death of her illegitimate son. We note that in the case of Labine v. Vincent, 401 U.S. 532, 91 S.Ct. 1017, 28 L.Ed.2d 288 (1971), the U.S. Supreme Court declined to extend the holdings in Levy and Glona to Louisiana's statutory scheme for intestate succession. It is also important to note that Levy and Glona both dealt with illegitimate children, who even though illegitimate were still biological children of the person killed or the plaintiff in the case. Since Louisiana does not recognize common law marriage, there is no way plaintiff herein can be anything but a concubine. Since she is not a wife, likewise she is not a widow under LSA-R.S. 23:1232(1).
We now turn to plaintiff's alternative argument that LSA-R.S. 23:1232(8) is authority for allowing plaintiff recovery. The evidence is clear that plaintiff was dependent on decedent for the entirety of her support, and that no one else was a dependent of decedent. Since decedent left neither widow, widower, child, dependent parent, and dependent brother or sister, we now consider whether plaintiff can come under the category of "other dependents" of LSA-R.S. 23:1232(8). In connection with this it is necessary to consider the second sentence of LSA-R.S. 23:1253 which reads:
"No person shall be considered a dependent, unless he is a member of the family of the deceased employee, or bearing to him the relation of husband or widow, or a lineal descendant or ascendant, or brother or sister, or child."
*818 The Louisiana Supreme Court has given a broad interpretation to the requirement that the claimant be "a member of the family of the deceased employee" in the factual situations it has considered except for the situation presently before us. In Archibald v. Employers' Liability Assurance Corp., 202 La. 89, 11 So.2d 492 (1942), the court allowed a father-in-law, mother-in-law, and two sisters-in-law of the decedent to recover. The court, in Archibald, said that the Legislature never intended that family be given a restrictive meaning. In Thompson v. Vestal Lumber & Manufacturing Co., 208 La. 83, 22 So.2d 842 (1944) the court in allowing workmen's compensation benefits to the children, said that a woman and a deceased employee who had never married but had lived together with their children constituted his family. Nevertheless, this Court in Moore v. Capitol Glass & Supply Co., 25 So.2d 248 (La.App. 1st Cir. 1946) refused to hold that a man and woman who lived alone in open concubinage constituted a "family" within the context we have before us. Then in Patin v. T. L. James & Co., 218 La. 949, 51 So.2d 586 (1951) the Court held that a deceased employee's concubine's minor nephew who lived with decedent to be a member of his family citing the Archibald and Thompson cases. In Humphreys v. Marquette Casualty Co., 235 La. 355, 103 So.2d 895 (1958) the court did not allow a concubine to recover under LSA-R.S. 23:1232(8) saying that it was never within the contemplation of the Legislature to include under the provisions of LSA-R.S. 23:1232 a dependent who had lived in open concubinage with a deceased during his lifetime. Finally, in the case of McDermott v. Funel, 258 La. 657, 247 So.2d 567 (1971) Justice Tate writing for the court said:
"It is now settled that a member of the family household (as the present plaintiff mother is), if dependent, is entitled to recover compensation benefits when a contributing wage earner dies as a result of work-caused injuries. The dependent member of the family 1 is entitled to compensation regardless of blood relationship or the technicalities of inheritance law or of acknowledgment or not of illegitimate children. This is in view of the socio-economic purposes of the statute to provide compensation for dependents deprived of support through the work-caused death of a wage earner."
Footnote 1 to the above quotation says:
"The sole jurisprudential exception is made in the case of a dependent concubine herself, Humphreys v. Marquette Casualty Co., 235 La. 355, 103 So.2d 895 (1958), an exception still recognized, although the concubine's children and other relatives may receive compensation, see decisions cited in text, if dependent members of the household."
The above quotation is the latest expression which we were able to find by the Louisiana Supreme Court. This result seems contrary to our best interpretation of LSA-R.S. 23:1232(8) for plaintiff herein was a dependent of decedent and under the Archibald and Thompson cases, supra, she could be considered a member of his family.
Professor Wex Malone in his treatise, Louisiana Workmen's Compensation, Section 304, at page 399, commenting on this issue says:
"The writer suggests that this pronouncement is more moralistic than it is sound. No other claimant need prove his moral worthiness so long as he or she is dependent. It would seem that the fault of a dependent concubine should no more exclude her from compensation than should the fault of the employee himself. Furthermore, the position of the court ignores the well-known fact that many negro couples live in concubinage through ignorance or because of the prohibitive cost of divorce proceedings, rather than because of moral delinquency. The social need for compensation here is as great as though the dictates of convention had been met. It does not seem fair that the employer or his insurer should profit by the windfall. The only justification of the court's position is the fact that concubinage is likely to be a transitory relationship, and there is little assurance that the bereaved concubine will long remain *819 in need of compensation. This, however, is not an insuperable objection, because the Act provides an adequate means for terminating the claim when dependency ceases."
Though we feel that plaintiff herein should be allowed recovery, as an intermediate appellate court we feel ourselves bound by the latest expression of the Supreme Court in McDermott v. Funel, supra, and therefore affirm the Trial Court in denying plaintiff recovery.
We now come to plaintiff's argument that the Trial Court's allowance of defendant's reconventional demand for compensation paid in error in the amount of $9,655.85 was incorrect. Of the total figure, $3,265.85 was paid as medical expenses to the provider of services. Furthermore, $1,000.00 was paid to Ardoin's Funeral Home for funeral expenses. Defendant's obligation to pay funeral and medical expenses was in no way dependent on plaintiff's right to collect compensation. Accordingly the judgment of the Trial Court is amended so as to reduce same to $5,390.00.
For the above and foregoing reasons, the judgment of the Trial Court is amended and as amended it is affirmed. Defendant is to pay costs of this appeal.
AMENDED AND AFFIRMED.


He's our top scorer, hardly constitutes a "disaster". His performances of late have been sub-par, but there was a period of the season where he was our best performer.

Utd made it look like they were being "nice to us"? I think this is just your own strange perception that you've created. Everyone knew his time was up over there, it wasn't dressed up as anything other.


Healthy Food Archive

Different nutrients like vitamins and minerals which we consume along with our food, enhance our energy, brain functioning, and memory. Since the human body is composed of various systems, these nutrients work together to stimulate the growth process and ensure the proper functioning of ...Read More

The trend of using plant-based treatment or herbal medicines has changed over the past few decades. These herbal medicines contain various active ingredients such as phenolic compounds, alkaloids, and terpenoids. These ingredients are well known for enhancing the muscle strength and body mass. Recently, ...Read More

Vegan diet is great for the human body and this planet also. It helps in making you feel full for the longer time and saves your body from the fad diets and starvation. To get the healthy fit body and the sound mind the ...Read More

We all look for the glowing flawless skin. It’s really important to feel good and confidant. That is why the beauty industry is one of the most profitable industries in the world. But the fact is if you are not clear and healthy from ...Read More

Uric acid is a waste product that produces in the body during the breakdown of purines. Purine gets out of the body through urine. But its presence in the body causes the higher uric acid level in the body. Purine is present in many ...Read More

Here are all the foods that can help you reduce weight and maintain an ever camera ready figure which is a dream for every man and woman. 20 Weight Loss Friendly Foods 1. Eggs Eggs which are considered to be a source of bad ...Read More

We live in a World full of diseases, which are becoming more and more rampant with every passing day. And this is not a surprise to know because the environment we lie in is tremendously toxic. The air we breathe in, the water we ...Read More

Latest research has enabled the scientist to remark that today the human brain health and its work ability is quite under the control of the person himself irrespective of the age or gender. This is basically related to the two phenomena of neuroplasticity and ...Read More

Peaches are very beneficial fruit with a great taste and aroma. It is a summer fruit and mostly grows in China. It has great nutritional value. Peaches has the wide variety of minerals and anti-oxidants in it which improves the overall health of an ...Read More


# 使用 Vaadin 创建 CRUD UI

> 原文：[Creating CRUD UI with Vaadin](https://spring.io/guides/gs/crud-with-vaadin/)
>
> 译者：[chenzhijun](http://github.com/chenzhijun)
>
> 校对：

本指南会教你如何在Spring Data JPA的基础上使用基于[Vaadin](https://vaadin.com/)来构建应用的UI：

## 你会构建什么？

你会编写一个使用JPA的Vaadin UI。得到一个完整的具有CRUD(Create，Read，Update，Delete)功能的应用和一个使用自定义的仓储方法实现的过滤实例。

你可以从两种方式开始，可以从已有的"initial"项目开始，或者从一个新的实例开始。他们之间的不同点在下面会讨论。

## 开始之前你需要准备

大约15分钟时间

一个喜欢的文本编辑器或者IDE

[JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) 或 更高版本

[Gradle 2.3+](http://www.gradle.org/downloads) 或 [Maven 3.0+](https://maven.apache.org/download.cgi)

你也可以直接导入代码到IDE:

[Spring Tool Suite (STS)](https://spring.io/guides/gs/sts)

[IntelliJ IDEA](https://spring.io/guides/gs/intellij-idea/)

## 如何完成指南？

像大多数 `Spring` [入门指南](https://spring.io/guides)一样, 你可以从头开始，完成每一步, 或者你也可以绕过你熟悉的基本步骤再开始。 不管通过哪种方式，你最后都会得到一份可执行的代码。

**如果从基础开始**，你可以往下查看[怎样使用 Gradle 构建项目](#miaodian)。

**如果已经熟悉跳过一些基本步骤**，你可以：

* [下载](https://github.com/spring-guides/gs-crud-with-vaadin/archive/master.zip)并解压源码库，或者通过 [Git](https://spring.io/understanding/Git)克隆：

 `git clone https://github.com/spring-guides/gs-accessing-mongodb-data-rest.git`
* 进入 `gs-accessing-mongodb-data-rest/initial`目录
* 跳过前面的部分[创建后台服务](#https://spring.io/guides/gs/crud-with-vaadin/#initial)

**当你完成之后**，你可以在`gs-crud-with-vaadin/complete`根据代码检查下结果。

<h2 id="miaodian"> 使用Gradle构建 </h2>

首先你需要编写基础构建脚本。在构建 Spring 应用的时候，你可以使用任何你喜欢的系统来构建， 这里提供一份你可能需要用 [Gradle](http://gradle.org/) 或者 [Maven](https://maven.apache.org/) 构建的代码。 如果你两者都不是很熟悉, 你可以先去参考[如何使用 Gradle 构建 Java 项目](https://spring.io/guides/gs/gradle)或者[如何使用 Maven 构建 Java 项目](https://spring.io/guides/gs/maven)。

### 创建以下目录结构

在你的项目根目录，创建如下的子目录结构; 例如，如果你使用的是\*nix系统，你可以使用`mkdir -p src/main/java/hello`:

```
└── src
    └── main
        └── java
            └── hello
```

### 创建Gradle构建文件

下面是一份[初始化Gradle构建文件](https://github.com/spring-guides/gs-crud-with-vaadin/blob/master/initial/build.gradle).

`build.gradle`

```gradle
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.9.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'

jar {
    baseName = 'gs-accessing-data-jpa'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
    maven { url "https://repository.jboss.org/nexus/content/repositories/releases" }
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    compile("org.springframework.boot:spring-boot-starter-data-jpa")
    compile("com.h2database:h2")
    testCompile("junit:junit")
}
```

[Spring Boot gradle 插件](https://github.com/spring-projects/spring-boot/tree/master/spring-boot-tools/spring-boot-gradle-plugin) 提供了很多非常方便的功能：

* 将 classpath 里面所有用到的 jar 包构建成一个可执行的 JAR 文件，使得运行和发布你的服务变得更加便捷。
* 搜索 `public static void main()` 方法并且将它标记为可执行类。
* 提供了将内部依赖的版本都去匹配 [Spring Boot 依赖](https://github.com/spring-projects/spring-boot/blob/master/spring-boot-dependencies/pom.xml) 的版本。你可以根据你的需要来重写版本，但是它默认提供给了 Spring Boot 依赖的版本。

## 使用Maven构建

首先，你需要设置一个基本的构建脚本。当使用 Spring 构建应用程序时，你可以使用任何你喜欢的构建系统，但是使用 [Maven](https://maven.apache.org/) 构建的代码如下所示。如果您不熟悉Maven，请参阅[使用Maven构建Java项目](https://spring.io/guides/gs/maven)。

### 创建目录结构

在你选择的项目目录中，创建以下子目录结构;例如, 在Linux/Unix系统中使用如下命令: `mkdir -p src/main/java/hello`

```
└── src
    └── main
        └── java
            └── hello
```

`pom.xml`

```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.springframework</groupId>
    <artifactId>gs-crud-with-vaadin</artifactId>
    <version>0.1.0</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
    </parent>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>
```

[Spring Boot Maven 插件](https://github.com/spring-projects/spring-boot/tree/master/spring-boot-tools/spring-boot-maven-plugin) 提供了很多便捷的特性:

- 它收集类路径上的所有jar包，并构建一个可运行的jar包，这样可以更方便地执行和发布你的服务。
- 它寻找`public static void main()` 方法来将其标记为一个可执行的类。
- 它提供了一个内置的依赖解析器将应用与Spring Boot依赖的版本号进行匹配。你可以修改成任意的版本，但它将默认为 Boot所选择了一组版本。

## 使用你的IDE构建

- 阅读如何将本指南直接导入 [Spring Tool Suite](https://spring.io/guides/gs/sts/)。
- 阅读如何使用 [IntelliJ IDEA](https://spring.io/guides/gs/intellij-idea) 来构建。

## 创建后台服务

本示例是 [Accessing Data with JPA](https://spring.io/gs/accessing-data-jpa)的扩展部分。唯一的不同是entity类有get/set方法，并且对于终端用户来说，可以更加优雅的在repository中自定义搜索方法。你并不需要先去阅读Access Data with JPA就可以完成本示例。

如果你是用一个全新的项目开始本示例，请将下面的entity和repository类加入到项目中。这样的目的是为了方便你接下来更好的完成。如果你的项目是从"初始化"开始的，这些类就都已经在项目中了。

`src/main/java/hello/Customer.java`

```java
package hello;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
public class Customer {

	@Id
	@GeneratedValue
	private Long id;

	private String firstName;

	private String lastName;

	protected Customer() {
	}

	public Customer(String firstName, String lastName) {
		this.firstName = firstName;
		this.lastName = lastName;
	}

	public Long getId() {
		return id;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Override
	public String toString() {
		return String.format("Customer[id=%d, firstName='%s', lastName='%s']", id,
				firstName, lastName);
	}

}
```

`src/main/java/hello/CustomerRepository.java`

```java
package hello;

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface CustomerRepository extends JpaRepository<Customer, Long> {

	List<Customer> findByLastNameStartsWithIgnoreCase(String lastName);
}
```

你可以保留整个Spring Boot应用，然后使用一些初始数据来填充数据库。

`src/main/java/hello/Application.java`

```java
package hello;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class Application {

	private static final Logger log = LoggerFactory.getLogger(Application.class);

	public static void main(String[] args) {
		SpringApplication.run(Application.class);
	}

	@Bean
	public CommandLineRunner loadData(CustomerRepository repository) {
		return (args) -> {
			// save a couple of customers
			repository.save(new Customer("Jack", "Bauer"));
			repository.save(new Customer("Chloe", "O'Brian"));
			repository.save(new Customer("Kim", "Bauer"));
			repository.save(new Customer("David", "Palmer"));
			repository.save(new Customer("Michelle", "Dessler"));

			// fetch all customers
			log.info("Customers found with findAll():");
			log.info("-------------------------------");
			for (Customer customer : repository.findAll()) {
				log.info(customer.toString());
			}
			log.info("");

			// fetch an individual customer by ID
			Customer customer = repository.findOne(1L);
			log.info("Customer found with findOne(1L):");
			log.info("--------------------------------");
			log.info(customer.toString());
			log.info("");

			// fetch customers by last name
			log.info("Customer found with findByLastNameStartsWithIgnoreCase('Bauer'):");
			log.info("--------------------------------------------");
			for (Customer bauer : repository
					.findByLastNameStartsWithIgnoreCase("Bauer")) {
				log.info(bauer.toString());
			}
			log.info("");
		};
	}

}
```

## Vaadin 依赖

如果你是从“initial”创建的项目，你已经将需要的依赖添加到项目里了。但如果你从一个全新的Spring项目中，你需要添加Vasdin依赖。Vaadin的Spring集成包中有Spring boot starter，你所需要做的，就是将它加入到Maven的pom文件中，或者在Gradle中做类似的配置：

```xml
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>
```

本示例使用的是较新版本的Vaadin，比starter默认模块中的版本要新一些。如果要使用新的版本，你可以定义Vaadin的一些参数，像下面这样：

```xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <version>8.0.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
```

Gradle 默认不支持"BOMs"，但是这里有一个非常遍历的[插件](https://plugins.gradle.org/plugin/io.spring.dependency-management)。下载完整的[build.gradle](https://github.com/spring-guides/gs-crud-with-vaadin/blob/master/complete/build.gradle)。

## 定义 UI 类

UI 类是 Vaadin UI逻辑入口点。在 Spring Boot应用中，你仅仅需要使用`@SpringUI`注解，然后Spring就会自动注入它。一个简单的"hello world"示例就像下面这样：

```java

package hello;

import com.vaadin.annotations.Theme;
import com.vaadin.server.VaadinRequest;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Notification;
import com.vaadin.ui.UI;

@SpringUI
@Theme("valo")
public class VaadinUI extends UI {

    @Override
    protected void init(VaadinRequest request) {
	    setContent(new Button("Click me", e -> Notification.show("Hello Spring+Vaadin user!")));
    }
}

```

## 数据展示

使用一个好的布局，如使用`Grid`组件。下面的实体`CustomerRepository`是从构造函数注入的,它是用[BeanItemContainer](https://vaadin.com/book/-/page/datamodel.container.html)包装起来，[BeanItemContainer](https://vaadin.com/book/-/page/datamodel.container.html)为Grid组建提供数据。`VaadinUI`的主体部分展开就像下面这样：

```java
CustomerRepository repo;
Grid<Customer> grid;

@Autowired
public VaadinUI(CustomerRepository repo) {
    this.repo = repo;
    this.grid = new Grid<>(Customer.class);
}

@Override
protected void init(VaadinRequest request) {
    setContent(grid);
    listCustomers();
}

private void listCustomers() {
    grid.setItems(repo.findAll());
}
```

> 如果你有大量的表或者大量的同步用户，你不应该绑定整个数据集到你的UI组件。

尽管许多Vaadin组件从服务器到浏览器的过程是懒加载的，上面的方案是将整个数据列表存储在服务器内存中。为了节省一些内存，你应该仅仅展示最重要的数据，然后使用分页或者提供懒加载数据来展示其它数据。你可以使用`setDataProvider(FetchItemsCallback<T>, SerializableSupplier<Integer>)`方法。

## 数据过滤

在大量的数据集成为你服务器的一个问题前，它造成了一个对想编辑相应数据的人头疼的问题。使用`TextField`组件来创建一个过滤入口。首先，修改`listCustomer()`方法让它支持过滤：

```java
void listCustomers(String filterText) {
	if (StringUtils.isEmpty(filterText)) {
		grid.setItems(repo.findAll());
	}
	else {
		grid.setItems(repo.findByLastNameStartsWithIgnoreCase(filterText));
	}
}
```

> 这是Spring Data的声明查询的便利方法。在`CustomerRepository`定义一个新方法`findByLastNameStartsWithIgnoringCase`

给`TextField`组建添加一个钩子，并且将它的值插入到该过滤器方法中。当文本被改变时，`TextChangeListener`会被延迟调用：

```java

TextField filter = new TextField();
filter.setPlaceholder("Filter by last name");
filter.setValueChangeMode(ValueChangeMode.LAZY);
filter.addValueChangeListener(e -> listCustomers(e.getValue()));
VerticalLayout mainLayout = new VerticalLayout(filter, grid);
setContent(mainLayout);

```

## 定义编辑组建

因为Vaadin UI都是一些平常的Java代码，没有理由不从一开始就写一些可重复使用的代码。为你的Customer实体定一个编辑组件。你需要将它定义成一个让Spring能够管理的Bean，然后你可以直接将`CustomerRepostiry`注入到编辑器中，构成C，U和D的部分，或者我们的CRUD功能设计。

`src/main/java/hello/CustomerEditor.java`

```java

package hello;

import org.springframework.beans.factory.annotation.Autowired;

import com.vaadin.data.Binder;
import com.vaadin.event.ShortcutAction;
import com.vaadin.server.FontAwesome;
import com.vaadin.spring.annotation.SpringComponent;
import com.vaadin.spring.annotation.UIScope;
import com.vaadin.ui.Button;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;

/**
 * A simple example to introduce building forms. As your real application is probably much
 * more complicated than this example, you could re-use this form in multiple places. This
 * example component is only used in VaadinUI.
 * <p>
 * In a real world application you'll most likely using a common super class for all your
 * forms - less code, better UX. See e.g. AbstractForm in Viritin
 * (https://vaadin.com/addon/viritin).
 */
@SpringComponent
@UIScope
public class CustomerEditor extends VerticalLayout {

	private final CustomerRepository repository;

	/**
	 * The currently edited customer
	 */
	private Customer customer;

	/* Fields to edit properties in Customer entity */
	TextField firstName = new TextField("First name");
	TextField lastName = new TextField("Last name");

	/* Action buttons */
	Button save = new Button("Save", FontAwesome.SAVE);
	Button cancel = new Button("Cancel");
	Button delete = new Button("Delete", FontAwesome.TRASH_O);
	CssLayout actions = new CssLayout(save, cancel, delete);

	Binder<Customer> binder = new Binder<>(Customer.class);

	@Autowired
	public CustomerEditor(CustomerRepository repository) {
		this.repository = repository;

		addComponents(firstName, lastName, actions);

		// bind using naming convention
		binder.bindInstanceFields(this);

		// Configure and style components
		setSpacing(true);
		actions.setStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
		save.setStyleName(ValoTheme.BUTTON_PRIMARY);
		save.setClickShortcut(ShortcutAction.KeyCode.ENTER);

		// wire action buttons to save, delete and reset
		save.addClickListener(e -> repository.save(customer));
		delete.addClickListener(e -> repository.delete(customer));
		cancel.addClickListener(e -> editCustomer(customer));
		setVisible(false);
	}

	public interface ChangeHandler {

		void onChange();
	}

	public final void editCustomer(Customer c) {
		if (c == null) {
			setVisible(false);
			return;
		}
		final boolean persisted = c.getId() != null;
		if (persisted) {
			// Find fresh entity for editing
			customer = repository.findOne(c.getId());
		}
		else {
			customer = c;
		}
		cancel.setVisible(persisted);

		// Bind customer properties to similarly named fields
		// Could also use annotation or "manual binding" or programmatically
		// moving values from fields to entities before saving
		binder.setBean(customer);

		setVisible(true);

		// A hack to ensure the whole form is visible
		save.focus();
		// Select all text in firstName field automatically
		firstName.selectAll();
	}

	public void setChangeHandler(ChangeHandler h) {
		// ChangeHandler is notified when either save or delete
		// is clicked
		save.addClickListener(e -> h.onChange());
		delete.addClickListener(e -> h.onChange());
	}

}
```

在一个大应用中你可以在多个地方使用这个编辑器组件。当然主要提出的是，在一些大的应用中，你应该提供一些通用的格式比如MVP来使你的UI代码具有结构性(当然这已经超出本教程的范围了)。

## 完整示例

在先前的步骤中，你已经知道了一些基础的组建该如果编写代码。使用`Button`并且监听`Grid`，你可以完全的集成我们的编辑器到主UI中，最终版本的`VaadinUi`类像下面这样：

`src/main/java/hello/VaadinUI.java`

```java
package hello;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;

import com.vaadin.server.FontAwesome;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.ValueChangeMode;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Grid;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@SpringUI
public class VaadinUI extends UI {

	private final CustomerRepository repo;

	private final CustomerEditor editor;

	final Grid<Customer> grid;

	final TextField filter;

	private final Button addNewBtn;

	@Autowired
	public VaadinUI(CustomerRepository repo, CustomerEditor editor) {
		this.repo = repo;
		this.editor = editor;
		this.grid = new Grid<>(Customer.class);
		this.filter = new TextField();
		this.addNewBtn = new Button("New customer", FontAwesome.PLUS);
	}

	@Override
	protected void init(VaadinRequest request) {
		// build layout
		HorizontalLayout actions = new HorizontalLayout(filter, addNewBtn);
		VerticalLayout mainLayout = new VerticalLayout(actions, grid, editor);
		setContent(mainLayout);

		grid.setHeight(300, Unit.PIXELS);
		grid.setColumns("id", "firstName", "lastName");

		filter.setPlaceholder("Filter by last name");

		// Hook logic to components

		// Replace listing with filtered content when user changes filter
		filter.setValueChangeMode(ValueChangeMode.LAZY);
		filter.addValueChangeListener(e -> listCustomers(e.getValue()));

		// Connect selected Customer to editor or hide if none is selected
		grid.asSingleSelect().addValueChangeListener(e -> {
			editor.editCustomer(e.getValue());
		});

		// Instantiate and edit new Customer the new button is clicked
		addNewBtn.addClickListener(e -> editor.editCustomer(new Customer("", "")));

		// Listen changes made by the editor, refresh data from backend
		editor.setChangeHandler(() -> {
			editor.setVisible(false);
			listCustomers(filter.getValue());
		});

		// Initialize listing
		listCustomers(null);
	}

	// tag::listCustomers[]
	void listCustomers(String filterText) {
		if (StringUtils.isEmpty(filterText)) {
			grid.setItems(repo.findAll());
		}
		else {
			grid.setItems(repo.findByLastNameStartsWithIgnoreCase(filterText));
		}
	}
	// end::listCustomers[]

}
```

## 总结

恭喜，你已经编写了一个完整的具有CURD功能的UI应用并且它使用Spring Data来持久化。你完成了它并且不需要暴露任何REST服务，也不需要编写一行JavaScript或者HTML代码。

## 了解更多

下面的指南可能对你有用:

- [Building an Application with Spring Boot](https://spring.io/guides/gs/spring-boot/)
- [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
- [Accessing Data with MongoDB](https://spring.io/guides/gs/accessing-data-mongodb/)
- [Accessing Data with GemFire](https://spring.io/guides/gs/accessing-data-gemfire/)
- [Accessing Data with Neo4j](https://spring.io/guides/gs/accessing-data-neo4j/)
- [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/)

> 本文由spring4all.com翻译小分队创作，采用[知识共享-署名-非商业性使用-相同方式共享 4.0 国际 许可](http://creativecommons.org/licenses/by-nc-sa/4.0/) 协议进行许可。


DecorationManager = require '../src/decoration-manager'

describe "DecorationManager", ->
  [decorationManager, buffer, displayLayer, markerLayer1, markerLayer2] = []

  beforeEach ->
    buffer = atom.project.bufferForPathSync('sample.js')
    displayLayer = buffer.addDisplayLayer()
    markerLayer1 = displayLayer.addMarkerLayer()
    markerLayer2 = displayLayer.addMarkerLayer()
    decorationManager = new DecorationManager(displayLayer)

    waitsForPromise ->
      atom.packages.activatePackage('language-javascript')

  afterEach ->
    decorationManager.destroy()
    buffer.release()

  describe "decorations", ->
    [layer1Marker, layer2Marker, layer1MarkerDecoration, layer2MarkerDecoration, decorationProperties] = []
    beforeEach ->
      layer1Marker = markerLayer1.markBufferRange([[2, 13], [3, 15]])
      decorationProperties = {type: 'line-number', class: 'one'}
      layer1MarkerDecoration = decorationManager.decorateMarker(layer1Marker, decorationProperties)
      layer2Marker = markerLayer2.markBufferRange([[2, 13], [3, 15]])
      layer2MarkerDecoration = decorationManager.decorateMarker(layer2Marker, decorationProperties)

    it "can add decorations associated with markers and remove them", ->
      expect(layer1MarkerDecoration).toBeDefined()
      expect(layer1MarkerDecoration.getProperties()).toBe decorationProperties
      expect(decorationManager.decorationForId(layer1MarkerDecoration.id)).toBe layer1MarkerDecoration
      expect(decorationManager.decorationsForScreenRowRange(2, 3)).toEqual {
        "#{layer1Marker.id}": [layer1MarkerDecoration],
        "#{layer2Marker.id}": [layer2MarkerDecoration]
      }

      layer1MarkerDecoration.destroy()
      expect(decorationManager.decorationsForScreenRowRange(2, 3)[layer1Marker.id]).not.toBeDefined()
      expect(decorationManager.decorationForId(layer1MarkerDecoration.id)).not.toBeDefined()
      layer2MarkerDecoration.destroy()
      expect(decorationManager.decorationsForScreenRowRange(2, 3)[layer2Marker.id]).not.toBeDefined()
      expect(decorationManager.decorationForId(layer2MarkerDecoration.id)).not.toBeDefined()

    it "will not fail if the decoration is removed twice", ->
      layer1MarkerDecoration.destroy()
      layer1MarkerDecoration.destroy()
      expect(decorationManager.decorationForId(layer1MarkerDecoration.id)).not.toBeDefined()

    it "does not allow destroyed markers to be decorated", ->
      layer1Marker.destroy()
      expect(->
        decorationManager.decorateMarker(layer1Marker, {type: 'overlay', item: document.createElement('div')})
      ).toThrow("Cannot decorate a destroyed marker")
      expect(decorationManager.getOverlayDecorations()).toEqual []

    it "does not allow destroyed marker layers to be decorated", ->
      layer = displayLayer.addMarkerLayer()
      layer.destroy()
      expect(->
        decorationManager.decorateMarkerLayer(layer, {type: 'highlight'})
      ).toThrow("Cannot decorate a destroyed marker layer")

    describe "when a decoration is updated via Decoration::update()", ->
      it "emits an 'updated' event containing the new and old params", ->
        layer1MarkerDecoration.onDidChangeProperties updatedSpy = jasmine.createSpy()
        layer1MarkerDecoration.setProperties type: 'line-number', class: 'two'

        {oldProperties, newProperties} = updatedSpy.mostRecentCall.args[0]
        expect(oldProperties).toEqual decorationProperties
        expect(newProperties).toEqual {type: 'line-number', gutterName: 'line-number', class: 'two'}

    describe "::getDecorations(properties)", ->
      it "returns decorations matching the given optional properties", ->
        expect(decorationManager.getDecorations()).toEqual [layer1MarkerDecoration, layer2MarkerDecoration]
        expect(decorationManager.getDecorations(class: 'two').length).toEqual 0
        expect(decorationManager.getDecorations(class: 'one').length).toEqual 2

  describe "::decorateMarker", ->
    describe "when decorating gutters", ->
      [layer1Marker] = []

      beforeEach ->
        layer1Marker = markerLayer1.markBufferRange([[1, 0], [1, 0]])

      it "creates a decoration that is both of 'line-number' and 'gutter' type when called with the 'line-number' type", ->
        decorationProperties = {type: 'line-number', class: 'one'}
        layer1MarkerDecoration = decorationManager.decorateMarker(layer1Marker, decorationProperties)
        expect(layer1MarkerDecoration.isType('line-number')).toBe true
        expect(layer1MarkerDecoration.isType('gutter')).toBe true
        expect(layer1MarkerDecoration.getProperties().gutterName).toBe 'line-number'
        expect(layer1MarkerDecoration.getProperties().class).toBe 'one'

      it "creates a decoration that is only of 'gutter' type if called with the 'gutter' type and a 'gutterName'", ->
        decorationProperties = {type: 'gutter', gutterName: 'test-gutter', class: 'one'}
        layer1MarkerDecoration = decorationManager.decorateMarker(layer1Marker, decorationProperties)
        expect(layer1MarkerDecoration.isType('gutter')).toBe true
        expect(layer1MarkerDecoration.isType('line-number')).toBe false
        expect(layer1MarkerDecoration.getProperties().gutterName).toBe 'test-gutter'
        expect(layer1MarkerDecoration.getProperties().class).toBe 'one'