Monday, 27 May 2013

Table going past margins

Valid year function in python

Here is the udacity.com web dev course, they ask to write a program for valid year, anything between 1900 and 2020 is a valid year...Now when I submit my below code it gives this error:
"Incorrect. Your submission did not return the correct result for the input '1920',. Your submission passed 7 out of 9 test cases."
my function:
def valid_year(year):
  if year and year.isdigit():
    if int(year) >=1900 and int(year) <=2020:
      return year

print valid_year('1970')
why it's not working for 1920? and the same function by udacity runs fine....Someone pls tell me what's the difference b/n both the code
Udacity function:
def valid_year(year):
  if year and year.isdigit():
    year = int(year)
    if year >=1900 and year <=2020:
      return year

print valid_year('1970')Table going past margins

I'm trying to create a header for my resume. I'm almost happy with the result, but there's a small formatting issue. I'm using a table to control where my name and contact info are placed. My name and details are just long enough to go slightly over my margins, and look a little awkward. Here's the minimum to show what I'm working with.
\documentclass[12pt]{article}
\usepackage{moresize}   
\usepackage{fullpage}
\usepackage[defaultsans]{droidsans}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}

\begin{document}

\begin{table}
\begin{tabular}{l r l}
\Huge{White H. Love-Tiger} &  & \\ \hline
 & \small{\tt{whlt@stackexchange.com}} & \small{42 Latex Ave.}\\
 & \small{(555) 765-4321} & \small{Texburg, \textsc{XY}}\\
 &  & \small{\textsc{A1A 1A1}} \\
\end{tabular}
\end{table}     

\section*{Experience}
Latex expert: I've never needed to ask anyone for help with Latex because I'm sure a Latex expert. Blah blah blah blah, lorem ipsum gibberish gibberish gibberish. I'm the most amazing, you really need to hire me, blah blah blah.... please give me a job. Blah blah blah blah, lorem ipsum gibberish gibberish gibberish. Blah blah blah blah, lorem ipsum gibberish gibberish gibberish. Blah blah blah blah, lorem ipsum gibberish gibberish gibberish.

\end{document}
The header goes just past the right margin. Is there a way I could have the header table fill the document from the left margin to the right margin, and have the lower rows of contact information not go past the right margin? This means that the end of my name might hang over the beginning of my email address, but I'm okay with that.

No comments:

Post a Comment