Friday, May 29, 2009

7zip Batch Zip

First, make sure that the 7zip directory is in your path. Usually, it is located at

C:\Program Files\7-Zip

Next, write the following in batch file

Zip all files in a directory

for /f %%A in ('dir /b') do 7z a -tbzip2 "%%A.bz2" "%%A"

Zip files with a specific extension in a directory (download batch file)

for /f %%A in ('dir /b *.txt *.dat') do 7z a -tbzip2 "%%A.bz2" "%%A"

Save and run in the directory where you want to zip the files.

Here, I am compressing using bzip2 (notice the switch: –tbzip2). You can change that to

-tzip for zip

-tgz for gz

-t7z for 7z

some more examples here.


Cite as:
Saad, T. "7zip Batch Zip". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2009/05/7zip-batch-zip.html

Restart Windows in Remote Desktop

press:

Alt + F4

Voila!


Cite as:
Saad, T. "Restart Windows in Remote Desktop". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2009/05/restart-windows-in-remote-desktop.html

Thursday, May 21, 2009

How to Add a Watermark in Latex

More often than not, I like to place a “DRAFT” watermark on my documents. This can be easily and automatically done by just including a specific package (one for PS and one for PDF).

Here’s how

\usepackage[draftcopy] % for PS and DVI

\usepackage[pdfdraftcopy] % for PDF

Voila!

For the documentation of draftcopy check here.

For the documentation of pdfdraftcopy check here.


Cite as:
Saad, T. "How to Add a Watermark in Latex". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2009/05/how-to-add-watermark-in-latex.html

Tuesday, May 19, 2009

Wolfram Alpha

It has been finally released!

http://www.wolframalpha.com/

I’m too sleepy now to experiment with it.

In the meantime, you can check the walking randomly blog.


Cite as:
Saad, T. "Wolfram Alpha". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2009/05/wolfram-alpha_19.html

Friday, May 15, 2009

How to Cite a Blog & Automatically Generate Citations for your Blog

The MLA format for citing a blog is:

Last Name, First. "Title of Entry." Weblog Entry. Title of Weblog. Date Posted. Date Accessed (URL).

You can find more information on studenthacks and on the Purdue website.

Now comes the fun part. If you’re familiar with the Wolfram mathworld website, there is a “CITE THIS AS” section at the bottom of every page (example). I wanted to reproduce something similar for my blog. As you may have already noticed, there is a “Cite as” box at the bottom of every post. Of course, I didn’t go over every post to add a cite-as box. I used the google blogger API to automatically add this to every post. Here’s how you can reproduce it for your own blog

  1. Go to the “Edit HTML” section for your template
  2. Enable the “Expand Widget Templates” check box
  3. Scroll down (or search: Ctrl + f) for
    <data:post.body/>
    This may require some tweaking as your template may be different. The idea is to locate the “post body” section – right after the body text of your post.
  4. Copy the following HTML code:
    <!-- BEGIN CITE AS CODE - BY T. SAAD -http://pleasemakeanote.blogspot.com --> 
    <br/>
    <p style='border-width:1px;border-style:solid;border-color:orange; padding:4px'>
    <font color='orange'>
    Cite as:
    <br/>
    LAST NAME, FIRST NAME &quot;<data:post.title/>.
    &quot; Weblog entry from <a href='http://LINK-TO-YOUR-BLOG> <data:blog.title/></a>.
    <a expr:href='data:post.url'><data:post.url/></a>
    </font>
    </p>
    <br/>
    <!-- END CITE AS CODE –>

  5. Save your template

Voila! Don’t forget to put your name and the link to your blog. You can easily modify the above script with little HTML and CSS knowledge.


Cite as:
Saad, T. "How to Cite a Blog & Automatically Generate Citations for your Blog". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2009/05/how-to-cite-blog-automatically-generate.html