Wednesday, June 5, 2013

ImageJ save Raw

26.10.6Raw Data…

Saves the active image or stack as raw pixel data without a header. 8-bit images are saved as unsigned bytes, unsigned 16-bit images are saved as unsigned shorts and signed 16-bit images (e.g., FileOpen SamplesCT (420K, 16-bit DICOM)) are saved as signed shorts. 32-bit images are saved as floats and RGB images are saved in three bytes per pixel (24-bit interleaved) format. 16-bit and 32-bit (float) images are saved using big-endian byte order unless Export Raw in Intel Byte Order is checked in the EditOptionsInput/Output… dialog box. 
 
http://rsbweb.nih.gov/ij/docs/guide/146-26.html

Monday, June 3, 2013

CUDA nvcc

"A different solution to overcome startup delay by JIT while still allowing execution on newer GPUs is to specify multiple code instances, as in
nvcc x.cu -arch=compute_10 -code=compute_10,sm_10,sm_13
This command generates exact code for two Tesla variants, plus ptx code for use by JIT in case a next-generation GPU is encountered. nvcc organizes its device code in fatbinaries, which are able to hold multiple translations of the same GPU source code. At runtime, the CUDA driver will select the most appropriate translation when the device function is launched."

"...the virtual compute architecture should always be chosen as low as possible, thereby maximizing the actual GPUs to run on. The real sm architecture should be chosen as high as possible (assuming that this always generates better code), but this is only possible with knowledge of the actual GPUs on which the application is expected to run. As we will see later, in the situation of just in time compilation, where the driver has this exact knowledge: the runtime GPU is the one on which the program is about to be launched/executed."

http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc

Thursday, May 30, 2013

Linux - New Video card upgrade

Right after you installed the card. Boot into recovery mode and go to text mode. Remove (or just rename) it:
Code:
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.old
Then restart your computer. While you are in the desktop, go to 'Additional Drivers' and install the Nvidia driver.

http://ubuntuforums.org/showthread.php?t=1939530

Friday, November 16, 2012

.profile vs. .bashrc

From "man bash"
Quote:
When bash is invoked as an interactive login shell, or as
a non-interactive shell with the --login option, it first
reads and executes commands from the file /etc/profile, if
that file exists. After reading that file, it looks for
~/.bash_profile, ~/.bash_login, and ~/.profile, in that
order, and reads and executes commands from the first one
that exists and is readable.
Quote:
When an interactive shell that is not a login shell is
started, bash reads and executes commands from ~/.bashrc,
if that file exists.
In other words, /etc/profile is run when a user logs in. ~/.bashrc is run for other shells (Ie opening an xterm)

http://www.linuxquestions.org/questions/linux-general-1/etc-profile-v-s-etc-bashrc-273992/

Thursday, October 18, 2012

SVN Branching and Merging

    A basic well-written tutorial: 
    http://nedbatchelder.com/text/quicksvnbranch.html
     More advanced stuff:
    1. You branch.
    2. Someone else changed T0 on trunk. Sequence in trunk: T0
    3. You make the change T1 on your first branch. Sequence in Branch: T1
    4. You create a new branch from trunk at T2; it contains change T0. Then you merge your changes from your prior branch (the yellow arc — a Bunny Hop) into your new branch. This brings change T1 into your second branch after change T0. Sequence in your branch: T0, T1
    5. You make change T3 in your branch. Sequence in your second branch: T0, T1, T3
    6. Someone else makes change T4 in trunk. They committed to trunk first; they win. Sequence in trunk T0, T4
    7. You make your third branch, at time T5. It includes changes T0, T4 in that order. You merge all your changes from the previous branch — this means you have to do the merging necessary to make changes T1 and T3 blend in correctly after T0, T4. But you get to do this in a workspace, off of a branch, nicely isolated from trunk. It is usually pretty easy. Sequence in the branch is now T0, T4, T1, T3
    8. With no other overlapping changes between when you cut this branch and now (between T5 and T6), you merge your branch into trunk. Because all of the changes in this branch take place after the already committed changes in trunk, the merge goes smoothly.
    http://designbygravity.wordpress.com/2009/10/19/what-mother-never-told-you-about-svn-branching-and-merging/
     

    Thursday, September 13, 2012

    Remove word "chapter" in a latex report

    Remove word "chapter" in a latex report

    \documentclass{report}
    \usepackage{titlesec}
    \titleformat{\chapter}
      {\normalfont\LARGE\bfseries}{\thechapter}{1em}{}
    \titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
    \begin{document}
    \chapter{Introduction}
    \section{Section}
    \end{document}
    
    
    http://tex.stackexchange.com/questions/10326/how-to-set-the-chapter-style-in-report-class
    
    

    Friday, August 31, 2012

    Linux Lost Internet Connection

    Linux renew ip command

    The -r flag explicitly releases the current lease, and once the lease has been released, the client exits. For example, open terminal and type the command:
    $ sudo dhclient -r
    Now obtain fresh IP:
    $ sudo dhclient
    There is no need to restart network service. Above command should work with any Linux distro such as RHEL, Fedora, CentOS, Ubuntu and others.

    On a related note you can also try out the following commands:
    # ifdown eth0
    # ifup eth0
    # /etc/init.d/network restart

    OR
    # /etc/init.d/networking restart 

    Source: http://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/

    OR

     $ sudo dhclient eth0

    Source: http://askubuntu.com/questions/2901/unmanaged-network-icon-network-manangement-disabled