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
#!/usr/bin/env python | |
# - * - coding: UTF-8 - * - | |
class Constants(object): | |
__slots__ = ['_d'] | |
def __init__(self, d): | |
self._d = d | |
for k, v in self._d.items(): | |
if isinstance(v, dict): |
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
#ifndef RBTREE_RBTREE_H_ | |
#define RBTREE_RBTREE_H_ | |
#include <cstddef> | |
#include <cassert> | |
#include <utility> | |
namespace upsuper { | |
namespace learning { |
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
#!/usr/bin/python | |
# - * - coding: UTF-8 - * - | |
from sys import stdout | |
from time import sleep | |
from itertools import cycle | |
MOON = [u'\U0001F311', u'\U0001F312', u'\U0001F313', u'\U0001F314', | |
u'\U0001F315', u'\U0001F316', u'\U0001F317', u'\U0001F318'] |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'net/http' | |
CATEGORIES = [:anime, :book, :music, :game, :real] | |
STATES = [:wish, :collect, :do, :on_hold, :dropped] | |
progress = true | |
options = { |
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
# coding: UTF-8 | |
import socket | |
import struct | |
def aton(addr): | |
return struct.unpack('!l', socket.inet_aton(addr)) | |
def ntoa(addr): | |
return socket.inet_ntoa(struct.pack('!l', addr)) |
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
class FileInfo | |
def initialize(name, data) | |
@name = name | |
@length = data.length | |
@space = data.each_char.inject(0) { |n, c| | |
n += case c | |
when '\t' then 8 | |
when /\s/ then 1 | |
else 0 | |
end |
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
diff -ur a/CPP/7zip/Archive/Zip/ZipItem.cpp b/CPP/7zip/Archive/Zip/ZipItem.cpp | |
--- a/CPP/7zip/Archive/Zip/ZipItem.cpp 2016-02-02 03:50:10.000000000 +1100 | |
+++ b/CPP/7zip/Archive/Zip/ZipItem.cpp 2023-08-15 23:19:44.862769098 +1000 | |
@@ -1,6 +1,7 @@ | |
// Archive/ZipItem.cpp | |
#include "StdAfx.h" | |
+#include <iconv.h> | |
#include "../../../../C/CpuArch.h" |
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
#!/bin/zsh | |
INITIAL_SIZE=5 | |
VOLUME_NAME='ramdisk' | |
MOUNTPOINT='/tmp/upsuper' | |
MOUNTPOINT_FILE='/tmp/ramdisk.mountpoint' | |
# find a non-existent initial mount point | |
mountpoint=$(mktemp -dt ramdisk) | |
# set ramdisk size |
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
#!/bin/bash | |
cat /proc/cpuinfo | grep processor | wc -l |
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
/* | |
* Copyright (C) 2012 Xidorn Quan <[email protected]> | |
* | |
* This file is part of MPlayer. | |
* | |
* MPlayer is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. | |
* |