Click here to Skip to main content
14,386,348 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: Long Lines Pin
Kevin Marois21-Oct-19 7:16
professionalKevin Marois21-Oct-19 7:16 
GeneralRe: Long Lines Pin
Marc Clifton21-Oct-19 10:35
mvaMarc Clifton21-Oct-19 10:35 
GeneralRe: Long Lines Pin
PeejayAdams22-Oct-19 0:22
MemberPeejayAdams22-Oct-19 0:22 
GeneralRe: Long Lines Pin
PIEBALDconsult22-Oct-19 3:57
professionalPIEBALDconsult22-Oct-19 3:57 
GeneralRe: Long Lines Pin
Member 916705721-Oct-19 21:52
MemberMember 916705721-Oct-19 21:52 
GeneralRe: Long Lines Pin
Sander Rossel21-Oct-19 22:55
professionalSander Rossel21-Oct-19 22:55 
GeneralRe: Long Lines Pin
Rolf Borchmann22-Oct-19 1:14
MemberRolf Borchmann22-Oct-19 1:14 
GeneralRe: Long Lines Pin
Richard Deeming22-Oct-19 2:35
mveRichard Deeming22-Oct-19 2:35 
PeejayAdams wrote:
double lowerBound = double.Parse(ConfigurationManager.AppSettings["LowerBound"].ToString());
double upperBound = double.Parse(ConfigurationManager.AppSettings["UpperBound"].ToString());

AppSettings is a NameValueCollection. The indexer returns a string. What are those extra .ToString() calls doing in there? Smile | :)

PeejayAdams wrote:
.ToList().OrderBy(f => f.Proportion).ThenByDescending(f => f.Rectangle.Height).FirstOrDefault()

Why are you reading the whole thing into a List when you only want one result? You can almost certainly drop the .ToList() call.

Also, are you sure the OutputImage method won't barf if you pass in null as the second parameter?
double lowerBound = double.Parse(ConfigurationManager.AppSettings["LowerBound"]);
double upperBound = double.Parse(ConfigurationManager.AppSettings["UpperBound"]);

var dirkBenedict = allFaces
    .Where(f => f.Proportion > lowerBound && f.Proportion < upperBound)
    .OrderBy(f => f.Proportion)
    .ThenBy(f => f.Rectangle.Width)
    .FirstOrDefault();

OutputImage(file, dirkBenedict);




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Long Lines Pin
PeejayAdams22-Oct-19 2:45
MemberPeejayAdams22-Oct-19 2:45 
GeneralRe: Long Lines Pin
Gary Wheeler22-Oct-19 3:10
MemberGary Wheeler22-Oct-19 3:10 
GeneralRe: Long Lines Pin
Dan Neely22-Oct-19 3:53
MemberDan Neely22-Oct-19 3:53 
GeneralRe: Long Lines Pin
obermd22-Oct-19 4:35
Memberobermd22-Oct-19 4:35 
GeneralRe: Long Lines Pin
Thomas James22-Oct-19 5:36
MemberThomas James22-Oct-19 5:36 
GeneralRe: Long Lines Pin
MikeTheFid22-Oct-19 6:51
MemberMikeTheFid22-Oct-19 6:51 
GeneralRe: Long Lines Pin
Jan Heckman22-Oct-19 13:11
professionalJan Heckman22-Oct-19 13:11 
GeneralThought of the Day Pin
OriginalGriff21-Oct-19 5:38
mveOriginalGriff21-Oct-19 5:38 
GeneralRe: Thought of the Day Pin
lopatir21-Oct-19 6:12
Memberlopatir21-Oct-19 6:12 
GeneralRe: Thought of the Day Pin
Kschuler21-Oct-19 6:44
MemberKschuler21-Oct-19 6:44 
GeneralRe: Thought of the Day Pin
jeron121-Oct-19 6:46
Memberjeron121-Oct-19 6:46 
GeneralRe: Thought of the Day Pin
Ravi Bhavnani21-Oct-19 6:48
professionalRavi Bhavnani21-Oct-19 6:48 
GeneralRe: Thought of the Day Pin
dandy7221-Oct-19 10:28
Memberdandy7221-Oct-19 10:28 
GeneralRe: Thought of the Day Pin
digimanus21-Oct-19 22:16
Memberdigimanus21-Oct-19 22:16 
GeneralAre you still alive... Pin
glennPattonWork21-Oct-19 4:09
professionalglennPattonWork21-Oct-19 4:09 
GeneralRe: Are you still alive... Pin
  Forogar  21-Oct-19 4:24
professional  Forogar  21-Oct-19 4:24 
GeneralRe: Are you still alive... Pin
phil.o21-Oct-19 4:32
mvephil.o21-Oct-19 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.