Friday 31 August 2018

Pushing an eclipse project to github for the first time

If you have an existing eclipse project that you want to push to an existing newly created repo on github, these are the steps:

1) Go to the eclipse project folder path in cmd prompt
2) git init
3) git add .
4) git commit -m "First Commit"
5) git remote add origin https://github.com/shamsa-abid/MyUPMiner.git
6) git pull origin master --allow-unrelated-histories(optional step)
7) git push -u origin master

However, it is recommended that you first create the repo on Github, clone it to a folder and create your eclipse project in that folder.

Solution for error: fatal: refusing to merge unrelated histories is step no. 6

Sunday 12 August 2018

How to properly display quotes in Latex

In latex when we want to add quotes like e.g. "Hello", the left quotes are rendered as right quotes.
The proper way to use quotes is NOT to use double quotes key.

In print, opening and closing double quotes are different; in TeX left quotes are coded as `` (on my keyboard this is on the left-most key on the upper row below ~). Right quotes are given by the two symbols '' (which is on the key below the single symbol " which is NOT used). Thus we have ``quote, unquote''. The same goes for single quotes, or `quote, unquote'.

Reference:
http://www.public.asu.edu/~arrows/tidbits/quotes.html

Wednesday 8 August 2018

How to include high resolution figures in Latex?

This could be the most frustrating and time consuming thing ever if you don't know how to go about it!


  1. First get your image into Word. (If you are copying it from Visio, use Paste Special and choose Enhanced Metafile. This makes the image extra sharp and clear at every zoom level).
  2. Then crop/resize it until you are satisfied with its size. Make sure you are currently in Print Layout with a 100% zoom factor.
  3. Now you need to trim off the paper size to make it equal to the size of the image. For this, click on the image and go to the Format bar and check its height and width. Specify the same height and width in the Paper Layout using custom size. Also, reset all margins and gutter to 0. If Word pops an alert just Ignore.
  4. Lastly, use Save As to save your word document as a PDF.(e.g. MyFigure )
  5. Then in Latex, use the following code:


\begin{figure}
\centering
\includegraphics[width=\linewidth]{MyFigure.pdf}
\caption{This is my figure}
\label{fig:MyFigure}
\end{figure}

Comment selected block of text in TexStudio: A keyboard Shortcut

Just select the text and press CTRL+T

Monday 6 August 2018

How to import a HUGE sql dump 586MB into phpMyAdmin?

If you directly try to import the sql file in phpMyAdmin you get an error as folows.

Warning: POST Content-Length of 615119678 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

Fatal error: Maximum execution time of 30 seconds exceeded in F:\xampp\phpMyAdmin\libraries\Psr4Autoloader.php on line 91

Solution:
Navigate to the location of mysql.exe inside the xampp folder in the command prompt.
Then type the following command:

mysql -u username -p new_database < data-dump.sql

This is what my command prompt looked like:
F:\xampp\mysql\bin>mysql -u root -p shamsa_db_8_6_2018 < shamsa_db_7_3_2018.sql
I was prompted for a password to which I just pressed enter.
After a while the data was dumped.

Saturday 4 August 2018

How to push local commits to online GitHub in Eclipse?

I found help for this issue from the link: https://wiki.eclipse.org/Git_and_EGit_for_Beginners

Following is an excerpt from the page:

In git, it(committing a change to the server) is a two step process. 1) You must COMMIT your changes at the file or folder level. This only commits them to a local git repository. To do the local commit, select the file, right-click menu, Team -> Commit. 2) To push them back to the server, you need to "Push to Upstream". You can only push to upstream at the project/repo level. You can't push an individual file, like you can in CVS.
To Push to Upstream, select the project/repo, select Team -> Push to Upstream.

Wednesday 1 August 2018

How to update references in texstudio after commenting out citations?

When you comment out lines including citations in your latex file, the references are not updated automatically in TexStudio. You have to go to Tools and click Bibliography.

The following will appear in the Messages view.

Process started: bibtex.exe "name_of_your_latex_file"
This is BibTeX, Version 0.99d (MiKTeX 2.9.6350 64-bit)
The top-level auxiliary file: name_of_your_latex_file.aux
The style file: IEEEtran.bst
Database file #1: name_of_your_latex_file.bib
-- IEEEtran.bst version 1.14 (2015/08/26) by Michael Shell.
-- http://www.michaelshell.org/tex/ieeetran/bibtex/
-- See the "IEEEtran_bst_HOWTO.pdf" manual for usage information.
Done.
Process exited normally


Now you can recompile and view your updated references!

Tuesday 31 July 2018

How to get rid of the Save Output to Printer Dialog?

  1. Open Control Panel.
  2. Under Hardware and Sound, click View Devices and Printers
  3. Right click on your printer and choose Remove Device
  4. Search your printer in system explorer and connect to it again by double clicking its icon

what is a good PhD contribution?

When PhD candidates embark on their thesis journey, the first thing they will likely learn is that their research must be a “significant ori...