Tuesday, December 11, 2012

setspace - Double line spacing - TeX - LaTeX

setspace - Double line spacing - TeX - LaTeX

For double spaced lines in LaTeX (one line space between each line, e. g. so someone could write in the white space for editing purposes) I used:

\usepackage[doublespacing]{setspace}

Wednesday, December 5, 2012

Linux Mint Forums • View topic - LM 13 maya cinnamon x64 network printer install problem (Setting up network printers in Linux Mint 13 Maya)

Linux Mint Forums • View topic - LM 13 maya cinnamon x64 network printer install problem

Had issues with the in house system settings printer config.  I would type in the IP address and it only found a few printers, none of them are correct.

Had to use the command in the terminal: system-config-printer

This brought up a config tool which worked fine.  I saved the program icon as a launcher in AWN.

Monday, November 26, 2012

Linux Mint 14 with Cinnamon Desktop [Review] | OMG! Ubuntu!

Linux Mint 14 with Cinnamon Desktop [Review] | OMG! Ubuntu!

One opinion of Mint, specifically 14.  So far, I love it.  A great alternative to Ubuntu.  Although, I haven't tried its multi-monitor support

Friday, November 23, 2012

Sage - Download for Linux - Version 5.4.1

Sage - Download for Linux

For those keeping up, ver 5.4.1 has been released.  I have kind of let Maxima and Sage fall to the wayside for now, like I've said before.  For now python and Asymptote are working pretty well for me.  If only I could get the contour plot to work in Asymptote...:(

Tuesday, November 20, 2012

Asymptote Graphics Package - A preliminary 2D plot

Alright, so awhile back, I think this past summer, I was experimenting with Asymptote in order to replace Origin.  Origin is great and probably the best, but I only have access to it through Windows, and I am not a fan at all of Windows and even more Microsoft products especially Office such as Word and PP.  So I am trying to find an alternative to Origin to create high quality publication ready graphs.  I've briefly looked at SciDavis (a free Origin type software), but it is missing a lot of options and just doesn't look as good.  There is also matplotlib for Python, but the images just don't look "right" as well (same can be said for Matlab, Mathematica, Maxima, and Sage plots).  I dunno what it is, but for me they just don't cut it, so far.  Now, Asymptote looks GREAT!  However, it is command line based which may scare some people and there isn't much in the way of help and/or examples like say compared to matplotlib or Matlab which can be quite frustrating, especially if something doesn't work right off the bat and you have to debug and figure it out on your own.  I had a bit of this, but once I got done I was ecstatic!

So for a 2D plot here is my example.  I hope this helps at least one person.  I would like to one day generate many examples if possible.  I will post links later as I forgot where I found some help.

This is preliminary and I will be cleaning it up later.  For the code:


import graph;

size(300, 200, IgnoreAspect);

real L = 2;

real a = 1;

real l = L/a;

real z = 0.5;

real z_ovr_l = z/l;

real sigma = 25;

real kappa = 1/(2*pi*l*sigma);

real u_z(real r) {return 2*pi*z*(cos(pi*(r^2)));}

draw(graph(u_z, 0, 1), "$u_z$");

xaxis("$r$", Bottom, LeftTicks);
yaxis("$u_z$", LeftRight, RightTicks(6,2));


Generates
In order to "run" or compile the Asymptote code, I used the built in terminal, Konsole, in Kile.  I usually have the .asy file saved in a folder called something like Asymptote files.  I then open the .asy file in Kile and click the Konsole button at the bottom.  To run the file type in the terminal (make sure you're in the folder where the file is; it should be already there if you opened the file in Kile):

For an .eps file type: asy -V test or just asy test where test is the name of the file and -V brings the image up in a viewer.

For a .pdf file type: asy -V -f pdf test or asy -f pdf test

More later.

The Linux Mint Blog » Blog Archive » Linux Mint 14 “Nadia” released!

The Linux Mint Blog » Blog Archive » Linux Mint 14 “Nadia” released!

Asymptote, a graphics software « Bubbles Bad; Ripples Good

Asymptote, a graphics software « Bubbles Bad; Ripples Good

A nice, short blog post on Asymptote and also a bit on MetaPost, MetaFont, and PGF/TiKZ.

Monday, November 19, 2012

Sunday, November 18, 2012

Placing LaTeX .sty files in Ubuntu/Mint/Linux

Ok, so since switching to Mint I had to reinstall all software programs including TeX Live.  I forgot that I had installed the latest version TeX Live 2012 in Ubuntu from this post so I just installed from the repositories which is version 2009 (uses the same or similar repositories as Ubuntu) for Mint 13.

I was trying to compile a .tex file in Kile when I received an error stating that the bigints.sty could not be found.  Now there are a few ways to solve this.  One is to install TeX Live 2012 which is what I did before.  Two is to download and install the bigints.sty file from

http://www.tex.ac.uk/CTAN/macros/latex/contrib/bigints/

or

http://www.ctan.org/tex-archive/macros/latex/contrib/bigints

and then place it into the directory of the file you are compiling.  This is a per file thing.  if you want to install universally you can either install into the directory (for me at least) /usr/local/share/texmf/ where I found to go onto /usr/local/share/texmf/tex/latex.  It is then suggested to create a folder named after whatever the file name is.  So in this case something like /usr/local/share/texmf/tex/latex/bigints.  However, I could not create a folder in Nautilus probably because I am not logged in as admin.  I tried to open a terminal and did su and typed in my password and went back to Nautilus with no luck.  I didn't feel like looking up the commands to do this in the terminal which would have probably worked fine especially since I saw an alternative I could try.  This alternative is to create the same file structure in your home directory.  This is useful especially if you DON'T have access as an admin.  So I created ~texmf/tex/latex/bigints and placed the .sty file there.  Oh, I also saw where you might have to run texhash which I did through Kile's built in Konsole.  Viola!  It worked!

I also noticed that there is a texmf-texlive file under the share folder so this might be a possibility as well if the other route through just texmf doesn't work.






Found help from the following links:

http://www.volkerschatz.com/tex/tpacks.html
http://tex.stackexchange.com/questions/39771/finding-a-ubuntu-package-for-a-sty-file
http://stackoverflow.com/questions/1911713/add-find-style-files-in-to-latex
http://ubuntuforums.org/showthread.php?t=334047

Wednesday, November 14, 2012

Fallback Mode (Classic Session) To Be Dropped From GNOME 3.8 ~ Web Upd8: Ubuntu / Linux blog

Fallback Mode (Classic Session) To Be Dropped From GNOME 3.8 ~ Web Upd8: Ubuntu / Linux blog

Hmm, not sure what to think here.  I guess this means Ubuntu as well?  Dang, as I am not liking Unity anymore.  It seems to be heavy resource wise.  Plus, I can only get Gnome classic/fallback to get my quad monitors to work without much fuss.  I've installed Mint with Cinnamon DE on my laptop, and I like it pretty well so far.  I think I will use this if Gnome classic goes out the way.  I tried to install the Cinnamon DE in Ubuntu, but I am not sure if it worked as it looks exactly like Gnome classic, which could be good, but I thought it would look more like Mint, I dunno.

Saturday, November 10, 2012

Header/Footer in Latex with Fancyhdr « LaTeX Matters

Again, I apologize for not updating as much and not being able to get to comments :(.  Really busy with school and behind, but I am trying to make an effort to update a bit now!

Header/Footer in Latex with Fancyhdr « LaTeX Matters

Good blog post on a bit about the LaTeX package fancyhdr which controls and gives options for headers and footers.

Some other links:

http://en.wikibooks.org/wiki/LaTeX/Page_Layout

http://latexforhumans.wordpress.com/2009/01/09/fancyhdr/

http://timmurphy.org/2010/08/07/headers-and-footers-in-latex-using-fancyhdr/

As an example, I wanted to place a line at the bottom of the page (or footer) right above the page number for every page, except the title page of course.

Here is some of the "code."


\usepackage{fancyhdr}  % controls headers and footers
\pagestyle{fancy}
% \fancypagestyle{plain}
\fancyhf{} % clear all header and footer fields
% \fancyhead{} % clear all header fields
% \fancyfoot{} % clear all footer fields
\fancyfoot[C]{--\thepage--}
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0.4pt}



Here is the result.



Thursday, November 8, 2012

Linux Mint Forums • View topic - Fast Playing Youtube Videos.

Linux Mint Forums • View topic - Fast Playing Youtube Videos.

http://forums.linuxmint.com/viewtopic.php?f=48&t=106040&start=0&hilit=youtube

I was having this problem.  Fixed!

System Tools -> Systems Settings -> Sound -> change output from HDMI and video card(???? weird I know) to, in my case, analog sound card and speakers.

Or just click on the sound icon in the lower right and select the appropriate output device.

Monday, October 8, 2012

23 Brand New Features in Ubuntu 12.10 Quantal Quetzal [Screenshots Tour] | Tech Drive-in

23 Brand New Features in Ubuntu 12.10 Quantal Quetzal [Screenshots Tour] | Tech Drive-in

The official release will be out soon.  Having mixed feelings about Ubuntu.  On my desktop I use 4 monitors which doesn't bode well in Ubuntu Unity so I am using Gnome fallback for my setup to work without much setup work (:P).  I am testing Mint 13 on a laptop.  May try it on the desktop if it works ok.  Trying Mint because they have more of a Gnome 2 desktop feel (multi-monitor setup with some ease in mind) with Cinnamon (haven't tried MATE yet which is a Gnome 2 fork).  Mint's also based off Ubuntu releases which helps with transition for me.  I just don't use the Unity features that much, not even on my laptop where I can actually use Untiy without fuss!

Tuesday, October 2, 2012

Linux Mint (or other Linux versions which require a code to set time and date)

I'm trying out Linux Mint 13 Maya with Cinnamon.  I dunno, I guess I am getting kind of tired of Ubuntu?  So we'll see how Mint stacks up.  So far it looks very nice.  I guess I am getting tired of the Unity theme and poor multi-monitor support.  Although, I've first installed Mint on one of my laptops side-by-side with Ubuntu.  Pretty easy installation using a USB stick.

Anyways, I was trying to adjust the time and in the Cinnamon Settings under Calender it requires a "code" of types.  Go here to get the look you want.

http://www.foragoodstrftime.com/




I found that if you go to the Date and Time under System Tools and System Settings you can change the date and time normally.



Tuesday, September 18, 2012

Avoid integer division when programming

I didn't realize I was doing this but noticed I did have a problem for one of my Python scripts.  I was doing 1/2 which is apparently a no-no in programming.  I fixed it by doing 0.5*...  Other ways include 1.0/2 etc.

Commenting in Python

To comment in Python simply use the pound sign, #, in front of what ever it is you would like to comment.  For Spyder users, the shortcut to this in the editor is Crtl+1.


Reserved words in Python


If you've been experimenting with Python, as I have, then you might notice that some words are saved for some certain processes.  For example lambda is one of these words.  I tried to use it as a variable name.  it will usually highlight in blue if it is important.  So an alternative is to use lamb_da or lamb_duh etc.

Other words include:

and, as, assert, break, class, continue, def, del, elif, else, except, False, finally, for, from, global, if, import, in, is, lambda, None, nonlocal, not, or, pass, raise, return, True, try, with, while,and yield.


Langtangen, H. P. (2012). A Primer on Scientific Programming with Python (3rd ed.). Heidelberg: Springer. doi:10.1007/978-3-642-30293-0

Differences between Python (scripting programming) and traditional programming C/C++/Fortran etc. (system programming)

This post is a summary from Langtangen's (2009) book Python Scripting for Computational Science (Chapter 1 Introduction).  Langtangen breaks down the programming languages into scritpting and traditional types.  Langtangen comments that these are quite different in programming style and are usually geared towards different goals.  The traditional programming languages are also known as system programming and are used for building (usually large, monolithic) applications (systems).  These languages include Fortran (77/90/95/2003), C, C++, C#, and Java.  Langtangen refers to scripting as programming at a high and abstraction level.  These languages include Perl, pythin, Ruby, Scheme, and Tcl.




Langtangen, H. P. (2009). Python Scripting for Computational Science (3rd ed.). Berlin: Springer. doi:10.1007/978-3-540-73916-6

Python 2 vs. Python 3

This is a summary from Langtangen's (2012) latest edition of A Primer on Scientific Programming with Python (found in the preface).  Currently, there are two versions of Python generally called Python 2 and Python 3.  You may have a version such as Python 2.7 or 3.2, etc.  Python 3 is an updated Python language which has some different syntax notation from Python 2.  However, some mathematical software for Python has not been ported to use with Python 3.  Langtangen provides one suggestion which is to use the latest 2, 2.7, and then use the translation tool 2to3 to obtain the code for version 3.

Langtangen also suggests to use the latest syntax and modules which will make the differences between 2 and 3 small.  This is the format Langtangen uses for his book.  He lists two distinct differences in the book's programs:

1. a/b implies float division in version 3 if a and b are integers
2. print 'Hello' in version 2 must be converted to a function for 3 such as print('Hello')

Langtangen states that users using version 3 should have any major issues studying the books version 2.7 program codes.



Langtangen, H. P. (2012). A Primer on Scientific Programming with Python (3rd ed.). Heidelberg: Springer. doi:10.1007/978-3-642-30293-0

Friday, July 20, 2012

Highlighting in LaTeX with the soul package - highlighting citations

Ok, after a quick search, I found that if you put an extra set of brackets around the \cite{}, then the highlighting should work!!

 So for example, \hl{{\cite{citation}}}

 It should work for other citation types too, \citeyear, etc.  I haven't tried it, but it probably works for other environments.

http://tex.stackexchange.com/questions/20021/how-to-highlight-paragraph-linebreak-preserving-as-well-as-itemize-tabular-et

Here is a screen shot from me:



Thursday, July 19, 2012

Some common functions in Maxima - trig, logarithms, the exponential, and square root

http://maxima.sourceforge.net/docs/manual/en/maxima_10.html#SEC47

exp(x)
log(x)
sqrt(x)
acos(x)
acosh(x)
acot(x)
acoth(x)
asin(x)
asinh(x)
asec(x)
asech(x)
acsc(x)
acsch(x)
atan(x)
atanh(x)
cos(x)
cosh(x)
cot(x)
coth(x)
sin(x)
sinh(x)
sec(x)
sech(x)
csc(x)
csch(x)
tan(x)
tanh(x)
Maxima does not have a built-in function for the base 10 logarithm or other bases. log10(x) := log(x) / log(10) is a useful definition.

Saturday, July 14, 2012

Maxima/wxMaxima - solving for the roots of a transcendental equation

Ok, so something is wrong with my Python.  I think Spyder is giving me some fits in Ubunt for somereason.  Anyways, luckily I have Maxima and Sage to fall back on.  In order to solve for the roots of a transcendental equation, I provide a following example.

The equation I want to solve is:

\[ \tan \left( \tfrac{1}{2} C d^2 \right) - \tan \left( \tfrac{1}{2} C a^2 \right) = 0 \]

where \( \deta \) is given.  I first plotted it to make sure it did in fact show trends of a root or roots for \( \delta = 0.5\).

delta:0.5;
eqn(x):= tan(0.5*x*(delta^2)) - tan(0.5*x);
plot2d(eqn, [x, 0, 20],[y, -1, 1]);

So, yup, it definitely has roots.  The first root is actually at zero, but this is trivial in my case.  So I am interesting in the second root.  It seems to be around 8.  I choose the interval for the root finder to look on as 7.8 to 8.5.

find_root(tan(0.5*x*(delta^2)) - tan(0.5*x), x, 7.8, 8.5);
8.377580409572781

So the root found is the bold number above!

Kile Issue - Keyboard suddenly does not work

I have run into the keyboard suddenly not working in Kile on occasion.  This is because there is some character length error which automatically enables Read Only Mode.  To fix this simply go to the Tools menu and disable the Read Only Mode (should have a check mark) by selecting it with a click of the mouse.  I went through some headaches with this before figuring out this simple fix from some help at KDE.  I filed a bug report and received responses which pointed to this simple fix.  It's always something stupid or simple, isn't it?

http://askubuntu.com/questions/82727/kile-does-not-get-keyboard-input-respond-to-altf

https://bugs.kde.org/show_bug.cgi?id=292766

gnome classic panel + unity launcher in ubuntu 12.04 precise - YouTube

gnome classic panel + unity launcher in ubuntu 12.04 precise - YouTube

edit: Well so much for that.  Compiz is apparently crashing I can't run the command anymore :(  SO I just moved the Avant bar back to the bottom, not bad, but not Unity either.  Ubuntu really needs to fix these issues including supporting multiple monitors (more than two) with ease if they want to stop the bleeding.  Fortunately, there really isn't a competitor out there (for me at least) that I have found.

Heck yeah!  I'm using GNOME classic (fallback session) because it's the only one that can run my Quad monitors fairly well (Wasn't a huge fan of Kubuntu nor Xubuntu.  I liked them but they seemed to be slow at times and things would crash on me for some reason. I've just always come back to Ubuntu-GNOME classic.)

Anyways, I really liked the Unity launch bar and tried to replace it with Avant, Cairo, and Docky.  Cairo looked nice, but I had issues with windows blocking it and didn't feel like trying to fix it.  Avant worked pretty well but once I filled up the side bar it's scrolling feature sucked.

Finally, found this, duh.  You can launch the Unity 2D shell in GNOME classic!!  The Unity 2D login didn't work for quads either which is why I am not using it if you are wondering.

Run:

sudo apt-get install gnome-session-fallback unity-2d-launcher


if not already installed, then log into GNOME classic, open a terminal, and run:

unity-2d-shell


The thing is I've probably read how you could do this, but I just didn't realize it.  The whole Unity, Unity 2D, GNOME, GNOME classic thing can be quite confusing.

Here is a nice post which goes into quite some detail (scroll down to the comment section as well; the author puts several informative responses there).

http://complete-concrete-concise.com/ubuntu-2/ubuntu-12-04/ubuntu-12-04-how-to-install-the-gnome-desktop

See the thing is this link^^^ says install GNOME desktop which now seems to include the GNOME 3 shell/desktop, the GNOME classic, and the GNOME classic (no effects).  Quite confusing because you can install the GNOME classic with a different command I thought.  It also seems, now that I understand, that GNOME classic simply runs on top of GNOME 3 with the GNOME 2 look alike desktop...?  Whatever, it works so far with me and my quads and I'm happy with the desktop (not Xubuntu, Kubuntu, etc).  I think I'll try to figure this out and break it down in another post some other time.

edit: plus each one runs on different window management systems such as compiz, metacity. etc...sheesh

Zotero Standalone and Zotero Connectors and more on citation/reference software

http://www.zotero.org/

Uh, hello, wow, finally, this is cool!! So, Zotero, my second favorite bibliography manager now has a standalone and a connector version of their software. I really liked Zotero when I first started using it, but found my way over to Menedeley Desktop once it came out. Both are very good alternatives to EndNote or even JabRef, and both have their pros and cons. Anyways, Zotero has released (since when, I don't know) alpha versions of a standalone and connector Zotero citation software. The standalone is what is says, a standalone version of Zotero (like Menedeley is a standalone) which used to require running in the Firefox web browser. The standalone is also cross-platform with downloads for Windows 2000 or later, Mac Intel, OS X 10.5 or later, and Linux 32- and 64-bit versions. I really like this because for some reason I was turned off by having to use Zotero in Firefox. I like Firefox and Zotero and all, but I use Chromium/Chrome more and just like Mendeley better. Actually, it has been awhile since I have used Zotero so I can really say what I liked or did not like. I'll have to review my older post which I will also add an update to.

Anyways, so you might be wondering or ask why am I so excited about having Zotero standalone if I use Mendeley all the time? Well, to tell you the truth, I am kind of an I like to have everything just in case I need it even though I probably don't need it or won't ever use it. I have gotten better with this obsession, but in reality it is probably for the better to have Zotero and to be able to convert between Mendeley if needed, since, as I plan to stay in academia or least research intensive, I will be collaborating with many people from around the world and who use different software. So I figure having Mendeley and Zotero on board I can cover most people's citation choices with both (not totally sure about this, I will update as I find out).

Pulled this one out of the archives.  Had it as a draft forever.  Finally installed Zotero standalone.  I founf this:

http://www.stephanieplumeri.net/blog/category/install-wizard/

which linked to this:

http://anterotesis.com/wordpress/2011/11/installing-zotero-standalone-on-ubuntu-11-10/

I couldn't get this^^ to work so after I downloaded and unpacked the file I just moved the folder to my home.  You can then double click the Zotero executable and then pin it to a launch bar.  It has this weird obsession to try to install itself in Libre every time I run it.  I don't want to atm so I clicked Cancel, it says are you sure you can install it later, I say yes OK.  It repeats!!  SO finally I clicked on the X to close the window box and it went away.  I might just let it install so it goes away.  I just figured that I am not ever going to use it in Libre so I didn't want/need to install.

I haven't tried the connectors either.  Normally Zotero works natively in FireFox, but it now has the ability to do the same in Chrome and Safari (haha, screw IE).  I didn't do this because I mainly use MD and won't be using Zotero too often.  I think I'll keep it on board for backup and just to keep up with the software.

Kile Issue: Toolbars and menus gone

[kubuntu] Kile problem: Toolbars and menus gone after upgrade to hardy - Ubuntu Forums

^^Linked from this thread: [ubuntu] kile: menu bar disappeared - Ubuntu Forums:

This is weird.  The menu bar where File, Edit, View, etc. had disappeared from Kile.  I still had the toolbar with the New, Open, etc. buttons.  Must have happened when I reinstalled Kubuntu and Xubuntu cause my GNOME classic had messed up (It was my fault, I had tried messing with it to get the windows to snap but never did and ended up messing some things up where it wouldn't work correctly at all.  Finally got back GNOME classic working again.  Leaving it alone for now.  I think it stems from my quad monitor setup.  *sigh* Maybe one day Ubuntu-Unity will work flawlessly with quads.  I probably could figure it out messing with the xconfig, but I don't have the time or patience at the moment.  Anyhoo...).  The fix which worked for me was:

I stumbled across this problem lately and this thread was the only hint to a solution that I could find. A very simple fix is to restore Kile to its default settings by removing your own settings (this does not affect your user defined shortcuts). Close Kile, open a terminal and type
Code:
rm $HOME/.kde/share/config/kilerc
Restart Kile. Done.

Friday, July 13, 2012

How to Install Latest Version of Chromium Browser in Ubuntu ~ Ubuntu Vibes | Daily Ubuntu Linux Updates

How to Install Latest Version of Chromium Browser in Ubuntu ~ Ubuntu Vibes | Daily Ubuntu Linux Updates

sudo add-apt-repository ppa:towolf/crack
sudo apt-get update
sudo apt-get install chromium-browser I noticed that it defaults to Yahoo for searching using the webpage name bar. You can change this under settings.

Installing/updating Maxima and wxMaxima to 5.27 and 12.04, respectively

It had been awhile since I had used wxMaxima/Maxima on my desktop, and I was getting an error when I was trying to run calculations that wxMaxima was not connected to Maxima.  I began to search for a solution then decided to check the version.  A newer version had of course come out for Maxima-xMaxima as 5.27 and wxMaxima as 12.04.  I decide that upgrading would be easier and more logical than trying to fix the old version I had.

First, I removed the old version.  You can probably do this through through SPM, the terminal, or (what I did) USC.  Then add the repository from blahota on launchpad:

https://launchpad.net/~blahota/+archive/wxmaxima/

apt-add-repository ppa:blahota/wxmaxima


I already had this added from an older version upgrade.  Then run update to update the repositories:

sudo apt-get update


Then install wxMaxima and Maxima either through the terminal (not sure of the exact command; probably something like sudo apt-get install maxima or whatever the file name is), USC, or (what I did) through SPM.  I just selected what I wanted to install.


Sage Interact Database | Interact with the Sage community

Sage Interact Database | Interact with the Sage community

Wow, this looks pretty cool and sounds like an awesome idea.  This is something Mathematica-esque.

It is my pleasure to introduce the Sage Interact website at

interact.sagemath.org

It's a space for Sage users to share snippets of code or Sage worksheets
on a single, public site. Anyone can browse the published content, but
only registered users can access the full features. Register an account
by clicking on an OpenID account provider and confirming your email
address. Once you've registered, you can share your own snippets of
code, bookmark your favorite posts, and interact with other users.

A Simple Asymptote IDE In Linux Using Inotify - YouTube

A Simple Asymptote IDE In Linux Using Inotify - YouTube

I've done something similar except I am using Kile since it has a built in terminal (Konsole) with normal Kile as the text editor.  Kate has the same feature but since I use Kile anyways for LaTeX no point in using Kate.

Xubuntu 12.04 LTS Review: Perfect Alternative for Those Who Can't Stand Unity/GNOME Shell | Tech Drive-in

Xubuntu 12.04 LTS Review: Perfect Alternative for Those Who Can't Stand Unity/GNOME Shell | Tech Drive-in

Could be great for smaller devices.  However, I always come back to GNOME classic with my setup at home (quad monitors).  I always seemed to have underlying problems with Kubuntu/Xubuntu.  It seemed to run slow at times and crash.  I like the familiarity of GNOME classic too.  Now, I use Unity on my other two laptops.  Don't get me wrong.  I could live with KDE or XFCE if I had to.

Sage 5.1 - Download for Linux - Ubuntu PPA

Sage - Download for Linux

I just realized that Sage 5.1 is out.  I think I was on 4.7 something on my desktop at home!

Anyways, they now have a ppa for Ubuntu users.  I may have known this, but since I haven't used Sage in awhile I may have forgotten.  I am mainly using Python now.  I will still occasionally use Sage and wxMaxima for backup and to keep up with its development.

apt-add-repository -y ppa:aims/sagemath
apt-get update
apt-get install sagemath-upstream-binary

Thursday, July 12, 2012

installation - How do I install the latest 2012 TeX Live on 12.04? - Ask Ubuntu

Ubuntu 12.04 comes with an old 2009 version of TeX Live.  I recently got my Ubuntu desktop back in shape (still not %100 but it's managable. and I was using Kile to compile a LaTeX document which had the bigints package.  This worked fine on my Windows using TeXstudio.  I think because I just recently installed TeX Live and it was the 2011 version.  I could have just placed the .sty file in the appropriate location as a solution.

http://blog.irrepupavel.com/2007/02/installing-latex-style-files-sty-on.html THIS LINK IS DEAD!

SEE post http://timothyandrewbarber.blogspot.com/2012/11/placing-latex-sty-files-in.html for manually installing .sty files instead!

However, I noticed, as I previously mentioned, that the version of TeX Live in Ubuntu 12.04 was outdated.  Ubuntu tends to run behind on some things in its repositories.

To install the latest TeX Live, 2012, I found this:

installation - How do I install the latest 2012 TeX Live on 12.04? - Ask Ubuntu

I ran:


sudo apt-add-repository ppa:texlive-backports/ppa

and then:

sudo apt-get update && sudo apt-get install texlive

I then installed the texlive-full package through synaptic just because I didn't feel like going through and picking the packages I needed, :P.

http://stackoverflow.com/questions/1911713/add-find-style-files-in-to-latex


$ sudo apt-get install texlive-full


It looks like 12.10 should come with the 2012 version of TeX Live.

Sorry the blog is messy.  I've been quite busy.  I also apologize to not replying to some comments.  I just haven't had the time at the moment.  Got some good stuff coming though such as using Asymptote.  I really like it.  It's not too hard and the figures look great.  I am happy so far as it replaces Origin for my needs.

sectioning - How to put a line-break in section heading? - TeX - LaTeX

sectioning - How to put a line-break in section heading? - TeX - LaTeX

I was running into problems with this.  I had the "//" in the section for line breakage but was getting errors. I finally fixed it with using

\section[Really long title here]{Really long title // here}

11.10 - How do I remove an icon from the top panel in GNOME Fallback mode? - Ask Ubuntu

11.10 - How do I remove an icon from the top panel in GNOME Fallback mode? - Ask Ubuntu

Works for 12.04 too of course.

Simplyu hold the ATL key then click the icon.  The options Remove and Move should now appear.

Wednesday, July 11, 2012

Install XFCE 4.10 In Xubuntu 12.04 Precise Pangolin Via PPA ~ Web Upd8: Ubuntu / Linux blog

Install XFCE 4.10 In Xubuntu 12.04 Precise Pangolin Via PPA ~ Web Upd8: Ubuntu / Linux blog

For those of you interested in XFCE and Xubuntu, the lasted XFCE, version 4.10,  has appeared but did not ship with 12.04.

I was using Xubuntu/XFCE cause my GNOME classic was messed up.

To install:

sudo add-apt-repository ppa:xubuntu-dev/xfce-4.10
sudo apt-get update
sudo apt-get dist-upgrade
If after running "dist-upgrade", you get 3 held back packages which can't be upgraded, open Synaptic Package Manager (it's installed by default in Xubuntu), click the "Mark all upgrades" button, then "Apply". Synaptic will ask to remove one package and install a new one - select yes and you're done.
I didn't have to do this ^^.  Not sure why.

Addition tip given:
To install XFCE 4.10 in Xubuntu 12.04 (if you're using a different desktop environment such as GNOME for example), instead of the last command above, use the following:
sudo apt-get install xubuntu-desktop

Tuesday, July 3, 2012

New Flight Trials For X-51, X-48, Phantom Eye

New Flight Trials For X-51, X-48, Phantom Eye

Vote Now! Best Space Stories of the Week - July 1, 2012 | Space News | Space.com

Vote Now! Best Space Stories of the Week - July 1, 2012 | Space News | Space.com

NASA - NASA Space Tech Program Selects Technologies For Development And Demonstration On Suborbital Flights

NASA - NASA Space Tech Program Selects Technologies For Development And Demonstration On Suborbital Flights

Upgrade to Ubuntu 12.04 from 11.10 using Ubuntu CD / DVD | Liberian Geek

Upgrade to Ubuntu 12.04 from 11.10 using Ubuntu CD / DVD | Liberian Geek

How to Install Microsoft Office Suite 2010 in Ubuntu 12.04 Using Wine 1.5 | Liberian Geek

How to Install Microsoft Office Suite 2010 in Ubuntu 12.04 Using Wine 1.5 | Liberian Geek

Ubuntu 12.10 Alpha 1 & 2 Released | Liberian Geek

Ubuntu 12.10 (Quantal Quetzal) Alpha 1 Released

Ubuntu 12.10 Alpha 2 Released | Liberian Geek

Download Ubuntu 12.04 Getting Started Manual | Liberian Geek

Download Ubuntu 12.04 Getting Started Manual | Liberian Geek

Thursday, June 28, 2012

The Glowing Python: How to find the roots of a function with fsolve

The Glowing Python: How to find the roots of a function with fsolve

25 Things I did After Installing Ubuntu 12.04 LTS "Precise Pangolin" | Tech Drive-in

25 Things I did After Installing Ubuntu 12.04 LTS "Precise Pangolin" | Tech Drive-in

I haven't really been able to use 12.04 much.  I've been stuck with a Windows machine for awhile, :(.  A couple of my computers needed hardware fixes.  Here is some info on 12.04 anyways.

Virgin Galactic to Launch New Cargo Plan, SpaceShip Design | Space.com

Virgin Galactic to Launch New Cargo Plan, SpaceShip Design | Space.com

Another nice space transport (an alternate to VG's space tourism concept) funded privately which could help the gap in space access.

X-48C Poised for Flight Tests

X-48C Poised for Flight Tests

Not hypersonics, but a nice concept to reduce noise and increase fuel efficiency for subsonic flight.

Friday, June 22, 2012

Asymptote Vector Graphics Package


Asymptote

I've seen this before in my Ubuntu repository when searching for LaTeX packages.  I want to try this one day.  Asymptote is a vector graphics software, except it is all through its own programming language.  At first, it seems  scary, but in reality, it is the same thing as making a plot in Python, MATLAB, Mathematice, Sage, Maxima, etc.  Asymptote seems nice since it seems very streamlined like LaTeX is for documents.
Asymptote is a powerful descriptive vector graphics language that provides a natural coordinate-based framework for technical drawing. Labels and equations are typeset with LaTeX, for high-quality PostScript output.

Thursday, June 21, 2012

Importing data into Python for a 2D plot

Yay!  I'm learning some Python! (For Family Guy fans this is in Peter's voice when Lois lets him take his cage of parrots on a trip and he says, Yay, you're letting me be myself!).

So I needed to load a small sample of data (about 7 data points) into a 2D graph in Python.  After awhile of searching and trial and error, I finally found a solution.

First, I had to figure out how to get Python to read the data and read it in a proper format or format that I needed for use.  Basically, a 2x2 array for x and y values.

At first I thought plotfile under matplolib under cbook and using fname and get_sample_data would work.

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plotfile

http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html

http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/plotfile_demo.py

http://matplotlib.sourceforge.net/api/cbook_api.html?highlight=fname

I also tried the csv package/module/library or whatever the proper term is in Python and its reader function.

http://docs.python.org/release/2.5.2/lib/csv-examples.html

http://www.endlesslycurious.com/2011/05/06/graphing-real-data-with-matplotlib/

http://docs.python.org/library/csv.html#csv.reader

http://docs.python.org/library/csv.html

http://www.doughellmann.com/PyMOTW/csv/

I did get this to display my data in a table
import csv
reader = csv.reader(open("some.csv", "rb"))
for row in reader:
    print row
Here is a screenshot:


However, I found loadtxt and upack=True but ended up using NumPy's genfromtxt which seems like they accomplish essentialyl the same thing, to load my data into a 2x2 matrix or array.

http://bulldog2.redlands.edu/facultyfolder/deweerd/tutorials/Tutorial-ReadingWritingData.pdf

http://www.programmingforbiologists.org/importing-data-python

http://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html

CSV stands for Comma Separated Value

http://docs.python.org/library/csv.html
The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. There is no “CSV standard”, so the format is operationally defined by the many applications which read and write it. The lack of a standard means that subtle differences often exist in the data produced and consumed by different applications. These differences can make it annoying to process CSV files from multiple sources. Still, while the delimiters and quoting characters vary, the overall format is similar enough that it is possible to write a single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer. The csv module implements classes to read and write tabular data in CSV format. It allows programmers to say, “write this data in the format preferred by Excel,” or “read data from this file which was generated by Excel,” without knowing the precise details of the CSV format used by Excel. Programmers can also describe the CSV formats understood by other applications or define their own special-purpose CSV formats.
My code is:

import numpy as np
import matplotlib.pyplot as plt

x, y = np.genfromtxt('1952_Kelsall_ax_vel_ser_I_first_z_loc_closeup_2.csv', delimiter = ',', unpack=True)
y = np.multiply(1.62, y)
y = np.divide(y, 2885)

plt.plot(x, y, 'o')

plt.show()

So I imported my data into x and y using unpack=True to ensure that the data went into its own column. I then did some scaling using NumPy's multiply and divide. Then simple plotted onto a 2D graph using 'o' for data points only.

Screenshot:


http://matplotlib.sourceforge.net/examples/api/unicode_minus.html

http://matplotlib.sourceforge.net/mpl_examples/api/unicode_minus.py

http://docs.scipy.org/doc/numpy/reference/generated/numpy.divide.html

http://docs.scipy.org/doc/numpy/reference/generated/numpy.multiply.html

http://www.scipy.org/NumPy_for_Matlab_Users


Here is a NumPy tutorial and reference:

Tentative NumPy Tutorialhttp://www.scipy.org/Tentative_NumPy_Tutorial

Numpy Example Listhttp://www.scipy.org/Numpy_Example_List

Tuesday, June 19, 2012

NASA - June 21, 1962 - This Week in Dryden's History - X-15 #3

NASA - June 21, 1962

June 21, 1962
During a preflight checkout of X-15 #3, a ground crewman writes in the frost covering its underside "250,000 OR NO ICE CREAM." Maj. Robert White reached only 246,700 feet.
The dawn of hypersonics.  One of my favorite vehicles, the X-15.

Tuesday, June 12, 2012

NASA - June 16, 1965 - The M2-F2 lifting body arrives by truck...

NASA - June 16, 1965

The M2-F2 lifting body arrives by truck at the Flight Research Center. A year would pass before it would make its first flight. After being horribly damaged in a crash landing, it was modified and renamed the "M2-F3."
This is one vehicle part of the lifting-body program which paved the way for unpowered lifting body landing, the STS or more commonly known as the Space Shuttle.

Sunday, June 10, 2012

Success! - First Mayavi Plot

Recently, I started Python from a fresh re-install of Python(x, y).  Confident I had everything, including Mayavi, installed correctly.  I tried to re-run some examples I found online.  This time I did not receive any error messages regarding that Mayavi could not be recognized.  However, I was/am still having problems.

I decided to try to open Mayavi from the Start Menu in Windows under the Python(x, y) folder structure.  It worked!  That is, Mayavi opened as a separate console/program.  I found Run Python Script under the File heading.  I tried to run one of my previous files, and this time it really did work!!

This is the spherical harmonic example using the mesh() function (although the example is a little different, maybe I got it from somewhere else; can't remember) from the Mayavi website:
http://docs.enthought.com/mayavi/mayavi/auto/examples.html
http://docs.enthought.com/mayavi/mayavi/index.html
http://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html#
http://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html#mesh

Edit:  I found the example, it is the provided demo - http://docs.enthought.com/mayavi/mayavi/mlab.html#simple-scripting-with-mlab

from numpy import *
from enthought.mayavi import mlab
# Create the data.
dphi, dtheta = pi/250.0, pi/250.0
[phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7
x = r*sin(phi)*cos(theta)
y = r*cos(phi)
z = r*sin(phi)*sin(theta);
# View it.
f = mlab.figure()
s = mlab.mesh(x, y, z)

My screenshots:




However, I could not get the flow() function example to work, :(, which I would like to use for 3D streamline plots.

import numpy
import enthought
from mayavi.mlab import *

def test_flow():
    x, y, z = numpy.mgrid[0:5, 0:5, 0:5]
    r = numpy.sqrt(x**2 + y**2 + z**4)
    u = y*numpy.sin(r)/r
    v = -x*numpy.sin(r)/r
    w = numpy.zeros_like(z)
    obj = flow(u, v, w)
    return obj

Edit: I got the test flow to work.  Just remove the def and return and unindent the rest.  (However, I still have very little grasp on how MayaVi works as I am having great difficulty in trying to produce streamlines from a velocity vector field.  Concept seems simple enough but...  I also still cannot get MayaVi to work from Spyder.  Very frustrating!!!!)

import numpy
import enthought
from mayavi.mlab import *

x, y, z = numpy.mgrid[0:5, 0:5, 0:5]
r = numpy.sqrt(x**2 + y**2 + z**4)
u = y*numpy.sin(r)/r
v = -x*numpy.sin(r)/r
w = numpy.zeros_like(z)
obj = flow(u, v, w)

I did get another 3D plot example I found to work which also uses the mesh() function.

http://www.sam.math.ethz.ch/~hheumann/Tutorial/html/mayavi2_tips.html

from numpy import mgrid, real, conj, ones, zeros
from numpy.fft.fftpack import fft2
from numpy.fft.helper import fftshift
from enthought.mayavi import mlab

# A mesh grid
X,Y = mgrid[-100:100, -100:100]

# The initial function: a 2D unit step
Z = zeros((200,200))
Z[0:6,0:6] = 0.3*ones((6,6))

# The fourier transform: a 2D sinc(x,y)
W = fftshift(fft2(Z))
W = real(conj(W)*W)

# Display the data with mayavi
# Plot the original function
#mlab.mesh(X, Y, Z)
# Plot the fourier transformed function
mlab.mesh(X, Y, W)
mlab.savefig("mayavi_fft_plot.png")


Saturday, June 9, 2012

Getting Python to work in Windows - Python 2.7.2, Python(x, y) 2.7.2.3, Sypder2, and Mayavi2

Ok, whew, I finally got a good grasp on installing Python in Windows 7.  I had it installed first (through Python(x,y) also apparently) but was having issues with getting Mayavi to work (or so I thought then, could have been ok I just didn't understand the structure until I got it to work now; not sure if I really understand, but whatever, it works).

So, I decided to uninstall everything again, and then re-install because I really had forgotten how I did it in the first place.  After some googling and browsing, I knew I wanted to use and install Spyder because I had it before.  So I went to the site http://packages.python.org/spyder/installation.html then found a link to https://code.google.com/p/spyderlib/.  However, I kept seeing Windows - Python(x,y).  So read and browsed a little more to find that Python(x,y) is a one stop for all source.  It not only installs Python, Spyder, IPython, and libraries such as Numpy, Scipy, Matplotlib, etc., but it also installs many other packages such as the IDLE simple IDE/editor, Mayavi2, etc. (all are options of course).  Python(x, y) also is integrated with or as (I don't yet understand) a Qt framework (again, not so sure what Qt is/does; like Java app development maybe?).

Qt links:
http://qt.nokia.com/
http://qt.nokia.com/products

Here is a nice schematic displaying the integration of Python(x, y) from http://code.google.com/p/pythonxy/wiki/Welcome


Python(x, y) home page link: http://code.google.com/p/pythonxy/

Python(x, y) installer download page: http://code.google.com/p/pythonxy/wiki/Downloads

The latest Python(x, y) version is 2.7.2.3 and simply download and run the installer .exe file: Python(x,y)-2.7.2.3.exe



I kept everything default under the installation except I added the SymPy library/package under the Python expansion.



Notice all the packages that come with Python(x, y):


Important note!  The Mayavi website says to make sure ETS (short for Enthought Software?) is checked for the installation of Mayavi.

http://docs.enthought.com/mayavi/mayavi/installation.html

Python(x, y) installs with it Python 2.7.2


Although, there have been releases of Python 3.x (3.2.3 as the latest stable) and a more recent 2.7.x as 2.7.3.  It seems that packages aren't caught up to 3.x yet, so it may be best to use 2.7.x for now?  See these links for more:

http://www.python.org/
http://www.python.org/download/releases/2.7.3/
http://wiki.python.org/moin/Python2orPython3

After installation, I feel more comfortable and confident that Python and packages such as Mayavi are installed properly.  I was getting an error before that Mayavi couldn't be found.

This is proof!
Spyder is installed too.

Thursday, June 7, 2012

Tuesday, June 5, 2012

PDF editor, free, for Windows for rotating PDFs - PDFTK Builder

PDFTK Builder is a nice free software with a good GUI in case you need to do minor changes to a PDF file such as rotating a PDF scan (my case).

Edit: This is also great for splitting and merging pdfs!

http://angusj.com/pdftkb/#pdftkbuilder

Full installation (includes PDFTK ver 1.41): 2 MB
http://angusj.com/pdftkb/pdftkb_setup.exe