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
git clone git://github.com/milnex/comphoto2011 /path/to/source | |
mkdir /path/to/build && cd /path/to/build | |
cmake /path/to/source | |
make |
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 xlrd import * | |
wb = open_workbook('sample.xls') | |
for sheet in wb.sheets(): | |
print 'Sheet: {0}'.format(sheet.name) | |
for row in range(sheet.nrows): | |
row_value = [] | |
for col in range(sheet.ncols): | |
row_value.append(sheet.cell(row, col).value) |
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 <stdio.h> | |
#include <math.h> | |
#define MAX 1000010 | |
int prime[MAX] = {0}; | |
void make_prime(); | |
int reverse(int); | |
int main() | |
{ | |
int n; | |
make_prime(); |
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 <stdio.h> | |
int main() | |
{ | |
int i; | |
char strings[4][8]; | |
for (i = 3; i >= 0; i--) | |
scanf("%s", strings[i]); |
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
class Circle(object): | |
def __init__(self, radius): | |
self._radius = radius | |
def _get_radius(self): | |
return self._radius | |
def _set_radius(self, value): | |
self._radius = value | |
def _del_radius(self): | |
del self._radius |
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
class Circle(object): | |
def __init__(self, radius): | |
self.radius = radius | |
circle = Circle(3) | |
print circle.radius | |
circle.radius = 10 |
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
class Circle(object): | |
def __init__(self, value): | |
self.radius = None | |
self.set_radius(value) | |
def set_radius(self, value): | |
if value < 0: | |
raise ValueError('radius must be positive: {0}'.format(value)) | |
self.radius = value | |
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
print circle.radius # getter | |
circle.radius = 10 # setter | |
del circle.radius # deleter |
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
class Circle(object): | |
def __init__(self, radius): | |
self._radius = radius | |
@property | |
def radius(self): | |
return self._radius | |
@radius.setter | |
def radius(self, value): | |
self._radius = value |
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 <stdio.h> | |
int sudoku[9][9]; | |
int row_count[9][10]; | |
int col_count[9][10]; | |
int box_count[3][3][10]; | |
int check(int r, int c){ | |
if(row_count[r][sudoku[r][c]] != 1) | |
return 0; |
OlderNewer