According to http://bugs.python.org/msg176429 from http://bugs.python.org/issue12370:
class C(A, B, metaclass=meta):
def f(self):
return __class__
To be compiled approximately like this:
package main | |
import ( | |
"bytes" | |
"code.google.com/p/portaudio-go/portaudio" | |
"encoding/binary" | |
"fmt" | |
"io" | |
"log" | |
"os" |
https://drive.google.com/open?id=1_pL0-pWX833hISo__Ho-Z3KkW-eePFsQ |
According to http://bugs.python.org/msg176429 from http://bugs.python.org/issue12370:
class C(A, B, metaclass=meta):
def f(self):
return __class__
To be compiled approximately like this:
From b34d733deefac7fb7f96bf5408ae705c49e764fa Mon Sep 17 00:00:00 2001 | |
From: Isaiah Peng <issaria@gmail.com> | |
Date: Fri, 4 Mar 2016 11:17:40 +0100 | |
Subject: [PATCH 1/1] include jquery and materializecss for test | |
--- | |
karma.conf.js | 2 ++ | |
package.json | 2 ++ | |
src/Select.js | 67 ++++++++++++++++++++++++++++++----------------------------- | |
3 files changed, 38 insertions(+), 33 deletions(-) |
require 'fileutils' | |
require 'taglib' | |
NAME = "©nam" | |
Dir.glob("./**/*.m4a").each do |f| | |
TagLib::MP4::File.open(f) do |mp4| | |
name = mp4.tag.item_list_map[NAME] | |
name = name.to_string_list.first | |
dir = File.dirname(f) | |
name = "#{dir}/#{name}.m4a" |
'atom-text-editor[data-grammar~="haskell"]': | |
'': 'haskell-ghc-mod:check-file' | |
'': 'haskell-ghc-mod:lint-file' | |
'ctrl-alt-t': 'haskell-ghc-mod:show-type' | |
'ctrl-alt-i': 'haskell-ghc-mod:show-info' | |
'ctrl-alt-T': 'haskell-ghc-mod:insert-type' | |
'': 'haskell-ghc-mod:show-info-fallback-to-type' | |
'ctrl-alt-I': 'haskell-ghc-mod:insert-import' | |
'body': |
n = 100000 | |
# taken from [here](http://blog.lojic.com/2008/12/22/ruby-dynamic-method-invocation-performance/), | |
# but the original one use the same string all the time, which doesn't reflect real world situation | |
bm(12) {|x| | |
x.report("orig") { n.times { test = "stormy weather"; test.length } } | |
x.report("call") { n.times { test = "stormy weather"; m = test.method(:length); m.call } } | |
x.report("send") { n.times { test = "stormy weather"; test.send(:length) } } | |
x.report("eval") { n.times { test = "stormy weather"; eval "test.length" } } |
Sometimes you found that jruby always complain about cannot find class you defined in your precious java class, that jruby failed to load the Service that defines all the classes in ruby space.
Let's talk about the way jruby load native extension, take puma as an example, Assume you have 'puma/http11.jar' in your load path, with:
require "rubygems" | |
require "hmac-sha1" | |
require "base64" | |
ankoder_access_key = ANKODER_ACCESS_KEY | |
private_key = ANKODER_PRIVATE_KEY | |
ankoder_date = Time.now.strftime("%a, %d %b %Y %X GMT") | |
ankoder_action = "POST" | |
ankoder_path = "/download" | |
string = "-#{ankoder_date}-#{ankoder_action}-#{ankoder_path}-" |
require "rubygems" | |
require "hmac-sha1" | |
require "base64" | |
ankoder_access_key = ANKODER_ACCESS_KEY | |
private_key = ANKODER_PRIVATE_KEY | |
ankoder_date = Time.now.strftime("%a, %d %b %Y %X GMT") | |
ankoder_action = "GET" | |
ankoder_path = "/video.xml" | |
string = "-#{ankoder_date}-#{ankoder_action}-#{ankoder_path}-" |