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 -*- | |
original_sequence = raw_input("Enter the sequence: ") | |
sequence_str = original_sequence.split() | |
sort_sequence = [] | |
for number_str in sequence_str: | |
sort_sequence.append(int(number_str)) | |
count = len(sort_sequence) |
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 -*- | |
original_sequence = raw_input("Enter the sequence: ") | |
sequence_str = original_sequence.split() | |
sort_sequence = [] | |
for number_str in sequence_str: | |
sort_sequence.append(int(number_str)) | |
count = len(sort_sequence) |
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 -*- | |
def quick_sort(sequence, start_index, end_index): | |
# print sequence | |
if start_index < end_index: | |
main_element = partition(sequence, start_index, end_index) | |
# print main_element | |
quick_sort(sequence, start_index, main_element-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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
class Trie_tree(): | |
def __init__(self): | |
# node = [father, child, keep_char, is_word] | |
self._root = [None, [], None, False] | |
def insert(self, word): |
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 -*- | |
# This is a Stack implementing in list. | |
class Stack(): | |
def __init__(self): | |
self._content = list() | |
def __len__(self): |
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 -*- | |
# This is a Queue implementing in list. | |
class Queue(): | |
def __init__(self): | |
self._content = list() | |
def __len__(self): |
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 -*- | |
class Trie_tree(): | |
def __init__(self): | |
# node = [father, child, keep_char, is_word] | |
self._root = [None, [], None, False] | |
def insert(self, word): |
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
9 Mac OS X Port Command Examples to Install and Update Packages | |
by Sanjay Kumar, thegeekstuff.comJanuary 23 | |
Port is a terminal command utility which is used to update open source software on Mac OS X. | |
The port command is bundled as part of MacPorts Framework. | |
You can install port command either by downloading and installing the binary version for your corresponding Mac OS X, or by downloading the source code and compiling it on your OS X version. | |
The binary file of MacPorts for various version of OSX are available here. Once you download the binary version, just click on the package to install it. You should have administrator right on your system to install it. X-code is pre-req for MacPorts. If you don’t have X-code on your system, it will display a warning message. |
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
[General] | |
loglevel = notify | |
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 127.0.0.0/8, 100.64.0.0/10, localhost, *.local, e.crashlytics.com | |
bypass-tun = 192.168.0.0/16, 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, |
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
# Question 1 | |
# Suppose we have an LSH family h of (d1,d2,.6,.4) hash functions. | |
# We can use three functions from h and the AND-construction to form a (d1,d2,w,x) family, | |
# and we can use two functions from h and the OR-construction to form a (d1,d2,y,z) family. | |
# Calculate w, x, y, and z, and then identify the correct value of one of these in the list below. | |
matrix_m <- matrix(c(0,0.5,0.5,0,1,0,0,0,0,0,0,1,0,0,1,0) * 0.7,4,4) | |
beta_set <- matrix(c(2/3,1/3,0,0,2/3,1/3,0,0,2/3,1/3,0,0,2/3,1/3,0,0) * 0.3, 4, 4) | |
a <- matrix_m + beta_set |
OlderNewer