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 numpy | |
| import pandas as pd | |
| import math as m | |
| #@author: Bruno Franca | |
| #@author: Peter Bakker | |
| #Moving Average | |
| def MA(df, n): | |
| MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n)) |
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
| var http = require('http'); | |
| var Static = require('node-static'); | |
| var WebSocketServer = new require('ws'); | |
| // list of users | |
| var CLIENTS=[]; | |
| var id; | |
| // web server is using 8081 port | |
| var webSocketServer = new WebSocketServer.Server({ port: 8081 }); |
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
| var mongoose = require('mongoose'); | |
| var hitSchema = mongoose.Schema({ | |
| text: String, | |
| music: String | |
| }); | |
| hitSchema.statics.bulkInsert = function(models, fn) { | |
| if (!models || !models.length) | |
| return fn(null); |
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
| <?php | |
| $deviceToken = '6e1326c0e4758b54332fab3b3cb2f9ed92e2cd332e9ba8182f49027054b64d29'; // iPad 5s Gold prod | |
| $passphrase = ''; | |
| $message = 'Hello Push Notification'; | |
| $ctx = stream_context_create(); | |
| stream_context_set_option($ctx, 'ssl', 'local_cert', 'pushcert.pem'); // Pem file to generated // openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts // .p12 private key generated from Apple Developer Account | |
| stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); | |
| $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); // production | |
| // $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); // developement |
NewerOlder