Skip to content

Instantly share code, notes, and snippets.

Mohamed Taher Alrefaie mohataher

View GitHub Profile
View english-pronouns-list
{
'I',
'you',
'my',
'mine',
'myself'
'we',
'us',
'our',
'ours',
View polar-hr-to-dataframe.py
import pandas as pd
import datetime
import time
row=None
with open("hr.csv") as fp:
for i, line in enumerate(fp):
if i == 1:
print(line)
row=line
@mohataher
mohataher / hr.csv
Created Jan 24, 2018
load-polar-hr-data-to-python-pandas-dataframe
View hr.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 26 columns, instead of 12. in line 2.
Name,Sport,Date,Start time,Duration,Total distance (km),Average heart rate (bpm),Average speed (km/h),Max speed (km/h),Average pace (min/km),Max pace (min/km),Calories,Fat percentage of calories(%),Average cadence (rpm),Average stride length (cm),Running index,Training load,Ascent (m),Descent (m),Notes,Height (cm),Weight (kg),HR max,HR sit,VO2max,
MTA,OTHER_INDOOR,23-06-2017,13:43:56,00:08:40,0.00,77,,,,,17,71,,,,,,,,170.0,64.0,,,,
Sample rate,Time,HR (bpm),Speed (km/h),Pace (min/km),Cadence,Altitude (m),Stride length (m),Distances (m),Temperatures (C),Power (W),
1,00:00:00,75,,,,,,,,,
,00:00:01,75,,,,,,,,,
,00:00:02,75,,,,,,,,,
,00:00:03,76,,,,,,,,,
,00:00:04,77,,,,,,,,,
,00:00:05,78,,,,,,,,,
,00:00:06,86,,,,,,,,,
@mohataher
mohataher / Install-Lboro-Printer-On-Ubuntu.md
Created Jun 1, 2016
How to install printers on Ubuntu at Loughborough University
View Install-Lboro-Printer-On-Ubuntu.md

How to install printers on Ubuntu at Loughborough University

Install SMB Client

The university use SMB client to communicate; it doesn't come prepacked so you need to install it.

sudo apt-get install smbclient
@mohataher
mohataher / setup-oraclejava8-git-maven.sh
Created Apr 5, 2016
Set up a new Ubuntu instance on EC2
View setup-oraclejava8-git-maven.sh
#!/bin/sh
# install oracle 8
# source: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
# install maven and git
sudo apt-get install git maven
@mohataher
mohataher / close_all_management_instances_in_titan_db.md
Last active Mar 27, 2016
Gremlin query to close all management instances in Titan database.
View close_all_management_instances_in_titan_db.md
mgmt = graph.openManagement()
it=mgmt.getOpenInstances().iterator(); while (it.hasNext()){ nxt=it.next(); if(!nxt.contains("current"))  mgmt.forceCloseInstance(nxt)}
mgmt.commit()
@mohataher
mohataher / java-8-ami.md
Last active Aug 2, 2016 — forked from rtfpessoa/java-8-ami.md
[Guide] Install Sun Java 8 on Amazon EC2 Ami
View java-8-ami.md

First verify the version of Java being used is not Sun Java 8 SDK

java -version

Get the Sun Java 8 SDK from Oracle

wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-x64.rpm"

Install Sun Java 8

sudo rpm -i jdk-8u73-linux-x64.rpm

Check if the default java version is set to Sun Java 8 SDK

You can’t perform that action at this time.