This file contains hidden or 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
| # Install Dependencies | |
| sudo apt-get install libmysqlclient-dev mysql-client libcurl4-openssl-dev libgd2-xpm-dev libjpeg-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libxslt1-dev bzip2 libbz2-dev libxml2-dev libevent-dev libltdl-dev libmagickwand-dev libmagickcore-dev imagemagick libreadline-dev libc-client-dev libsnmp-dev snmpd snmp libvpx-dev libxpm-dev libgmp3-dev libicu-dev libpspell-dev libtidy-dev freetds-dev unixodbc-dev librecode-dev libglib2.0-dev libsasl2-dev libgeoip-dev imagemagick libmagickcore-dev libmagickwand-dev | |
| # Stop Apache | |
| sudo service apache2 stop | |
| # Cleanup Packages | |
| sudo apt-get autoremove | |
| # Remove Ubuntu PHP Packages |
This file contains hidden or 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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <math.h> | |
| #define MAXLEN 32 | |
| #define printB(x) printf("len: %d\nones: %d\n", x->lenBin, x->onesNum) | |
| #define print(x) printf("%.0f\n",x) | |
| typedef struct binary_struct{ | |
| int *bin; /*the binary array*/ |
This file contains hidden or 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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <math.h> | |
| #define MAXLEN 32 | |
| #define printB(x) printf("len: %d\nones: %d\n", x->lenBin, x->onesNum) | |
| #define print(x) printf("%.0f\n",x) | |
| typedef struct binary_struct{ | |
| int *bin; /*the binary array*/ |
This file contains hidden or 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 <stdio.h> | |
| #include <string.h> | |
| #define sigma 26 | |
| #define print(x) printf("%ld\n",x); | |
| long factorial(int k) | |
| { | |
| if(k==0) | |
| return 1; | |
| int i; |
This file contains hidden or 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 cg(n,t): # according to taocp v4f3 chap. 7.2.1.3 algo l. | |
| import pdb | |
| pdb.set_trace() | |
| # initializing... | |
| result = [] | |
| comb=[-1] | |
| for j in range(1, t+1): | |
| comb.append(j-1) | |
| comb.append(len(n)) | |
| comb.append(0) |
This file contains hidden or 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 randPermute(r, n ): | |
| """ Compute C(n,r) and the corresponding combinations. r here is | |
| a list. | |
| @return list all combinations.(Including duplicates) | |
| """ | |
| import pdb | |
| #pdb.set_trace() | |
| d = [] # a result container | |
| if len(r) == 0: | |
| return d |
This file contains hidden or 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 randPermute(r, n ): | |
| """ Compute C(n,r) and the corresponding combinations. r here is | |
| a list. | |
| @return list all combinations.(Including duplicates) | |
| """ | |
| import pdb | |
| #pdb.set_trace() | |
| d = [] # a result container | |
| if len(r) == 0: | |
| return d |
This file contains hidden or 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 randPermute(r, n ): | |
| """ Compute C(n,r) and the corresponding combinations. r here is | |
| a list. | |
| @return list all combinations.(Including duplicates) | |
| """ | |
| import pdb | |
| #pdb.set_trace() | |
| d = [] # a result container | |
| if len(r) == 0: | |
| return d |
This file contains hidden or 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 evaluate(pages,border, avg): | |
| D =0 | |
| for i in range(len(border)): | |
| d = sum(pages[border[i-1][0]:border[i][0]]) - avg | |
| D += d**2 | |
| return D | |
| def DFS(k, m, pages,solutions, border,branch=-1,score = [float("inf"),0]): | |
| if branch != 0: | |
| if branch == -1: |
This file contains hidden or 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 evaluate(pages,border, avg): | |
| D =0 | |
| for i in range(len(border)): | |
| d = sum(pages[border[i-1][0]:border[i][0]]) - avg | |
| D += d**2 | |
| return D | |
| def DFS(k, m, pages,solutions, border,branch=-1,score = [float("inf"),0]): | |
| import pdb | |
| pdb.set_trace() |