Articles that help understanding
This file contains hidden or 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
| static List<Integer> search(String pattern, String text) { | |
| int[] pi = buildTable(pattern); | |
| return kmpSearch(text, pattern, pi); | |
| } | |
| static List<Integer> kmpSearch(String text, String pattern, int[] pi) { | |
| List<Integer> res = new ArrayList<>(); | |
| int p = 0; | |
| for (int i=0;i<text.length();i++) { | |
| while (p>0 && text.charAt(i) != pattern.charAt(p)) { |
This file contains hidden or 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
| var s = new BouncingCanvasShapesStage(); | |
| var option = { | |
| particleWidth: 10, | |
| particleHeight: 10, | |
| }; | |
| var benchmark = new BouncingCanvasShapesBenchmark( | |
| { | |
| // controller: 'adaptive', | |
| // "test-interval": 1000, | |
| complexity: 200, |
This file contains hidden or 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
| Ria 89.7 | http://mediacorp.rastream.com/897fm | |
| Gold 90.5 FM | http://mediacorp.rastream.com/905fm | |
| 91.3 Hot FM | http://sph.rastream.com/913fm | |
| Kiss 92.0 | http://sph.rastream.com/sph-kiss92 | |
| Symphony 92.4 | http://mediacorp.rastream.com/924fm | |
| Yes 93.3 | http://mediacorp.rastream.com/933fm | |
| 93.8 Live | http://mediacorp.rastream.com/938fm | |
| Warna 94.2 | http://mediacorp.rastream.com/942fm | |
| Class 95.0 | http://mediacorp.rastream.com/950fm | |
| 95.8 Capital | http://mediacorp.rastream.com/958fm |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>index</title> | |
| </head> | |
| <body> | |
| <label for="Input">Input</label> | |
| <input type="text" name="Input" value="" id="Input"> | |
| <ul id="suggestions"> |
This file contains hidden or 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
| // https://stackoverflow.com/questions/9272232/fft-library-in-android-sdk | |
| public class FFT { | |
| int n, m; | |
| // Lookup tables. Only need to recompute when size of FFT changes. | |
| double[] cos; | |
| double[] sin; |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Test 2 way data binding</title> | |
| </head> | |
| <body> | |
| <div id="app">{{ abc }} - {{ def }} = {{ abc-def }} </div> | |
| <button id='add'>add</button> | |
| <button id='double'>double</button> | |
| <script src='main.js'></script> |
This file contains hidden or 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 time | |
| from random import random | |
| from threading import Thread, Lock | |
| """ | |
| Python's GIL ensures that non IO ops will execute sequentially | |
| So no need to sync the followings | |
| s = store + 1 | |
| store = s |
This file contains hidden or 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
| set nocompatible " be iMproved, required | |
| set rtp+=$HOME/.vim/bundle/Vundle.vim | |
| filetype off " required | |
| " set the runtime path to include Vundle and initialize | |
| call vundle#begin('$HOME/.vim/bundle/') | |
| " alternatively, pass a path where Vundle should install plugins | |
| "call vundle#begin('~/some/path/here') | |
| " let Vundle manage Vundle, required |
This file contains hidden or 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
| def kmp(text, word): | |
| wl = len(word) | |
| jump = [0 for _ in range(wl)] | |
| j = 0 | |
| i = 1 | |
| while i < wl: | |
| if word[i] == word[j]: | |
| jump[i] = j + 1 | |
| i+=1 |