Skip to content

Instantly share code, notes, and snippets.

View fasiha's full-sized avatar
💭
🧘‍♂️🐻

Ahmed Fasih fasiha

💭
🧘‍♂️🐻
View GitHub Profile
@JayKickliter
JayKickliter / Julia FFTS.jl
Last active August 29, 2015 13:57
Calling FFTS c functions from Julia
# Complex transforms
# Sign argument
# -1 = Complex to Complex reverse FFT
# 1 = Complex to Complex forward FFT
# ffts_plan_t *ffts_init_1d(size_t N, int sign);
# Create a plan for a forward 1D FFT of size 16
N = 2^16
Direction = 1
ffts_plan = ccall((:ffts_init_1d, "libffts"), Ptr{Void}, (Csize_t, Cint), N, Direction)
(ns cljobs.resources.manage.os-projects
(:require [cljobs.resources.common :as c]
[cljobs.db.queries :as q]))
(def new-data (c/query-result q/user-os-projects))
(defn process-params
[ctx]
(-> (c/assoc-user ctx :os-project/user)
(update-in [:request :params]
@Yaffle
Yaffle / Math.nextUp.js
Last active February 2, 2017 22:49
Math.nextAfter, Math.nextDown, Math.nextUp, Math.ulp in javascript
(function (global) {
"use strict";
// Math.nextUp
// Note:
// Math.nextDown = function (x) { return -Math.nextUp(-x); };
// Math.nextAfter = function (x, y) { return y < x ? -Math.nextUp(-x) : (y > x ? Math.nextUp(x) : (x !== x ? x : y)); };
// Math.ulp = function (x) { return x < 0 ? Math.nextUp(x) - x : x - (-Math.nextUp(-x)); };
var EPSILON = Math.pow(2, -52);
var FFT = (function() {
"use strict";
var FFT = function() {
initialize.apply(this, arguments);
}, $this = FFT.prototype;
var FFT_PARAMS = {
get: function(n) {
return FFT_PARAMS[n] || (function() {
@masayu-a
masayu-a / gist:b3ce862336e47736e84f
Created May 27, 2015 02:43
English translations of UniDic inflection types, prepared by Irena Srdanovic, 18.1.2013 and 22.1.2013
Inflection type (Ja) Inflection type (En) Inflection type - description (En)
カ行変格 ka_irr kahen_verb.irregular
サ行変格 sa_irr sahen_verb.irregular
ザ行変格 za_irr zahen_verb.irregular
上一段-ア行 V1i.a kamiichidan_verb_i_row.a_column
上一段-カ行 V1i.ka kamiichidan_verb_i_row.ka_column
上一段-ガ行 V1i.ga kamiichidan_verb_i_row.ga_column
上一段-ザ行 V1i.za kamiichidan_verb_i_row.za_column
上一段-タ行 V1i.ta kamiichidan_verb_i_row.ta_column
@masayu-a
masayu-a / gist:3e11168f9330e2d83a68
Created May 27, 2015 02:46
English translations of UniDic inflection forms, prepared by Irena Srdanovic, 18.1.2013 and 22.1.2013
Inflected forms (Ja) Inflected forms (En) Inflected forms (En)- description
ク語法 ku_wrd ku_wording
仮定形-一般 Cond.g conditional.general(katei)
仮定形-融合 Cond.int conditional.integrated(katei)
命令形 Imp imperative(meirei)
已然形-一般 Real.g realis.general(izen)
已然形-補助 Real.aux realis.auxiliary(izen)
意志推量形 Vol_tent volitional_tentative(ishi_suiryo)
未然形-サ Irr.sa irrealis.sa(mizen)
@Kimtaro
Kimtaro / gist:ab137870ad4a385b2d79
Created December 26, 2014 12:06
Add to mecab dictionary
# Put new words in a CSV with this format
# 表層形,左文脈ID,右文脈ID,コスト,品詞,品詞細分類1,品詞細分類2,品詞細分類3,活用形,活用型,原形,読み,発音
# surface_form,left_context_id,right_context_id,cost,part_of_speech,pos_division_1,pos_division_2,pos_division_3,inflection_type,inflection_style,lemma,reading,pronunciation
$ echo "fasihsignal,-1,-1,100,名詞,一般,*,*,*,*,fasihsignal,ファシシグナル,ファシシグナル" > a.csv
# Then use mecab-dict-index to compile the csv into a .dic file, based on an existing mecab dictionary file
$ /usr/local/Cellar/mecab/0.996/libexec/mecab/mecab-dict-index -d/usr/local/Cellar/mecab/0.996/lib/mecab/dic/ipadic/ -u a.dic -f utf8 -t utf8 a.csv
# The use it
$ mecab -ua.dic
@estebistec
estebistec / README.md
Last active February 3, 2021 23:16
This minimal setup allows you to run nginx using the current folder as the doc-root. NOTE: python's simplehttpserver may be good enough for you. This is just a nice simple nginx setup.
  1. Get all of these files into the target folder
  2. Run the following commands:
chmod +x *.sh
./nginx-start.sh
# Git branch in prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
alias ls='ls -G'
export CLICOLOR=1
export LSCOLORS=Gxfxcxdxbxegedabagacad
@rmcgibbo
rmcgibbo / install.md
Last active October 14, 2021 00:17
Scientific Python From Source, with MKL

Scientific Python From Source

This document will walk you through compiling your own scientific python distribution from source, without sudo, on a linux machine. The core numpy and scipy libraries will be linked against Intel MKL for maximum performance.

This procedure has been tested with Rocks Cluster Linux 6.0 (Mamba) and CentOS 6.3.

Compiling Python From Source