Date picker using Calendar in Excel

If you want to insert a calendar into your spreadsheet, you can do so by enabling Developer Mode from the program’s main menu.


  • Click the “Office” button and select the “Excel Options” option from the drop-down menu that appears.
  • Click the “Popular” tab in the “Options” menu and place a check mark next to the “Show Developer Tab in the Ribbon” option.
  • Click “OK” to save the changes.
  • Click the “Developer” tab, followed by the “Insert” menu. Select the “More Controls” button in the drop-down menu that appears. Highlight the “Microsoft Date and Time Picker Control” option, then click “OK.”
  • Click on the upper left corner of the cell to which you want to add the calendar and drag your mouse pointer to the cell’s bottom-right corner. This will draw a rectangle around the cell.Release your mouse button to insert the calendar into the cell.
  • Whenever you click on the cell, the calendar drop-down menu will appear.
  • Before the Date and Time Picker Control can be used its properties must be defined. With the control selected, in the Controls section of the Developer tab click the Properties button. This opens the Properties window listing all the properties of the Date and Time Picker control. Here you can specify a format for the date, define a range of allowed dates as well as  many other useful properties.
  • The calendar needs to be activated before it will work. Click the Design Mode button on the Developer tab to take the worksheet out of design mode. Job done!
  • To insert a date click the control’s down-arrow to open the calendar. When you select a date the calendar will close and the date will be written into the specified cell. If you want to link the calendar to a specific cell so that, when a date is chosen it is entered into that cell only, you must enter the address of the cell into the LinkedCell

Articles of help

Date picker using Calendar in Excel

Latex tips and tricks

Here are some tips and tricks I found useful while working with Latex

  • If one wants to reduce the spacing between a figure and its caption, use the following command
\begin{figure}[t]
 \centering
 \includegraphics[width=3.5in]{some_image.pdf}
 \vspace*{-1.0cm}
 \caption{some image caption}
 \label{fig:ref_to_some_image}
  • If one wants two or more images to be placed on the same page, include them in the same figure environment
\begin{figure}[t]
 \centering
 \includegraphics[width=3.5in]{fig1.pdf}
 \vspace*{-1.0cm}
 \caption{caption 1}
 \label{fig:label1}
\includegraphics[width=3.5in]{fig2.pdf}
 \vspace*{-1.0cm}
 \caption{caption2}
 \label{fig:label2}
 \end{figure}

 

Latex tips and tricks

Move to first character on the command line

I am using CSH inside SCREEN on a PUTTY terminal. When I have to repeatedly enter similar commands, I tend to press the up arrow or use the shell history to bring up the command at the prompt. However I realise that there is a switch right at the beginning of the command that I need to change.

How do I quickly move to the first character of the command

Nope!!! <HOME> does not work for me.

Instead I press Ctrl + x twice to toggle cursor position from the first character to the last character of the command.

I do not know if this shortcut is provide by CSH or by Screen or by Putty, but it does work for me right now.

Move to first character on the command line

Change size of the expect_out buffer in Expect

While reading output, more than 2000 (think of a 25 x 80 terminal) bytes can force earlier bytes to be “forgotten”. This may be changed with the function match_max. (Note that excessively large values can slow down the pattern matcher.) If patlist is full_buffer, the corre- sponding body is executed if match_max bytes have been received and no other patterns have matched. Whether or not the full_buffer keyword is used, the forgotten characters are written to expect_out(buffer).

             taken from 'man expect'

I’ve found that match_max can cause expect_out(buffer) to become undefined. Redefine it after calling match_max to get round this.

   match_max 5000
   set expect_out(buffer) {}

As noted by Cameron Laird here: http://phaseit.net/claird/comp.lang.tcl/expect.html

Change size of the expect_out buffer in Expect

Sed command to create a verilog blackbox

I recently had to create black boxes for 28 verilog modules. I could have done it manually, but thought of using some sed scripting, and it sure got done in a flash.

This is the sed command I used.

sed -i".bak" -n -e '/module/p' -e '/output/p' -e '/input/p' bb.v

where bb.v is the blackbox file.

In my case, I had already created copies of my verilog.v file as bb.v, and I then went about editing the bb.v files. One can also perform the copying and editing in a single step as follows

sed -n -e '/module/p' -e '/output/p' -e '/input/p' verilog.v > bb.v

The

-i".bak"

switch is a way of telling sed that the substitution. printing, deletion have to be done in-place

Sed command to create a verilog blackbox

For loop in csh, tcsh

CSH has a for loop. The syntax of the loop is as follows

> foreach i (1,2,3,4,5)
     dosomething1
     dosomething2
  end

Another flavor of the foreach loop is when one wants to perform the same action on a set of files in a directory, or a set of sub-directories in a directory

Below is an example of copying a file verilog.v to bb.v in each of the sub-directories in the present directory

foreach fn ( `ls` )
  if (-d $fn) then
    cp $fn/Verilog/verilog.v $fn/Verilog/bb.v
  endif
end
For loop in csh, tcsh