Wednesday, October 20, 2010

Getting R sweave to work

-- remove the one installed by aptitude and install the one from:
http://www.michaels-website.de/gedit-latex-plugin/


then run:
sudo aptitude install lacheck latex-beamer latex-xcolor pgf prosper ps2eps python-enchant python-poppler rubber texlive

yes, yes, most of these should already be installed but making sure doesn't hurt anything.

Now the gedit plug in works.


Some background:
http://en.wikipedia.org/wiki/Sweave

http://www.statistik.lmu.de/~leisch/Sweave/

http://personal.bgsu.edu/~mrizzo/Rmisc/Sweave/SweaveEx1a.htm

warzone 2100

So after installing warzone2100 on ubuntu I ran into the typical problem where it doesn't see the screen size correctly since I use two monitors and it is totally screwed.

So, by running I got myself a good window to play the game in (and it saves the settings so next time the menu works fine)
warzone2100 --window  --resolution=1024x768

Sweave with Gedit

So, apparently the new cool way to include R code with latex files is using Sweave.

Using the latex plugin with Gedit, it should handle the sweave automatically. However there seems to be a few difficulties that need to worked out to get everything working just right.

My goal here is to layout everything that needs to be done in order to make it work.

Basic command:
"R CMD Sweave 'file.Rnw' "

In Gedit, the latex plugin forgets the "CMD", so to make it work, go edit -> preferences -> plugins -> Gedit Latex Plugin 0.2 rc3 -> configure -> tools -> R Sweave to PDF -> "properties"

Now you can try to edit the command.

For me, this did not work, so to make it work right I did the following,
edit the file
~/.gnome2/gedit/plugins/GeditLaTeXPlugin/tools.xml

There should be a section like

<tool description="Process R Sweave file and create a PDF from the resulting LaTeX source" extensions=".Rnw" id="1" label="R Sweave → PDF">
        <job mustSucceed="true" postProcessor="GenericPostProcessor">R CMD Sweave "$shortname.Rnw"</job>
        <job mustSucceed="true" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all --pdf "$shortname.tex"</job>
        <job mustSucceed="true" postProcessor="GenericPostProcessor">gnome-open "$shortname.pdf"</job>
    </tool>

In the above section I have already added the "CMD" that was otherwise missing. Then save the file and restart Gedit. (As I was using gedit to modify the file.) And, now it still doesn't work.

Ahh, well command line it is for now.

I'll update it when I finally get it to work.

Tuesday, October 19, 2010

Programs to learn Japanese

Here are some tools for learning Japanese:
kanatest (ubuntu install with aptitude)
langdrill (ubuntu -- seems like only command line, as there is no shortcut in the menu)

kdrill (ubuntu install with aptitude)
-> install "kanjidic" First otherwise it can't find the dictionary.

One article:
http://blogaddins.blogspot.com/2008/08/japanese-learning-tools-on-ubuntu.html
lists:
-> kanatest
-> langdrill

http://wakan.manga.cz/?page=download&lang=en
wakan
-> appears to be for windows.

http://www.japanese.ryukent.co.uk/
Tango Blaster






A few general programs for flash card type programs.
http://jewelmirror.com/
pyFlashCards
An Open Source Flash Cards Software

http://sourceforge.net/projects/jmemorize/
jmemorize

Monday, October 18, 2010

Caps lock Indicator

So my wireless keyboard (mk300 - has mouse too) does not have indicators for: caps lock, num lock, and scroll lock. Actually it doesn't even have a scroll lock key. But that is not important right now.

Anyway as there is no software for ubuntu from logitech like for windows which tells you when one of them is turned on and off.

So I found a replacement:

Indicator-Keylock

A webpage which talks about it:
http://www.omgubuntu.co.uk/2010/09/indicator-keylock-ubuntu/

sadly the person is using apt-get. (You should never use apt-get) Instead, you should always use "aptitude". There are a number of reasons like clean removals but that isn't too important.


sudo add-apt-repository ppa:tsbarnes/indicator-keylock
aptitude search indicator-keylock
sudo aptitude update
sudo aptitude install indicator-keylock
sudo aptitude install indicator-keylock-ubuntu-mono

seemed like I had to then run "indicator-keylock"

Then after restarted it started up on its own. So all seems good.

The indicator has caps-lock up all the time. And otherwise by clicking on it, you can see the rest. Turning one on or off displays an indicator on the screen.

As a replacement as keyboard lights, I like it.

Saturday, October 16, 2010

Setting up Ubuntu 10.04

I am a researcher, but the basic install of Ubuntu doesn't provide everything to be productive in research. This leads me to writing a post about what things I needed to install and how.

I always use aptitude as it is preferred over apt-get. You should use it too.

First: activate the nonfree graphics drivers to activate acceleration. This will be important for running compiz and make the desktop user friendly.

Next: stupid issue. As far as I can tell they removed the ability to always show the path in the file manager. This is beyond stupid. I can read the path much faster than the buttons that show up, so see the path with
"ctrl + L"
This is temporary measure. When I have time I will try to find how to what happened to the option. This is definitely a big minus for linux. This is exactly like the M-crap trying to be user friendly without options. A rule for linux programmers: People use linux because it provides options, if the options arn't there people will stop supporting the community. Everything should have an option just because some programmer doesn't think it will help doesn't mean others don't want it. Options are what make Linux strong.

Enough ranting. Back to how to get everything setup.


Non-work related:
chromium-browser
flashplugin-nonfree

compiz:
compizconfig-settings-manager
compiz-fusion-plugins-extra

setup compiz:
desktop wall -> bindings within wall (will work anywhere)
move left <- ctrl + alt + button 4 (mouse wheel up)
move right <- ctrl + alt + button 5 (mouse wheel down)

viewport switcher:
desktop-based viewport switching (these only work when mouse is over desktop)
move next - button 5
move prev - button 4


Now I have google chrome and flash.

First is Latex. Install the package "texlive_latex_base" and this will get everything ready to setup Latex documents.

R - satistical software.
"r-base" - this installs a lot, like g++ and many other useful programing tools. After installing R, I don't need to worry about c tools as they will already be there.
Packages:
-> caTools - provides write.gif
-> to add others later when I get the list together

How about editors? (I want something to edit both R code and latex and some other c/java/others on the side)

gedit - best
plugins stored in "~/.gnome2/gedit/plugins"
-> rGedit - for R
rgedit.sourceforge.net
install the files into the plugins folder, activate, and good to go.
I setup the extra plugins: comment code, and snippets (super powerful)

-> gedit-latex-plugin - for latex (so far excellent)
http://www.michaels-website.de/gedit-latex-plugin/


Others:

geany -- pretty good (I am not currently using it but it is my backup editor)
-> options file stored in "~/.config/geany/geany.conf"
->-> user based and easy. Huge bonus.
-> "ctrl + E" for comment



Scite -- equivalent to notepad++ which is my favorite in windows.
-> need to modify the global options file to work with R
-> /usr/share/scite/SciTEGlobal.properties    remove "#" on the line for #import r
->-> requires root to modify so minus many points. And it doesn't accept "import r " on any other options file. This pretty much breaks usefulness for me. They fail the easy to setup.
->Plus you have to specify use monospaced font "ctrl + F11" (not default)
->-> who would ever program without using a monospaced font???
->->-> fails the test of wanting to use for too many reasons


Others in order I would be willing to try:
Eclipse -- it is very popular but seems like over loaded. I prefer simiple
rkward (bad since it is based on kde. Not my preference)


Graphics:
gimp
gimp-gutenprint
gimp-gap
gimp-ufraw and gimp-dcraw conflict so pick one

Version control:
tortoisehg - (installs mercurial)
tortoisehg-nautilus
-> run: "nautilus --quit" to get the icons working

compressing:
p7zip
p7zip-full
p7zip-rar

Communication:
skype
-> add the canonical repository under other software

Interesting games:
-> neverputt
-> neverball (both of these are a bit annoying but sometimes so is work)

Others to look into getting working again:
libsensors

Installing Ubuntu 10.04

After starting with Ubuntu 8.?? a few years ago, I had setup everything the way I wanted it over an extended period of time. Then, I upgraded to Ubuntu 9.?? using the upgrade method within Ubuntu. That is when the problems started. Simple things like starting the computer became troublesome, because some program would hang and make it impossible to make it to the desktop without killing the window manager and forcing it to restart.

Recently I decided to start over and install Ubuntu 10.04 on a separate hard drive and see how well I could setup everything again.

The install procedure:
1) create a usb drive bootable with the image of Ubuntu 10.04
2) disconnect all other hard drives except for the one I wanted to install Ubuntu 10.04 on. This is important as the installer does not make it easy to tell it which drive is the one I am booting from, and I find that using the startup selector in bios is much easier than trying to configure a boot loader. (As a side note I have successfully had 3 separate operating systems on separate hard drives and never once had difficulties picking which one to start up. However, the one time I tried to configure a boot loader, I had spent days trying it to work correctly. So, for me this is easier.)
3) Using the live image, I used shred on the hard disk. Shred is a utility that makes it impossible to recover previous data that may have been on the drive.

sudo shred -v -zn2 /dev/sda

That will write random numbers twice and finish by writing zeros. The zeros are supposed to cover up using shred, but I saw that the device id was also being rewritten by zero's so it becomes pretty clear that the drive had shred used on it. So I decided that finishing with random numbers may in fact be better. Use something like

sudo shred -v -n2 /dev/sda

(Note if using sudo is annoying we can always use
sudo -i
Just make sure to exit before closing the console. It appears that not exiting first may make it possible to access root.)

4) install using the usb. Choose install instead of preview/test. Choosing standard partitions resulted in no choice to modify what the default is as could be done in previous installs. The advanced option did allow for custom but it did not provide any help in getting started. Previously it would give you a good starting point to work from if you wanted to change some options.

In short, I am a bit disappointed in the changes made to the installer. Although, it worked correctly without errors so that is a huge plus and I am willing to accept a few lost features to avoid having lots of problems. As it did provide an advanced option, I will accept that they do allow for customization. So, I really don't mind the way it turned out.

Installation complete....
And, everything works. Well, not everything. I need to install a number of programs to get back to where I can do work.

Installing basic programs to be productive, in the next post.

Monday, September 20, 2010

Trader joe's - Tiramisu Torte



Trader joe's Tiramisu Torte. Made in Italy.

Package actually says Trader Giotto's. I am not sure if that is an overseas name or not but it doesn't seem to be a problem.

To eat it says defrost in the refrigerator for 1-2 hours before eating. We did so without any problems.

The top is very dusty and the filling is nice. Only issue is the bottom was a little wet. We were both expecting something a bit drier. I don't know if it was an issue with the defrost or what. I think I am going to have to deduct a point on this aspect though.

Overall - 4 stars (-1 for the wet bottom)

I still think it is really good and have no problems with the flavor. I was just looking forward to a more cake like bottom and wasn't expecting it to be leaking fluid when I bite in. I don't think it took away from the flavor at all, and I really hope the refrigerator will help to dry it out a bit before tomorrow. This is not a reason to not buy, as I am still happy with the choice.

Trader joe's - meat balls (flame broiled)


Trader joe's meat balls (flame broiled).

Cooked in the oven for about 30 minutes from frozen. Turned out really well. Inside was moist with good flavor.

Overall - 5 stars

Trader joe's - garlic fries

Trader joe's garlic fries.

These are not for those who do not like lots and lots of garlic. Special feature of these fries is that it will make your kitchen and eating area smell like garlic long after you have eaten them. This was the second time we ate them, and this time we only cooked half. Yes, the directions say cook the whole thing, but for 2 people half is fine.

First time we cooked in the oven, this time we cooked in a toaster oven. Both times turned out really well without problems.

If you don't like strong garlic these are not for you.

Overall - 5 stars. (I don't consider lasting odor a problem since you pick how much sauce to put on (it comes in a packet))

Trader joe's - crab cakes

Trader joe's crab cakes.

These were a batter based crab cake that was baked. Chunks of a variety of things that tasted good. These were heated in the oven for 20 minutes at 325. Not the recommended cooking directions, but still turned out great.

Overall - 5 stars

New faucet

The kitchen sink started leaking water so it turns out to be from the faucet. Only fix, new faucet. Turns out to be a good thing as the new one is far better.
The part that broke was the piece that connected the spray handle to the faucet itself. It was some cheap plastic looking part that really didn't look strong. So in the end caused lots of problems.

Sunday, September 19, 2010

Trader Joe's dried fruit - Unsulfured Sweetened and Dried Mango


Trader Joe's dried fruit - Unsulfured Sweetened and Dried Mango.

No problems, and tastes good. It is not really sticky or slimy but is moist when you bite in.

If you like mango, it is a good choice.

Saturday, September 18, 2010

Korean pancakes

So we went to H-mart today and 4 different people giving out food said their thing was a Korean pancake. None of them looked the same and definitely didn't taste the same either.

This begs the question, what is the definition of a Korean pancake? Is it something that is a very general term or is there something that is actually a Korean pancake but it was getting lost in the translation? Sadly I don't know anyone who can tell me what is the actual answer, and there does not seem to be the right information on-line anywhere.

In summary: a Korean Pancake can be (1) something that looks like an american pancake, (2) some ball things that were multicolored and had some filling that I can't tell what it was, (3) a stuffed pancake that had some sugar and peanut stuff inside (We bought this one and made it. I think it was actually yeast bread with filling that was fried.), (4) something that didn't look like a pancake at all and I am not sure how to describe it.

I think the common element of all these items is the fact that they all use flour that comes from a bag saying Korean Pancake. That is extremely hard to verify as I have problems telling if two worlds in Korean are the same or not, especially with the fonts on the food items. So in the end, unless someone can let me know what the  real answer is I will probably never know. I welcome anyone leaving a comment if they can shed some light on this issue.

Trader Joe's - chocolate lava cakes

We made trader joe's chocolate lava cakes. Only 2 in the box for $2.69 and 15 minutes in the oven at 400°.
I think it turned out really well. Inside was quite lava like.
Only problem was slight sticking to the pan that made it leak outside when moved. I would suggest parchment paper to prevent problems.
Overall - excellent.