To have specific number of digits in string formatting, I am aware that it can be done in this way:  In [18]: hours = 01  In [19]: "%.2d" %(hours) Out[19]: '01'  In [20]: "%.2f" %(hours) Out[20]: '1.00'   But my case is a bit different. I am using specific keys to denote the values, for example:  for filename in os.listdir('/home/user/zphot_01/')   Here I want to have different values for the '01', i.e.   for filename in os.listdir('/home/user/zphot_{value1}/'.format(value1=some_number):   When I use the above method with some_number = 01, it does not take into account the 0 and so my folder is not recognised.   EDIT:  Most of the answers are for only one value, however, I want to have more than one key value, i.e.:  for filename in os.listdir('/home/user/zphot_{value1}/zphot_{value2}'.format(value1=some_number1,value2=some_number2)).
What is a Pythonic way to pad a numeric string with zeroes to the left, i.e. so the numeric string has a specific length?
Customizing citations and the list of publications depending on the author Say I use a bibliography file in my document, relying on Biblatex and Biber for citation management.  Given a citation command such as \cite{A, B, C} (or any other standard Biblatex citation command), I'd like the resulting citations to be typeset differently depending on whether a given field (e.g. the author field) in the corresponding bibliography entry contains a given string (e.g. someone's lastname).   Besides, I'd like to generate two different bibliography sections in the resulting document, depending on the same condition as above.  Typically this would be used to differentiate, both at the citation level in the main text and in the appendix, the publications that I co-authored from others.  EDIT: adding a MWE:  \documentclass{article} \usepackage{filecontents} \usepackage[backend=biber,style = alphabetic]{biblatex} \usepackage[colorlinks=true, breaklinks, allcolors = blue]{hyperref} \DeclareSourcemap{%   \maps[datatype=bibtex]{%     \map{%       \step[fieldsource=author, match=Doe, final]%       \step[fieldset=keywords, fieldvalue=doe]%     }%   }% } \begin{filecontents}{\jobname.bib} @Book{p1,   author =       "A. U. Thor and John Doe",   title =        "A Scientific Article 1",   year =         "1975"   } @Book{p2,   author =       "John Doe",   title =        "A Scientific Article 2",   year =         "1985"   } @Book{p3,   author =       "Joe Bar",   title =        "A Scientific Article 3",   year =         "1995"   } @Book{p4,   author =       "Jane Baz",   title =        "A Scientific Article 4",   year =         "2005"   } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} % Requirement 1: should make citations of Doe bold In \parencite{p4, p1, p2, p3}, ``TD75'' and ``Doe85'' should appear in bold (the semicolon should remain plain).  % Requirement 2: separating bibliographies. IT WORKS. \section{Co-authored Publications} \nocite{*} \printbibliography[keyword=doe,heading=none]  \section{Other Publications} \nocite{*} \printbibliography[notkeyword=doe,heading=none]  \end{document} Running OS X Apps On Ubuntu 14.04 Is there any way that still works to run OS X apps on Ubuntu 14.04? If Darling still works, please tell me how to install it.  Thanks. :) Test coverage for setCookies method I am adding cookie to my page in the controller using  ApexPages.currentPage().setCookies(new Cookie[]{CookieName});  When am trying to get the code coverage, my test class is not covering the above line.  How to get the code coverage for the above setcookie method in the test class. I just made some minor edits to the text of .  I didn't edit the tags at all.  When I completed my edits, my edit showed as:    Now, I think those tags were present before I started my edit, and so were probably slipped in by the OP in their edit grace window.  I have no problem with that tagging, but I don't like seeing edits attributed to me that I didn't make.  So, what the heck? Curvature of a curve on a sphere execute drush command from devel/php drupal Can any one please tell me how can I execute drush command from devel/php?  I can execute PHP codes from devel/php. But I don't know how can I execute drush command from devel/php. (As we know "devel/php" URL coming from devel module).  I have written some custom drush command for cron purpose. I can able to run those commands from command line.  &gt; drush my-cmd or drush cc all or drush status , etc ... I can run it through command line.   Expecting some function as mentioned below to run from devel/php  some_function("drush cc all"); vim-clang-format: clang-format is not found Calling the base constructor in C# I have a very stupid question. I developed a website that has only one page at the public html directory(index.php).  all content are dynamically loaded as different pages.   How can i SEO my pages for google?  i mean like the what we type in this site are .............i believe stored in database and search engine find these pages like any static pages...  Just a little tip would be appreciable.......! What is the result of $ \lim_{n \to \infty} \frac{ \sum^n_{i=1} i^k}{n^{k+1}},\ k \in \mathbb{R} $ and why? How to get permission number by string : -rw-r--r-- I need to set the same chmod, how to get number for -rw-r--r-- ? Creating the Nabla operator (also known as Del operator) as an operator In C, is it possible to forward the invocation of a variadic function? As in,  int my_printf(char *fmt, ...) {     fprintf(stderr, "Calling printf with fmt %s", fmt);     return SOMEHOW_INVOKE_LIBC_PRINTF; }   Forwarding the invocation in the manner above obviously isn't strictly necessary in this case (since you could log invocations in other ways, or use vfprintf), but the codebase I'm working on requires the wrapper to do some actual work, and doesn't have (and can't have added) a helper function akin to vfprintf.  [Update: there seems to be some confusion based on the answers that have been supplied so far. To phrase the question another way: in general, can you wrap some arbitrary variadic function without modifying that function's definition.] Is there any way to keep a command from being added to your history? I have a command that I want to keep out of my history file, and I really don't care to have it there when I search the history stored in memory, though that's less of a concern. Is there any way to prevent this, or do I just have to go back and edit my history file.  update: I didn't realize this might be shell-specific. My shell is zsh. You're welcome to answer for other shells so people know how to do this in their shell. How to get time difference in minutes in PHP If $f: \mathbb Q\to \mathbb Q$ is a homomorphism, prove that $f(x)=0$ for all $x\in\mathbb Q$ or $f(x)=x$ for all $x$ in $\mathbb Q$.  I'm wondering if you can help me with this one? Is ∅ equivalent to {∅}? $\newcommand{\Var}{\operatorname{Var}}$In this  is claimed that if the equation of errors in OLS is given by: $$u=y - X\beta$$ Then in the presence of heteroscedasticity the variance of $u$, will not be constant, $\sigma^2 \times I$, where $I$ is an identity matrix, but: $$\Var(u\mid X)=\sigma^2\Omega$$ In order to account for the heteroskedasticity, we can estimate the transform system, such that $P$ is a transformation matrix. $$Py=PX\beta-Pu$$ Where "the variance of a constant matrix $P$ times a random vector $u$" is: $$\Var(Pu\mid X)=P\Var(u\mid X)P'=P(\sigma^2\Omega)P'$$ Can somebody explain me the proof for that? I have been asked by a client to implement some views for reporting purposes, the views will be accessed via PowerBI, Excel and SSRS. The designated user will only have access to the view and no underlying tables must be available to the user.  The problem I have encountered in that the SQL within the view touches 3 different schemas (All within the same database):   Pupil Provider  Security   The view is:  CREATE VIEW dbo.vTestPermissions AS SELECT a.Column1,        b.Column1,        c.Column1 FROM Pupil.Table1 a JOIN Provider.Table2 b ON a.Column1 = b.Column1 JOIN Security.Table3 c ON a.Column1 = c.Column1   The owners of the Tables/View are as follows:   Pupil.Table1 - Owner Pupil Provider.Table2 - Owner Provider Security.Table3 - Owner Security vTestPermissions - Owner dbo   When I select from the view I get an error:     The SELECT permission was denied on the object 'table3', database   'TEST', schema 'Security'   I have tried giving SELECT permission with and without the GRANT option to the schema, and the tables, but that makes the underlying tables available to the user.  Any help on this will be greatly appreciated. Flow chart using Tikz- spanning multiple pages I am trying to create a flowchart with Tikz. Since it is a long one, it spans three pages. So after creating a node to stop, I am continuing to the next page using \newpage command. Unfortunately some elements in page 1 are connected to page 2, 3 and vice versa. So when I try to create the arrow connection, it is not possible since the \newpage command comes in between. I am sharing the code with you for info. Could  anyone help me to improve the flowchart so that I could direct the arrows among multiple pages. My sample code is below:  \begin{tikzpicture} \node 1 \node 2 ........ \draw[arrow] (node1)--(node2) \draw[arrow] (node2)--(node3) ---- \end tikzpicture} \newpage \begin{tikzpicture} \node 1 \node 2 ........ \draw[arrow] (node1)--(node2) \draw[arrow] (node2)--(node3) ---- \end tikzpicture} \newpage  \begin{tikzpicture} \node 1 \node 2 ........ \draw[arrow] (node1)--(node2) \draw[arrow] (node2)--(node3) ---- \end tikzpicture}