Skip to main content

Posts

Showing posts with the label Tutorial

How to add a favicon to your wordpress site?

Favicon is the small icon that appears on left of the title bar  when your website is opened in browser. Figure below show favicons of gmail and blogger. This is a very good way to brand your site. To add a favicon to your wordpress follow these steps. Create favicon favicon is a 16 x 16 pixel image so you have to either shrink your logo to this size or create a new image for your favicon. You can save image in either gif, png, jpg or ico.  Adding favicon Once you have the image ready install " All in One favicon ".  Then in your website admin dashboard goto            Plugins-> All installed Plugins and under All in one favicon select settings. This will open this interface Now you can select a favicon in whatever format you have(only one) and save.  Reload your site and favicon should be there.  In case you have any problems leave a comment here.

How to add JCalendar/ date chooser to WindowBuilder, for Swing GUI in Java?

WindowBuilder is most popular eclipse plugin for drag and drop GUI design. It supports SWT and Swing. Swing does not have a date chooser component of its own. But there are many components available that you can use. My personal favourite is JCalendar . You can add JCalendar components to your WindowBuilder  palette  by following these instructions. Download and extract JCalendar.  Right-click on the palette   in WindowBuilder Select jar file of Jcalendar select all componetnts Restart Eclipse. Now you will see JCalendar components in your  palette . For more information about  visit this page.  

How to disable flash in FirefoxDriver/ FirefoxProfile / using java in Selenium?

For some tests using selenium automated testing with FirefoxDriver one can create a custom FirefoxProfile and disable flash in it. Here is the code I used for this.                 FirefoxProfile profile= new FirefoxProfile(); profile.setPreference("plugin.state.flash", 0); FirefoxDriver driver = new                                       FirefoxDriver(profile);

How to parse HTML/ extract data from HTML / using Java?

Java has a large set of APIs to parse HTML. To extract data from HTML  and perform any manipulation we should be able to parse it. jsoup provides a very easy to use , powerful and compact API to pare HTML and extract data. It supports DOM, CSS and jquery like selectors. It is designed for all types of HTML and will even parse HTML which is not perfectly valid. Example In this example we fetch BBC Sport , parse it to DOM and then select headlines using css-selector. Document doc = soup.connect(" http://www.bbc.co.uk/sport/0/ ").get();  Elements newsHeadlines = doc.select("#more-news-headlines li"); We can also provide HTML directly in a string.  A detailed documentation is available at jsoup website. You may start from official cook book available here . 

Find and remove duplicate files in Ubuntu / Mint Linux

If you have accumulated thousands of files , some times you will have more than one versions of same file. If you use Ubuntu of Mint linux you can find and remove these duplicates very easily. There are two popular tools for this fdupes and fslint Using fdubes ftubes is the most popular, simple and powerful tool to find duplicates and remove them. It is a command line tool so if you don't like command line move to next heading. It compares file size  and MD5 signatures(Do not worry if you don't know what it is). So it will find duplicates even if they have different names. Installation From terminal execute following command  sudo apt-get install fdupes ftubes Syntax fdupes [options] directory where  options available are -r --recurse include files residing in subdirectories -s --symlinks follow symlinked directories -H --hardlinks normally, when two or more files point to the same disk area they are treated as non-duplicates; this ...

Harvard Style citation in Latex

Here I will explain how I use natbib and agsm from harvard package for Harvard style of references. Include natbib by using \usepackage{natbib}   set  citesep  (separation between two citations in the same place) and  aysep  (separation between author and year in a citation) using \setcitestyle{citesep={;}, aysep={,}}  set bibliograpgy style to agsm my using \bibliographystyle{agsm} and the cite as required using \cite{key} , or \citep{key} a complete reference can be found here Example \documentclass[a4paper,10pt]{report}  \usepackage{natbib} \setcitestyle{citesep={;}, aysep={,}} \begin{document} \chapter{Chapter 1} This is a \citep{key}.  \bibliographystyle{agsm} \bibliography{library} \addcontentsline{toc}{chapter}{References} \end{document}

How to enable / install captcha RECAPTCHA in Joomla 3

Captcha or ReCaptcha is already installed with Joomla 2.5 and 3.0. But before you can use it , you will have to enable it by providing some keys. Here I will give you step by step guide on how enable captcha using Joomla 3. Login to your site Admin at yourdomain.com/administrator From top menu select Extension Manager -> Plug In Manager From list of plug-ins find Captcha - ReCaptcha(Enable it if it is not already) Go to basic options tab , it will require a Public and Private key go to  ReCaptcha  website to get the key, provide your domain and it will give you the keys paste Keys in Jooma 3.0 and you are done. The following video explains all the steps. 

How to make a presentation with LaTeX / TeX / Beamer

Here we will see how we can create a presentation using LaTeX / TeX / Beamer. LaTeX is a newer version of TeX. Beamer is a special class of LaTeX used to create presentations. The options available with beamer and Latex make it a very powerful combination for making professional presentations. We start with a simple example. Here is the code for a simple presentation \documentclass{beamer} \usetheme{Frankfurt} \title{How to make a presentation using Beamer/ \LaTeX2e ?} \author{Gappu} \institute{http://tech-gupshup.blogspot.co.uk/} \date{July, 2012} \begin{document} \begin{frame} \titlepage \end{frame} \begin{frame}{Introduction} Beamer class is used to make presentations using \LaTeX. Like any \LaTeX document you can create it with any text editor. \end{frame} \begin{frame}{Features of \textbf{Beamer}} \begin{itemize} \item \textbf{Beamer} is used to make presentations \item It allows to add animations \item you can embed images, videos , sounds and other media \item...

How to transliterate/ type Arabic, Bengali, Farsi (Persian), Greek, Gujarati, Hindi, Kannada, Malayalam, Marathi, Nepali, Punjabi, Tamil, Telugu and Urdu in Microsoft Word or any other windows application

Transliterate transliterate means that you type using English alphabets like "Duniya gol hai" and transliterate will convert it too دنیا گول ہے . Easy :) To use  transliterate   on your computer you need to download and install Google IME plugin for specific language from here  http://www.google.com/ime/transliteration/ After you install language toobar will apear in your taskbar or it might be a floating bar on your desktop. On windows 7 it looks like this. Whenever you want to write in urdu just choose urdu from this toolbar and start typing. When you type using English alphabet it will automatically convert it to urdu alphabets. It will also give you other possible words which match your input . Here is an example If you have any questions please leave a comment. Thanks