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
# insert sort using python | |
def insert_sort(the_list): | |
for i in range(1,len(the_list)): | |
print 'key is %d' %(key) | |
current = i - 1 | |
while the_list[current] > key and current >= 0: | |
the_list[current + 1] = the_list[current] | |
current = current - 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
# insert sort using ruby | |
def insert_sort(array) | |
(1..array.size-1).each do |index| | |
key = array[index] | |
j = index - 1 | |
while key < array[j] && j >= 0 | |
array[j + 1] = array[j] | |
j = j-1 | |
end #while |
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 Queue() { | |
this.dataSource = []; | |
this.enqueue = enqueue; | |
this.dequeue = dequeue; | |
this.front = front; | |
this.back = back; | |
this.toString = toString; | |
this.empty = empty; | |
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
// insert sort implement using javascript | |
function print(what) { | |
console.log(what); | |
} | |
function insertSort(array) { | |
var currentPos, before; | |
for(currentPos = 1; currentPos < array.length; currentPos++) { |
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 Stack() { | |
this.dataSource = []; | |
this.top = 0; | |
this.push = push; | |
this.pop = pop; | |
this.peek = peek; | |
this.clear = clear; | |
this.length = length; | |
function push(element) { |
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 List() { | |
this.listSize = 0; | |
this.pos = 0; | |
this.dataSource = []; | |
this.clear = clear; | |
this.find = find; | |
this.toString = toString; | |
this.insert = insert; | |
this.append = append; | |
this.remove = remove; |
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
source "https://rubygems.org" | |
gem "rake" | |
# Screens | |
gem "ProMotion" | |
gem 'motion-layout' |
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
# -*- coding: utf-8 -*- | |
from selenium import webdriver | |
import time | |
import unittest | |
dr = webdriver.Chrome() | |
dr.get("http://192.168.10.21:28080/admin/tag/list.do") | |
jqueryPath = 'D:/jquery-1.7.1.js' | |
jqueryFile = open(jqueryPath) |
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 unittest | |
from selenium import webdriver | |
import time | |
from time import sleep | |
class WordPressTestCase(unittest.TestCase): | |
dr = None | |
login_url = 'http://localhost/wordpress/wp-login.php' | |
post_list_url = 'http://localhost/wordpress/wp-admin/edit.php' |
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 unittest, httplib, urllib, json | |
class ApiTestCase(unittest.TestCase): | |
def setUp(self): | |
self.conn = httplib.HTTPConnection('localhost', 5000) | |
def tearDown(self): | |
if self.conn is not None: self.conn.close() | |
def get(self, path='/'): |