Skip to content

Instantly share code, notes, and snippets.

#include <QCoreApplication>
#include <opencv.hpp>
#include <QDebug>
double compute_skew(QString filename);
void deskew(QString filename, double angle);
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.ComponentModel;
@jaydp17
jaydp17 / gist:5263201
Created March 28, 2013 13:42
The array version
public Boundaries CheckBoundaries(int[] pixels) {
// check left
double boundayFactor = 0.1; //10% of the image width/height
Boundaries b = new Boundaries();
b.Left = CheckLeft(pixels, boundayFactor);
b.Right = CheckRight(pixels, boundayFactor);
b.Top = CheckTop(pixels, boundayFactor);
b.Bottom = CheckBottom(pixels, boundayFactor);
return b;
}
@jaydp17
jaydp17 / gist:5263207
Created March 28, 2013 13:43
WriteableBitmap version
public static Boundaries CheckBoundaries(WriteableBitmap bmp)
{
// check left
double boundayFactor = 0.1; //10% of the image width/height
Boundaries b = new Boundaries();
b.Left = CheckLeft(bmp, boundayFactor);
b.Right = CheckRight(bmp, boundayFactor);
b.Top = CheckTop(bmp, boundayFactor);
b.Bottom = CheckBottom(bmp, boundayFactor);
return b;
@jaydp17
jaydp17 / fft.cpp
Last active December 21, 2015 04:39
Arduino almost working code
#include <BiColorLED.h>
// LEDPad.cpp
class LEDPad
{
public:
BiColorLED leds[9];
LEDPad() {
int j = 0;
/*
Code developed by Team 7, B.Tech 2011, DA-IICT, India
for making controller for operating in arduino project on TicTacToe
Please feel free to download, use and share
Cheers !!
*/
int j = 1; // integer used in scanning the array designating column number
//2-dimensional array for asigning the buttons and there high and low values
@jaydp17
jaydp17 / 0_reuse_code.js
Created January 26, 2014 04:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
require.config({
baseUrl : "bower_components/codemirror",
});
require(['lib/codemirror', 'addon/hint/show-hint'], function(CodeMirror, sh) {
console.log(CodeMirror.defaults);
console.log(CodeMirror.showHint);
});

Openshift

To manage openshift apps we'll be using rhc.

Setup rhc

Follow the first 3 steps from here

Creating a rails app

@jaydp17
jaydp17 / barebone_mosca.js
Last active December 10, 2015 15:09
A simple server using mosca
var mosca = require('mosca')
var ascoltatore = {
//using ascoltatore
type: 'mongo',
url: 'mongodb://localhost:27017/mqtt',
pubsubCollection: 'ascoltatori',
mongo: {}
};