Table of Contents generated with DocToc
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
ffmpeg -i input.avi -acodec mp3 -vcodec copy out.avi |
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
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
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
SRC = SecureRandom.uuid | |
Benchmark.bmbm do |bm| | |
bm.report('MD5') { 100000.times{ Digest::MD5.hexdigest SRC } } | |
bm.report('SHA1') { 100000.times{ Digest::SHA1.hexdigest SRC } } | |
bm.report('SHA2') { 100000.times{ Digest::SHA2.hexdigest SRC } } | |
bm.report('SHA256') { 100000.times{ Digest::SHA256.hexdigest SRC } } | |
end |
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
def FindRemainder(numerator,denominator) | |
if denominator > numerator | |
puts "#{numerator}" | |
else | |
result = denominator | |
i = 1 | |
while ((denominator*i)<=numerator) | |
result = denominator*i | |
i = i + 1 | |
end |
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
require "net/http" | |
require "json" | |
def Findplaces(keyword) | |
keyword=keyword.gsub(' ','%20') | |
uri = URI("https://maps.googleapis.com/maps/api/place/textsearch/json?query=#{keyword}&name=goa&sensor=false&key=AIzaSyAGeap2PXa_AS19npQLjDlUbE8w0t_atwE") | |
response = Net::HTTP.get_response(uri) | |
result = JSON.parse(response.body) | |
#puts result.inspect |
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
require "net/http" | |
require "json" | |
def autocomplete(keyword) | |
keyword=keyword.gsub(' ','%20') | |
uri = URI("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=#{keyword}+in+india&types=establishment&sensor=false&key=AIzaSyAGeap2PXa_AS19npQLjDlUbE8w0t_atwE") | |
response = Net::HTTP.get_response(uri) | |
result = JSON.parse(response.body) |
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
require "net/http" | |
require "json" | |
def find_distance(lat1,long1,lat2,long2) | |
uri = URI("http://maps.googleapis.com/maps/api/distancematrix/json?origins=#{lat1},#{long1}&destinations=#{lat2},#{long2}&mode=driving&sensor=false") | |
response = Net::HTTP.get_response(uri) | |
distancematrix = JSON.parse(response.body) | |
#puts distancematrix |
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
public class Remainder | |
{ | |
public static int findRemainder(int numerator, int denominator) | |
{ | |
int result = 0; | |
if(denominator > numerator) | |
{ | |
System.out.println("Remainder : "+numerator); | |
} | |
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
import java.util.Scanner; | |
public class PrintNumbers | |
{ | |
static Scanner input = new Scanner(System.in); | |
public static void print(int n) | |
{ | |
for(int i=1;i<=n;i++) | |
{ |