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
#include <algorithm> | |
std::reverse(str.begin(), str.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
<?php | |
/* | |
Detects browser and redirects to a different link for each browser. | |
*/ | |
$browser = $_SERVER['HTTP_USER_AGENT']; | |
$chrome = '/Chrome/'; | |
$firefox = '/Firefox/'; | |
$ie = '/MSIE/'; | |
if (preg_match($chrome, $browser)){ | |
//echo "chrome/opera"; |
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 | |
# -*- coding: utf-8 -*- | |
# Brute-force string generation | |
# Copyright (C) 2011 Radek Pazdera | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
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
# Oh My ZSH Configuration File | |
# Auhor: Deekshith Allamaneni | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/deekshitha/.oh-my-zsh | |
# Setting Default user name | |
# Replace 'deekshitha' with your user name. | |
# This removes displaying your username when you are | |
# logged in from your own machine. | |
DEFAULT_USER='deekshitha' |
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
" My .vimrc | |
" Author: Deekshith Allamaneni | |
" Launch configurration | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
" Colors | |
syntax enable |
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
(* Pseudo Random Password generator of given length*) | |
(* Get all \ | |
characters you would like to be a part of your password *) | |
letters[] := StringSplit[FromCharacterCode[Range[33, 126]], ""] | |
(* Pick up random characters from the list *) | |
GeneratePassword[n_] := StringJoin[RandomSample[letters[], n]] | |
(* Generate password*) | |
GeneratePassword[12] |
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 overloading in Mathematica *) | |
SumMultiply[x_?NumericQ, y_Real] := | |
Module[ | |
{sum, mul}, | |
sum = x + y; | |
mul = x y; | |
{sum, mul} | |
] | |
SumMultiply[x_Integer, y_Real] := | |
Module[ |
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
(* Monitors given website load time and plots it *) | |
dataLength = 400; | |
timeTakenUrlReq := | |
First@AbsoluteTiming[Import["http://google.com/"]]; | |
timeTakenTime := {DateList[], timeTakenUrlReq}; | |
data = {timeTakenTime}; | |
Dynamic[Last[AppendTo[data, timeTakenTime]], UpdateInterval -> 10, | |
TrackedSymbols -> {}] | |
Dynamic[If[Length[data] < dataLength, Length[data = data], | |
Length[data = data[[-dataLength ;;]]]]] |
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/bash | |
lineNum=1 | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
echo "Processing line $lineNum : $line" | |
curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" $line -o scraped-html/$lineNum.html | |
delayNow=$((RANDOM%10*30+RANDOM%10)) | |
echo "Waiting for $delayNow sec" | |
sleep $delayNow | |
lineNum=$((lineNum+1)) | |
done < "$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 java.util.Arrays; | |
import java.util.List; | |
import java.util.ListIterator; | |
public class IntegerTest { | |
public static void main(String[] args) { | |
long startTime; | |
long duration; | |
long endTime; |
OlderNewer