Giter Club home page Giter Club logo

web_app's People

Contributors

slee172 avatar

Watchers

 avatar  avatar  avatar

web_app's Issues

test cgi

#!/usr/bin/env python
print "Content-type:text/html\n\n"
print "\n"
print "Python Script Test Page"
print "\n"

solution_0519

LOAD DATA LOCAL INFILE 'sample_info.txt' INTO TABLE boundaries fields terminated by '\t' lines terminated by '\n' (Samples,Censored,Survival,age_at_initial_pathologic_diagnosis_Clinical,gender-Is-male_Clinical,race-Is-white_Clinical,race-Is-black or african american_Clinical,race-Is-asian_Clinical,race-Is-american indian or alaska native_Clinical,histological_type-Is-oligoastrocytoma_Clinical,histological_type-Is-astrocytoma_Clinical,histological_type-Is-oligodendroglioma_Clinical,histological_type-Is-glioblastoma multiforme (gbm)_Clinical,histological_type-Is-treated primary gbm_Clinical,histological_type-Is-untreated primary (de novo) gbm_Clinical,radiation_therapy-Is-yes_Clinical)

Configure file Location

For Homebrew:
--Cache
/Users/*username/Library/Caches/Homebrew/
--/usr/local/etc/ contains the php and apache2 --can find the configure file here
brew services start homebrew/php/php56
which php
/usr/local/bin/php
which httpd
/usr/local/bin/httpd
DocumentRoot for Apache2
/usr/local/var/www/htdocs

echo $PATH
/Users/*username/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
modify by
export PATH=/usr/local/bin:/usr/local/sbin:$PATH

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.httpd22.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.httpd22.plist
brew services stop httpd24
brew services start httpd24

➜ ~ which php
/usr/bin/php
➜ ~ which httpd
/usr/sbin/httpd

solution_0521

/var/www/html/HistomicsML/php
sudo service al_server start
cd /var/log
cat al_server.log

X-code

To tell Xcode to analyze your project, choose Analyze from Xcode's Product menu or press Shift-Command-B. It will take Xcode a few moments, but when it's finished you should see a list of issues in the Issue Navigator on the left. Issues found by the analysis are highlighted in blue.

Error while executing .plist file Path had bad ownership/permissions

Try changing to ownership of the .plist file, as noted here.

sudo chown root /Library/LaunchDaemons/myfile.plist
sudo chgrp wheel /Library/LaunchDaemons/myfile.plist
It is also worth noting that these root LaunchDaemons can't be world writable, for security reasons:
sudo chmod o-w /Library/LaunchDaemons/*

install

setup activelearning on virtual box

virtual OS: Ubuntu 14.04.3 LTS

mount host directory on vitual directory

  1. install guest edition in Device tab
  2. edit /etc/rc.local
    ...
    sudo mount -t vboxsf localdata /localdata
    exit0
  3. reboot os

setup working directory

for features

mkdir -p /localdata/datasets/GBM
cp GBM-features.h5 /localdata/datasets/GBM

for images

mkdir -p /localdata/pyramids/GBM
cp TCGA-02-0010-01Z-00-DX4.svs.dzi.tif to /localdata/pyramids/GBM

install packages

sudo apt-get update
sudo apt-get upgrade

setup Web server and database

install Apache2, MYSQL, php, python, numpy and scipy

sudo apt-get install apache2
sudo apt-get install mysql-server php5-mysql
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

sudo apt-get install python-pip
sudo pip install -U pip
sudo apt-get install python-dev libmysqlclient-dev
sudo pip install MySQL-python // virtual environment
or sudo apt-get install python-mysqldb

sudo apt-get install python-numpy
sudo apt-get install cython
sudo apt-get install python-scipy
pip install mysqlclient

setup learning server

install cmake, hdf5, libconfig, gengetopt, h5py, jannson, OpenCV 2.4.10, cblas

sudo apt-get install cmake
sudo apt-get install libhdf5-serial-dev hdf5-tools
sudo apt-get install libconfig++9
sudo apt-get install gengetopt
pip install h5py
sudo apt-get install libjansson-dev

install dependencies

sudo apt-get install -y build-essential
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev

sudo apt-get install libqt4-core libqt4-dev libqt4-gui qt4-dev-tools

install IIP Server and dependencies

need to change source repository

sudo sed -i -e '1i deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse' /etc/apt/sources.list
sudo sed -i -e '1i deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse' /etc/apt/sources.list
sudo sed -i -e '1i deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse' /etc/apt/sources.list
sudo sed -i -e '1i deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse' /etc/apt/sources.list

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev
sudo apt-get install -y build-essential libapache2-mod-fcgid php5-cgi libfcgi0ldbl zlib1g libstdc++6 libmemcached10 libapache2-mod-fastcgi memcached libjpeg-dev libtiff-dev libpng-dev libjasper-dev

install jpeg and tiff

wget http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz
tar -xzvf tiff-4.0.6.tar.gz
cd tiff-4.0.6
./configure
make
sudo make install

wget -c https://github.com/uclouvain/openjpeg/archive/v2.1.2.tar.gz -O openjpeg-2.1.2.tar.gz
tar -xzvf openjpeg-2.1.2.tar.gz
mkdir openjpeg-2.1.2/build
cd openjpeg-2.1.2/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install

install IIP Server

wget https://sourceforge.net/projects/iipimage/files/IIP%20Server/iipsrv-1.0/iipsrv-1.0.tar.bz2
tar -xvjf iipsrv-1.0.tar.bz2
cd iipsrv-1.0
./configure && make

modify apach configuration

copy iipsrv.fcgi to /usr/lib/cgi-bin directory

sudo iipsrv-1.0/src/iipsrv.fcgi /usr/lib/cgi-bin

link iipsrv.conf at mods_enable

cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/iipsrv.conf

copy iipsrv.conf to mods-available directory

sudo cp iipsrv.conf /etc/apache2/mods-available/iipsrv.conf

add servername as localhost

vi /etc/apache2/apache2.conf
ServerName localhost

check if iip server works correctly

check IIP server itself

http://localhost/fcgi-bin/iipsrv.fcgi

check image: image should be located in /localdata/pyramids/GBM/TCGA-02-0010-01Z-00-DX1.svs.dzi.tif

http://localhost/fcgi-bin/iipsrv.fcgi?DeepZoom=/localdata/pyramids/GBM/TCGA-02-0010-01Z-00-DX1.svs.dzi.tif

install opencv-2.4.10

wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.10/opencv-2.4.10.zip
unzip opencv-2.4.10.zip
cd opencv-2.4.10
mkdir release
cd release
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D BUILD_FAT_JAVA_LIB=ON -D INSTALL_TO_MANGLED_PATHS=ON -D INSTALL_CREATE_DISTRIB=ON -D INSTALL_TESTS=ON -D ENABLE_FAST_MATH=ON -D WITH_IMAGEIO=ON -D BUILD_SHARED_LIBS=OFF -D WITH_GSTREAMER=ON ..
make all -j4 # if you have 4 cores
sudo make install

install cblas

sudo apt-get install -y libblas-dev libblas-doc liblapacke-dev liblapack-doc libatlas-base-dev libconfig++-dev

install git

sudo apt-get install git-all

install Active Learning

git clone https://github.com/cooperlab/ActiveLearning.git
cd ActiveLearning/al_server/build/release
cmake -D CMAKE_BUILD_TYPE=Release ../..
make

copy al_server to /usr/local/bin

sudo cp ../../bin/al_serverd /usr/local/bin
sudo cp ../../bin/validate /usr/local/lib

cd scripts
sudo cp al_server /etc/init.d
sudo mkdir /etc/al_server
sudo cp al_server.conf /etc/al_server

install web app

cd ActiveLearning/scripts
sudo ./web_install.sh /var/www/html

change IIPServer address to localhost

edit hostspecs.php

copy host infomation to HistomicsML directory

sudo cp hostspecs.php /var/www/html/HistomicsML/php

start learning server

sudo service al_server start

database setup

creat users guest and logger

./add_users.py root

copy accounts.php to HistomicsML directory

sudo cp accounts.php /var/www/html/HistomicsML/db

create database tables and set user privileges

mysql -u root -p < database_create.sql
mysql -u root -p < set_privileges.sql

insert boundary data

mysql -u root -p --local-infile=1
use nuclei;
LOAD DATA LOCAL INFILE 'GBM-boundaries.txt' INTO TABLE boundaries fields terminated by '\t' lines terminated by '\n' (slide, centroid_x, centroid_y, boundary);

create csv

GBM-pyramids.csv
TCGA-02-0010-01Z-00-DX4,32001,38474,/localdata/pyramids/GBM/TCGA-02-0010-01Z-00-DX4.svs.dzi.tif,1

insert pyramids information to slides table

mysql -u root -p --local-infile=1
use nuclei;
LOAD DATA LOCAL INFILE 'GBM-pyramids.csv' INTO TABLE slides fields terminated by ',' lines terminated by '\n' (name, x_size, y_size, pyramid_path, scale);

insert data information to datasets and dataset_slide tables

GBM-list.txt
TCGA-02-0010-01Z-00-DX4

edit ActiveLearning/scripts/create_dataset.py

cursor.execute("select id from datasets where name=%s", (dataset,))
cursor.execute("select id from slides where name=%s", (slide,))

run create_dataset.py

python ./create_dataset.py root GBM-1 GBM/GBM-features.h5 GBM-list.txt

launch HistomicsML

http://localhost/HistomicsML

restart

memory :2G
disk:20G
sudo apt-get install gparted
use dash in ubuntu to open gparted (search)

^M in csv file

File has been transferred between systems of different types with different newline conventions. For example, Windows-based text editors will have a special carriage return character (CR+LF) at the end of lines to denote a line return or newline, which will be displayed incorrectly in Linux (^M). This can be difficult to spot, as some applications or programs may handle the foreign newline characters properly while others do not. Thus some services may crash or not respond correctly. Often times, this is because the file is created or perhaps even edited on a Microsoft Windows machine and then uploaded or transferred to a Linux server. This typically occurs when a file is transferred from MS-DOS (or MS-Windows) without ASCII or text mode.

reinstall_steps

After installing old version ubuntu(14.04) on virtual box, how to resolve the resolution problem of the screen without updating the ubuntu version?
sudo apt-get install virtualbox-guest-utils

Data Organization in js

The data I've got is an array of objects
[Object1,
Object2,
Object3,
...
]
Each Object is an json format
{"key1":"value1","key2":"value2","key3":"value3","key4":"value4"...}
To get all the value of a few given key

function getFields(input, field) {
  var output = [];
  for (var i=0; i < input.length ; ++i){
    output.push(input[i][field]);
  }
  return output;    //loop through all the objects and find all the values for one key
}

$('.destination .list-group-item').each(function(){
         chosen_field.push($(this).text());
       });
       var json_join = new Array();
       for (var i = 0; i < chosen_field.length; i++) {
           var result = (getFields(data,chosen_field[i]));
           var json = new Object();
           json.key = chosen_field[i];
           json.value = JSON.stringify(result);
           json_join.push(json);
        }
//loop through all the selected fields and return each value array and combine to a new json file 
preparing for sending to php in the format of json file.

solvedProblems_0518_mySQL

6.1.6 Security Issues with LOAD DATA LOCAL

https://dev.mysql.com/doc/refman/5.7/en/load-data-local.html

The LOAD DATA statement can load a file located on the server host, or, if the LOCAL keyword is specified, on the client host.
To avoid LOAD DATA issues, clients should avoid using LOCAL. To avoid connecting to untrusted servers, clients can establish a secure connection and verify the server identity by connecting using the --ssl-mode=VERIFY_IDENTIFY option and the appropriate CA certificate.
For the mysql client, local data loading is disabled by default. To enable or disable it explicitly, use the --local-infile[=1] or --local-infile=0 option.

software installation on ubuntu using apt-get

how to find your server's public address on ubuntu
sudo apt-get install curl
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
shorter one 👍
curl ipinfo.io/ip

apache

which httpd
/usr/local/bin/httpd
curl -I -L localhost
curl: (7) Failed to connect to localhost port 80: Connection refused

try survival analysis

Install minianaconda
export PATH=/Users/tianyulan/miniconda3/bin:$PATH
source ~/.zshrc

JavaScript and JQuery interactive front-end web development

Solution to remotely import a csv file and parse the file to get the field name using javascript

 $(document).ready(function() {
          if (window.File && window.FileReader && window.FileList && window.Blob) {
            $('#files').bind('change', handleFileSelect);
          }
        });
        function handleFileSelect(evt) {
          var files = evt.target.files; // FileList object
          var file = files[0];
          var reader = new FileReader();
          reader.readAsText(file);
          reader.onload = function(event) {
              var csv = event.target.result;
              var data = $.csv.toObjects(csv);
              var obj1 = data[0];
              var result = Object.keys(obj1);
              var var_len = result.length;
              console.log(var_len);
              console.log(result);       
          }
}
         

0510

install iipimage-server
sudo apt-get install iipimage-server

0616python lifelines

quick way to see the csv file

Number of Rows

cat Test.csv | wc -l

Number of Columns

head -1 Test.csv | sed 's/,/\t/g' | wc -w

0602_web

sudo cp index.html /var/www/html/HistomicsML/
tianyulan@tianyulan-VirtualBox:/localdata/ActiveLearning/web_app$ sudo cp js/app_main.js /var/www/html/HistomicsML/js/
tianyulan@tianyulan-VirtualBox:/localdata/ActiveLearning/web_app$ sudo cp db/getclinical_info.php /var/www/html/HistomicsML/db/
tianyulan@tianyulan-VirtualBox:/localdata/ActiveLearning/web_app$

0619_system program problem detected

1.Remove old crash-reports
sudo rm /var/crash/*
After a reboot the popups are gone.
If you don't want to reboot, you can close all open popups with:
2.killall system-crash-notification
(Any further new pop-ups still should be investigated. If you want to see the details,
look in /var/crash/ for any new reports)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.