This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the libraries | |
library(zoo) | |
library(dplyr) | |
Dataset <- Dataset %>% group_by(PermNo) | |
Dataset <- mutate(Dataset, cumRet = (((Price/lag(Price, n=12, order_by = Month))-1))) | |
top <- Dataset[Dataset$ME >= Dataset$BP_ME,] | |
top <- top[!(top$Month<="Dec 1990"),] | |
bottom <- Dataset[Dataset$ME < Dataset$BP_ME,] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="ui secondary menu purple-menu"> | |
<div class="ui container"> | |
<a class="fitted item"> | |
Scoot | |
</a> | |
<div class="right menu"> | |
<a class="item" href="/discover"> | |
Discover | |
</a> | |
<a class="item" href="/host"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Realm.Sync.User.login('http://<SERVER-IP>:9080', <USERNAME>, <PASSWORD>, (error, user) => { | |
if(!error){ | |
Realm.openAsync({ | |
schema: [SomeSchema], | |
sync: { | |
user: user, | |
url: 'realm://<SERVER-IP>:9080/data' | |
}}, (error, realm) => { | |
if (error) { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <LiquidCrystal.h> | |
#include <SoftwareSerial.h> | |
#include <Keypad.h> | |
#define redLED 13 | |
#define greenLED 10 | |
#define relayPIN 12 | |
String password = "2468"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webbrowser | |
from oauth2client import client | |
client_id_file = "client_id.json" | |
flow = client.flow_from_clientsecrets(client_id_file, scope='https://www.googleapis.com/auth/analytics.readonly', redirect_uri='urn:ietf:wg:oauth:2.0:oob') | |
auth_uri = flow.step1_get_authorize_url() | |
# Open a browser window to manually authenticate and get the auth code | |
webbrowser.open(auth_uri) | |
auth_code = raw_input('Enter the authorization code: ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
names = ["name1", "name2"] | |
def write(): | |
print('Creating log files...') | |
for name in names: | |
file_name = name + '.txt' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mail(): | |
#Imports the module | |
import smtplib | |
fromaddr = '[email protected]' | |
toaddrs = '[email protected]' | |
msg = "Sent via python" | |
# Authentication |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void commandProcessor(void) { | |
int lastCounts; | |
int counts; | |
boolean firstCount = true; | |
if (Encoder.buttonDown()) { // Read push button status (Ground true => 0=down) | |
while (Encoder.buttonDown()); // Do nothing while button is depressed | |
// Display menu | |
LCD.printString(MSG_FCT_SELECT, 1); | |
counts = 0; | |
Encoder.setCounter(counts, 0, 3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<?php | |
function getFeed($feed_url) { | |
$content = file_get_contents($feed_url); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
try: | |
from urlparse import parse_qsl | |
except: | |
from cgi import parse_qsl | |
import oauth2 as oauth |
NewerOlder