Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(int argc, char** argv )
{
if ( argc != 2 )
{
printf("usage: DisplayImage.out <Image_Path>\n");
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(int argc, char** argv )
{
if ( argc != 2 )
{
printf("usage: DisplayImage.out <Image_Path>\n");
@JinpengLI
JinpengLI / sync_two_cols.js
Last active August 29, 2015 14:08
How to synchronize both editable column in two google spreadsheets
function sub_sync_cols(ss_id1, sheet_name1, col1, ss_id2, sheet_name2, col2)
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var activeSheet = ss.getActiveSheet();
var activeSheetName = ss.getActiveSheet().getSheetName();
if( activeSheetName == sheet_name1)
{
var activeSheet = ss.getSheetByName(sheet_name1);
@JinpengLI
JinpengLI / gist:8444360
Created January 15, 2014 20:51
getElementByClass javascript
function getElementByClass (className, parent) {
parent || (parent = document);
var descendants= parent.getElementsByTagName('*'), i=-1, e, result=[];
while (e=descendants[++i]) {
((' '+(e['class']||e.className)+' ').indexOf(' '+className+' ') > -1) && result.push(e);
}
return result;
}
@JinpengLI
JinpengLI / check_if_pickable.py
Created August 18, 2013 11:48
to check if it is pickable
def check_if_pickable(obj):
"""
Example
-------
>>> class A:
... def __init__(self):
... self.ma = 1
... def methodx(self):
... return self.ma
...
@JinpengLI
JinpengLI / sync_pages.js
Last active December 21, 2015 01:49
PhantomJS (http://phantomjs.org/) is a HEADLESS browser, but it exists a problem about synchronization problem. This project builds a framework to solve the synchronization problem. Reference http://stackoverflow.com/questions/9246438/how-to-submit-a-form-using-phantomjs
var system = require('system');
var fs = require('fs');
// maybe need run several times
var page_url = "https://github.com/login";
var github_login = "your github login";
var github_pw = "your github password";
// see png files in /tmp/*.png