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
#!/usr/bin/env python | |
from PIL import Image | |
from PIL.ExifTags import TAGS | |
import sys | |
import datetime | |
from sys import exit | |
def get_exif(fn): | |
ret = {} | |
i = Image.open(fn) |
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
<HTML> | |
<HEAD> | |
<TITLE>YQL DEMO</TITLE> | |
<script type="text/javascript"> | |
function renderYQL(o) { | |
var div = document.getElementById("main"); | |
var html = ""; | |
if (div) { | |
if (o.results[0]) { | |
count = o.results.length; |
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
using System.IO; | |
using System.IO.Compression; | |
class Qompress | |
{ | |
public static byte[] CompressBuffer(byte[] byteArray) | |
{ | |
MemoryStream strm = new MemoryStream(); |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>DOM + JavaScript Test</title> | |
</head> | |
<script> | |
var count=0; | |
var stop=true; | |
function testfun(){ | |
document.getElementById("count").innerHTML=""+Math.sqrt(count); |
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
[ | |
{ 'j' : "next Item" , 'k': "prev Item" , 'v': "open Item"}, | |
{ 's': "sneak Peek" , 'z': "zoom-In" , 'x': "zoomOut", 'd': "change Color", 'w': "changeFont"}, | |
{ 'n': "decrease width", 'm': "increase width"}, | |
{ 'c': "configuration", 'f':"share on Facebook", 't': "share on twitter"} | |
] |
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
############################################### | |
# DoConceptTagging ############################ | |
############################################### | |
class DoConceptTagging(webapp.RequestHandler): | |
def get(self): | |
q = self.request.get('q', ''); | |
callback= self.request.get('cb', ''); | |
param=urllib.urlencode({ | |
'apikey':'key', | |
'outputMode':'json', |
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
/************************ | |
function getPictures: returns image from query | |
filter: 0 no filter, 1 for grayscale and subsequent for | |
color from color index | |
isFlickr: true if only flickr photos | |
callback: function to call after load is complets | |
function(image,results){ | |
image is image object of first image | |
results are the array of images | |
} |
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
function getColor(noOfColors){ | |
html=""; | |
frequency=5/noOfColors; | |
for (var i = 0; i < noOfColors; ++i){ | |
var xspan=(i%10)+2; | |
var yspan=Math.floor(i/10); | |
yspan=(1-yspan/2); | |
r = Math.sin(frequency*i + 0) * (127) + 128; |
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 | |
################################################################################## | |
# R E A D T H I S B E F O R E U S I N G | |
# This script is to help you in executing a list of thing in parralel. this will fork background processes | |
# if you want to kill background processes use pkill -9 <yourscripname> | |
# | |
# -- U S A G E | |
# suppose you have 10 thousands items in a file which requires some || processing | |
# Note: if you are doing pure math, do not make it ||lel will not help much on single core CPU. | |
# but if you are doing some network operation, u can make it ||lel it will help you for sure!! |
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
<textarea id="tu" cols="90" rows="10">Your text goes here </textarea> | |
<input id="btget" class="mybutton" type="button" value="Go Extract Info"/> | |
<div id="imgdiv" ></div> | |
<script> | |
function init(){ | |
var contentanalysisURL="http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20contentanalysis.analyze%20where%20text%3D%22{text}%22&format=json&callback=?"; | |
//this function will be called on json recieve | |
function receiveJSON(data){ | |
//6. recieve Data |
OlderNewer