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
// In JavaScript string, you don't need to escape / | |
var a = "a/b"; // will give "a/b" | |
// But if you use \, it can be escaped | |
var b = "a\/b"; // will also give "a/b" | |
// While \ should always be escaped | |
var c = "a\b"; // will give "a" since \b means a backspace, | |
// which does nothing special here |
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
{% capture tags %} | |
{% for tag in site.tags %} | |
{{ tag[0] }} | |
{% endfor %} | |
{% endcapture %} | |
{% assign sortedtags = tags | split:' ' | sort %} | |
{% for tag in sortedtags %} | |
<div id="tag-{{ tag }}" class="tag-posts"> | |
{% for post in site.posts %} |
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
<a class="button view-source" href="https://raw.githubusercontent.com/Ovilia/blog/gh-pages/_posts/{{ page.url | append: '@' | replace: '/', '-' | remove_first: '-' | remove: '-@' }}.md" target="_blank">View Source on GitHub</a> |
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 <assert.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
//#define PRINT_RESULT | |
// insert sort: n * n | |
template <typename T> | |
void insertSort(int len, T* arr) |
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
var fs = require('fs'); | |
// SleepBot.csv is downloaded from https://mysleepbot.com | |
var lines = fs.readFileSync('SleepBot.csv').toString().split('\n'); | |
var sumToSleep = 0; | |
var sumToAwake = 0; | |
var sumSleepMin = 0; |