Saturday, February 22, 2014

Minty Review: Linux Mint 16 (cinnamon flavor)

After being on the top of the chart for more than a couple of years, I finally decided to give Linux Mint a try, after all why are people using it so much? I must say I was biased previously because I though Mint looked a little too boring for me and aside from being an easy to use sort of distro, I didn't see the appeal. To be perfectly honest, I never thought Ubuntu was hard to use so even that appeal I don't quite understand.

Anyway, now that I've played with Mint for about a week, I feel like I can form a more relevant opinion, and to be honest I was not impressed. First of all, as I feared the OS to me looks very vanilla, and offered as far as I saw, nothing dramatically interesting. As I mentioned, often mint is labeled as a great distro to start with, and while it is easy to use, I had two crashes in my first day of use and one of them was while watching a regular video. I feel that a distrubution that is known for media compatibility out of the box should be able to play simple videos without a hiccup.Ubuntu 13.04 VM or my Xubuntu 12.04 VM. I had a lot of issues getting a few pieces of software, including my email client to work smoothly and that didn't help me have a good opinion of it.

I do need to disclose that I was running it as a virtual machine, so perhaps my experience would have been better on a hard install, but these are issues I didn't seem to have with my

Perhaps I am being unfair by reviewing Mint as a VM, but I've done that with other distros before and considering Mint's reputation, I don't feel that it requires special treatment on my review.

Overall, I feel that Mint, much like Ubuntu, has really helped bring Linux to a lot of new users, and I applaud them for that. I think that if there is anything that can be done to make Linux more popular, it should be done. With all the discourse regarding online privacy, the NSA and hackers, a shift to Linux is a great first step into trying to protect yourself. The Internet is my favorite invention of the 20th century and I truly believe that popularizing Linux is just another step into giving people online freedom, and ensuring that we stay in control of our own private habits. So Mint gets points for doing that, however as a distrubution for someone like me, I wasn't impressed. In my opinion Ubuntu is just as easy to use to a user with some computer knowledge and it offers a much more inovative experience. I have to admit I am an Unity fan boy, even though it is bulky. If I want a less meaty distro, my current pick is Xubuntu, I have yet to see another really lightweight distro that looks so good and functions so well.

Sunday, February 16, 2014

ANOVA with SPSS: quick tutorial

I've recently had to do quite a bit of statistics for my project in school and I ended up having to learn it with a new software for compatibility with what my professor uses, which is SPSS. It's probably a good statistical package to learn since it's one of the most popular ones around the world. Since I had no idea how to do anything on it before this, I had to do a bit of reading and thought there would be some value in posting a quick step by step guide on how to run a one-way anova test using SPSS.

For completness, I'm using IBM SPSS Statistics 22. So load up your SPSS (which is shockingly bulky imho). I imagine that if you are reading this post you know what an ANOVA is but in case you don't, ANOVA stands for ANalysis Of VAriance. If you are familiar with the student's t-test, an ANOVA is similar to that. However, while a t-test compares the means of two groups, an ANOVA compares the means of several groups. It looks across all your data and spits out a number (F) which tells you how significant the variance is across all your groups. This will tell you whether there is an overall effect after looking at all your data. A One-Way ANOVA does just that, and it looks specifically across one factor such as different treatment groups. If you hear about a Two-Way ANOVA, that's when you have multiple factors to be compared, for instance you may have different treatment groups in a drug study, but you may also want to look at how those treatment groups change over time, say the course of a month. Then you need to look at changes between groups, (does drug X make animals sick?) as well as within groups (do animals taking drug X become resistant to the drug over a period of time?). Lastly, from an ANOVA, you can also do a Post Hoc comparisson, which is essentially a t-test across all your groups. If you have an overall effect from your ANOVA (F > critical value) then you compare each group to see if they have p < 0.05 for significance. In my example I will use the Bonferroni test which is a more conservative one. There are other popular options such as the less conservative LSD, as well as Tukey's and Dunnett's test.


Open your data or enter your data, for me I had everything in excel before, so it was just a matter of copying and pasting everything. However, in SPSS, as you may or may not know, you can also assign your groups as a different type of data. On the bottom there are two tabs, to work on your groups click on "Variable View". There you will see all your variables, and in my case I eddited the varialbe "Group" by pressing on the cell under "Values".


There you should label each numeric value that represents one of your groups to a label that makes sense to you. Click OK and go back to the original tab, "Data View".


 Now to actually run the test, first find out what columns of data you are actually going to analyze. The sheet I'm using as an example contains all my data from one of my taste reactivity experiments, and includes a lot of behavioural data I have no interest in running stats on. For this example I am interested in running a one-way ANOVA comparing across all my treatment groups, however only testing the total number of gaping reactions.

To do that, find in the menu the option "Analyze" > "Compare Means" > "One-Way ANOVA..."

That should lead you to a smaller pop-up window where you will put your treatment group column under "Factor" and place the data you want analyzed under "Dependent List" which corresponds to your dependent variables. From there click on "Post Hoc..."


There you can chose what type of Post Hoc comparisson you want to make, in my case I am doing a Bonferroni test.


Now, still in the  ANOVA screen, go to "Options..." and click "Descriptive" which I believe will provide you with some of the basic statistical values for your data such as means, standard deviation, standard error and so forth.

From there click continue and OK to run your test. Voila, you should see a report page. On the top you will find your descriptives separated by your groups. N will be the total number of individuals in your groups, your mean, SEM, etc. Below will be your general ANOVA results, which will give you your degrees of freedom, your F value and your significance value. My degrees of freedom are 5 and 50, as you sometimes see them represented as F(5,50), and my F which is 5.475. This is sufficient for me to claim significance in my data, notice the .000 value under significance as well which is similar to a p-value that you are used to.

Below you will find your Post Hoc Tests, in my case Bonferroni. Each row block will have all your comparissons between one group to all the other groups. See in my figure below a comparisson between my Saline group to all other groups. Notice that the only significant difference lies between group Lor6 and my vehicle group. It has a * next to it and you will notice that significance is 0.002, which is >0.05.


Saturday, February 15, 2014

Change the resolution of your VirtualBox Ubuntu VM using Win7 host

I've been using VirtualBox to have easy access to linux on my Windows 7 machine for a while, however, one thing that has always kept me from using it more consistently is the fact that my VMs usually come with a small native resolution making it difficult to work on my VM primarily. Well I decided recently I should change that, so that perhaps I will start using my VM more for a lot of my day to day needs.

It turns out changing this resolution is a bit more laborous that I would have thought. I started by giving my VM more video memory and more power in general, as well as updating drivers and that wasn't the problem. This is a VirtualBox setting that I need to change. In order to make those changes, follow the instructions below:

First click on the VirtualBox menu option "Devices" and look for "Install Guest Additions" (figure1). From there you will get a pop up asking if you trust this source and then you will be asked about downloading a CD image from the web, just proceed and wait for it to download and install whatever it needs to install. Once this is complete, the next step will vary slightly from distro to distro, but you basically want to mount whatever it downloaded. On Ubuntu 13.10, you should see an iso image appear on the bottom of your unity menu bar, click on that.


When you open the image you should see several options of files which you will have to chose the one appropriate to your need. Since my host is a Windows 7 64-bit, I will copy the file of the appropriate exe file to your desktop.

From here open you distro's terminal and go to desktop. For me it was just a matter of typing cd Desktop/

From here type

$ chmod +x xfilenamex

xfilenamex is the name of the file that you copied of course which in my case was

$ chmod +xVBoxWindowsAdditions-amd64.exe

This will give you priviledge to run this particular file. Next execute the file via

$ sudo ./VBoxWindowsAdditions-amd64.exe

again change the filename to whatever file pertains to your OS.This will ask you for your root credentials and install the guest additions. Now you can close your terminal and shutdown your VM

$ sudo shutdown -h now

From there go to your Windows 7 and open the windows terminal. If you don't know how, just type "cmd" on after pressing the windows button. From there look for the folder where your VM is installed on Windows. in my case it was under Program Files, but not the x86 one for some reason. There you should see Oracle\VirtualBox.

From there type

VBoxManage setextradata "xOSnamex" "CustomVideoMode1" "xresolutionx"

in my case

VBoxManage setextradata "u1310" "CustomVideoMode1" "1680x1050x32"

This didn't actually seem to do the trick, so I went ahead and also ran the following command:

VBoxManage setextradata global GUI/MaxGuestResolution 1680,1050

Now load your VM up as you normally would and this did the trick for me. I'm not sure if you need the first VBoxManage command so if you want to try just using the global command go ahead and try it out. If it works post a comment to let me know. Again I'm using a Windows 7 host OS, trying to run a Ubuntu 13.10 VM on it.


Thursday, February 13, 2014

Installing Sublime-text-2 and Sublime-text-3 via apt-get

If you are looking to try out this IDE for python like me, there is an easy way to get it install on Ubuntu via apt-get. I found this from an answer from Jarred Burrows at askubuntu.com.

For Sublime-text-2 go ahead and type

$ sudo add-apt-repository ppa:webupd8team/sublime-text-2

this will add the ppa that gives you acces to it. Then run a quick update

$ sudo apt-get update

and type the following to actually download sublime text

$ sudo apt-get install sublime-text

To get Sublime-text-3 the process will be similar

$ sudo add-apt-repository ppa:webupd8team/sublime-text-3

$ sudo apt-get update

$ sudo apt-get install sublime-text-installer

Sunday, February 9, 2014

Cortical regions involved in voluntary movement

Voluntary movement occurs in a very different manner from reflex induced movements. Unlike reflexes, voluntary movements require planning and accurate execution. The process begins with the decision to move which occurs internally, and is followed by the activation of several cortical regions, each with a specific role in the production of deliberate movements. The premotor area is a region involved in the programming aspect of movements. It is where organization of the sequences in which motor cortical regions will be activated occurs. Part of the function of the premotor regions is to assist the motor cortex in orchestrating movements, much like the steering wheel controls the car, while alone it does not move the car, it is essential for directing when to turn. It is in the premotor cortex that sequencing of motor outputs using sensory information occurs. This is an important aspect of how the CNS coordinates distal movements while maintaining postural support and coordination.

Much like the premotor cortex, the supplementary motor area (SMA) also projects to the primary motor cortex. The SMA is important in the coordination of bimanual movements. While the SMA does not program the actual movements to be performed by either side, it does activate both movements in a coordinated manner, using higher inputs as well as sensory information. An example of why this is important can be illustrated with an example of someone pouring water into a glass being held by one hand, while holding the original glass container in the other. As the glass fills up, more force is required from that arm in order to maintain its stability. While the brain has to compensate for increased weight on the arm holding the glass, it also must account for the weight changes in the arm holding the original container, which slowly becomes lighter.

Lastly the primary motor cortex is where much of the input from the SMA, premotor cortex as well as sensory association areas converge. This is the region directly involved in controlling the activity of motoneurons. It does so by storing motor synergy information, in other words, neurons in the motor cortex have millions of combinations of “movement programs” that can be activated and relayed to the appropriate motoneurons. These movement programs can be thought as predetermined combinations of muscle inputs that produce a specific movement. As consequence of this, there are multiple representations of the same muscles within the primary motor cortex.


Cheney PD (1985), Role of cerebral cortex in voluntary movements. A review. Phys Ther 65:624-35

Kandel ER, Schwartz JH, Jessell TM (2000). Principles of Neural Science, 4th edition. New York: McGraw-Hill

MacKay WA (1999). Neurophysiology without tears, 3rd edition. Toronto: Sefalotek Ltd.

Thursday, February 6, 2014

Weather update from console and a conky config

I found some Linux goodies while redditing the other day and thought they were worthy of reposting here.

First, I found this awesome weather app for the console. Basically, you type your "FIPS area code" and it spits out an update on the area directly from that particular mornitoring station. It's fairly detailed and it's on the console which is just great for those that appreciate being able to do that. It may seem a bit inconvenient to get that type of information that way but it's not very hard to just creat an alias and only have to type a short command to get it. You can even set it as a cron job and get periodic updates on an open console. Maybe you just think it sounds cool. Anyway, to get this little gem go ahead and type

$ sudo apt-get install weather-util

which should install it. This can also be done via the ubuntu software centre if you so chose. To get the weather update you just have to type

$ weather ????

or

$ weather --forecast CYYZ

where ???? is the 4 digit FIPS code for your area, in my case CYYZ corresponds to Toronto International Airport. Note that not everywhere has these updates available, to check what is available check out the IWS website. The website for the actual software you can find at http://fungi.yuggoth.org/weather/

I found this link from a post by avaipar on /r/ubuntu and the article comes from OMG ubuntu.



The other link I came across was smileymalais' conky config from his blog (presumably). Here is the config for it:

# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# - tail of /var/log/messages
# - netstat connections to your computer
#
#
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_hints undecorated,below,skip_taskbar
background yes
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer no
use_xft yes
# Update interval in seconds
update_interval 3.0

# Minimum size of text area
minimum_size 0
# Maximum width
maximum_width 160

# Draw shades?
draw_shades yes
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 8
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color black
default_outline_color white
own_window_colour black
own_window_transparent yes
own_window_argb_value 50
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
gap_x 10
gap_y 110
# stuff after 'TEXT' will be formatted on screen
override_utf8_locale no
xftfont Inconolata:size=8
#xftalpha 0.8

TEXT
${offset 0}${color #ddaa00}LUBUNTU 13.10

# ${offset 0}${color white}${time %a, } ${color #aaaaaa}${time %B %e %G}
# ${offset 0}${color white}${time %Z, }${color #aaaaaa}${time %H:%M:%S}
${offset 0}${color #ddaa00}Kern:${color #aaaaaa}$kernel
${offset 0}${color #ddaa00}UpTime: ${color #aaaaaa}$uptime

${offset 0}${color #ddaa00}CPU:${color white} $cpu% ${acpitemp}C
${offset 0}${cpugraph 20,130 000000 ffffff}
${offset 0}${color #ddaa00}Load: ${color }$loadavg
${offset 0}${color #ddaa00}Processes: ${color }$processes
${offset 0}${color #ddaa00}Running: ${color }$running_processes
${offset 0}${color #ddaa00}Highest CPU:
${offset 0}${color white} ${top name 1}${top_mem cpu 1}
${offset 0}${color lightgrey} ${top name 2}${top cpu 2}
${offset 0}${color lightgrey} ${top name 3}${top cpu 3}
${offset 0}${color lightgrey} ${top name 4}${top cpu 4}
${offset 0}${color #ddaa00}Highest MEM:
${offset 0}${color white} ${top_mem name 1}${top_mem mem 1}
${offset 0}${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${offset 0}${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${offset 0}${color lightgrey} ${top_mem name 4}${top_mem mem 4}

${offset 0}${color #ddaa00}RAM: ${color } $memperc% $mem/$memmax
${offset 0}${membar 3,130}
${offset 0}${color #ddaa00}SWAP: ${color }$swapperc% $swap/$swapmax
${offset 0}${swapbar 3,130}
${offset 0}${color #ddaa00}ROOT: ${color }${fs_free /}/${fs_size /}
${offset 0}${fs_bar 3,130 /}
${offset 0}${color #ddaa00}HOME: ${color }${fs_free /home}/${fs_size /home}
${offset 0}${fs_bar 3,130 /home}

${offset 0}${color #ddaa00}NET:
${offset 0}${color}Up: ${color }${upspeed wlan0} k/s
${offset 0}${upspeedgraph wlan0 20,130 000000 ffffff}
${offset 0}${color}Down: ${color }${downspeed wlan0}k/s${color}
${offset 0}${downspeedgraph wlan0 20,130 000000 ffffff}



Wednesday, February 5, 2014

Mars Trilogy: Red Mars review

I have not read a book that really caught my attention in a little while. I had this one on my "to read" list for a few years and finally decided to try it out. It has surprised me greatly. I have to say it is now a contender for my top book series, potentially taking Dune out of the top spot. While this will have to wait until I finish the trilogy, I expect I will continue to enjoy the journey.

What made me appreciate Dune so much was the depth of the Dune universe and in particular the scientific discussions about ecology, geology, economics, politics and religion combined with some great characters and an epic feel to it. I loved the really interesting interplay of all those forces in a far distance expansive humanity. Red Mars by Kim Stanley Robinson starts the series with the theme of human's attempt to colonize the red planet. Once I started the book I realized it was much more than that. The book uses this Mars colonization as a medium, but the real story lies on the characters, which for the most part are thinkers, scientist philosophers, that want to colonize a new planet and make a fresh start for humanity. This serves as a great way to discuss social, political and economical systems that we have adopted over the course of human development. It is very interesting how a few characters really try to discard some of the most fundamental aspects of human culture as either inefficient or as an antiquated system that had a purpose originally but we managed to exploit it to turn it into something harmful to society. It's a book that really tries to challenge the status quo, and worked very well on me to get me to evaluate a bit more carefully some of the pillars of humanity. There are some very compelling ideas there.

I really don't want to give much away for anyone actually interested in reading this, but if you like books that are sometimes heavy on ideas and science, this is the book for you as it was the book for me. I look forward to every chance I have to read it, which hasn't been very often due to my time commitment writing my graduate theses.