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 <stdlib.h> | |
#include <time.h> | |
#include <xmmintrin.h> | |
#include <mmintrin.h> | |
#include "matrix.h" | |
#include "z_order.h" | |
using namespace nda; |
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
from __future__ import print_function | |
import httplib2 | |
import os | |
from apiclient import discovery | |
from apiclient.http import BatchHttpRequest | |
from datetime import datetime | |
from oauth2client import client | |
from oauth2client import tools | |
from oauth2client.file import Storage |
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
static uint32_t * | |
fast_bsearch_u32(uint32_t *base, size_t nmemb, uint32_t key) { | |
while (nmemb) { | |
size_t half = nmemb >> 1; | |
if (base[half] < key) { | |
base += nmemb - half; | |
} | |
nmemb = half; | |
} | |
return base; |
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
/* | |
Copyright (c) 2014, Cosmin Gorgovan <cosmin [at] linux-geek [dot] org> | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. |
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
// Compile and run with: | |
// | |
// gcc -O3 -march=native fast-strlen.c -lpthread -o fast-strlen | |
// && ./fast-strlen | |
// | |
// Use gcc because clang is too smart and optimizes away parts of the | |
// benchmark. Results on Xeon(R) CPU E5-2650 v4 @ 2.20GHz with gcc | |
// 9.4.0: | |
// | |
// Scanning 10 times over 4.00GB... |
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
from ast import * | |
from pygraphviz import AGraph | |
from re import sub | |
COLOR_KWD = '#a020f0' | |
COLOR_VAR = '#6c71c4' | |
COLOR_STR = '#8b2252' | |
def colorize(s, col): | |
return '<font color="%s">%s</font>' % (col, s) |
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
// Notes: | |
// | |
// * unsigned int vs. int: makes a small difference for clang but | |
// probably not for gcc. | |
// * best tiling appears to be 256x256x256. | |
// | |
// 12.31 for two 8192 matrices | |
// | |
// | |
#include <assert.h> |
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
// Notes: | |
// | |
// * unsigned int vs. int: makes a small difference for clang but | |
// probably not for gcc. | |
// * best tiling appears to be 256x256x256. | |
// | |
// 12.31 for two 8192 matrices | |
#include <assert.h> | |
#include <math.h> | |
#include <pthread.h> |
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
# Usage: | |
# python cas.py simplify "(x+y)**30*(2*x)+123*z**8" | |
# python cas.py solve "3*x**2 == -x**2 + 5*x" | |
import math, sys | |
from ast import * | |
from functools import reduce | |
from collections import Counter, defaultdict | |
def parse_mv(mv): | |
def pow(n, e): |
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
<nav class="navbar navbar-default navbar-fixed-top navbar-inverse"> | |
<div class="container-fluid"> | |
<!-- Brand and toggle get grouped for better mobile display --> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> | |
<span class="sr-only">Toggle navigation</span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> |
NewerOlder