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
;; Call the renderer-fn macro with a template and it returns a function optimized to render it. | |
;; This happens at compile-time. | |
;; At run-time, you call this function with the parameters that will be interpolated into the template, | |
;; typically (but not limited to) a map. | |
;; | |
;; Useful in i18n for variable interpolation, for example. I'm using this to add internationalization | |
;; support to https://github.com/xavi/noir-auth-app | |
;; See usage at the end. |
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
// kernel.cu : Defines the entry point for the console application. | |
// | |
#include "kernel.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <cuda.h> | |
#include <cutil.h> | |
#include <cuda_runtime.h> |
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
find . -type f | xargs wc -l |
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
# searches from ./ | |
find . -type f|xargs perl -pi -e 's/\t/ /g' |
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 java.util.ArrayList; | |
import java.util.List; | |
import java.util.Collections; | |
public class MinimumEditDistance { | |
public interface CostFunction { | |
public int cost(int[][] distanceMatrix, CharSequence x, CharSequence y, int i, int j); | |
} | |
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
tr -sc 'A-Za-z' '\n' < filename.txt | aspell list --mode=none | |
same as: | |
tr -sc 'A-Za-z' '\n' < filename.txt | spell -v |
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
grep '[A–Z]' #lines with an uppercase char | |
grep 'ˆ[A–Z]' #lines starting with an uppercase char | |
grep '[A–Z]$' #lines ending with an uppercase char | |
grep 'ˆ[A–Z]*$' #lines with all uppercase chars | |
grep '[aeiouAEIOU]' #lines with a vowel | |
grep 'ˆ[aeiouAEIOU]' #lines starting with a vowel | |
grep '[aeiouAEIOU]$' #lines ending with a vowel | |
grep –i '[aeiou]' #ditto | |
grep –i 'ˆ[aeiou]' | |
grep –i '[aeiou]$' |
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
# Case sensitive version | |
tr -sc 'A-Za-z' '\n' < textfile > textfile.words | |
tail +2 textfile.words > textfile.nextwords | |
tail +2 textfile.nextwords > textfile.nextnextwords | |
paste textfile.words textfile.nextwords textfile.nextnextwords | sort | uniq -c > textfile.trigrams | |
sort -nr < textfile.trigrams | |
# Case insensitive version |
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
# Case sensitive version | |
tr -sc 'A-Za-z' '\n' < textfile > textfile.words | |
tail +2 textfile.words > textfile.nextwords | |
paste textfile.words textfile.nextwords | sort | uniq -c > textfile.bigrams | |
sort -nr < textfile.bigrams | |
# Case insensitive version | |
tr 'A-Z' 'a-z' < textfile | tr -sc 'a-z' '\n' > textfile.words |
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
tr 'A-Z' 'a-z' < filename.txt | tr -sc 'a-z' '\n' | rev | sort | uniq | sort -d | rev | less |
NewerOlder