Total Pageviews

Wednesday, June 4, 2014

Java/Android Notes


  • How is Java program created/built/executed?
    • Create Hello.java.
      • Create class Hello.
      • Inside the Hello class, create a static method main with the signature:
        • public static void main(String[] args)
      • Inside the main method, use System.out.println("Hello world!"); to write to standard output.
    • Use javac Hello.java to create Hello.class.
    • Use java Hello to run Hello.class, notice no .class extension when using java to execute a class.
  • Write a Java program that defines/uses package.
    • Assume current directory is hello.
    • mkdir -p a/b/c && cd a/b/c
    • Inside a/b/c, create a file Add.java.
    • Inside Add.java file, declare the package it belongs to:
      • package a.b.c;
    • Inside Add.java file, create a public class Add.
    • Inside class Add, create a public static method add with the signature:
      • public static int add(int a, int b)
    • Go back to hello directory: cd hello.
    • Create a file AddTest.java.
    • Inside the AddTest.java file, import class Add from package a.b.c:
      • import a.b.c.Add;
    • Inside the AddTest.java file, create a public static main method with the signature:
      • public static void main(String[] args)
    • The main method:
      • Read arguments from the command line.
      • Use Integer.parseInt to convert them to int.
      • Call Add.add to compute the sum.
      • Call System.out.println to print the result to standard output.
    • In directory hello, compile the AddTest.java file by javac AddTest.java, it generates AddTest.class.
    • Run the program: java AddTest 1 2, should see the result 3 printed to the standard output.
  • Java's member access rule:
  • Modifier    | Class | Package | Subclass | World
    ————————————+———————+—————————+——————————+———————
    public      |  y    |    y    |    y     |   y
    ————————————+———————+—————————+——————————+———————
    protected   |  y    |    y    |    y     |   n
    ————————————+———————+—————————+——————————+———————
    no modifier |  y    |    y    |    n     |   n
    ————————————+———————+—————————+——————————+———————
    private     |  y    |    n    |    n     |   n
    
    y: accessible
    n: not accessible
  • How to import .jar in ADT
    • Download the library .jar file x to folder p.
    • In the `Package Explorer', find libs folder (if not exists, create one: New -> Folder).
    • Right click libs, Import -> General -> File System.
    • Navigate to folder p, find x in the right panel. Check the check-box. Click Finish.
    • If libs is already in the build path, we are done. Otherwise, Right click the project, Build Path -> Configure Build Path..., select Libraries tab. Click Add JARs..., find the x, click ok.
  • How to setup jni? (TODO)
  • How to call c/c++ procedure from Java through jni? (TODO)
  • How to call Java procedure from c/c++ through jni? (TODO)

Friday, October 25, 2013

Ruby notes from Javascript coder


  • Symbols begins with :
  • function call do not need (), just mention it.
  • If you want to get the function object instead of the result of calling it, use method(:function_name), obj.method(:method_name) or class.instance_method(:method_name).
  • no curly braces, use `end` key word.
  • string enclosed by "" can be perform fancy variable substitute; with '', no substitute.
  • substitute: #{variable_name}, #{variable_name.method}
  • Inside class, @prop means `this.prop`
  • To define class properties: attr_accessor, attr_reader, atter_writer
  • Result of the last express in a method definition will be the return value.
  • Can define constants by using upper case letter as variable name. It is still mutable, but the interpreter will complain.
  • By convention, methods end with ? are predicates, they all return a boolean value.
  • By convention, methods end with ! would perform some mutation to the object.
    • list.sort => return a new list
    • list.sort! => sort the list in place
  • Variable naming and their scope:
    • begin with $ => global
    • begin with @ => instance variable
    • begin with @@ => class variable
    • begin with [a-z_] => local
    • begin with [A-Z] => constant
  • Special global variables: $@, $_, $., ..., http://www.tutorialspoint.com/ruby/ruby_predefined_variables.htm
  • Function arguments:
    • variable length of arguments, (*args), then args will be a Enumerable
    • default value def method(a=1, b)
  • Operate on collection (Enumerable class): http://ruby-doc.org/core-2.0.0/Enumerable.html, mapping from Javascript Array methods:
    • filter <=> select
    • reduce <=> reduce, inject
    • map <=> map, collect
    • every <=> all?
    • some <=> any?
    • flat_map == collect_concat
  • Lambda expression:
    • function(x){return x*2;} => {|x| x*2}, do |x| x*2 end
  • Ranges:
    • (1..10) , double dot, includes 10
    • (1...10), triple dot, does not include 10
  • JSON like hash syntax works on later version of ruby. But the original syntax looks like:
    • my_hash = { :a => 1, "b" => 2, 3 => 3 }
  • Array decomposition can be used to pull out values from a array and assign them to variables:
    • a, (b, *c), *d = 1, [2, 3, 4], 5, 6
  • Support modifier form for if, unless, while, until
    • a += 1 if a.zero?
    • a += 1 while a < 10
    • a += 1 until a > 10
    • begin a+= 1 end while a < 10
  • Ruby use `next` key word instead of `continue`
  • Regex:
    • create syntax => same as Javascript:  /[0-9a-z]/i
    • re.test( 'some string' ) <=> re === 'some string'











Tuesday, June 11, 2013

Download all pdf links from ASCE search page


- Search the articles by key word
- Get a web page that list all the pdf links
- Inspect the pdf link element, looks like this:
    <a class="ref nowrap" target="_blank" title="Opens new window" href="/doi/pdf/10.1061/%28ASCE%290733-9488%282001%29127%3A3%28118%29">PDF (1569 KB)</a>
- Open browser console, use jQuery select the pdf links based on its class/text/or other features
    pdfLinks = [];
    $('.ref:contains("PDF")').each( function() {  pdfLinks.push( $(this).attr( 'href' ); ) } ) ;
    pdfLinks.join( '\n' )
- Copy the output text from browser console, and save it to a text file list.txt.
- Use wget to get all the links:
    cat list.txt | xargs -I{} wget http://ascelibrary.org{}

Thursday, January 24, 2013

Install WordPress on linux server

Here are the instructions for setting up your own WordPress server. In this example, the server runs CentOS 6.3. Before you get started, switch to root user first, since most of the instructions below require a root privilege.
  1. Install related softwares: yum install httpd mysql-server mysql php php-mysql
  2. Start httpd and mysql: service start httpd service start mysqld Now open http://localhost, you should see a test page that indicates the server is working.
  3. Set up mysql server: Use mysqladmin utility to do the job: mysqladmin -u root -p password 123456 Then a prompt 'Enter password:' should appear, just hit enter since the default root user has no password. After this step, the mysql server has been setup. There is a user 'root' with the password 123456 (of course, you can change it).
  4. Install database manage tool phpMyAdmin: This tool provide a web gui interface to manage the mysql database.
    • Download the latest version of phpMyAdmin and put into the document root of Apache server(usually is /var/www/html): cd /var/www/html wget 'http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.5/phpMyAdmin-3.5.5-all-languages.tar.bz2/download#!md5!3f77e1a608939224a7dce97caf860f46'
    • Uncompress the file to phpmyadmin folder and remove the downloaded file: tar xvf phpMyAdmin-3.5.5-all-languages.tar.bz2 mv phpMyAdmin-3.5.5-all-languages phpmyadmin rm -rf phpMyAdmin-3.5.5-all-languages.tar.bz2
    • Now open http://localhost/phpmyadmin in the browser, you should see a login interface. Login with username root and password 123456 (configured in step (3))
  5. Create a new user and database for wordpress: In phpMyAdmin page:
    • Login phpMyAdmin as root.
    • In phpMyAdmin, click 'Users' tab on home page.
    • Click 'Add User'
    • In 'Add User' form, fill in the user information.
    • User name: choose 'User text field', fill in 'wordpress'
    • Host: choose 'Local'
    • Hit generate password, copy the generated password to somewhere else for future use. In this example, the password is jcqu9LH5C82h238c
    • Under 'Database for user' tab, choose second option: 'Create database with same name and grant all privileges'
    • Hit 'Add User', now the user 'wordpress' and database 'wordpress' is added to the mysql database.
  6. Install wordpress:
    1. Download and uncompress the lastest version of wordpress into document root:cd /var/www/html wget http://wordpress.org/latest.tar.gz tar xfv latest.tar.gz wordpress rm -rf latest.tar.gz Now a folder name 'wordpress' is placed under the document root.
    2. Create the config file by copying the sample file: cd wordpress cp wp-config-sample.php wp-config.php
    3. Configure database:
      • Use your favourite text editor, open wp-config.php file: emacs ./wp-config.php
      • Replace the corresponding lines in the file with your own database settings: define('DB_NAME', 'wordpress'); define('DB_USER', 'wordpress'); define('DB_PASSWORD', 'jcqu9LH5C82h238c');
      • Save the file
    4. Web interface install:
      1. Launch http://localhost/wordpress, now you should see a welcome page of wordpress.
      2. Follow the instruction in wordpress install page, choose site title, i.e., set up admin password, fill in your email address, then hit 'Install Wordpress'.
      3. If everything above goes well, it will redirect to a page that tells you WordPress has been successfully installed. Now you can log in the wordpress as 'admin' and configure you website via WordPress web interface.
  7. Set up proper folder permissions: Usually you need setup a ftp server to manage plugins. But it can be configured in such a way that the plugins install directly into /wp-content/plugins folder, which is easier. To do so:
    • Add a line in wp-config.php: define('FS_METHOD', 'direct');
    • Change the owner of /wp-content folder to apache server: chown -R apache:apache wp-content

Friday, March 11, 2011

javascript object array bug

use new obj() to create a object, you can not use var obj() directly!

Tuesday, March 8, 2011

install flashplayer on Linux 64 machine

In linux 64 firefox, you can not browse flash content by default, you will have to download the linux 64 version library libflashplayer.so from http://labs.adobe.com/downloads/flashplayer10_square.html, then search libflashplayer.so in the computer and replace them with the 64 bit version.

Sunday, March 6, 2011

how to acquire 3D point cloud from multiple camera views

Microsoft's photosynth can do that. How do they calibrate the camera?

In CV class, I learned to reconstruct 3D scenes from two views. In two camera views case, without camera calibration, projected structure is best you can get. If you want to recover the original structure, you have to suppress your knowledge of the real structure such as parallel, perpendicular, or more than five points' coordinates.  Usually we need to use check-boards to calibrate the camera.

In photosynth, we are not asked to choose the lines that a orthogonal or parallel, neither to take photos with a check-board. But we offer more than two views. What will we benefit from that? Can we calibrate the camera without providing any extra information beyond the pixels? Andrew says maybe they can get the parameters of camera from the photo itself. Well, it is a possible way, but what if we don't have the information?

create a panorama

Microsoft's Image Composite Editor can do that, but you have to download a software and run it only on windows platform. Someone has already build online application:http://www.dermandar.com/create.php.

By using the knowledge I have learned in CV class, I wrote a program in Matlab to create panoramas. It takes about two minute to combine five images, and each image is of size 5 megabits.

Now the program can be improved in several aspects:
1)The interest points detection correspondence matching process, which is very time expensive, is written in a sequential loop, I can try to use parallel computation.
2)Try to use downsampled image to estimate homography to save time.
3)Try to eliminate the artifact in boundaries of the image.


Saturday, March 5, 2011

graphic card driver problem on CentOS

I solved the graphic card driver problem today. There are some hints that let me know my graphic card is not working properly.

1)I ran 'bench' in Matlab, the result shows the 2D and 3D function is extremely poor (poor than my laptop) while other test figure are very good.
2)When I use firefox, I can not use WebGL as before. My firefox is the latest beta version, it should work.
3)When I ran OpenGL program, it reports error: extension "GLX" missing on display ":0.0".
4)I found my screen is not as shape as it supposed to be. 

I googled the GLX problem and found it is related to the graphic card. Here is the article http://wiki.centos.org/HardwareList/Nvidia_Graphics. Followed the instruction, I have my graphic card driver installed. After the installation the screen became nice and shape. It also works properly on WebGL and OpenGL things. And I run the matlab bench again, it turns out to be super fast now.


Compile Opensees on CentOS

Here is a record of compiling OpenSees in CentOS. I edit my Makefile based on Makefile.def.LINUX_RedHat_ENTERPRISE and then start compiling. I posted my Makefile.def.CentOS in another blog.

First Error is:

/home/GL/OpenSees/SRC/system_of_eqn/linearSOE/sparseGEN/SuperLU.h:78: error: ‘superlu_options_t’ does not name a type
/home/GL/OpenSees/SRC/system_of_eqn/linearSOE/sparseGEN/SuperLU.h:79: error: ‘SuperLUStat_t’ does not name a type
make[2]: *** [commands.o] Error 1
make[2]: Leaving directory `/home/GL/OpenSees/SRC/tcl'
make[1]: *** [tk] Error 2
make[1]: Leaving directory `/home/GL/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

After googling, I find SuperLU.h is a old version, change :

SUPERLUdir   = $(HOME)/OpenSees/OTHER/SuperLU
to
SUPERLUdir   = $(HOME)/OpenSees/OTHER/SuperLU_3.0/SRC

Second Error:

cc1plus: warning: -f[no-]force-mem is nop and option will be removed in 4.2
make[2]: Leaving directory `/home/GL/OpenSees/SRC/tcl'
g++: /home/GL/lib/libOpenSees.a: No such file or directory
make[1]: *** [tk] Error 1
make[1]: Leaving directory `/home/GL/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

It seems to get stuck at /home/GL/OpenSees/SRC/tcl , so I go to this directory and type make, after making sure all '.o's are generated, I go back to opensees, type make. The error has gone.

Then I get the error about BJtensor.

cc1plus: warning: -f[no-]force-mem is nop and option will be removed in 4.2
BJtensor.cpp: In member function ‘BJtensor BJtensor::operator*(BJtensor&)’:
BJtensor.cpp:1174: error: unable to find a register to spill in class ‘DIREG’
BJtensor.cpp:1174: error: this is the insn:
.......
BJtensor.cpp:1174: confused by earlier errors, bailing out

I googled it and find it has something to do with C++Flags, which I don't know much about it so far.  I change the flag to this:

C++FLAGS        = -Wall -D_LINUX -D_UNIX -D_MYSQL -D_TCL84 $(GRAPHIC_FLAG) $(RELIABILITY_FLAG)\
 $(DEBUG_FLAG) $(PROGRAMMING_FLAG) -O3 -ffloat-store -D_HTTPS

Then I go back to home directory and type make. This time it compiled for a few minutes. After that, the compiler says all libraries are built and it is going to link them. While linking, some errors occur:

/home/GL/OpenSees/SRC/tcl/tkMain.o: In function `Tk_MainOpenSees(int, char**, int (*)(Tcl_Interp*), Tcl_Interp*)':
tkMain.cpp:(.text+0x561): undefined reference to `TkpDisplayWarning'
......tkAppInit.cpp:(.text+0x37): undefined reference to `Tk_Init'

It has something to do with Tk library, since these functions are implemented in Tk. So just add TK library (libtk8.4.so) into this variable:

TCL_LIBRARY  = /usr/local/tcl/lib/libtcl8.4.so
so it is now:
TCL_LIBRARY  = /usr/lib64/libtcl8.4.so /usr/lib64/libtk8.4.so

Another error is:

/home/GL/lib/libOpenSees.a(AMDNumberer.o): In function `AMD::number(Graph&, int)':
AMDNumberer.cpp:(.text+0x37b): undefined reference to `amd_order'

`amd_order' function is implemented in AMD library, which needs to be compiled. Do things below to get rid of this error:

1)add a line:
AMDdir = $(HOME)/OpenSees/OTHER/AMD
2)add  $(AMDdir) to DIRS
3)add a line:
AMD_LIBRARY = $(HOME)/lib/libAMD.a
4) add $(AMD_LIBRARY) to MACHINE_NUMERICAL_LIBS


/home/GL/lib/libOpenSees.a(HTTP.o): In function `httpsSEND_File(char const*, char const*, char const*, char const*, char const*, unsigned int, bool, bool, char**)':
HTTP.cpp:(.text+0x21a): undefined reference to `SSL_library_init'
HTTP.cpp:(.text+0x21f): undefined reference to `SSLv2_client_method'
......
/home/GL/lib/libOpenSees.a(HTTP.o): In function `httpsGET_File(char const*, char const*, char const*, unsigned int, char const*)':
HTTP.cpp:(.text+0x653): undefined reference to `SSL_library_init'
HTTP.cpp:(.text+0x658): undefined reference to `SSLv2_client_method'
......
collect2: ld returned 1 exit status
make[1]: *** [tk] Error 1
make[1]: Leaving directory `/home/GL/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

The error above tell us OpenSSL library needs to be linked. By adding -lssl to MACHINE_SPECIFIC_LIBS to get rid of the error. i.e:

MACHINE_SPECIFIC_LIBS = -lssl -ldl  -lieee -lm -lc -lg2c -Wl,-rpath,/usr/local/lib \
/usr/local/mysql/lib/libmysqlclient.a

The above is a brief record of the main compiling process. But there are many other tricky things:

My CentOS do have tcl/tk at 8.4 version. But it does not comtain a tk.h file, very strange... So I download it manually from some website and put it into the TCL_INCLUDES directory. Then the compiler report 'Tk_SafeInit' is not declared... So I edit the tk.h and declare 'Tk_SafeInit', although I have no idea what it is. I just copy the way they declare 'Tk_Init' and change the name. Then it will work.

Another tricky thing is when you use command g++ -l(library) to specify the library you want to link, it can only search for something with the file named *.so, it can not find something like *.so.0.0, so if the library file's name is *.so.0.0, you have to make a link *.so pointing to it. Use the command:
ln -s libraryname.so.0.0 libraryname.so.

Makefile.def.CentOS

############################################################################
#
#  Program:  OpenSees
#
#  Purpose:  A Top-level Makefile to create the libraries needed
#            to use the OpenSees framework.
#
#   version created for Redhat Enterprise LINUX distribution
#
#  Written: fmk
#  Created: 01/2003
#
#
############################################################################

# %---------------------------------%
# | NOTE:       WARNING             |
# %---------------------------------%

# on my installation tcl/tk header files were not installed
# by default. IN FACT THEY ARE NOT ON RedHat CD's. They use 3.3.5 anyway,
# kinda obsolete. Suggest you download tcl/tk8.4.6 from
# http://www.tcl.tk/software/tcltk/downloadnow84.tml
# gunzip and untar it, cd into the unix directory and issue the following 3
# commands for (with minor mod tk for tcl in first) in the unix directory:
#  ./configure --prefix=/usr/local/tcl  (./configure --prefix=/usr/local/tk)
#  ./make
#  ./make install

# If you use 3.3.5 REMOVE -D_TCL84 from the C++_FLAGS lower down in this file.

# also no MySQL!!!!! .. i got 4.0.20 from
#http://dev.mysql.com/get/Downloads/MySQL-4.0/mysql-standard-4.0.20-pc-linux-i686.tar.gz/from/pick#mirrors

# gunzip, untar and follow instructions in INSTALL-BINARY file.

# %---------------------------------%
# |  SECTION 1: PROGRAM             |
# %---------------------------------%


#
# Specify the location and name of the OpenSees interpreter program
# that will be created (if this all works!)

OpenSees_PROGRAM = $(HOME)/bin/OpenSees

# %---------------------------------%
# |  SECTION 2: MAKEFILE CONSTANTS  |
# %---------------------------------%
#
# Specify the constants the are used as control structure variables in the Makefiles.

OPERATING_SYSTEM = LINUX
GRAPHICS = UsingOpenGL

#RELIABILITY = YES_RELIABILITY, NO_RELIABILITY
RELIABILITY = NO_RELIABILITY


# %---------------------------------%
# |  SECTION 3: PATHS               |
# %---------------------------------%
#
# Note: if vendor supplied BLAS and LAPACK libraries or if you have
# any of the libraries already leave the directory location blank AND
# remove the directory from DIRS.

#  PUT YOUR HOME DIRECTOREY HERE
HOME  = /home/GL
FE    = $(HOME)/OpenSees/SRC
BASE  =

BLASdir      = $(HOME)/OpenSees/OTHER/BLAS
CBLASdir     = $(HOME)/OpenSees/OTHER/CBLAS
LAPACKdir    = $(HOME)/OpenSees/OTHER/LAPACK
ARPACKdir    = $(HOME)/OpenSees/OTHER/ARPACK
UMFPACKdir   = $(HOME)/OpenSees/OTHER/UMFPACK
METISdir     = $(HOME)/OpenSees/OTHER/METIS
SRCdir       = $(HOME)/OpenSees/SRC
#SUPERLUdir   = $(HOME)/OpenSees/OTHER/SuperLU
SUPERLUdir   = $(HOME)/OpenSees/OTHER/SuperLU_3.0/SRC
AMDdir = $(HOME)/OpenSees/OTHER/AMD

DIRS        = $(BLASdir) \
              $(CBLASdir) \
              $(SUPERLUdir) \
              $(LAPACKdir) \
              $(ARPACKdir) \
              $(UMFPACKdir) \
              $(METISdir) \
              $(SRCdir)\
              $(AMDdir)

# %-------------------------------------------------------%
# | SECTION 4: LIBRARIES                                  |
# |                                                       |
# | The following section defines the libraries that will |
# | be created and/or linked with when the libraries are  |
# | being created or linked with.                         |
# %-------------------------------------------------------%
#
# Note: if vendor supplied BLAS and LAPACK libraries leave the
# libraries blank. You have to get your own copy of the tcl/tk
# library!!
#
# Note: For libraries that will be created (any in DIRS above)
# make sure the directory exsists where you want the library to go!

FE_LIBRARY          = $(HOME)/lib/libOpenSees.a
NDARRAY_LIBRARY     = $(HOME)/lib/libndarray.a  # BJ_UCD jeremic@ucdavis.edu
MATMOD_LIBRARY      = $(HOME)/lib/libmatmod.a   # BJ_UCD jeremic@ucdavis.edu
BJMISC_LIBRARY      = $(HOME)/lib/libBJmisc.a  # BJ_UCD jeremic@ucdavis.edu
LAPACK_LIBRARY      = $(HOME)/lib/libLapack.a
BLAS_LIBRARY        = $(HOME)/lib/libBlas.a
SUPERLU_LIBRARY     = $(HOME)/lib/libSuperLU.a
CBLAS_LIBRARY       = $(HOME)/lib/libCBlas.a
ARPACK_LIBRARY      = $(HOME)/lib/libArpack.a
UMFPACK_LIBRARY     = $(HOME)/lib/libUmfpack.a
METIS_LIBRARY       = $(HOME)/lib/libMetis.a
AMD_LIBRARY = $(HOME)/lib/libAMD.a

TCL_LIBRARY         = /usr/lib64/libtcl8.4.so /usr/lib64/libtk8.4.so

GRAPHIC_LIBRARY     = -L/usr/X11/R6/lib -lGL -lGLU

RELIABILITY_LIBRARY =


# WATCH OUT .. These libraries are removed when 'make wipe' is invoked.

WIPE_LIBS = $(FE_LIBRARY) \
           $(NDARRAY_LIBRARY) \
           $(MATMOD_LIBRARY) \
           $(SUPERLU_LIBRARY) \
           $(ARPACK_LIBRARY) \
           $(UMFPACK_LIBRARY) \
           $(METIS_LIBRARY) \
           $(LAPACK_LIBRARY) \
           $(BLAS_LIBRARY) \
           $(CBLAS_LIBRARY) \
  $(RELIABILITY_LIBRARY)

# %---------------------------------------------------------%
# | SECTION 5: COMPILERS                                    |
# |                                                         |
# | The following macros specify compilers, linker/loaders, |
# | the archiver, and their options.  You need to make sure |
# | these are correct for your system.                      |
# %---------------------------------------------------------%

# ###################################################
# # Compilers
# ###################################################

CC++            =  g++
CC              =  gcc
FC              =  g77
F90             =
LINKER          =  g++

AR = ar
ARFLAGS = cqls
RANLIB = ranlib
RANLIBFLAGS     =

GRAPHIC_FLAG = -D_GLX
PROGRAMMING_FLAG =
RELIABILITY_FLAG =

C++FLAGS        = -Wall -D_LINUX -D_UNIX -D_MYSQL -D_TCL84 $(GRAPHIC_FLAG) $(RELIABILITY_FLAG)\
 $(DEBUG_FLAG) $(PROGRAMMING_FLAG) -O3 -ffloat-store -D_HTTPS

CFLAGS          = -O2 $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG)
FFLAGS          = -Wall
LINKFLAGS       = -rdynamic


# Misc
MAKE            = make
CD              = cd
ECHO            = echo
RM              = rm
RMFLAGS         = -f
SHELL           = /bin/sh

# %---------------------------------------------------------%
# | SECTION 6: COMPILATION                                  |
# |                                                         |
# | The following macros specify the macros used in         |
# | to compile the source code into object code.            |
# %---------------------------------------------------------%

.SUFFIXES:
.SUFFIXES: .C .c .f .f90 .cpp .o .cpp

#
# %------------------%
# | Default command. |
# %------------------%
#
.DEFAULT:
@$(ECHO) "Unknown target $@, try:  make help"
#
# %-----------------------------------------------%
# |  Command to build .o files from source files. |
# %-----------------------------------------------%
#

.cpp.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $<

.C.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $<

.c.o:
@$(ECHO) Making $@ from $<
$(CC) $(CFLAGS) -c $< -o $@

.f.o:    
@$(ECHO) Making $@ from $<
$(FC) $(FFLAGS) -c $< -o $@

.f77.o:    
@$(ECHO) Making $@ from $<
$(FC) $(FFLAGS) -c $< -o $@

.f90.o:    
@$(ECHO) Making $@ from $<
$(FC90) $(FFLAGS) -c $< -o $@

# %---------------------------------------------------------%
# | SECTION 7: OTHER LIBRARIES                              |
# |                                                         |
# | The following macros specify other libraries that must  |
# | be linked with when creating executables. These are     |
# | platform specific and typically order does matter!!     |
# %---------------------------------------------------------%
MACHINE_LINKLIBS  = -L$(BASE)/lib \
                    -L$(HOME)/lib \

MACHINE_NUMERICAL_LIBS  = -lm \
  $(ARPACK_LIBRARY) \
  $(SUPERLU_LIBRARY) \
  $(UMFPACK_LIBRARY) \
  $(LAPACK_LIBRARY)  \
  $(BLAS_LIBRARY) \
  $(CBLAS_LIBRARY) \
  $(GRAPHIC_LIBRARY)\
  $(RELIABILITY_LIBRARY)\
  $(AMD_LIBRARY) -lg2c -ldl -lpng

MACHINE_SPECIFIC_LIBS = -lssl -ldl  -lieee -lm -lc -lg2c -Wl,-rpath,/usr/local/lib \
/usr/local/mysql/lib/libmysqlclient.a

# %---------------------------------------------------------%
# | SECTION 8: INCLUDE FILES                                |
# |                                                         |
# | The following macros specify include files needed for   |
# | compilation.                                            |
# %---------------------------------------------------------%


MACHINE_INCLUDES        = -I/usr/local/BerkeleyDB.4.0/include \
                          -I/usr/local/mysql/include \
                          -I$(HOME)/include   \
                 -I$(UMFPACKdir) \
                          -I$(SUPERLUdir)

# this file contains all the OpenSees/SRC includes
include $(FE)/Makefile.incl

TCL_INCLUDES = -I/usr/local/tcl/include

INCLUDES =  $(MACHINE_INCLUDES) $(TCL_INCLUDES) $(FE_INCLUDES)

Wednesday, March 2, 2011

20100301

Doing CV homework all day.
Try to implement panorama generation.

Tuesday, March 1, 2011

Friday, February 25, 2011

20100225

morning&afternoon : CV homework.
night play basketball. eat at pc, yogurt world, good.

20100224

morning: se203 class.
afternoon: discuss with LNM about CV
night: CV homework, send ZLY's suitcase to airport

Thursday, February 24, 2011

20100223

Finish SE203 homework in LaTex in the morning.
Take the seminar about Bridge in China. Interesting. Tried to figure out CSE252B homework 3.
Played basketball at night.

Tuesday, February 22, 2011

20100222

Feel sick, sleep all morning
eat lunch, sleep to 4:40, CV class..
discuss with LNM about CV homework at night

Monday, February 21, 2011

20100221_start_typing_LaTex

woke up at 8:30, checked the final schedules, registered the class.
Then worked on se203 homework, started learning LaTex until 7:30pm.
Played basketball at night.
I feel a little sick, maybe got cold.