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 vobject | |
| import codecs | |
| def main(input, output): | |
| with open(input, 'r') as input_stream: | |
| with codecs.open(output, 'w', encoding='utf-8') as output_stream: | |
| for card in vobject.readComponents(input_stream, False, True, False, False): | |
| try: |
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 MACD(Indicator): | |
| def __init__(self, strategy, pair, short_period=12, long_period=26, weight_period=9): | |
| self._weight_period = weight_period | |
| self._weight = 2.0 / (weight_period + 1.0) | |
| self._short_ema = EMA(strategy, pair, period=short_period) | |
| self._long_ema = EMA(strategy, pair, period=long_period) | |
| self._data = pandas.DataFrame(columns=['Value', 'MACD_line', 'Signal_line']) | |
| super(MACD, self).__init__("MACD", strategy, pair) |
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 | |
| from __future__ import print_function | |
| import sys | |
| import requests | |
| from bs4 import BeautifulSoup | |
| SEMESTER = 9 | |
| sectors = [ u"Επιστήμης και Τεχνολογίας των Κατασκευών", u"Υδραυλικής και Τεχνικής Περιβάλλοντος", u"Γεωτεχνικής Μηχανικής", u"Μεταφορών και Διαχείρισης Έργων" ] |
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 naturals(): | |
| i = 0 | |
| while True: | |
| yield i | |
| i += 1 | |
| def take(n, f): | |
| i = 0 | |
| while i < n: |
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 __AUDIO_HPP | |
| #define __AUDIO_HPP | |
| // TODO: Remove this | |
| #include <iostream> | |
| #include <floating_array.hpp> | |
| #include <string> | |
| #include <algorithm> |
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 Opcodes; | |
| import std.getopt; | |
| import std.stdio; | |
| import std.algorithm; | |
| import std.string; | |
| import std.conv; | |
| import std.ascii; | |
| import std.array; |
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
| // TODO: write cover template ArrayList | |
| SafeArray: cover template <T> { | |
| data: T* | |
| size: Int | |
| init: func@ ~stealData (=data, =size) | |
| init: func@ (=size) { | |
| data = gc_malloc(size * T 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
| (defun getAllTexts () | |
| (setq selection (ssget "_X" '((0 . "TEXT,MTEXT"))) | |
| textlist (list)) | |
| (if selection | |
| (repeat (setq i (sslength selection)) | |
| (setq e (ssname selection (setq i (1- i))) | |
| x (cdr (assoc 0 (entget e))) | |
| ) |
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/sh | |
| # This script cross-compiles rock for multiple architecures and systems, makes a package for each of them and publishes on builds.ooc-lang.org | |
| # Vendor prefixes should be | |
| # rock/vendor-prefix -> linux64 | |
| # rock/win32-vendor-prefix -> win32 | |
| # rock/X-vendor-prefix -> X | |
| # $1: architecture to compile to | |
| function compile { |
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
| // Rust like system, let's make a simple example macro definition and call | |
| raise-if-null: macro($expr, $msg: Expression) { | |
| if($expr == null) raise($msg) | |
| } | |
| // Call | |
| #raise-if-null(null, "Good!") | |
| // Macros can be expressions or statements |