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
n = ((n >> 1) & 0x55555555) | ((n << 1) & 0xaaaaaaaa); | |
n = ((n >> 2) & 0x33333333) | ((n << 2) & 0xcccccccc); | |
n = ((n >> 4) & 0x0f0f0f0f) | ((n << 4) & 0xf0f0f0f0); | |
n = ((n >> 8) & 0x00ff00ff) | ((n << 8) & 0xff00ff00); | |
n = ((n >> 16) & 0x0000ffff) | ((n << 16) & 0xffff0000); |
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
/// inserts a series of bits into a byte buffer at the specified bit offset | |
/// @param[in] dst pointer to buffer | |
/// @param[in] src array of data to insert into the dst buffer | |
/// @param[in] len length in bytes of the buffer | |
/// @param[in] offset number of bits to offset the data in the buffer | |
/// @param[in] n number of bits to insert into the buffer | |
void bitops_copy(uint8_t * dst, uint8_t * src, uint32_t len, uint32_t offset, | |
uint32_t n) | |
{ | |
uint32_t byte_required; |
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
# | |
# Slapd Daemon Configuration | |
# Copyright (C) 2011 Bindle Binaries <syzdek@bindlebinaries.com>. | |
# | |
# @BINDLE_BINARIES_BSD_LICENSE_START@ | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are | |
# met: | |
# |
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
dn: o=slapdUsers | |
description: top level tree for administering LDAP access | |
o: slapdUsers | |
objectClass: top | |
objectClass: organization | |
dn: ou=Clients,o=slapdUsers | |
objectClass: top | |
objectClass: organizationalUnit | |
ou: Clients |
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
/************************************************* | |
* PCRE DEMONSTRATION PROGRAM * | |
*************************************************/ | |
/* This is a demonstration program to illustrate the most straightforward ways | |
of calling the PCRE regular expression library from a C program. See the | |
pcresample documentation for a short discussion ("man pcresample" if you have | |
the PCRE man pages installed). | |
In Unix-like environments, if PCRE is installed in your standard system |
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
Dictionary Stats: | |
Words Dropped: 23* | |
Words Duplicated: 0 | |
Words Indexed: 117946 | |
---------------------------- | |
Total Words Parsed: 117969** | |
* Words with a 'q' not immediately followed by a 'u' (e.g "qiviut"). | |
** The 'u' following a 'q' have been striped from the word (e.g. "quilting" | |
becomes "qilting"). The 'u' is implied by a 'q' in some word tile/dice |
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
#!/bin/bash | |
# set parameters | |
TOTP_UID=${1:-$UID} | |
TOTP_CODE=${2:-123456} | |
# encode numeric UID into three port numbers | |
TOTP_PORT1=$(( $(( ${TOTP_UID} / 4194304)) + 4096 )) | |
TOTP_PORT2=$(( $(( $(( ${TOTP_UID} % 4194304)) / 16384 )) + 4096 )) | |
TOTP_PORT3=$(( $(( $(( ${TOTP_UID} % 4194304)) % 16384 )) + 4096 )) |
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
intmax_t sqroot_imax(intmax_t n, int round) | |
{ | |
intmax_t op = n; | |
intmax_t res = 0; | |
intmax_t one = 1uL << ((sizeof(intmax_t)*8)-2); | |
// "one" starts at the highest power of four <= than the argument. | |
while (one > op) | |
one >>= 2; |
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
- (UIImage *) tileImageFromImage:(UIImage *)image | |
{ | |
CGImageRef imageRef; | |
CGContextRef context; | |
CGColorSpaceRef color; | |
CGFloat w; | |
CGFloat h; | |
CGFloat r; | |
CGFloat m; | |
NSInteger pos; |
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
/* | |
* simple Iv4/IPv6 TCP server which echos any data sent to the open port | |
*/ | |
#include <stdio.h> | |
#include <poll.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <sys/uio.h> | |
#include <unistd.h> |
OlderNewer