This file contains 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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
This file contains 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 as np | |
import pylab as pl | |
from numpy import fft | |
def fourierExtrapolation(x, n_predict): | |
n = x.size | |
n_harm = 10 # number of harmonics in model | |
t = np.arange(0, n) | |
p = np.polyfit(t, x, 1) # find linear trend in x | |
x_notrend = x - p[0] * t # detrended x |
This file contains 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 MatRemoveRows(cv::Mat& matIn, int row, int rowCount=1) | |
{ | |
cv::Size size = matIn.size(); | |
cv::Mat matOut(size.height - rowCount, size.width, matIn.type()); | |
if (!(matIn.isContinuous() && matOut.isContinuous())) throw "both should be continous"; //fix later if required, maybe use the rect solution if not continious https://gist.github.com/enpe/369a7a17fd9b3856b544 OR use as https://kezunlin.me/post/61d55ab4/ | |
int rowSizeInBytes = size.width * sizeof(matIn.elemSize()); |
This file contains 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 express = require('express'), | |
passport = require('passport'), | |
GoogleStrategy = require('passport-google').Strategy, | |
connect = require('express/node_modules/connect'), | |
http = require('http'), | |
path = require('path'), | |
util = require('util'), | |
fs = require('fs'), | |
redis = require('redis'), | |
cookie = require('cookie'), |
This file contains 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 express = require('express'), | |
passport = require('passport'), | |
LocalStrategy = require('passport-local').Strategy, | |
connect = require('connect'), | |
http = require('http'), | |
path = require('path'), | |
util = require('util'), | |
fs = require('fs'), | |
redis = require('redis'), | |
cookie = require('cookie'), |
This file contains 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
/* based off of tinyxhr by Shimon Doodkin - license: public doamin - https://gist.github.com/4706967 | |
Added ontop of Simon's code: | |
- Serialization of the object | |
- Moved some arguments to line up with jQuery( url, data, callback ) | |
- Will attempt to parse JSON from the response if it's valid JSON | |
- Added a tinyPost and tinyGet method | |
Some other things that'd be good: | |
- Seprate error callback for failed responses |
This file contains 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
/* | |
These next two functions work together to lock down bbPress forums based on PMPro membership level. | |
Check that the current user has access to this forum. Be sure to update the $restricted_forums array based on your needs. | |
*/ | |
function pmpro_check_forum() | |
{ | |
global $current_user; | |
/* |
This file contains 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
//licence: 2 clouse mit, by Shimon Doodkin | |
function ObserverPubSub(parent, key_of_myself) { | |
this._topics = {}; | |
this.length = 0; | |
this._subUid = -1; | |
this._parent = parent; | |
this._name = key_of_myself; | |
} | |
ObserverPubSub.prototype = { |
This file contains 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
#! /bin/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
This file contains 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
/* | |
It looks like there is a problem with http | |
If I define the on end and on data callbacks (too late) - like | |
after like 120 ms (like after all data is transfered) | |
it does not calls the callbacks (on data, on end). | |
or maybe because it is clousre inside a clousre, | |
the request object looks okay, but it does not fire the events, |
NewerOlder