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
from paypal.standard.forms import PayPalPaymentsForm as PPPF | |
from django import forms | |
class OTPForm(forms.Form): | |
code = forms.CharField(label = "TOTP Code") | |
def clean_code(self): | |
code = self.cleaned_data['code'] | |
if not check_otp(code): # use libraries like onetimepass |
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 "rotation.hpp" | |
using namespace cv; | |
using namespace std; | |
void rotate(const Mat src, Mat &dest, double angle, int borderMode, const Scalar &borderValue){ | |
int w = src.size().width, h = src.size().height; | |
Size2d new_size = Size2d(abs(w * COS((int)angle % 180)) + abs(h * SIN((int)angle % 180)), abs(w * SIN((int)angle % 180)) + abs(h * COS((int)angle % 180))); |
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
/* origin: http://technet.microsoft.com/de-de/ms683194%28v=vs.80%29 */ | |
#include <windows.h> | |
#include <malloc.h> | |
#include <stdio.h> | |
#include <tchar.h> | |
typedef BOOL (WINAPI *LPFN_GLPI)( | |
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, | |
PDWORD); |
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 <numa.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
if(numa_available() < 0){ | |
printf("System does not support NUMA API!\n"); | |
} | |
int n = numa_max_node(); | |
int size = 1024*1024; |
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
/* Example hwloc API program. | |
* | |
* See other examples under doc/examples/ in the source tree | |
* for more details. | |
* | |
* Copyright © 2009-2014 Inria. All rights reserved. | |
* Copyright © 2009-2011 Université Bordeaux 1 | |
* Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. | |
* See COPYING in top-level directory. | |
* |
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
import hashlib, hmac, urllib2, time, json, requests | |
COINBASE_ENDPOINT = "https://coinbase.com/api/v1" | |
FORMAT = "json" | |
# store these in a secure place... this is only for demo purpose | |
KEY = "KEY" | |
SECRET = "SECRET" | |
NewerOlder