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(match_spec_from_record). | |
-export([hooks_for_scope/2]). | |
-record(hooks, { | |
scope :: atom(), | |
pid :: pid(), | |
pre :: mfa(), | |
post :: mfa() |
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
(* | |
Please note: this is my ad-hoc script and it possibly contains bugs and strange behaviour. | |
It's also may be convenient to consolidate iTunes library after usage. | |
*) | |
on dedup(aList) | |
set res to {} | |
repeat with i from 1 to (length of aList) | |
set cur to item i of aList | |
if {cur} is not in res then set res to (res & {cur}) |
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 BangPatterns #-} | |
import Data.Maybe | |
import Data.Array | |
import Data.Int | |
data Relation = G | L | N deriving (Show, Enum, Ord, Eq, Bounded) | |
data SCond = Any | F !Relation !Int64 deriving (Show, Ord, Eq) | |
key (Any, n) = (-1, -1, n) |
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
#!/usr/bin/env escript | |
%%! -name port_inspector | |
-module(port_inspector). | |
-export([inspect/0, main/1]). | |
%% | |
%% Info Collection Routines | |
%% | |
inspect() -> |
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
#import <Foundation/Foundation.h> | |
typedef id (^MVGetterBlock)(void); | |
typedef void (^MVSetterBlock)(id); | |
typedef id (^MVStateOpBlock)(id); | |
typedef NSOperation * (^MVOpSetupBlock)(MVGetterBlock, MVSetterBlock); | |
@interface MVStateStorage : NSObject { | |
__block NSMutableDictionary *data; |
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
@interface NSInvocationOperation (mutipleObject) | |
- (id)initWithTarget:(id)target selector:(SEL) objects:(id)first, ...; | |
@end | |
@implementation NSInvocationOperation (multipleObjects) | |
- (id)initWithTarget:(id)target selector:(SEL)sel objects:(id)first, ... { | |
NSAutoreleasePool *pool = [NSAutoreleasePool new]; | |
NSMethodSignature *signature = [target methodSignatureForSelector:sel]; |
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
-- | Задание практикума №2 | |
-- Вариант №2 "Отождествление Рефал-выражений" | |
module Main where | |
import Debug.Trace | |
import Data.Maybe | |
import Control.Monad | |
import Text.ParserCombinators.Parsec as Parsec | |
-- * Вспомогательные функции и типы |
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 <cstdlib> | |
#include <cstdio> | |
#include <iostream> | |
using namespace std; | |
template <typename T1, typename T2> | |
class Cast { | |
private: | |
struct BigType { |
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(head_srv). | |
-compile(export_all). | |
%-export([start/1, benchmark/1, console_start/0, loop/1]). | |
-include("jsonerl/jsonerl.hrl"). | |
-record(command, {action, error, login, desc}). | |
-record(logic_state, {ies = none}). | |
-define(INTERNAL_TIMEOUT, 10000). | |
-define(LISTEN_PORT, 6070). |
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 <cstdlib> | |
#include <iostream> | |
using namespace std; | |
struct Functor { | |
inline int operator () (int i, char c) { | |
return i+c; | |
} | |
}; |