Cite as:
Saad, T. "C++ – CALLING OVERLOADED OPERATOR () FROM POINTER".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2017/05/c-calling-overloaded-operator-from.html
Please Make a Note is a collection of science & technology tips and derivations that will make it easier for research scientists & engineers to perform the various tasks they are faced with. These notes cover a wide range of scientific topics, software, media, and data analysis utilities.
Wednesday, May 31, 2017
C++ – CALLING OVERLOADED OPERATOR () FROM POINTER
Monday, April 11, 2016
Find and Sort Files Recursively by Size on Linux
find . -size +5M -exec du -h {} \; | sort -nr
Cite as:
Saad, T. "Find and Sort Files Recursively by Size on Linux".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2016/04/find-and-sort-files-recursively-by-size.html
Monday, September 28, 2015
How to Release all PBS Jobs with qrls
First create a small script file
emacs qrlsall
#!/bin/bashjobids=$(showq -u tsaad | awk '{if ($3 == "UserHold") print $1;}')
echo $jobidsqrls $jobid
Now make qrlsall executable
chmod +x qrlsallVoila!
Cite as:
Saad, T. "How to Release all PBS Jobs with qrls".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2015/09/how-to-release-all-pbs-jobs-with-qrls.html
Monday, March 9, 2015
Latex v Symbol MathJax Wordpress
<script type="text/x-mathjax-config">According to MathJax documentation, this essentially enforces MathJax to use web-based or image fonts. It seems to do the trick and all my v's look pretty now.
MathJax.Hub.Config({
"HTML-CSS": {
availableFonts: []
}
});
</script>
Cite as:
Saad, T. "Latex v Symbol MathJax Wordpress".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2015/03/latex-v-symbol-mathjax-wordpress.html
Thursday, March 5, 2015
SVN List Modified Files Only
svn status | grep '^M'
Cite as:
Saad, T. "SVN List Modified Files Only".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2015/03/svn-list-modified-files-only.html
Tuesday, March 3, 2015
Git Remote Branches not showing/not listed
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*git fetch
Cite as:
Saad, T. "Git Remote Branches not showing/not listed".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2015/03/git-remote-branches-not-showingnot.html
Wednesday, July 16, 2014
Using GitStat to Generate Commit Statistics for Git Repositories
You will nee python and a working installation of gnuplot.
- cd ~/pkg/
- git clone git://github.com/hoxu/gitstats.git
- cd gitstats
- ./gitstats path-to-repository path-to-html-output
For more information on the options provided by gitstat, use
- cd ~/pkg/
- git clone git://github.com/hoxu/gitstats.git
- cd gitstats
- ./gitstats -c start_date=1/1/2014 ~/development/uintah-work/src ~/uintah-stats-2014/
./gitstats --helpNote that you will always need to use -c flag to change the gitstats configuration.
Cite as:
Saad, T. "Using GitStat to Generate Commit Statistics for Git Repositories".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2014/07/using-gitstat-to-generate-commit.html
Tuesday, June 24, 2014
Maximum Entropy PDF Reconstruction Code
Here is a summary of the maximum entropy method. You can access my code through the interface below. At the bottom of this page, you will find a example moments from known distributions. Use those to experiment with the code.
- Known Moments: The set of all known moments for the unknown distribution. Enter one moment per line in the textarea below. Moments are assumed to be integer moments and are given as m0, m1, m2, etc...
- Number of Moments: Specify how many moments you wish to use (from the set of known moments) to reconstruct the distribution
- Lower Bound: Specify the lower bound on the reconstructed distribution
- Upper Bound: Specify the upper bound on the reconstructed distribution
- Number of Integration Points: Has to do with the numerical quadrature algorithm. Defaults to 80,000
- Maximum number of Iterations: specifies the number of internal iterations of the nonlinear solver
- Tolerance: Specifies the nonlinear solver tolerance
- Finite Difference Jacobian: Use finite difference to compute the Jacobian matrix
- Discrete Distribution: Use to reconstruct Discrete distribution. NOTE: Make sure you use a realistic number of integration points!
Cite as:
Saad, T. "Maximum Entropy PDF Reconstruction Code".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2014/06/maximum-entropy-pdf-reconstruction-code.html
Tuesday, July 23, 2013
how to move keynote from one mac to another
http://geekinc.ca/moving-iwork-pages-keynote-and-numbers-from-an-old-apple-to-a-new-one/I basically moved the following files:
- Macintosh HD:Library:Preferences:com.apple.iWork09.Installer.plist
- Macintosh HD:Library:Preferences:com.apple.iWork09.plist
- Macintosh HD:Library:Application Support:Keynote
- Macintosh HD:Library:Application Support:iWork ’09
- Macintosh HD:Applications:iWork ’09
Cite as:
Saad, T. "how to move keynote from one mac to another".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2013/07/how-to-move-keynote-from-one-mac-to.html
Saturday, July 6, 2013
My New Project: Show Me the Math
Thank you all for your support,
yNot
Cite as:
Saad, T. "My New Project: Show Me the Math".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2013/07/my-new-project-show-me-math.html
latex2html Underline Equations and Formulas
latex2html main.texbut I ended up with a bunch of unsavory lines under all of my equations. Upon googling things a bit, I found the following solution that worked for me:
https://ccrma.stanford.edu/~jos/webpub/Eliminating_Black_Rules_Equation.htmlOn my mac, here's what I did:
- search for the file alt-rule.pro (on my Mac, I opened the folder /usr and searched for it there. the file was located under: /usr/local/texlive/2012/texmf/dvips/config/
- edit the file as suggested by the link above. i.e., replace
gsave newpath /ruleY X /ruleX X
with
gsave newpath
transform round exch round exch itransform
/ruleY X /ruleX X
Cite as:
Saad, T. "latex2html Underline Equations and Formulas".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2013/07/latex2html-underline-equations-and.html
Thursday, June 13, 2013
How to change username and password in git-svn?
http://jamiemonserrate.wordpress.com/2010/01/11/how-to-change-username-and-password-in-git-svn/
Cite as:
Saad, T. "How to change username and password in git-svn?".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2013/06/how-to-change-username-and-password-in.html
Thursday, May 2, 2013
SVN revert recursively
svn revert -R .
Cite as:
Saad, T. "SVN revert recursively".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2013/05/svn-revert-recursively.html
Wednesday, April 10, 2013
git autocomplete on Mac OS X
curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash echo "source ~/.git-completion.bash" >> ~/.bash_profile
and Voila!
Thanks to Mike Pottyn for this: http://railslove.com/blog/2011/11/25/git-autocomplete-in-bash-on-a-mac
Cite as:
Saad, T. "git autocomplete on Mac OS X".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2013/04/git-autocomplete-on-mac-os-x.html
Thursday, January 31, 2013
Generate List of Publications from bib File
Cite as:
Saad, T. "Generate List of Publications from bib File".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2013/01/generate-list-of-publications-from-bib.html
Monday, September 17, 2012
XCode 4 Build Locations (Lion, Mountain Lion)
The new xcode 4 has had a major rehaul. I just updated to mountain lion and the latest xcode (4.4.1). The first annoying feature that you will notice about xcode is the non-intuitive and complex user interface. I can't even find the console or the debugging tools... oh wait, they're placed at the bottom of the screen and they're practically invisible. Maybe it is time to read the documentation... but who has time for that?
In any event, I went ahead and tested a "Bonjour y'all!" code and it worked. but I could not locate the executable file in the project's directory. Are you serious? It turns out that XCode defaults to some location in your library. Fortunately, I just found a way to go back to standard operation and place your executable where it BELONGS:
- Open XCODE
- go to: Preferences
- Click on the "Locations" tab
- Change the path for "Derived Data" to relative and that should do it.
- If you want to be a bit more picky, click on Advanced
- select "Custom"
- Select "Relative to Workspace"
Cite as:
Saad, T. "XCode 4 Build Locations (Lion, Mountain Lion)".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2012/09/xcode-4-build-locations-lion-mountain.html
Friday, September 14, 2012
Calling gnuplot from C/C++ on Mac OS X
First install gnuplot either from their website or using macports. I like the macports model because it installs all dependencies for you automatically.
- Install macports from: http://www.macports.org/
- Open up your terminal
- type: sudo port selfupdate (to update port names)
- type: sudo port install gnuplot
- Open up your terminal
- type: gnuplot
- type: set terminal x11
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void plotResults(double* xData, double* yData, int dataSize);
int main() {
int i = 0;
int nIntervals = 100;
double intervalSize = 1.0;
double stepSize = intervalSize/nIntervals;
double* xData = (double*) malloc((nIntervals+1)*sizeof(double));
double* yData = (double*) malloc((nIntervals+1)*sizeof(double));
xData[0] = 0.0;
double x0 = 0.0;
for (i = 0; i < nIntervals; i++) {
x0 = xData[i];
xData[i+1] = x0 + stepSize;
}
for (i = 0; i <= nIntervals; i++) {
x0 = xData[i];
yData[i] = sin(x0)*cos(10*x0);
}
plotResults(xData,yData,nIntervals);
return 0;
}
void plotResults(double* xData, double* yData, int dataSize) {
FILE *gnuplotPipe,*tempDataFile;
char *tempDataFileName;
double x,y;
int i;
tempDataFileName = "tempData";
gnuplotPipe = popen("gnuplot","w");
if (gnuplotPipe) {
fprintf(gnuplotPipe,"plot \"%s\" with lines\n",tempDataFileName);
fflush(gnuplotPipe);
tempDataFile = fopen(tempDataFileName,"w");
for (i=0; i <= dataSize; i++) {
x = xData[i];
y = yData[i];
fprintf(tempDataFile,"%lf %lf\n",x,y);
}
fclose(tempDataFile);
printf("press enter to continue...");
getchar();
remove(tempDataFileName);
fprintf(gnuplotPipe,"exit \n");
} else {
printf("gnuplot not found...");
}
}
This code should run as is. Of course, feel free to take the plot function and use it in your own codes.
Cite as:
Saad, T. "Calling gnuplot from C/C++ on Mac OS X".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2012/09/calling-gnuplot-from-cc-on-mac-os-x.html
Thursday, June 23, 2011
The Maximum Entropy Method for Reconstructing Density Distriubtions
Cite as:
Saad, T. "The Maximum Entropy Method for Reconstructing Density Distriubtions".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2011/06/maximum-entropy-method-for.html
Monday, April 11, 2011
Quadrature Methods for Numerical Integration
Download PDF.
Cite as:
Saad, T. "Quadrature Methods for Numerical Integration".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2011/04/quadrature-methods-for-numerical.html
Saturday, April 2, 2011
Endnote Auto-formatting parentheses
Sometimes, in your word document, if you write certain acronyms between parentheses, EndNote may think that this is a reference. To prevent this from happening, in EndNote, do the following:
Files->Preferences->Autoformat
and change the delimiters from parentheses to something else.
Cite as:
Saad, T. "Endnote Auto-formatting parentheses".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2011/04/endnote-auto-formatting-parentheses.html