Skip to content

Instantly share code, notes, and snippets.

#include<stdio.h>
#include<string.h>
void main () {
int t, k[10],i,z,len[0];
char s[10][50];
scanf("%d",&t);
for(i=0;i<=t-1;i++){
scanf("%s",&s[i]); scanf("%d",&k[i]);
}
// k-errorpairedcode should be found for each string
# Script to get all xkcd comic pics
import urllib2
tits={}
def zeropad(i):
plen=3-len(str(i))
pstr=''
j=0
while(j<plen):
#!/bin/sh
# Bash dent function.
function dent () {
curl -s -u user:passwd \
-d status="$1" \
"http://identi.ca/api/statuses/update.xml";
}
# Examples:
# code that powers http://identi.ca/brightnessjokebot (crontab entry)
30 11 2,8,14,20,27 * * curl -s -u brightnessjokebot:passwd -d status="Don't you wish there was a knob on the TV to turn up the intelligence? There's one marked 'Brightness,' but it doesn't work." "http://identi.ca/api/statuses/update.xml" > /home/shashi/Code/identica/log/brightnessbot.log
# python script to back-up all your identica notices.
import json, urllib2
import time
user = 'user'
day = ''
f = open ('identica-'+user+'.bak', 'a', 1)
for i in range(1,1000):
j = json.loads(urllib2.urlopen('https://identi.ca/api/statuses/user_timeline/'+user+'.json?page='+str(i)).read())
# Python Script to block spammy subscribers from your identi.ca account.
# bug me: identi.ca/g0
import json
import sys
import urllib2
apipath = 'http://identi.ca/api'
username = raw_input('Your username: ')
password = raw_input('Your password: ')
@shashi
shashi / app_inventor_camera_canvas.diff
Created April 6, 2012 18:49
Canvas with camera background
// Copyright 2009 Google Inc. All Rights Reserved.
package com.google.appinventor.components.runtime;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
@shashi
shashi / Canvas.java
Created April 6, 2012 19:49
Canvas with camera background
// Copyright 2009 Google Inc. All Rights Reserved.
package com.google.appinventor.components.runtime;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
@shashi
shashi / todo.css
Last active December 22, 2015 02:29 — forked from anonymous/todo.css
/* CSS declarations go here */
.wrapper {
width: 960px;
margin: 10px auto;
}
ul {
list-style: none;
}
def remove_comments(line, pref="", ctx=None, escape=False):
if line == "": return pref
if ctx == "#" and line[0] != '\n':
return remove_comments(line[1:], pref, ctx)
if not ctx:
if line[0] == "#": return remove_comments(line[1:], pref, '#')
for c in ['"""', '"', "'"]:
if line.startswith(c):
# open context
return remove_comments(line[len(c):], pref + c, c)