Skip to content

Instantly share code, notes, and snippets.

int l3dh_load_geometry_obj(l3dh_model_t *model, char *path, int storeDouble) {
FILE *inputFile = fopen(path, "r");
if(inputFile == NULL) {
return 0;
}
double dRead[3];
int iRead[9];
double *verticies = NULL;
int l3dh_load_geometry_vtn(l3dh_model_t *model, char *path) {
uint32_t vf_count = 0, tf_count = 0, nf_count = 0;
char *file = l3dh_read_file(path);
if(!file) {
return -1;
}
vf_count = buf4CharToUint32(file);
tf_count = buf4CharToUint32(file+4);
size_t i;
for(i = 0; i < facesCount; ++i) {
memcpy(&verticiesPrepared[i*9 + 0], &verticies[(faces[i*9 + 0] - 1)*3 + 0], 3*sizeof(double));
memcpy(&verticiesPrepared[i*9 + 3], &verticies[(faces[i*9 + 3] - 1)*3 + 0], 3*sizeof(double));
memcpy(&verticiesPrepared[i*9 + 6], &verticies[(faces[i*9 + 6] - 1)*3 + 0], 3*sizeof(double));
memcpy(&textureCoordinatesPrepared[i*6 + 0], &textureCoordinates[(faces[i*9 + 1] - 1)*2 + 0], 2*sizeof(double));
memcpy(&textureCoordinatesPrepared[i*6 + 2], &textureCoordinates[(faces[i*9 + 4] - 1)*2 + 0], 2*sizeof(double));
memcpy(&textureCoordinatesPrepared[i*6 + 4], &textureCoordinates[(faces[i*9 + 7] - 1)*2 + 0], 2*sizeof(double));
[00:32] няша ([email protected]/fatal-zond-bot) has joined
[00:32] Майор Пахом: сохрани страницу в файл check.html
[00:32] (\_/): http://www.kinopoisk.ru/film/335/
[00:32] (\_/): https://bitbucket.org/ancestor/fatal-bot/src/9fdc681537c65c79b27c3e3b9dfc45aa92690de2/plugins/isidabot/plugins/www.py?at=default#cl-130
[00:33] (\_/): Писикак: не работает
[00:33] Майор Пахом: https://gist.github.com/majorpakhom/2d04088be1e1786c002f
[00:33] Писикак: def get_tag не могу найти
[00:33] Майор Пахом: Писикак: plugins/isidabot/isidacore.py
[00:33] Майор Пахом: :407
[00:34] Майор Пахом: (\_/): попробуй кароч такй срипт запустить
import re
def get_tag(body,tag):
T = re.findall('<%s.*?>(.*?)</%s>' % (tag,tag),body,re.S)
if T: return T[0]
else: return ''
def main():
page = open("check.html", "rb").read().decode('utf-8')
print(get_tag(page,"title"))
/*
Version 8.
Batch processing included.
listpatch <hex file> <binary file 1> ... <binary file N>
Naive, with optimizations:
compile with following options:
gcc -o listpatch listpatch.c -O3 -fexpensive-optimizations -fomit-frame-pointer