Wednesday, April 27, 2011

Work with Path

http://stackoverflow.com/questions/428085/how-do-i-set-a-path-in-visual-studio
For example, to prepend C:\Windows\Temp to the PATH:
PATH=C:\WINDOWS\Temp;%PATH%
Similarly, to append $(TargetDir)\DLLS to the PATH:
PATH=%PATH%;$(TargetDir)\DLLS
Project | Properties | Select Configuration | Configuration Properties | Debugging | Working directory
Repeat for each project configuration.

Sunday, April 24, 2011

Software for contaminant transport

http://www.epa.gov/ada/csmos/index.html#download

BIOSCREEN

http://www.epa.gov/ada/csmos/models/bioscrn.html
BIOSCREEN is a screening model that simulates remediation through natural attenuation of dissolved hydrocarbons at petroleum fuel release sites. The model is designed to simulate biodegradation by both aerobic and anaerobic reactions.
Keyword: Analytical model, natural attenuation process, Domenico-based Fate and Transport Models.

BIOPLUME
http://www.epa.gov/ada/csmos/models/bioplume3.html

HSSM
http://www.epa.gov/ada/csmos/models/hssmwin.html
Keyword: LNAPL

MT3D
http://hydro.geo.ua.edu/mt3d/
Keyword: numerical model, flow and transport

PHREEQC
http://www.xs4all.nl/~appt/
Keyword: Geochemical modeling

PHT3D
http://www.pht3d.org/pht3d_public.html

RT3D
Keyword: reactive modeling
http://bioprocess.pnnl.gov/rt3d_down.htm

Terms:
BTEX
http://en.wikipedia.org/wiki/BTEX

BTEX
is an acronym that stands for benzene, toluene, ethylbenzene, and xylenes.[1] These compounds are some of the volatile organic compounds (VOCs) found in petroleum derivatives such as petrol (gasoline). Toluene, ethylbenzene, and xylenes have harmful effects on the central nervous system.

BTEX compounds are notorious due to the contamination of soil and groundwater with these compounds. This typically occurs near petroleum and natural gas production sites, and petrol stations and other areas with Underground Storage Tanks (USTs) or Above-ground Storage Tanks (ASTs) containing gasoline or other petroleum-related products.

The amount of 'Total BTEX', the sum of the concentrations of each of the constituents of BTEX, is sometimes used to aid in assessing the relative risk or seriousness at contaminated locations and the need of remediation of such sites. Naphthalene may also be included in Total BTEX analysis yielding results referred to as BTEXN. In the same way, styrene is sometimes added, making it BTEXS.

Wednesday, April 20, 2011

Development tools - optimization

Microsoft Solver Foundation

Getting started:
http://msdn.microsoft.com/en-us/library/ff524512%28v=VS.93%29.aspx
Examples:
http://msdn.microsoft.com/en-us/library/ff524501%28VS.93%29.aspx

Download

http://archive.msdn.microsoft.com/solverfoundation/Release/ProjectReleases.aspx?ReleaseId=1799

SVM
http://msdnrss.thecoderblogs.com/2011/02/support-vector-machines-svms-in-f-using-microsoft-solver-foundation/

NLP
http://dandesousa.com/2010/07/15/microsoft-solver-foundation-for-quadratic-programming/
for convex programming
http://stackoverflow.com/questions/1978754/whats-a-good-convex-optimization-library

Open source

LPsolve
http://lpsolve.sourceforge.net/5.5/

Coin-or
http://www.coin-or.org/resources.html

GNU
http://www.gnu.org/software/glpk/

MATLAB
http://www.convexoptimization.com/wikimization/index.php/MATLAB_Programs_for_Optimization

benchmarks
http://plato.asu.edu/ftp/lpfree.html
http://scip.zib.de/

Format
mps
ftp://ftp.caam.rice.edu/pub/people/bixby/miplib/mps_format

Development tools - plotting

GNUPLOT

Demos show capabilities
http://gnuplot.sourceforge.net/demo_4.4/

Include in C
http://users.aims.ac.za/~kuzamunu/faq/page1.php

Include in C#
http://www.debugging.com/bug/17233

Octave using GNUPLOT
http://www.shogun-toolbox.org/media/images/OctaveDemo.png

MS Chart:

http://archive.msdn.microsoft.com/mschart

Tuesday, April 19, 2011

Shell Script Notes

Question: How to do this in shell script
I have a txt file aa.txt like below:

100 | 200
11 | 22 | 33 | 44
12 | 23 | 35 | 55
14 | 24 | 36 | 56
200 | 300
21 | 22 | 330 | 44
22 | 23 | 315 | 55
24 | 55 | 361 | 56

I like to choose all the lines with 4 fields and collect the second
field of the 4 fields

i.e., discard all lines only with 2 fields, and take the second field of
the remaining,

the output should be
22
23
24
22
23
55

Answer:
grep ".*|.*|.*|.*" aa.txt |awk '{print $3}'

grep "^[0-9]\+ | [0-9]\+ | [0-9]\+ | [0-9]\+$" a | awk '{print $3}'

awk '{if (NF>4) print $3}' temp

awk -F'|' 'NF>4{print $2}' temp
yours are wrong :) should be 'NF>3'
Dashagen's was correct coz awk's default separator is space/tab.


Do it in the Q way,

d[;1] @/: (til count d) except where max each null d: flip
("IIII";"|") 0: `:aa.txt
Perl version:
perl -anle 'print @F[2] if scalar @F>3' aa.txt


Think:
if we only are interested the lines with 2 fields and like to print their
2nd field, what can we do?

Live a healthy life for your loved ones

Touched by a death of a young female scholar, Juan Yu, in Shanghai, China. She was only 33 years old, a new mother of a 1-years old, a beloved wife, and a new PhD graduate with a lecture position in FuDan University, but died of Breast Cancer on Apr. 19, 2011.

Before her death, she has written online dairies on her experiences of flighting cancer as well as her thoughts on reasons of her cancer. I have been following her dairy for several months, now she is gone.

These reasons, mainly about a person's life-style, even though lack of scientific basis, are quite common among young people living a professional or academic life (like me). For instance, we stayed up late at night, lacked sleep, ate irregular meals, did not exercise regularly, accumulated too much stresses before a due date, etc.

So stressed, tired, yet still indulging this feeling of exhaustion, like me right now, I feel it may be a time to change (hopefully not too late). May God bless her and everyone happened to cross this piece. Live a healthy life for yourself and for whoever loves you and you love. Life is too short to waste on non-senses, and also burn it recklessly.

Here is an address of her Blog, what a loss!
http://blog.sina.com.cn/u/1904273792