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
(defun find-closing-bracket () | |
(interactive) | |
(search-forward "]") | |
(when (not (equal (point) (- (point-max) 1))) | |
(goto-char (point)))) |
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 ParsePlist ( Xexpr(..) | |
, plistParser | |
, plistParserWithHeaderAndFooter | |
, defaultHeader | |
, defaultFooter | |
, parseXexpr | |
)where | |
import Control.Monad | |
import Text.Parsec (spaces, (<|>), manyTill, many, noneOf, |
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
parseXmark :: Parser L.Text | |
parseXmark = (L.strip . L.pack) <$> | |
(char '<' *> spaces | |
*> (many $ noneOf ">") <* | |
char '>' <* spaces) | |
parseLit :: T.Text -> Parser Xexpr | |
parseLit endMark = (Lit . T.strip . T.pack) <$> (spaces *> | |
(manyTill anyChar |
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
clearXmlEscapes s = foldr (\(old, new) str -> T.replace old new str) s xmlEscapes | |
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
{-# LANGUAGE OverloadedStrings #-} | |
module ParsePlist ( parseFromPlist | |
, plistParser | |
, plistParserWithHeaderAndFooter | |
, defaultHeader | |
, defaultFooter | |
, parseXexpr | |
)where | |
import Control.Monad |
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 pandas as pd | |
import pyqtgraph as pq | |
import numpy as np | |
import matplotlib.mlab as mlab | |
import pylab | |
from matplotlib.cm import Accent | |
def PlotCustomSpectrogram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, | |
window=mlab.window_hanning, noverlap=128, |
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
+(NSObject*)extractSexp:(const Sexp*)s{ | |
if(s==NULL) return nil; | |
switch (s->type) { | |
case Bool: | |
return [NSNumber numberWithBool:(*(int*)s->value)!=0]; | |
case Integer: | |
return [NSNumber numberWithInteger:(*(int*)s->value)]; | |
case Double: | |
return [NSNumber numberWithDouble:(*(double*)s->value)]; | |
case String: |
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
(global-set-key (kbd "C-x m") nil) | |
(global-set-key (kbd "C-x m >") 'mc/mark-next-like-this) |
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 GHC.Show (intToDigit) | |
-- | Fast hex representation of Word8 | |
showHex :: Word8 -> ShowS | |
showHex n0 = showIt (1 :: Int) (quotRem n0 16) | |
where | |
showIt x (n,d) r = seq c $ -- stricter than necessary | |
case x of | |
0 -> r' | |
_ -> showIt (x-1) (quotRem n 16) r' |
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) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license> | |
#include <stdlib.h> | |
//Customize for your data Item type | |
typedef int Item; | |
#define ItemLess(a,b) ((a)<(b)) | |
#define ItemMean(a,b) (((a)+(b))/2) | |
typedef struct Mediator_t |
OlderNewer