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
window.onerror = function(errorMsg, file, lineNo, colNo, errStack) { | |
"use strict"; | |
var msg = errorMsg ? errorMsg : "null" | |
, stack = errStack ? errStack : "null, only Chrome/Chromium/Firefox based browsers support errorStack" | |
, errFile = file ? file : "null" | |
, errLineNo = lineNo ? lineNo : "null" | |
, msgElem = document.getElementById("MSG") | |
, stackElem = document.getElementById("STACK") | |
, fileElem = document.getElementById("FILE") | |
, lineElem = document.getElementById("LINE_NO") |
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>CORS Example</title> | |
<style type="text/css"> | |
div { | |
border: 1px solid #C0C0C0; | |
padding: 10px; | |
border-radius: 10px; | |
margin: 5px; |
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
get_twitter_data.py | |
=================== | |
#!/usr/bin/env python | |
import argparse | |
import urllib | |
import urllib2 | |
import json | |
import os | |
import oauth2 |
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 gi.repository import Gtk | |
import subprocess | |
class BrightnessScale: | |
def __init__(self): | |
# get active monitor and current brightness | |
self.monitor = self.getActiveMonitor() | |
self.currB = self.getCurrentBrightness() |
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 brightness(){ | |
if [ $# -gt 0 ]; then | |
# set brightnessValue | |
brightnessValue=$1 | |
# get activeDisplay | |
activeDisplay=`xrandr -q | grep ' connected' | head -n 1 | cut -d ' ' -f1` | |
# change brightness if $activeDisplay is not empty | |
if [ "$activeDisplay" != "" ]; then | |
xrandr --output $activeDisplay --brightness $brightnessValue | |
else |
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
[ravikirn@rk-dell-xps ~]# xrandr -q | grep ' connected' | head -n 1 | cut -d ' ' -f1 | |
LVDS1 |
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
[ravikirn@rk-dell-xps ~]# xrandr -q | |
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767 | |
LVDS1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm | |
1920x1080 60.0*+ 59.9 | |
1680x1050 60.0 59.9 | |
1600x1024 60.2 | |
1400x1050 60.0 | |
1280x1024 60.0 | |
1440x900 59.9 | |
1280x960 60.0 |
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
clc;clear; | |
% start time | |
tic; | |
%feature vector size | |
featSize = 20000; | |
% training data | |
N = 300; | |
neg = randi([1, N], int16(N/3), 1); |
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 urllib | |
import urllib2 | |
import json | |
#start getTwitterData | |
def getData(keyword): | |
url = 'http://search.twitter.com/search.json' | |
data = {'q': keyword, 'lang': 'en', 'result_type': 'recent'} | |
params = urllib.urlencode(data) | |
try: |
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
#Search for 'keyword' | |
http://search.twitter.com/search.json?q=keyword&lang=en&result_type=recent | |
#Search for 'keyword' between 20120601 and 20120602 | |
http://search.twitter.com/search.json?q=keyword&lang=en&result_type=recent&since=20120601&until=20120602 |