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 "tusb.h" | |
//#include <vector> | |
#include <initializer_list> | |
#include <algorithm> | |
#include <array> | |
//#include <tuple> | |
#include <cstddef> | |
#include <type_traits> |
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
/* | |
* Copyright 2008-2022 Async-IO.org | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
# FXML requires loading both ruby and java classes. | |
# JRuby has no such single classloader builtin, so we proxy them all | |
# This is a minimal classloader only for classes, resources not supported | |
class PolyglotClassLoader < java.lang.ClassLoader | |
def initialize() | |
super(JRuby.runtime.jruby_class_loader) | |
end | |
java_signature "java.lang.Class findClass(java.lang.String name)" | |
def findClass(a) | |
# TODO: full Ruby modules? |
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
module Umm | |
module Paintbrush | |
#TODO: test self.to_java on non-super'd non-become_java'd things | |
class Balloons < com.test.SecondaryClass | |
def initialize(*args) | |
puts "yay, helo(i), with #{args.inspect}" | |
#raise "ack" #java.lang.NullPointerException.new | |
egads = args.length + 5 |
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
diff --git a/Rakefile b/Rakefile | |
index ce27f29..2ac712a 100644 | |
--- a/Rakefile | |
+++ b/Rakefile | |
@@ -42,6 +42,7 @@ task :distclean => :clobber | |
desc "Test the extension" | |
task :test => [ :spec ] | |
+puts "hi" | |
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
let template = `<?xml version="1.0" encoding="UTF-8"?> | |
<?OFX OFXHEADER="200" VERSION="203" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?> | |
<OFX> | |
</OFX>`; | |
let ofx = new DOMParser().parseFromString(template, "text/xml"); | |
let ofxs = slop(ofx.firstElementChild); | |
// Note: awful. I just don't want to drag in any other libraries for one format |
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
run (Proc.new do |cfg| | |
hc = cfg["HTTP_COOKIE"] || "" | |
logged = hc.include? "yup" | |
case cfg["PATH_INFO"] | |
when "/" | |
unless logged | |
['200', {'Content-Type' => 'text/html'}, ['<a href="/login">Login</a><br><br><a href="/res">Resource</a>']] | |
else | |
['200', {'Content-Type' => 'text/html'}, ['<a href="/logout">Logout</a><br><br><a href="/res">Resource</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
# usage instructions | |
# $ gem install pry | |
# $ gem install jrubyfx | |
# Then download and unpack lib/ in . from https://github.com/byteit101/rb-readline/tree/pty-fixes | |
# gather the 5 jars listed below in . | |
# then you can launch this with jruby demo.rb | |
# Note you need a javafx-enabled java build. | |
# Tested with jdk1.8.0_144 on Linux | |
# You may need to ctrl-z, kill %1 to exit. |
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
require 'irb' | |
require 'pty' | |
require 'ffi' | |
require 'rspec' | |
require 'rspec/core' | |
RSpec::Core::Runner.autorun | |
# patching PTY::open to comment out fnctl bug in JRuby | |
if defined? JRUBY_VERSION |
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 <iostream> | |
using namespace std; | |
class A { | |
public: void isNull() { | |
if (this == nullptr) | |
std::cout << "We are null" <<std::endl; | |
else | |
std::cout << "We are not null" <<std::endl; | |
} | |
}; |
NewerOlder