Skip to content

Instantly share code, notes, and snippets.

View sound.cpp
#define SIZE 2
using namespace std;
int main(){
const char *animal[] = {"Dog","Cat"};
View poly.c
double f(double c3,double c2,double c1,double c0,double x){
double f = c3*x*x*x + c2*x*x + c1*x + c0;
return f;
int main(){
char *poly = "C3*x^3 + C2*x^2 + C1*x + C0";
View linearsearchanalysis
Methods of analysis
To be able to predict the time without having to look at the details of the input, we measure it as a function of the length of the input. Here x has basically constant length (depending on what an item is) and the length of L is just the number of items in it.
So given a list L with n items, how many comparisons does the algorithm take? Answer: it depends.
We want an answer that doesn't depend. There are various ways of getting one, by combining the times for different inputs with the same length.
Worst case analysis -- what is the most comparisons we could ever see no matter how perverse the input is?
time_wc(n) = max time(I)
(input I of size n)
bitwiser /
Created Mar 4, 2014
Download Bing Image of the Day
import os
import sys
import urllib2
import json
import threading
import time
BING = {
"base": "",
"wall": "/HPImageArchive.aspx?format=js&idx=0&n=1&nc=1393792328465&pid=hp&video=1"
import java.util.*;
public class TimeComparer
public static void main(String[] args)
Scanner in = new Scanner(;
System.out.println("Please enter the first time in military time (hour minute): ");
int hour1 = in.nextInt();
bitwiser / google_app_script.js
Last active Jul 23, 2019
Email Google Form Spreadsheet data as Attachment using Google Script
View google_app_script.js
* author: bitwiser
* for complete tutorial, visit:
var START_ROW = 2;
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
View html.html
<!doctype html>
color: red;
View html.html
Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language. While most often used to style web pages and interfaces written in HTML and XHTML, the language can be applied to any kind of XML document, including plain XML, SVG and XUL.
<body style="background-image: url('image.jpg')">
View exercise1.php
//Excersice 1
function getextension($file){
$path = pathinfo($file);
return $path['extension'];
$music = "";
View parentheses.cpp
using namespace std;
bool checkBalancedParentheses(string s){
stack<char> st;
for(int i=0;i<s.length();i++){
You can’t perform that action at this time.