Skip to content

Instantly share code, notes, and snippets.

View VinACE's full-sized avatar
💭
I may be slow to respond.

VinACE

💭
I may be slow to respond.
View GitHub Profile
https://github.com/datastax/spark-cassandra-connector/blob/master/doc/14_data_frames.md
http://stackoverflow.com/questions/32556178/create-labeledpoints-from-spark-dataframe-in-python
http://stackoverflow.com/questions/37574833/create-labledpoints-from-spark-dataframe-how-to-pass-list-of-names-to-vectoras?noredirect=1&lq=1
sqlContext.sql(
"""CREATE TEMPORARY TABLE words
|USING org.apache.spark.sql.cassandra
|OPTIONS (
| table "ActivityMonitoringHistorical",
| keyspace "ihealth",
| cluster "Test Cluster",
https://docs.datastax.com/en/datastax_enterprise/4.6/datastax_enterprise/spark/sparkPySpark.html
COPY keyspace.columnfamily1 (column1, column2,...) TO 'temp.csv';
COPY keyspace.columnfamily2 (column1, column2,...) FROM 'temp.csv';
seqno ,peopleid ,datetime ,activityid ,datasetfileid ,datasetid ,heartrate ,imuankleacc16gxaxis ,imuankleacc16gyaxis ,imuankleacc16gzaxis ,imuankleacc6gxaxis ,imuankleacc6gyaxis ,imuankleacc6gzaxis ,imuanklegyroxaxis ,imuanklegyroyaxis ,imuanklegyrozaxis ,imuanklemagxaxis ,imuanklemagyaxis ,imuanklemagzaxis ,imuankleori1 ,imuankleori2 ,imuankleori3 ,imuankleori4 ,imuankletemp ,imuchestacc16gxaxis ,imuchestacc16gyaxis ,imuchestacc16gzaxis ,imuchestacc6gxaxis ,imuchestacc6gyaxis ,imuchestacc6gzaxis ,imuchestgyroxaxis ,imuchestgyroyaxis ,imuchestgyrozaxis ,imuchestmagxaxis ,imuchestmagyaxis ,imuchestmagzaxis ,imuchestori1 ,imuchestori2 ,imuchestori3 ,imuchestori4 ,imuchesttemp ,imuhandacc16gxaxis ,imuhandacc16gyaxis ,imuhandacc16gzaxis ,imuhandacc6gxaxis ,imuhandacc6gyaxis ,imuhandacc6gzaxis ,imuhandgyroxaxis ,imuhandgyroyaxis ,imuhandgyrozaxis ,imuhandmagxaxis ,imuhandmagyaxis ,i
start_simulation.sh
rest_api_service.py
clean_rest_api_service.py
consumer.log
producer.log
(kproduce) [centos@ip-10-0-0-11 kproduce]$ pwd
/home/centos/kafkaProduce/kproduce
from kafka import KafkaProducer
from cassandra.cluster import Cluster
from cassandra import ReadTimeout
import logging,sys
import time
from .utils.configmanager import ConfigManager
@VinACE
VinACE / tear_down_mesos
Last active May 17, 2017 13:45
tear_down mesos framework
http://stackoverflow.com/questions/25979560/kill-a-framework-in-mesos
vi /tmp/post.txt
frameworkId=23423-23423-234234-234234
curl -d@/tmp/post.txt -X POST http://your_mesos:5050/master/shutdown
https://jamesmccaffrey.wordpress.com/2015/06/09/particle-swarm-optimization-using-python/
# particleswarm.py
# python 3.4.3
# demo of particle swarm optimization (PSO)
# solves Rastrigin's function
import random
import math # cos() for Rastrigin
import copy # array-copying convenience
import sys # max float
http://milq.github.io/install-opencv-ubuntu-debian/
sudo apt-get clean python-minimal
sudo apt-get upgrade
@VinACE
VinACE / INSTALL
Created August 4, 2017 10:57 — forked from arya-oss/INSTALL.md
Ubuntu 16.04 Developer Tools installation
###### development tools
sudo apt-get install build-essential python-dev git nodejs-legacy npm gnome-tweak-tool openjdk-8-jdk
### Python packages
sudo apt-get install python-pip python-virtualenv python-numpy python-matplotlib
### pip packages
pip install django flask django-widget-tweaks django-ckeditor beautifulsoup4 requests classifier SymPy ipython
@VinACE
VinACE / virtual environment
Last active August 18, 2017 06:53
python virtual environment in Windows
https://github.com/davidmarble/virtualenvwrapper-win/
set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib