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 <stdbool.h> | |
#include <stdint.h> | |
#include "convert_utf8.h" | |
#define UTF8_SINGLE_BYTE_CONTROL_MASK 0x80 | |
#define UTF8_SINGLE_BYTE_CONTROL_VALUE 0x00 | |
// Returns true if `byte` is standalone in UTF8. |
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
-module(proc_lib_instance). | |
-export([start_link/0, | |
ping/1]). | |
-export([init/1, | |
system_continue/3, | |
system_code_change/4, | |
system_terminate/4]). |
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
-module(util_record). | |
-compile(export_all). | |
-define(NAME_ELEMENT, 1). | |
-define(VERSION_ELEMENT, 2). | |
-spec update_record(atom(), fun(), tuple()) -> tuple(). |
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
-module(code_change_test). | |
% How to use: | |
% | |
% 1. Compile with first st record definition uncommented | |
% | |
% 2. Start several processes: | |
% 1> {ok, Pid1} = code_change_test:start(). | |
% init | |
% {ok,<0.34.0>} |
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
-module(or_or_or). | |
-compile(export_all). | |
f1(X) -> | |
if | |
length(X) =:= 1; size(X) =:= 1 -> | |
okay; | |
true -> | |
nope |
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 <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define CODE_LEN 16 | |
const unsigned char ENCRYPTED[][CODE_LEN + 1] = { | |
// ad8b0a518f4e717b |
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
# ad8b0a518f4e717b | |
strings zosia | |
# b96fce77a01aa3f1 | |
dtrace -c ./zosia -n 'syscall::open:entry /execname == "zosia"/ { printf("code b: %s", copyinstr(arg0)); }' | |
# c27c4c97a2cca1e5 | |
dtrace -c ./zosia -n 'syscall::write:entry /execname == "zosia"/ { printf("code c: %s", copyinstr(arg1)); }' | |
# da2c30abab3f9ba0 |
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 <string.h> | |
int my_string_compare(const void* a, const void* b) { | |
return strcmp(*(const char**)a, *(const char**)b); | |
} | |
int main() { | |
const char* s[] = {"dalet", "gimel", "bet", "aleph"}; |
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
{-# LANGUAGE FlexibleInstances, | |
MultiParamTypeClasses, | |
ScopedTypeVariables, | |
TypeFamilies, | |
TypeOperators, | |
UndecidableInstances #-} | |
{-# OPTIONS_GHC -funbox-strict-fields #-} | |
module Main where |
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 division | |
def is_letter(c): | |
return c >= 'A' and c <= 'Z' or c >= 'a' and c <= 'z' | |
def score_word(s): | |
return len(filter(is_letter, s)) / len(s) | |
def average(s): | |
return sum(s) / len(s) |
OlderNewer