Mohammadreza Hadizadeh

How to delete ._ files in MAC

Pasted Graphic 14

Problem:
How one can clean the ‘dot underbar‘ files or ‘Apple double‘ files?
Solution:
1) Open up the terminal application and enter the following command to merge & delete the files:
$ dot_clean -m DIRECTORY_ADDRESS


DIRECTORY_ADDRESS is the address of the folder or the directory that you want to clean the  ._ files.
If you want to delete all ._ files in your MAC just replace it with ‘./’.

2) or you can delete the files by entering the following command in the terminal:
$ find DIRECTORY_ADDRESS -name ._\* -delete


How to empty file cache on Mac OS X

Pasted Graphic 13

Problem:
How one can make free the allocated RAM to the file cache?
Solution:
Open up the terminal application and activity monitor. In terminal enter the command:
$ sudo purge


If one checks the activity monitor it should show the reduction in RAM usage on the Mac and the file cache should be cleared.

Run gedit on Mac OS X Mavericks

Pasted Graphic 12
1) Download the last version of gedit (gedit-3.2.6-3) from gnome.org for Mac OS X (Click here for direct download link).
2) Install gedit application.

To solve the problem of running gedit on Mac OS X Mavericks, we need to update the version of libxml2 packaged with gedit as follow:
3) use the command
$ brew install libxml2
4) and then
$ cp /usr/local/Cellar/libxml2/2.9.0/lib/libxml2.2.dylib /Applications/gedit.app/Contents/Resources/lib/
point: If in the last step, you get the error message
cp: /usr/local/Cellar/libxml2/2.9.0/lib/libxml2.2.dylib: No such file or directory
you need to check the version of installed libxml2 on your system (here it is supposed to be 2.9.0) and change the version in cp command.

Search not working properly in mail (Mac OS X)

Pasted Graphic 10

If there are problems with information in your mailboxes, you might see an alert message saying that Mail needs to repair your mailboxes by reindexing your messages for you.
At other times, you may want to reindex messages yourself—for example, when searching mailboxes using Subject, To, or From doesn’t return the correct results.


1) Quit Mail if it is open.
2) In ~/Library/Mail/V2/MailData, delete any file that begins with “Envelope Index,” such as Envelope Index, Envelope Index-shm or Envelope Index-wal.
3) Your home Library folder is hidden by default. To display it, choose Finder > “Go to Folder” and then enter “~/Library”.
4) Then open Mail. Mail creates new Envelope Index files. This process may take a few minutes, depending on how many messages Mail is reindexing.

Computation Tools: C/Fortran Compilers for Mac OS X

Pasted Graphic 9

GCC 4.7, 4.8, 4.9 (auto-vectorizing gcc with OpenMP):
Compiled using source code from the GNU servers. This contains current versions (4.7 is the stable release) of gfortran (free, open source, GNU Fortran 95 compiler), gcc (GNU C) and g++ (GNU C++) compilers that can perform auto-vectorization (i.e. modify code to take advantage of AltiVec/SSE, automatically) and other sophisticated optimizations like OpenMP. For more information, see this webpage.
Installation of gfotran:
1) Install Xcode: You will need to have Apple's XCode Tools installed from the Mac App Store. On LION & M. LION, with XCode 4 or 5 you will need to download the command-line tools as an additional step. You will find the option to download the command-line tools in XCode's Preferences  (click on Downloads tab). On 10.9 Mavericks, you can get the command-line tools by simply typing
$ xcode-select --install
2) Download one of following binaries,
Binaries:
gcc-4.9-bin.tar.gz, gfortran-4.9-bin.tar.gz (gfortran only), updated Oct 2013 (10.9 Mavericks only).
gcc-4.8-bin.tar.gz, gfortran-4.8-bin.tar.gz (gfortran only), updated Oct 2013 (M. Lion & Mavericks).
gcc-4.7-bin.tar.gz, gfortran-4.7-bin.tar.gz (gfortran only), updated July 2012 (Lion & M. Lion).
Documentation:
click here!
3) Installation
$ cd to the download folder.
then
$ gunzip gcc-4.8-bin.tar.gz (if your browser didn't do so already)
then
$ sudo tar -xvf gcc-lion.tar -C /
It installs everything in /usr/local.
You can invoke the Fortran 95 compiler by simply typing
gfortran, as following example:
$ gfortran your_program.f

g77 3.4: This is the FINAL release of g77 (version 3.4 compiler). Future versions of GCC will have gfortran (see above).

Installation of g77:
1) Install Xcode:
You will need to have Apple's XCode Tools installed from the Mac App Store. On LION & M. LION, with XCode 4 or 5 you will need to download the command-line tools as an additional step. You will find the option to download the command-line tools in XCode's Preferences  (click on Downloads tab). On 10.9 Mavericks, you can get the command-line tools by simply typing
$ xcode-select --install
2) Download one of following binaries Binaries: g77-bin.tar.gz (PowerPC only),
g77-intel-bin.tar.gz (Intel Mac only), updated October 2006.
Documentation:
click here!
3) Installation
$ cd to the download folder.
Then

$ gunzip g77-bin.tar.gz (if your browser didn't do so already)
and
$ sudo tar -xvf g77-bin.tar -C /
It installs everything in /usr/local.
F2C based Fortran:
This is the oldest Fortran compiler available for OS X. Its been around since OS X was in a public beta state.
Installation of F2C:
1) Download following shell script:
script: buildf2c
Documentation:
click here!
2) then type
$ chmod +x buildf2c and then
$ sudo ./buildf2c
The script will grab f2c source from Netlib repositories and install a f2c based compiler in/usr/local/. You are done! The compiler can be envoked by the commands fc or f2c.
Reference: HPC for MAC OS X

Matlab loads, but "freezes" after taking Java update in Mac OS X

Pasted Graphic 6

After taking the Java update via the App store, Matlab will launch and open the last file, however, it will freeze and don't open any file. This is a Java issue and reinstalling Matlab or a new user profile will not resolve.
Context
- Affects MATLAB 2012b and earlier, with the Java for OS X 2013-004 update - The original update gives build 1.6.0_51-b11-456-10M4508 - This can be verified by running the command below in terminal and comparing the build
$ java -version
Good:
Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
Java(TM) SE Runtime Environment (build
1.6.0_51-b11-457-11M4509)
Bad:
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-456-10M4508)

SOLUTION - Apple's update has been fixed, however, it is not being pushed via updates to clients already affected. It is now safe to update via the Appstore, Java for OS X 2013-004 is the package. - If you are stuck on version 10M4508, you can manually update:
* for 10.7/10.8: http://support.apple.com/kb/DL1572
*
for 10.6: http://support.apple.com/kb/DL1573

Installing XmGrace (Grace) on Mac OS X

Pasted Graphic 5
(updated on June 9, 2016)

METHOD 1:
1) Install Xcode:
$ xcode-select --install
2) Install open motif
$ sudo port install openmotif
3) Install Xmgrace
$ sudo port install grace
4) Open Xmgrace and enjoy!
$ xmgrace

METHOD 2:
1) Install motif libraries. You can download binary from here:
http://www.ist.co.uk/downloads/motif_download.html
2) Grace download and install:
$ cd Desktop
$ wget ftp://ftp.fu-berlin.de/unix/graphics/grace/src/grace5/grace-5.1.23.tar.gz
$ tar xzvf grace-5.1.23.tar.gz
$ cd grace-5.1.23
$ ./configure --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib --with-motif-library=-lXm --with-extra-incpath=/usr/OpenMotif/include:/usr/local/fftw-3.3.4/include --with-extra-ldpath=/usr/OpenMotif/lib:/usr/local/fftw-3.3.4/lib
$ make
$ sudo make install
$ echo "export PATH=$PATH:/usr/local/grace/bin" >> ~/.bashrc
$ source ~/.bashrc
$ xmgrace
Tips:
- on Mac OS X Lion, wget doesn't work. Use curl -O instead of wget.
- if in the last step, when you try to run xmgrace, you get the following error:
$ xmgrace
Can't open display
Failed initializing GUI, exiting
you can try:
$ DISPLAY=:0.0 xmgrace
if it doesn’t solve the problem, you need to open XQuartz and then enter the following command:
$ DISPLAY=:0.0 xmgrace

Xmgr Grace application for Mac OS X & Mac OS X Lion

Pasted Graphic
This is a very easy to use, open-source, X11 based, 2D plotting tool. For installation move the Grace application to the system /Applications folder for it to function correctly.

DOWNLOAD:
Binaries: Grace (PowerPC only),
Grace Lion, updated Jan. 2012
Grace updated Aug 2014.
Documentation: click here!